10 #include "KVElasticScatter.h"
11 #include "KVMultiDetArray.h"
13 #include "KVDetector.h"
36 fIntLayer = fNDets = 0;
46 Warning(
"KVElasticScatter",
"gMultiDetArray does not refer to a valid multidetector array");
47 printf(
"Define it before using this class, and put it in simulation mode : gMultiDetArray->SetSimMode(kTRUE)");
57 KVElasticScatter::~KVElasticScatter()
84 fMultiLayer = (fTarget->NumberOfLayers() > 1);
134 Error(
"SetDetector",
"Detector %s is unknown!", det);
138 if (fDetector->GetNode()->GetNTraj()>1)
140 Warning(
"SetDetector",
"Ambiguous trajectory choice: detector %s has %d trajectories", det, fDetector->GetNode()->GetNTraj());
142 auto traj = (
KVGeoDNTrajectory*)fDetector->GetNode()->GetTrajectories()->First();
143 Info(
"SetDetector",
"Using trajectory: %s", traj->GetName());
147 fAlignedDetectors.Clear();
149 traj->IterateBackFrom();
153 while ((gdn = traj->GetNextNode()))
156 fAlignedDetectors.Add(
d);
157 fDetInd.SetValue(
d->GetLabel(), i);
181 "<KVElasticScatter::SetTargetScatteringLayer> : No target set. Set run first."
185 fIntLayer = fTarget->GetLayerIndex(
name);
187 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
215 if (!fProj.IsDefined()) {
217 "<KVElasticScatter::CalculateScattering> : Set projectile properties first"
223 "<KVElasticScatter::CalculateScattering> : Set projectile energy first"
229 "<KVElasticScatter::CalculateScattering> : Set detector first" <<
235 "<KVElasticScatter::CalculateScattering> : No target set. Set run first."
252 new TH1F(
"hDepth",
"Depth (mg/cm2)", 500, 0.,
253 fTarget->GetTotalEffectiveThickness());
254 fTheta =
new TH1F(
"hTheta",
"Theta (deg.)", 500, 0., 0.);
260 fHistos =
new TObjArray(fAlignedDetectors.GetSize());
267 TIter n(&fAlignedDetectors);
268 while ((
d = (KVDetector*)
n())) {
271 TH1F(
Form(
"hEloss_%s",
d->GetName()),
"Eloss (MeV)", fBinE, 0., 0.));
279 fProj.SetEnergy(fEnergy);
286 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
289 fTarget->GetInteractionPoint(&fProj);
295 TVector3 IP = fTarget->GetInteractionPoint();
300 fKinematics->SetTarget(t);
307 fKinematics->SetEDiss(fExx);
312 for (
int i = 0; i <
N; i++) {
314 fTarget->SetIncoming();
315 fTarget->DetectParticle(&fProj);
316 fKinematics->SetProjectile(fProj);
317 if (!has_outgoing) fOutgoing = fProj;
319 fKinematics->SetOutgoing(fOutgoing);
321 fKinematics->CalculateKinematics();
326 fDetector->GetRandomAngles(th, ph);
333 fKinematics->GetELab(3, th, 3, e1, e2);
335 fOutgoing.SetTheta(th);
336 fOutgoing.SetPhi(ph);
337 xsec =
TMath::Abs(fKinematics->GetXSecRuthLab(fOutgoing.GetTheta()));
338 fTheta->Fill(fOutgoing.GetTheta(), xsec);
340 fTarget->SetOutgoing();
342 fTarget->DetectParticle(&fOutgoing);
343 fDepth->Fill(IP.
z());
348 while ((
d = (KVDetector*)
n())) {
349 auto cew =
d->GetCentreOfEntranceWindow();
350 d->DetectParticle(&fOutgoing, &cew);
352 ((
TH1F*)(*fHistos)[j++])->Fill(
d->GetEnergy(), xsec);
356 fProj.SetEnergy(fEnergy);
358 fProj.GetParameters()->Clear();
359 fOutgoing.GetParameters()->Clear();
362 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
365 fTarget->GetInteractionPoint(&fProj);
369 targ_mat = fTarget->GetLayer(fTarget->GetInteractionPoint());
372 fKinematics->SetTarget(t);
375 IP = fTarget->GetInteractionPoint();
396 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)
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.
Path taken by particles through multidetector geometry.
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
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)
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)
Double_t Max(Double_t a, Double_t b)