ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
iFatras::ProcessSamplingTool Class Reference

#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. More...
 
virtual ~ProcessSamplingTool ()=default
 Destructor. More...
 
Trk::PathLimit sampleProcess (CLHEP::HepRandomEngine *randomEngine, double mom, double charge, Trk::ParticleHypothesis pHypothesis) const
 Process pre-sampling : to be moved into material updators eventually. More...
 

Private Attributes

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

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 
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 }

Member Data Documentation

◆ m_hadInt

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

hadronic interaction

Definition at line 45 of file ProcessSamplingTool.h.


The documentation for this class was generated from the following files:
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
RunExEngineTest.PathLimit
PathLimit
Definition: RunExEngineTest.py:61
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
beamspotman.n
n
Definition: beamspotman.py:731
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
iFatras::ProcessSamplingTool::m_hadInt
BooleanProperty m_hadInt
hadronic interaction
Definition: ProcessSamplingTool.h:45
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
charge
double charge(const T &p)
Definition: AtlasPID.h:494
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::photon
@ photon
Definition: ParticleHypothesis.h:32
Trk::nonInteractingMuon
@ nonInteractingMuon
Definition: ParticleHypothesis.h:36