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) {
139 Warning(
"SetDetector",
"Ambiguous trajectory choice: detector %s has %d trajectories", det, fDetector->GetNode()->GetNTraj());
141 auto traj = (
KVGeoDNTrajectory*)fDetector->GetNode()->GetTrajectories()->First();
142 Info(
"SetDetector",
"Using trajectory: %s", traj->GetName());
146 fAlignedDetectors.Clear();
148 traj->IterateBackFrom();
152 while ((gdn = traj->GetNextNode())) {
154 fAlignedDetectors.Add(
d);
155 fDetInd.SetValue(
d->GetLabel(), i);
179 "<KVElasticScatter::SetTargetScatteringLayer> : No target set. Set run first."
183 fIntLayer = fTarget->GetLayerIndex(
name);
185 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
213 if (!fProj.IsDefined()) {
215 "<KVElasticScatter::CalculateScattering> : Set projectile properties first"
221 "<KVElasticScatter::CalculateScattering> : Set projectile energy first"
227 "<KVElasticScatter::CalculateScattering> : Set detector first" <<
233 "<KVElasticScatter::CalculateScattering> : No target set. Set run first."
250 new TH1F(
"hDepth",
"Depth (mg/cm2)", 500, 0.,
251 fTarget->GetTotalEffectiveThickness());
252 fTheta =
new TH1F(
"hTheta",
"Theta (deg.)", 500, 0., 0.);
258 fHistos =
new TObjArray(fAlignedDetectors.GetSize());
265 TIter n(&fAlignedDetectors);
266 while ((
d = (KVDetector*)
n())) {
269 TH1F(
Form(
"hEloss_%s",
d->GetName()),
"Eloss (MeV)", fBinE, 0., 0.));
277 fProj.SetEnergy(fEnergy);
284 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
287 fTarget->GetInteractionPoint(&fProj);
293 TVector3 IP = fTarget->GetInteractionPoint();
298 fKinematics->SetTarget(t);
305 fKinematics->SetEDiss(fExx);
310 for (
int i = 0; i <
N; i++) {
312 fTarget->SetIncoming();
313 fTarget->DetectParticle(&fProj);
314 fKinematics->SetProjectile(fProj);
315 if (!has_outgoing) fOutgoing = fProj;
317 fKinematics->SetOutgoing(fOutgoing);
319 fKinematics->CalculateKinematics();
324 fDetector->GetRandomAngles(th, ph);
331 fKinematics->GetELab(3, th, 3, e1, e2);
333 fOutgoing.SetTheta(th);
334 fOutgoing.SetPhi(ph);
335 xsec =
TMath::Abs(fKinematics->GetXSecRuthLab(fOutgoing.GetTheta()));
336 fTheta->Fill(fOutgoing.GetTheta(), xsec);
338 fTarget->SetOutgoing();
340 fTarget->DetectParticle(&fOutgoing);
341 fDepth->Fill(IP.
z());
346 while ((
d = (KVDetector*)
n())) {
347 auto cew =
d->GetCentreOfEntranceWindow();
348 d->DetectParticle(&fOutgoing, &cew);
350 ((
TH1F*)(*fHistos)[j++])->Fill(
d->GetEnergy(), xsec);
354 fProj.SetEnergy(fEnergy);
356 fProj.GetParameters()->Clear();
357 fOutgoing.GetParameters()->Clear();
360 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
363 fTarget->GetInteractionPoint(&fProj);
367 targ_mat = fTarget->GetLayer(fTarget->GetInteractionPoint());
370 fKinematics->SetTarget(t);
373 IP = fTarget->GetInteractionPoint();
388 return (fDetInd.HasParameter(label) ? GetEnergy(fDetInd.GetIntValue(label)) : 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
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)