ATLAS Offline Software
Loading...
Searching...
No Matches
iFatras::ProcessSamplingTool Class Reference

Fatras AlgTool to sample process and free path. More...

#include <ProcessSamplingTool.h>

Inheritance diagram for iFatras::ProcessSamplingTool:
Collaboration diagram for iFatras::ProcessSamplingTool:

Public Member Functions

 ProcessSamplingTool (const std::string &, const std::string &, const IInterface *)
 Constructor.
virtual ~ProcessSamplingTool ()=default
 Destructor.
Trk::PathLimit sampleProcess (CLHEP::HepRandomEngine *randomEngine, double mom, double charge, Trk::ParticleHypothesis pHypothesis) const
 Process pre-sampling : to be moved into material updators eventually.

Private Attributes

BooleanProperty m_hadInt {this, "HadronicInteraction", true, ""}
 hadronic interaction

Detailed Description

Fatras AlgTool to sample process and free path.

Author
Sharka Todorova Sarka.Todorova -at- cern.ch

Definition at line 28 of file ProcessSamplingTool.h.

Constructor & Destructor Documentation

◆ ProcessSamplingTool()

iFatras::ProcessSamplingTool::ProcessSamplingTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Constructor.

Definition at line 25 of file ProcessSamplingTool.cxx.

28 : base_class(t,n,p)
29{
30}

◆ ~ProcessSamplingTool()

virtual iFatras::ProcessSamplingTool::~ProcessSamplingTool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ sampleProcess()

Trk::PathLimit iFatras::ProcessSamplingTool::sampleProcess ( CLHEP::HepRandomEngine * randomEngine,
double mom,
double charge,
Trk::ParticleHypothesis pHypothesis ) const

Process pre-sampling : to be moved into material updators eventually.

Definition at line 33 of file ProcessSamplingTool.cxx.

34{
35 int process=0;
36 double x0Max = -1.;
37
38 if ( particle == Trk::electron && charge<0. ) return Trk::PathLimit(x0Max,process);
39
40 if ( particle == Trk::muon || particle == Trk::nonInteractingMuon ) return Trk::PathLimit(x0Max,process);
41
42 double rndx = CLHEP::RandFlat::shoot(randomEngine);
43
44 if ( particle == Trk::photon ) {
45
46 // conversion (14), compton effect (13), photo-effect (12)
47
48 double p0 = -7.01612e-03;
49 double p1 = 7.69040e-02;
50 double p2 = -6.07682e-01;
51 // calculate xi
52 double xi = p0 + p1*pow(momentum/1000.,p2);
53 double attenuation = -7.777e-01*(1.-xi);
54
55 x0Max = log(rndx)/attenuation ;
56
57 // comment additional interactions till properly implemented
58 /*
59 // first estimate : compton ~ 4% , use attenuation factor as for conversion (till parameterized )
60 double rndp = CLHEP::RandFlat::shoot(randomEngine);
61
62 if ( rndp > 0.96 ) { // do Compton scattering
63 process = 13;
64 } else if (rndp < 5.53/pow(momentum,1.184) ) {
65 process = 12;
66 attenuation = -0.378;
67 x0Max = log(rndx)/attenuation *momentum ;
68 } else {
69 process = 14;
70 //x0Max *= 0.5;
71 }
72 */
73
74 process = 14;
75
76 return Trk::PathLimit(x0Max,process);
77 }
78
79 if ( particle == Trk::electron && charge>0. ) { // positron
80
82 double gamma = momentum/mass;
83
84 // annihilation
85 // energy dependent factor
86 double fpa = log(2*gamma)/gamma;
87 // material dependent factor - use Al(Z=13) for the moment
88 double fza = 13.;
89 double attenuation = -fpa*fza; // adjust
90
91 x0Max = log(rndx)/attenuation ;
92 process = 5;
93
94 return Trk::PathLimit(x0Max,process);
95
96 }
97
98 // presumably here we are left with hadrons only
99 if (m_hadInt) {
100
101 // sample free path in terms of nuclear interaction length
102 double al = 1.; // scaling here
103
104 /*
105
106 if ( particle == Trk::pion || particle == Trk::kaon || particle == Trk::pi0 || particle == Trk::k0) {
107 al *= 1./(1.+ exp(-0.5*(momentum-270.)*(momentum-270.)/60./60.));
108 }
109 if ( particle == Trk::proton || particle == Trk::neutron ) al *=0.7;
110 if ( particle == Trk::pion || particle == Trk::pi0) al *=0.9;
111 */
112
113 x0Max = -log(rndx)*al ;
114
115 process = 121;
116
117 //std::cout <<"hadronic path limit:"<<momentum<<","<<al<<","<< x0Max << std::endl;
118 return Trk::PathLimit(x0Max,process);
119 }
120
121
122 return Trk::PathLimit(x0Max,process);
123
124}
double charge(const T &p)
Definition AtlasPID.h:997
static Double_t al
constexpr int pow(int base, int exp) noexcept
BooleanProperty m_hadInt
hadronic interaction
const std::string process
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
@ nonInteractingMuon

Member Data Documentation

◆ m_hadInt

BooleanProperty iFatras::ProcessSamplingTool::m_hadInt {this, "HadronicInteraction", true, ""}
private

hadronic interaction

Definition at line 45 of file ProcessSamplingTool.h.

45{this, "HadronicInteraction", true, ""};

The documentation for this class was generated from the following files: