ATLAS Offline Software
ITruthIncident.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_EVENT_ITRUTHINCIDENT_H
6 #define ISF_EVENT_ITRUTHINCIDENT_H 1
7 
8 // DetectorDescription
10 
11 // Barcode includes
13 
14 // forward declarations
17 
18 namespace ISF {
19 
27  typedef enum InteractionClass_t {
28  STD_VTX = 0,
34 
46  public:
48  m_numChildren(numChildren),
49  m_passWholeVertex(true),
50  m_childPassedFilters(numChildren,false) { };
51 
54 
56  virtual const HepMC::FourVector& position() const = 0;
57 
59  virtual int physicsProcessCategory() const = 0;
61  virtual int physicsProcessCode() const = 0;
62 
64  virtual double parentP2() const = 0;
66  virtual double parentPt2() const = 0;
68  virtual double parentEkin() const = 0;
70  virtual int parentPdgCode() const = 0;
74  virtual int parentStatus() = 0;
76  virtual int parentBarcode() = 0; // TODO Remove this method
78  virtual int parentUniqueID() = 0;
80  virtual bool parentSurvivesIncident() const = 0;
84 
86  inline unsigned short numberOfChildren() const;
88  virtual double childP2(unsigned short index) const = 0;
90  virtual double childPt2(unsigned short index) const = 0;
92  virtual double childEkin(unsigned short index) const = 0;
94  virtual int childPdgCode(unsigned short index) const = 0;
96  virtual int childBarcode(unsigned short index) const = 0;
99  inline bool childrenP2Pass(double p2cut);
102  inline bool childrenPt2Pass(double pt2cut);
105  inline bool childrenEkinPass(double ekincut);
109  virtual HepMC::GenParticlePtr childParticle(unsigned short index,
110  int bc = HepMC::UNDEFINED_ID) = 0;
112  inline void setChildPassedFilters(unsigned short index);
114  inline bool childPassedFilters(unsigned short index) const;
116  inline void setPassWholeVertices(bool passWholeVertex);
117 
126  private:
128  protected:
131  std::vector<bool> m_childPassedFilters;
132 
133  };
134 
135  //
136  // inline methods :
137  //
138 
139  unsigned short ISF::ITruthIncident::numberOfChildren() const {
140  return m_numChildren;
141  }
142 
143  // default loops to check a given cut for all child particles
144 
145  // loop over children to find out whether the momentum cut is passed or not
147  bool pass = false; // true if cut passed
148  // as soon as at a particle passes the cut -> end loop and return true
149  for ( unsigned short i=0; !(pass && m_passWholeVertex) && (i<m_numChildren); ++i) {
150  bool thispassed = (childP2(i) >= p2cut);
151  if(thispassed) { setChildPassedFilters(i); }
152  pass |= thispassed;
153  }
154  return pass;
155  }
156 
157  // loop over children to find out whether the transverse momentum cut is passed or not
159  bool pass = false; // true if cut passed
160  // as soon as at a particle passes the cut -> end loop and return true
161  for ( unsigned short i=0; !(pass && m_passWholeVertex) && (i<m_numChildren); ++i) {
162  bool thispassed = (childPt2(i) >= pt2cut);
163  if(thispassed) { setChildPassedFilters(i); }
164  pass |= thispassed;
165  }
166  return pass;
167  }
168 
169  // loop over children to find out whether the transverse momentum cut is passed or not
171  bool pass = false; // true if cut passed
172  // as soon as at a particle passes the cut -> end loop and return true
173  for ( unsigned short i=0; !(pass && m_passWholeVertex) && (i<m_numChildren); ++i) {
174  bool thispassed = (childEkin(i) >= ekincut);
175  if(thispassed) { setChildPassedFilters(i); }
176  pass |= thispassed;
177  }
178  return pass;
179  }
180 
182  m_childPassedFilters[index] = true;
183  return;
184  }
185 
186  bool ISF::ITruthIncident::childPassedFilters(unsigned short index) const {
187  return m_childPassedFilters[index];
188  }
189 
190  void ISF::ITruthIncident::setPassWholeVertices(bool passWholeVertex) {
191  m_passWholeVertex=passWholeVertex;
192  }
193 
194 }
195 
196 #endif //> !ISF_EVENT_ITRUTHINCIDENT_H
ISF::ITruthIncident::position
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
ISF::ITruthIncident::childParticle
virtual HepMC::GenParticlePtr childParticle(unsigned short index, int bc=HepMC::UNDEFINED_ID)=0
Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle...
ISF::ITruthIncident::parentStatus
virtual int parentStatus()=0
ISF::ITruthIncident::physicsProcessCode
virtual int physicsProcessCode() const =0
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
ISF::STD_VTX
@ STD_VTX
Definition: ITruthIncident.h:28
AtlasRegion.h
index
Definition: index.py:1
ISF::ITruthIncident::parentPdgCode
virtual int parentPdgCode() const =0
Return the PDG Code of the parent particle.
ISF::ITruthIncident::ITruthIncident
ITruthIncident(AtlasDetDescr::AtlasRegion geoID, unsigned short numChildren)
Definition: ITruthIncident.h:47
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::QS_PREDEF_VTX
@ QS_PREDEF_VTX
Definition: ITruthIncident.h:31
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
ISF::ITruthIncident::m_numChildren
int m_numChildren
Definition: ITruthIncident.h:129
ISF::ITruthIncident::childBarcode
virtual int childBarcode(unsigned short index) const =0
Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise ret...
GenParticle_fwd.h
ISF::ITruthIncident::interactionClassification
virtual ISF::InteractionClass_t interactionClassification() const
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:125
ISF::ITruthIncident::childEkin
virtual double childEkin(unsigned short index) const =0
Return Ekin of the i-th child particle.
ISF::ITruthIncident::childP2
virtual double childP2(unsigned short index) const =0
Return p^2 of the i-th child particle.
ISF::ITruthIncident::parentParticleAfterIncident
virtual HepMC::GenParticlePtr parentParticleAfterIncident(int newBC)=0
Return the parent particle after the TruthIncident vertex (and assign a new barcode to it)
ISF::UNKNOWN_VTX
@ UNKNOWN_VTX
Definition: ITruthIncident.h:32
ISF::ITruthIncident::parentParticle
virtual HepMC::GenParticlePtr parentParticle()=0
Return the parent particle as a HepMC particle type (only called for particles that will enter the He...
ISF::ITruthIncident::numberOfChildren
unsigned short numberOfChildren() const
Return total number of child particles.
Definition: ITruthIncident.h:139
SimpleVector.h
ISF::ITruthIncident::m_geoID
AtlasDetDescr::AtlasRegion m_geoID
region that the TruthIncident is located in
Definition: ITruthIncident.h:125
lumiFormat.i
int i
Definition: lumiFormat.py:85
ISF::ITruthIncident::childPt2
virtual double childPt2(unsigned short index) const =0
Return pT^2 of the i-th child particle.
ISF::QS_SURV_VTX
@ QS_SURV_VTX
Definition: ITruthIncident.h:29
ISF::ITruthIncident
Definition: ITruthIncident.h:45
ISF::QS_DEST_VTX
@ QS_DEST_VTX
Definition: ITruthIncident.h:30
ISF::ITruthIncident::childrenPt2Pass
bool childrenPt2Pass(double pt2cut)
Return true if at least one child particle passes the given pT^2 cut (= at least one child with pT^2 ...
Definition: ITruthIncident.h:158
ISF::ITruthIncident::parentSurvivesIncident
virtual bool parentSurvivesIncident() const =0
Return a boolean whether or not the parent particle survives the incident.
ISF::ITruthIncident::parentPt2
virtual double parentPt2() const =0
Return pT^2 of the parent particle.
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:56
MagicNumbers.h
ISF::InteractionClass_t
InteractionClass_t
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:27
ISF::ITruthIncident::parentEkin
virtual double parentEkin() const =0
Return Ekin of the parent particle.
ISF::ITruthIncident::childPdgCode
virtual int childPdgCode(unsigned short index) const =0
Return the PDG Code of the i-th child particle.
ISF::ITruthIncident::childrenEkinPass
bool childrenEkinPass(double ekincut)
Return true if at least one child particle passes the given Ekin cut (= at least one child with Ekin ...
Definition: ITruthIncident.h:170
ISF::ITruthIncident::childrenP2Pass
bool childrenP2Pass(double p2cut)
Return true if at least one child particle passes the given p^2 cut (= at least one child with p^2 >=...
Definition: ITruthIncident.h:146
ISF::ITruthIncident::childPassedFilters
bool childPassedFilters(unsigned short index) const
Should a particular child be written out to the GenEvent.
Definition: ITruthIncident.h:186
DeMoScan.index
string index
Definition: DeMoScan.py:364
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::ITruthIncident::parentBarcode
virtual int parentBarcode()=0
Return the barcode of the parent particle.
ISF::ITruthIncident::setPassWholeVertices
void setPassWholeVertices(bool passWholeVertex)
Set whether this TruthIncident should pass the vertex as a whole or individual children.
Definition: ITruthIncident.h:190
ISF::ITruthIncident::m_passWholeVertex
bool m_passWholeVertex
Definition: ITruthIncident.h:130
ISF::ITruthIncident::physicsProcessCategory
virtual int physicsProcessCategory() const =0
Return category of the physics process represented by the truth incident (eg hadronic,...
ISF::ITruthIncident::setChildPassedFilters
void setChildPassedFilters(unsigned short index)
Record that a particular child passed a check.
Definition: ITruthIncident.h:181
ISF::ITruthIncident::parentP2
virtual double parentP2() const =0
Return p^2 of the parent particle.
ISF::ITruthIncident::parentUniqueID
virtual int parentUniqueID()=0
Return the unique ID of the parent particle.
ISF::ITruthIncident::m_childPassedFilters
std::vector< bool > m_childPassedFilters
Definition: ITruthIncident.h:131
ISF::ITruthIncident::geoID
AtlasDetDescr::AtlasRegion geoID()
Return the SimGeoID corresponding to the vertex of the truth incident.
Definition: ITruthIncident.h:53