ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace ISF {
19
34
46 public:
48 m_numChildren(numChildren),
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);
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
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
183 return;
184 }
185
188 }
189
190 void ISF::ITruthIncident::setPassWholeVertices(bool passWholeVertex) {
191 m_passWholeVertex=passWholeVertex;
192 }
193
194}
195
196#endif //> !ISF_EVENT_ITRUTHINCIDENT_H
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 >=...
virtual int physicsProcessCategory() const =0
Return category of the physics process represented by the truth incident (eg hadronic,...
virtual int physicsProcessCode() const =0
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
virtual int parentPdgCode() const =0
Return the PDG Code of the parent particle.
virtual ISF::InteractionClass_t interactionClassification() const
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
void setChildPassedFilters(unsigned short index)
Record that a particular child passed a check.
bool childrenEkinPass(double ekincut)
Return true if at least one child particle passes the given Ekin cut (= at least one child with Ekin ...
virtual int parentBarcode()=0
Return the barcode of the parent particle.
virtual double parentEkin() const =0
Return Ekin of the parent particle.
virtual HepMC::GenParticlePtr parentParticle()=0
Return the parent particle as a HepMC particle type (only called for particles that will enter the He...
virtual double parentPt2() const =0
Return pT^2 of the parent particle.
bool childPassedFilters(unsigned short index) const
Should a particular child be written out to the GenEvent.
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...
unsigned short numberOfChildren() const
Return total number of child particles.
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 ...
virtual double childPt2(unsigned short index) const =0
Return pT^2 of the i-th child particle.
AtlasDetDescr::AtlasRegion geoID()
Return the SimGeoID corresponding to the vertex of the truth incident.
virtual int parentUniqueID()=0
Return the unique ID of the parent particle.
virtual HepMC::GenParticlePtr parentParticleAfterIncident(int newBC)=0
Return the parent particle after the TruthIncident vertex (and assign a new barcode to it)
virtual double parentP2() const =0
Return p^2 of the parent particle.
ITruthIncident(AtlasDetDescr::AtlasRegion geoID, unsigned short numChildren)
std::vector< bool > m_childPassedFilters
void setPassWholeVertices(bool passWholeVertex)
Set whether this TruthIncident should pass the vertex as a whole or individual children.
virtual bool parentSurvivesIncident() const =0
Return a boolean whether or not the parent particle survives the incident.
virtual int childPdgCode(unsigned short index) const =0
Return the PDG Code of the i-th child particle.
AtlasDetDescr::AtlasRegion m_geoID
region that the TruthIncident is located in
virtual int parentStatus()=0
virtual double childP2(unsigned short index) const =0
Return p^2 of the i-th child particle.
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...
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
virtual double childEkin(unsigned short index) const =0
Return Ekin of the i-th child particle.
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
Definition AtlasRegion.h:21
constexpr int UNDEFINED_ID
GenParticle * GenParticlePtr
Definition GenParticle.h:37
ISFParticleOrderedQueue.
InteractionClass_t
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
@ QS_SURV_VTX
@ QS_PREDEF_VTX
@ UNKNOWN_VTX
@ QS_DEST_VTX
Definition index.py:1