10 #include "KVElasticCountRates.h"
11 #include "KVMultiDetArray.h"
13 #include "KVDetector.h"
14 #include "KVTelescope.h"
18 #include "KVNucleus.h"
37 fAngularRange(theta_min, theta_max, phi_min, phi_max),
38 fBeamDirection{beam_dir}
57 Warning(
"KVElasticCountRates",
"gMultiDetArray does not refer to a valid multidetector array");
58 printf(
"Define it before using this class, and put it in simulation mode : gMultiDetArray->SetSimMode(kTRUE)");
68 KVElasticCountRates::~KVElasticCountRates()
93 fTarget->SetRandomized();
95 fMultiLayer = (fTarget->NumberOfLayers() > 1);
107 fEnergy = fProj.GetE();
108 fProj.SetMomentum(fEnergy, fBeamDirection);
128 "<KVElasticCountRates::SetTargetScatteringLayer> : No target set. Set run first."
132 fIntLayer = fTarget->GetLayerIndex(
name);
134 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
173 if (!fProj.IsDefined()) {
175 "<KVElasticCountRates::CalculateScattering> : Set projectile properties first"
181 "<KVElasticCountRates::CalculateScattering> : Set projectile energy first"
187 "<KVElasticCountRates::CalculateScattering> : No target set. Set run first."
204 new TH1F(
"hDepth",
"Depth (mg/cm2)", 500, 0., fTarget->GetTotalEffectiveThickness());
205 fTheta =
new TH1F(
"hTheta",
"Theta (deg.)", 500, 0., 0.);
206 fGlobalMap =
new TH2F(
"hGlobalMap",
"X-section in x(vert)-y(hori) plane",
207 500, -fAngularRange.GetThetaMax(), fAngularRange.GetThetaMax(),
208 500, -fAngularRange.GetThetaMax(), fAngularRange.GetThetaMax());
220 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
223 fTarget->GetInteractionPoint(&fProj);
229 TVector3 IP = fTarget->GetInteractionPoint();
233 fKinematics->SetTarget(t);
239 fKinematics->SetEDiss(fExx);
243 for (
int i = 0; i <
N; i++) {
245 fTarget->SetIncoming();
246 fTarget->DetectParticle(&fProj);
247 fKinematics->SetProjectile(fProj);
248 fKinematics->SetOutgoing(fProj);
249 fKinematics->CalculateKinematics();
251 fAngularRange.GetRandomAngles(theta, phi,
"random");
252 fProj.SetTheta(theta);
257 double angle_with_beam =
TMath::RadToDeg() * fProj.Angle(fBeamDirection);
258 xsec =
TMath::Abs(fKinematics->GetXSecRuthLab(angle_with_beam));
264 fKinematics->GetELab(3, angle_with_beam, 3, e1, e2);
266 fTheta->Fill(theta, xsec);
268 fTarget->SetOutgoing();
269 fTarget->DetectParticle(&fProj);
273 fDepth->Fill(IP.
z());
274 FillHistograms(detectors);
275 fProj.GetParameters()->Clear();
276 fProj.SetEnergy(fEnergy);
277 fProj.SetMomentum(fEnergy, fBeamDirection);
280 fTarget->SetInteractionLayer(fIntLayer, fBeamDirection);
283 fTarget->GetInteractionPoint(&fProj);
287 targ_mat = fTarget->GetLayer(fTarget->GetInteractionPoint());
290 fKinematics->SetTarget(t);
293 IP = fTarget->GetInteractionPoint();
320 for (
int i = 0; i < ndets; i++) {
326 histo =
new TH1F(detname,
Form(
"Eloss in %s", detname.
Data()), fBinE, 0, 0);
333 histo =
new TH1F(detname +
"_dW",
Form(
"Solid angle of %s", detname.
Data()), fBinE, 0, 0);
339 histo2 =
new TH2F(detname +
"_map",
Form(
"Map of %s", detname.
Data()), 100, 0, 0, 100, 0, 0);
342 histo2->
Fill(theta, phi, xsec);
368 : detector(
n), counts(
c), energy(
e), theta(t), phi(
p), fluence(
f), dissipation(
d), intXsec(i) {}
371 printf(
"%s \t: N=%8.2f/sec. \t <E>=%7.1f MeV \t Tot.Xsec=%9.3E barn \t fluence=%9.3E/sec./cm**2 \t dissip.=%9.3E MeV/sec./cm**2\n",
372 detector.
Data(), counts, energy, intXsec, fluence, dissipation);
401 return a.theta <
b.theta;
417 std::vector<count_rate> count_rates;
419 while ((
h = (
TH1F*)it())) {
421 if (!
name.EndsWith(
"_dW") && !
name.EndsWith(
"_map")) {
424 double intXsec =
h->
Integral() * fVolume / fNtirages;
426 double rate = fAtomicDensity * beam_intensity * intXsec;
432 count_rates.push_back(
438 std::sort(count_rates.begin(), count_rates.end(), compare_count_rates);
440 for (std::vector<count_rate>::iterator it = count_rates.begin(); it != count_rates.end(); ++it) {
454 nl.
SetName(
"Generated by KVElasticCountRates::PutResultsInList method");
460 nl.
SetValue(
"Intensity(pps)", beam_intensity);
462 std::vector<count_rate> count_rates;
464 while ((
h = (
TH1F*)it())) {
466 if (!
name.EndsWith(
"_dW") && !
name.EndsWith(
"_map")) {
469 double intXsec =
h->
Integral() * fVolume / fNtirages;
471 double rate = fAtomicDensity * beam_intensity * intXsec;
477 count_rates.push_back(
483 std::sort(count_rates.begin(), count_rates.end(), compare_count_rates);
485 for (std::vector<count_rate>::iterator it = count_rates.begin(); it != count_rates.end(); ++it) {
winID h TVirtualViewer3D TVirtualGLPainter p
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 b
char * Form(const char *fmt,...)
Relativistic binary kinematics calculator.
Extension of TDatime to handle various useful date formats.
Base class for detector geometry description.
virtual void Clear(Option_t *opt="")
virtual Double_t GetEntranceWindowSurfaceArea()
Return surface area of first layer of detector in cm2.
Calculate elastic scattering count rates in multidetector arrays.
void PrintResults(Double_t beam_intensity=1.e+07)
Print mean energy deposit & counting rate for given beam intensity in particles per second.
KVNameValueList PutResultsInList(Double_t beam_intensity=1.e+07)
Print mean energy deposit & counting rate for given beam intensity in particles per second.
void FillHistograms(KVNameValueList *)
void SetProjectile(const Char_t *nuc, Double_t e_sur_a)
Set projectile and beam energy [MeV/nucleon] & direction.
void SetEbinning(Int_t nbins=500)
void CalculateScattering(Int_t N=10000)
void SetRun(Int_t run)
Set detector parameters, target, etc. for run.
void SetTargetScatteringLayer(const Char_t *name)
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 KVNameValueList * DetectParticle(KVNucleus *part)
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
void SetFilterType(Int_t t)
virtual void InitializeIDTelescopes()
virtual void SetROOTGeometry(Bool_t on=kTRUE)
virtual void SetSimMode(Bool_t on=kTRUE)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
const Char_t * GetNameAt(Int_t idx) const
Int_t GetNpar() const
return the number of stored parameters
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Double_t GetAtomsPerCM2() const
virtual UInt_t GetUnits() const;
const char * AsSQLString() const
virtual Double_t GetMean(Int_t axis=1) const
TObject * FindObject(const char *name) const override
virtual Int_t Fill(const char *name, Double_t w)
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
virtual void SetTitle(const char *title="")
const char * GetName() const override
virtual void SetName(const char *name)
const char * Data() const
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
constexpr Double_t DegToRad()
Double_t Max(Double_t a, Double_t b)
constexpr Double_t RadToDeg()
Utility class used by KVElasticCountRates to store results.
Utility class used by KVElasticCountRates.
count_rate(TString n, double c, double e, double t, double p, double f, double d, double i)
void PutInList(KVNameValueList &nl)