ATLAS Offline Software
ParticleUserInformation.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // ParticleUserInformation.h, (c) ATLAS Detector software
8 
9 #ifndef ISF_EVENT_PARTICLEUSERINFORMATION_H
10 #define ISF_EVENT_PARTICLEUSERINFORMATION_H
11 
12 #include <cmath>
13 
14 namespace ISF {
15 
28  {
29  float dMax; // path limit after which sampled process occurs
30  float dCollected; // material thickness traversed so far
31  int process; // type of pre-sampled material process
32 
33  MaterialPathInfo( int proc, float pathLimit, float pathCurrent ) :
34  dMax(pathLimit), dCollected(pathCurrent), process(proc)
35  {}
39  void updatePath( float d) { dCollected += d; }
40 
42  bool operator==(const MaterialPathInfo& rhs) const {
43  float epsilon = 1e-6;
44  bool pass = true;
45  pass &= std::fabs(dMax-rhs.dMax) < epsilon;
46  pass &= std::fabs(dCollected-rhs.dCollected) < epsilon;
47  pass &= process == rhs.process;
48  return pass;
49  }
50  };
51 
53 
54  public:
57 
59  virtual ~ParticleUserInformation() { delete m_matInfo; };
60 
61  int getExtraBC() const;
62  int process() const;
63  int generation() const;
64  const MaterialPathInfo* materialLimit() const;
65 
66  void setExtraBC(int extrabc);
67  void setProcess(int proc);
68  void setGeneration(int gen);
69  void setMaterialLimit(int process, float x0lim, float x0coll);
70 
72  bool operator==(const ParticleUserInformation& rhs) const;
73 
74  private:
75 
76  int m_process; // generating process
77  int m_generation; // generation number (i.e. number of vertices separating vertex of origin
78  // from the primary vertex (GenEvent input)
79  MaterialPathInfo* m_matInfo; // presampled process and material collection
80  };
81 } // end of namespace
82 
83 
84 inline int ISF::ParticleUserInformation::process() const { return m_process; }
85 
86 inline int ISF::ParticleUserInformation::generation() const { return m_generation; }
87 
88 inline const ISF::MaterialPathInfo* ISF::ParticleUserInformation::materialLimit() const { return m_matInfo; }
89 
90 inline void ISF::ParticleUserInformation::setProcess(int proc) { m_process = proc; }
91 
92 inline void ISF::ParticleUserInformation::setGeneration(int gen) { m_generation = gen; }
93 
94 inline void ISF::ParticleUserInformation::setMaterialLimit(int proc, float dMax, float d)
95 { delete m_matInfo; m_matInfo = new ISF::MaterialPathInfo(proc,dMax,d); }
96 
97 #endif // ISF_EVENT_PARTICLEUSERINFORMATION_H
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ISF::ParticleUserInformation::m_process
int m_process
Definition: ParticleUserInformation.h:76
ISF::MaterialPathInfo::updatePath
void updatePath(float d)
collected material update
Definition: ParticleUserInformation.h:39
ISF::ParticleUserInformation::m_generation
int m_generation
Definition: ParticleUserInformation.h:77
ISF::ParticleUserInformation::m_matInfo
MaterialPathInfo * m_matInfo
Definition: ParticleUserInformation.h:79
ISF::ParticleUserInformation::operator==
bool operator==(const ParticleUserInformation &rhs) const
Comparison.
Definition: ParticleUserInformation.cxx:20
ISF::ParticleUserInformation::setProcess
void setProcess(int proc)
Definition: ParticleUserInformation.h:90
hist_file_dump.d
d
Definition: hist_file_dump.py:137
ISF::ParticleUserInformation::getExtraBC
int getExtraBC() const
ISF::MaterialPathInfo::dMax
float dMax
Definition: ParticleUserInformation.h:29
ISF::MaterialPathInfo::dCollected
float dCollected
Definition: ParticleUserInformation.h:30
ISF::MaterialPathInfo::MaterialPathInfo
MaterialPathInfo(int proc, float pathLimit, float pathCurrent)
Definition: ParticleUserInformation.h:33
master.gen
gen
Definition: master.py:32
ISF::ParticleUserInformation::setExtraBC
void setExtraBC(int extrabc)
ISF::ParticleUserInformation
Definition: ParticleUserInformation.h:52
ISF::ParticleUserInformation::~ParticleUserInformation
virtual ~ParticleUserInformation()
virtual destructor
Definition: ParticleUserInformation.h:59
ISF::ParticleUserInformation::setGeneration
void setGeneration(int gen)
Definition: ParticleUserInformation.h:92
ISF::ParticleUserInformation::setMaterialLimit
void setMaterialLimit(int process, float x0lim, float x0coll)
Definition: ParticleUserInformation.h:94
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
ISF::MaterialPathInfo
Definition: ParticleUserInformation.h:28
ISF::ParticleUserInformation::materialLimit
const MaterialPathInfo * materialLimit() const
Definition: ParticleUserInformation.h:88
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::ParticleUserInformation::ParticleUserInformation
ParticleUserInformation()
empty constructor
Definition: ParticleUserInformation.cxx:13
ISF::ParticleUserInformation::process
int process() const
Definition: ParticleUserInformation.h:84
ISF::MaterialPathInfo::operator==
bool operator==(const MaterialPathInfo &rhs) const
comparison
Definition: ParticleUserInformation.h:42
ISF::ParticleUserInformation::generation
int generation() const
Definition: ParticleUserInformation.h:86
ISF::MaterialPathInfo::process
int process
Definition: ParticleUserInformation.h:31