10 #include "KVElasticScatter.h"
11 #include "KVMultiDetArray.h"
13 #include "KVDetector.h"
36 fIntLayer = fNDets = 0;
39 fAlignedDetectors = 0;
47 Warning(
"KVElasticScatter",
"gMultiDetArray does not refer to a valid multidetector array");
48 printf(
"Define it before using this class, and put it in simulation mode : gMultiDetArray->SetSimMode(kTRUE)");
58 KVElasticScatter::~KVElasticScatter()
87 fMultiLayer = (fTarget->NumberOfLayers() > 1);
100 fProj.SetZandA(Z, A);
128 fAlignedDetectors =
nullptr;
129 Fatal(
"SetDetector",
"Reimplement using particle trajectories");
137 TIter n(fAlignedDetectors);
139 while ((
d = (KVDetector*)
n())) {
141 if (fDetInd->HasParameter(
d->GetType())) {
145 newname.
Form(
"%s_%d",
d->GetType(), j++);
146 while (fDetInd->HasParameter(newname.
Data()))
147 newname.
Form(
"%s_%d",
d->GetType(), j++);
148 fDetInd->SetValue(newname.
Data(), i);
151 fDetInd->SetValue(
d->GetType(), i);
176 "<KVElasticScatter::SetTargetScatteringLayer> : No target set. Set run first."
180 fIntLayer = fTarget->GetLayerIndex(
name);
182 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
210 if (!fProj.IsDefined()) {
212 "<KVElasticScatter::CalculateScattering> : Set projectile properties first"
218 "<KVElasticScatter::CalculateScattering> : Set projectile energy first"
224 "<KVElasticScatter::CalculateScattering> : Set detector first" <<
230 "<KVElasticScatter::CalculateScattering> : No target set. Set run first."
247 new TH1F(
"hDepth",
"Depth (mg/cm2)", 500, 0.,
248 fTarget->GetTotalEffectiveThickness());
249 fTheta =
new TH1F(
"hTheta",
"Theta (deg.)", 500, 0., 0.);
255 fHistos =
new TObjArray(fAlignedDetectors->GetSize());
262 TIter n(fAlignedDetectors);
263 while ((
d = (KVDetector*)
n())) {
266 TH1F(
Form(
"hEloss_%s",
d->GetName()),
"Eloss (MeV)", fBinE, 0., 0.));
274 fProj.SetEnergy(fEnergy);
281 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
284 fTarget->GetInteractionPoint(&fProj);
290 TVector3 IP = fTarget->GetInteractionPoint();
295 fKinematics->SetTarget(t);
301 fKinematics->SetEDiss(fExx);
306 for (
int i = 0; i <
N; i++) {
308 fTarget->SetIncoming();
309 fTarget->DetectParticle(&fProj);
310 fKinematics->SetProjectile(fProj);
311 fKinematics->SetOutgoing(fProj);
312 fKinematics->CalculateKinematics();
317 fDetector->GetRandomAngles(th, ph);
324 fKinematics->GetELab(3, th, 3, e1, e2);
328 xsec =
TMath::Abs(fKinematics->GetXSecRuthLab(fProj.GetTheta()));
329 fTheta->Fill(fProj.GetTheta(), xsec);
331 fTarget->SetOutgoing();
332 fTarget->DetectParticle(&fProj);
334 fAlignedDetectors->R__FOR_EACH(KVDetector, DetectParticle)(&fProj);
336 fDepth->Fill(IP.
z());
339 while ((
d = (KVDetector*)
n())) {
340 ((
TH1F*)(*fHistos)[j++])->Fill(
d->GetEnergy(), xsec);
344 fProj.SetEnergy(fEnergy);
346 fProj.GetParameters()->Clear();
349 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
352 fTarget->GetInteractionPoint(&fProj);
356 targ_mat = fTarget->GetLayer(fTarget->GetInteractionPoint());
359 fKinematics->SetTarget(t);
362 IP = fTarget->GetInteractionPoint();
383 return (fDetInd->HasParameter(
type) ? GetEnergy(fDetInd->GetIntValue(
type)) : 0);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
Relativistic binary kinematics calculator.
Calculate elastic scattering spectra in multidetector arrays.
void SetDetector(const Char_t *det)
Set name of detector which will detect particle.
TH1F * GetEnergy()
Return pointer to energy loss histogram for chosen detector (in MeV)
void CalculateScattering(Int_t N)
void SetEbinning(Int_t nbins=500)
void SetProjectile(Int_t Z, Int_t A)
Set projectile Z and A.
void SetRun(Int_t run)
Set detector parameters, target, etc. for run.
void SetTargetScatteringLayer(const Char_t *name)
void SetEnergy(Double_t E)
Set energy of projectile in MeV.
virtual KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Description of physical materials used to construct detectors & targets; interface to range tables.
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
virtual void SetSimMode(Bool_t on=kTRUE)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void Clear(Option_t *opt="") override
Description of properties and kinematics of atomic nuclei.
void SetZ(Int_t z, Char_t mt=-1)
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
void SetRandomized(Bool_t r=kTRUE)
const char * Data() const
void Form(const char *fmt,...)
Double_t Max(Double_t a, Double_t b)