ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::ISFTruthIncident Class Reference

Interface class for all truth incidents handled by the ISF. More...

#include <ISFTruthIncident.h>

Inheritance diagram for ISF::ISFTruthIncident:
Collaboration diagram for ISF::ISFTruthIncident:

Public Member Functions

 ISFTruthIncident (ISF::ISFParticle &parent, const ISFParticleVector &children, int process, AtlasDetDescr::AtlasRegion geoID, ISF::KillPrimary killsPrimary=ISF::fPrimarySurvives, const HepMC::FourVector *position=0)
virtual ~ISFTruthIncident ()
 ISFTruthIncident (const ISFTruthIncident &)=delete
ISFTruthIncidentoperator= (const ISFTruthIncident &)=delete
const HepMC::FourVector & position () const override final
 Return HepMC position of the truth vertex.
int physicsProcessCategory () const override final
 Return category of the physics process represented by the truth incident (eg hadronic, em, ..)
int physicsProcessCode () const override final
 Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung, ..)
double parentP2 () const override final
 Return p^2 of the parent particle.
double parentPt2 () const override final
 Return pT^2 of the parent particle.
double parentEkin () const override final
 Return Ekin of the parent particle.
int parentPdgCode () const override final
 Return the PDG Code of the parent particle.
HepMC::GenParticlePtr parentParticle () override final
 Return the parent particle as a HepMC particle type (usually only called for particles that will enter the HepMC truth event)
int parentStatus () override final
int parentBarcode () override final
 Return the barcode of the parent particle.
int parentUniqueID () override final
 Return the unique ID of the parent particle.
bool parentSurvivesIncident () const override final
 Return a boolean whether or not the parent particle survives the incident.
HepMC::GenParticlePtr parentParticleAfterIncident (int newBC) override final
 Return the parent particle after the TruthIncident vertex (and give it a new barcode)
double childP2 (unsigned short index) const override final
 Return p^2 of the i-th child particle.
double childPt2 (unsigned short index) const override final
 Return pT^2 of the i-th child particle.
double childEkin (unsigned short index) const override final
 Return Ekin of the i-th child particle.
int childPdgCode (unsigned short index) const override final
 Return the PDG Code of the i-th child particle.
int childBarcode (unsigned short) const override final
 Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise return 0.
HepMC::GenParticlePtr childParticle (unsigned short index, int bc) override final
 Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle (usually only called for particles that will enter the HepMC truth event)
void updateParentAfterIncidentProperties ()
 Update the id and particleLink properties of the parentAfterIncident (to be called after registerTruthIncident)
void updateChildParticleProperties ()
 Update the id and particleLink properties of the child particles (to be called after registerTruthIncident)
AtlasDetDescr::AtlasRegion geoID ()
 Return the SimGeoID corresponding to the vertex of the truth incident.
unsigned short numberOfChildren () const
 Return total number of child particles.
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 >= pt2cut)
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 >= pt2cut)
bool childrenEkinPass (double ekincut)
 Return true if at least one child particle passes the given Ekin cut (= at least one child with Ekin >= ekincut)
void setChildPassedFilters (unsigned short index)
 Record that a particular child passed a check.
bool childPassedFilters (unsigned short index) const
 Should a particular child be written out to the GenEvent.
void setPassWholeVertices (bool passWholeVertex)
 Set whether this TruthIncident should pass the vertex as a whole or individual children.
virtual ISF::InteractionClass_t interactionClassification () const
 The interaction classifications are described as follows: STD_VTX: interaction of a particle without a pre-defined decay; QS_SURV_VTX: a particle with a pre-defined decay under-going a non-destructive interaction; QS_DEST_VTX: a particle with a pre-defined decay under-going a destructive interaction other than its pre-defined decay; QS_PREDEF_VTX: a particle under-going its pre-defined decay.

Protected Attributes

int m_numChildren
bool m_passWholeVertex
std::vector< bool > m_childPassedFilters

Private Member Functions

 ISFTruthIncident ()
HepMC::GenParticlePtr getHepMCTruthParticle (ISF::ISFParticle &particle) const
 return attached truth particle
HepMC::GenParticlePtr updateHepMCTruthParticle (ISF::ISFParticle &particle, ISF::ISFParticle *parent=nullptr) const
 convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding

Private Attributes

ISF::ISFParticlem_parent
const ISFParticleVectorm_children
const int m_process
const ISF::KillPrimary m_killsPrimary
const HepMC::FourVector * m_position
AtlasDetDescr::AtlasRegion m_geoID
 region that the TruthIncident is located in

Detailed Description

Interface class for all truth incidents handled by the ISF.

Author
Elmar.nosp@m..Rit.nosp@m.sch@c.nosp@m.ern..nosp@m.ch

Definition at line 35 of file ISFTruthIncident.h.

Constructor & Destructor Documentation

◆ ISFTruthIncident() [1/3]

ISF::ISFTruthIncident::ISFTruthIncident ( ISF::ISFParticle & parent,
const ISFParticleVector & children,
int process,
AtlasDetDescr::AtlasRegion geoID,
ISF::KillPrimary killsPrimary = ISF::fPrimarySurvives,
const HepMC::FourVector * position = 0 )

Definition at line 36 of file ISFTruthIncident.cxx.

41 :
43 m_parent(parent),
44 m_children(children),
46 m_killsPrimary(killsPrimary),
48{
49 if ( !m_position) {
50 // No position was given, so compute it.
51 // Default to the parent particle position in the case that there are no child particles.
52 const ISF::ISFParticle *particle = (m_children.empty()) ? &m_parent : m_children.front();
53 if ( !particle) particle = &m_parent; // protection against nullptrs in m_children ISFParticleVector - this would indicate a bug upstream, better to throw an exception here?
54 const Amg::Vector3D &pos = particle->position();
55
56 double time = 0.; //<! TODO: FIXME
57 m_position = new HepMC::FourVector( pos.x(), pos.y(), pos.z(), time );
58 }
59}
const HepMC::FourVector * m_position
ISF::ISFParticle & m_parent
const ISFParticleVector & m_children
const ISF::KillPrimary m_killsPrimary
const HepMC::FourVector & position() const override final
Return HepMC position of the truth vertex.
AtlasDetDescr::AtlasRegion geoID()
Return the SimGeoID corresponding to the vertex of the truth incident.
ITruthIncident(AtlasDetDescr::AtlasRegion geoID, unsigned short numChildren)
const std::string process
Eigen::Matrix< double, 3, 1 > Vector3D
time(flags, cells_name, *args, **kw)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ ~ISFTruthIncident()

ISF::ISFTruthIncident::~ISFTruthIncident ( )
virtual

Definition at line 61 of file ISFTruthIncident.cxx.

61 {
62 delete m_position;
63}

◆ ISFTruthIncident() [2/3]

ISF::ISFTruthIncident::ISFTruthIncident ( const ISFTruthIncident & )
delete

◆ ISFTruthIncident() [3/3]

ISF::ISFTruthIncident::ISFTruthIncident ( )
private

Member Function Documentation

◆ childBarcode()

int ISF::ISFTruthIncident::childBarcode ( unsigned short index) const
finaloverridevirtual

Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise return 0.

Implements ISF::ITruthIncident.

Definition at line 149 of file ISFTruthIncident.cxx.

149 {
150 return numberOfChildren() > index ? HepMC::barcode(m_children[index]) : HepMC::UNDEFINED_ID;
151}
unsigned short numberOfChildren() const
Return total number of child particles.
str index
Definition DeMoScan.py:362
int barcode(const T *p)
Definition Barcode.h:16
constexpr int UNDEFINED_ID

◆ childEkin()

double ISF::ISFTruthIncident::childEkin ( unsigned short index) const
finaloverridevirtual

Return Ekin of the i-th child particle.

Implements ISF::ITruthIncident.

Definition at line 140 of file ISFTruthIncident.cxx.

140 {
141 return m_children[index]->ekin();
142}

◆ childP2()

double ISF::ISFTruthIncident::childP2 ( unsigned short index) const
finaloverridevirtual

Return p^2 of the i-th child particle.

Implements ISF::ITruthIncident.

Definition at line 132 of file ISFTruthIncident.cxx.

132 {
133 return m_children[index]->momentum().mag2();
134}

◆ childParticle()

HepMC::GenParticlePtr ISF::ISFTruthIncident::childParticle ( unsigned short index,
int bc )
finaloverridevirtual

Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle (usually only called for particles that will enter the HepMC truth event)

Implements ISF::ITruthIncident.

Definition at line 153 of file ISFTruthIncident.cxx.

154 {
155 // the child particle
156 ISF::ISFParticle *sec = m_children[index];
157
158 // set particle barcode of the child particle
159 if (bc) {
160 sec->setBarcode( bc);
161 }
162
163 // Enforce that the status is set correctly
165
166 // FIXME At this point the sec ISFParticle's id, truthBinding
167 // and particleLink all still need to be updated
168
169 // and update truth info (including the ISFParticle's HMPL)
170 return updateHepMCTruthParticle( *sec, &m_parent );
171}
void setBarcode(int bc)
set a new barcode
void setStatus(int a)
HepMC::GenParticlePtr updateHepMCTruthParticle(ISF::ISFParticle &particle, ISF::ISFParticle *parent=nullptr) const
convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...

◆ childPassedFilters()

bool ISF::ITruthIncident::childPassedFilters ( unsigned short index) const
inlineinherited

Should a particular child be written out to the GenEvent.

Definition at line 186 of file ITruthIncident.h.

186 {
188 }
std::vector< bool > m_childPassedFilters

◆ childPdgCode()

int ISF::ISFTruthIncident::childPdgCode ( unsigned short index) const
finaloverridevirtual

Return the PDG Code of the i-th child particle.

Implements ISF::ITruthIncident.

Definition at line 145 of file ISFTruthIncident.cxx.

145 {
146 return m_children[index]->pdgCode();
147}

◆ childPt2()

double ISF::ISFTruthIncident::childPt2 ( unsigned short index) const
finaloverridevirtual

Return pT^2 of the i-th child particle.

Implements ISF::ITruthIncident.

Definition at line 136 of file ISFTruthIncident.cxx.

136 {
137 return m_children[index]->momentum().perp2();
138}

◆ childrenEkinPass()

bool ISF::ITruthIncident::childrenEkinPass ( double ekincut)
inlineinherited

Return true if at least one child particle passes the given Ekin cut (= at least one child with Ekin >= ekincut)

Definition at line 170 of file ITruthIncident.h.

170 {
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 }
void setChildPassedFilters(unsigned short index)
Record that a particular child passed a check.
virtual double childEkin(unsigned short index) const =0
Return Ekin of the i-th child particle.

◆ childrenP2Pass()

bool ISF::ITruthIncident::childrenP2Pass ( double p2cut)
inlineinherited

Return true if at least one child particle passes the given p^2 cut (= at least one child with p^2 >= pt2cut)

Definition at line 146 of file ITruthIncident.h.

146 {
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 }
virtual double childP2(unsigned short index) const =0
Return p^2 of the i-th child particle.

◆ childrenPt2Pass()

bool ISF::ITruthIncident::childrenPt2Pass ( double pt2cut)
inlineinherited

Return true if at least one child particle passes the given pT^2 cut (= at least one child with pT^2 >= pt2cut)

Definition at line 158 of file ITruthIncident.h.

158 {
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 }
virtual double childPt2(unsigned short index) const =0
Return pT^2 of the i-th child particle.

◆ geoID()

AtlasDetDescr::AtlasRegion ISF::ITruthIncident::geoID ( )
inlineinherited

Return the SimGeoID corresponding to the vertex of the truth incident.

Definition at line 53 of file ITruthIncident.h.

53{ return m_geoID; };
AtlasDetDescr::AtlasRegion m_geoID
region that the TruthIncident is located in

◆ getHepMCTruthParticle()

HepMC::GenParticlePtr ISF::ISFTruthIncident::getHepMCTruthParticle ( ISF::ISFParticle & particle) const
inlineprivate

return attached truth particle

Definition at line 175 of file ISFTruthIncident.cxx.

175 {
176 auto* truthBinding = particle.getTruthBinding();
177 HepMC::GenParticlePtr currentGenParticle = truthBinding ? truthBinding->getCurrentGenParticle() : nullptr;
178
179 // We have what we want
180 if (currentGenParticle) {
181 return currentGenParticle;
182 }
183 //Otherwise we need to create it
184 return updateHepMCTruthParticle(particle,&particle);
185}
GenParticle * GenParticlePtr
Definition GenParticle.h:37

◆ interactionClassification()

virtual ISF::InteractionClass_t ISF::ITruthIncident::interactionClassification ( ) const
inlinevirtualinherited

The interaction classifications are described as follows: STD_VTX: interaction of a particle without a pre-defined decay; QS_SURV_VTX: a particle with a pre-defined decay under-going a non-destructive interaction; QS_DEST_VTX: a particle with a pre-defined decay under-going a destructive interaction other than its pre-defined decay; QS_PREDEF_VTX: a particle under-going its pre-defined decay.

Reimplemented in iGeant4::Geant4TruthIncident.

Definition at line 125 of file ITruthIncident.h.

125{return ISF::STD_VTX;};

◆ numberOfChildren()

unsigned short ISF::ITruthIncident::numberOfChildren ( ) const
inlineinherited

Return total number of child particles.

Definition at line 139 of file ITruthIncident.h.

139 {
140 return m_numChildren;
141 }

◆ operator=()

ISFTruthIncident & ISF::ISFTruthIncident::operator= ( const ISFTruthIncident & )
delete

◆ parentBarcode()

int ISF::ISFTruthIncident::parentBarcode ( )
finaloverridevirtual

Return the barcode of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 101 of file ISFTruthIncident.cxx.

101 { // TODO Remove this method
102 return HepMC::barcode(m_parent); // FIXME barcode-based
103}

◆ parentEkin()

double ISF::ISFTruthIncident::parentEkin ( ) const
finaloverridevirtual

Return Ekin of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 85 of file ISFTruthIncident.cxx.

85 {
86 return m_parent.ekin();
87}

◆ parentP2()

double ISF::ISFTruthIncident::parentP2 ( ) const
finaloverridevirtual

Return p^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 77 of file ISFTruthIncident.cxx.

77 {
78 return m_parent.momentum().mag2();
79}

◆ parentParticle()

HepMC::GenParticlePtr ISF::ISFTruthIncident::parentParticle ( )
finaloverridevirtual

Return the parent particle as a HepMC particle type (usually only called for particles that will enter the HepMC truth event)

Implements ISF::ITruthIncident.

Definition at line 97 of file ISFTruthIncident.cxx.

97 {
99}
HepMC::GenParticlePtr getHepMCTruthParticle(ISF::ISFParticle &particle) const
return attached truth particle

◆ parentParticleAfterIncident()

HepMC::GenParticlePtr ISF::ISFTruthIncident::parentParticleAfterIncident ( int newBC)
finaloverridevirtual

Return the parent particle after the TruthIncident vertex (and give it a new barcode)

Implements ISF::ITruthIncident.

Definition at line 113 of file ISFTruthIncident.cxx.

113 {
114 // if parent is killed in the interaction -> return nullptr
115 if (m_killsPrimary==ISF::fKillsPrimary) return nullptr;
116
117 // only update the parent particle, if it survived the interaction
118
119 // set a new barcode
120 m_parent.setBarcode( newBC );
121
122 // set a new status
124
125 // FIXME At this point the m_parent ISFParticle's id, truthBinding
126 // and particleLink all still need to be updated
127
128 // and update truth info (including the ISFParticle's HMPL)
130}
int parentStatus() override final
constexpr int SIM_STATUS_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
@ fKillsPrimary

◆ parentPdgCode()

int ISF::ISFTruthIncident::parentPdgCode ( ) const
finaloverridevirtual

Return the PDG Code of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 89 of file ISFTruthIncident.cxx.

89 {
90 return m_parent.pdgCode();
91}

◆ parentPt2()

double ISF::ISFTruthIncident::parentPt2 ( ) const
finaloverridevirtual

Return pT^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 81 of file ISFTruthIncident.cxx.

81 {
82 return m_parent.momentum().perp2();
83}

◆ parentStatus()

int ISF::ISFTruthIncident::parentStatus ( )
finaloverridevirtual

Implements ISF::ITruthIncident.

Definition at line 93 of file ISFTruthIncident.cxx.

93 {
94 return m_parent.status();
95}

◆ parentSurvivesIncident()

bool ISF::ISFTruthIncident::parentSurvivesIncident ( ) const
finaloverridevirtual

Return a boolean whether or not the parent particle survives the incident.

Implements ISF::ITruthIncident.

Definition at line 109 of file ISFTruthIncident.cxx.

109 {
111}

◆ parentUniqueID()

int ISF::ISFTruthIncident::parentUniqueID ( )
finaloverridevirtual

Return the unique ID of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 105 of file ISFTruthIncident.cxx.

105 {
106 return m_parent.id();
107}

◆ physicsProcessCategory()

int ISF::ISFTruthIncident::physicsProcessCategory ( ) const
finaloverridevirtual

Return category of the physics process represented by the truth incident (eg hadronic, em, ..)

Implements ISF::ITruthIncident.

Definition at line 69 of file ISFTruthIncident.cxx.

69 {
70 return -1;
71}

◆ physicsProcessCode()

int ISF::ISFTruthIncident::physicsProcessCode ( ) const
finaloverridevirtual

Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung, ..)

Implements ISF::ITruthIncident.

Definition at line 73 of file ISFTruthIncident.cxx.

73 {
74 return m_process;
75}

◆ position()

const HepMC::FourVector & ISF::ISFTruthIncident::position ( ) const
finaloverridevirtual

Return HepMC position of the truth vertex.

Implements ISF::ITruthIncident.

Definition at line 65 of file ISFTruthIncident.cxx.

65 {
66 return *m_position;
67}

◆ setChildPassedFilters()

void ISF::ITruthIncident::setChildPassedFilters ( unsigned short index)
inlineinherited

Record that a particular child passed a check.

Definition at line 181 of file ITruthIncident.h.

181 {
183 return;
184 }

◆ setPassWholeVertices()

void ISF::ITruthIncident::setPassWholeVertices ( bool passWholeVertex)
inlineinherited

Set whether this TruthIncident should pass the vertex as a whole or individual children.

Definition at line 190 of file ITruthIncident.h.

190 {
191 m_passWholeVertex=passWholeVertex;
192 }

◆ updateChildParticleProperties()

void ISF::ISFTruthIncident::updateChildParticleProperties ( )

Update the id and particleLink properties of the child particles (to be called after registerTruthIncident)

Definition at line 239 of file ISFTruthIncident.cxx.

239 {
240 unsigned short numSec = numberOfChildren();
241 for (unsigned short i=0; i<numSec; i++) {
242 // the current particle
243 ISF::ISFParticle *child = m_children[i];
244 ISF::TruthBinding *childTruthBinding = child->getTruthBinding();
245 if (!childTruthBinding) {
246 // Child particles which were rejected during
247 // registerTruthIncident need a TruthBinding
248 auto parentTruthBinding = m_parent.getTruthBinding();
249 if (parentTruthBinding) {
250 childTruthBinding = parentTruthBinding->childTruthBinding(nullptr);
251 }
252 else {
253 // FIXME We really shouldn't end up here, possibly abort if we hit this?
254 childTruthBinding = new TruthBinding( nullptr, nullptr, nullptr );
255 }
256 child->setTruthBinding(childTruthBinding);
257 }
258 auto childGenParticle = childTruthBinding->getCurrentGenParticle();
259 const int childID = (childGenParticle) ? HepMC::uniqueID(childGenParticle) : HepMC::UNDEFINED_ID;
260 HepMcParticleLink* childHMPL{};
261 const HepMcParticleLink* oldChildHMPL = child->getParticleLink();
262 int eventIndex{0};
263 if (childGenParticle) { eventIndex = childGenParticle->parent_event()->event_number(); }
264 else if (oldChildHMPL) { eventIndex = oldChildHMPL->eventIndex(); }
265 const HepMcParticleLink::PositionFlag idxFlag =
266 (eventIndex==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM;
267 if (oldChildHMPL) {
268 delete oldChildHMPL;
269 }
270 if (!childGenParticle) {
271 childHMPL = new HepMcParticleLink(childID, eventIndex, idxFlag, HepMcParticleLink::IS_ID);
272 }
273 else {
274 childHMPL = new HepMcParticleLink(childGenParticle, eventIndex, idxFlag);
275 }
276 child->setId(childID);
277 child->setParticleLink(childHMPL);
278 }
279}
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
void setId(int id)
set a new unique ID
void setParticleLink(const HepMcParticleLink *partLink)
void setTruthBinding(TruthBinding *truth)
HepMC::GenParticlePtr getCurrentGenParticle()
pointer to the particle in the simulation truth
TruthBinding * childTruthBinding(HepMC::GenParticlePtr childP)
Create a TruthBinding for a child particle.
thread_local event_number_t eventIndex
int uniqueID(const T &p)

◆ updateHepMCTruthParticle()

HepMC::GenParticlePtr ISF::ISFTruthIncident::updateHepMCTruthParticle ( ISF::ISFParticle & particle,
ISF::ISFParticle * parent = nullptr ) const
inlineprivate

convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding

Definition at line 188 of file ISFTruthIncident.cxx.

189 {
190 auto* truthBinding = particle.getTruthBinding();
191 HepMC::GenParticlePtr newGenParticle = ParticleHelper_convert( particle );
192
193 if (truthBinding) {
194 truthBinding->setCurrentGenParticle(newGenParticle);
195 } else {
196 auto parentTruthBinding = parent ? parent->getTruthBinding() : nullptr;
197 auto primaryGenParticle = parentTruthBinding ? parentTruthBinding->getPrimaryGenParticle() : nullptr;
198 auto generationZeroGenParticle = newGenParticle; // New physical particle so this is also the generation zero particle
199 truthBinding = new TruthBinding( newGenParticle, primaryGenParticle, generationZeroGenParticle );
200 particle.setTruthBinding(truthBinding);
201 }
202 // At this point the values returned by particle.getParticleLink()
203 // and particle.id() are not consistent with what is stored in the
204 // TruthBinding.
205
206 // FIXME Consider deleting the HepMcParticleLink and setting the id to HepMC::UNDEFINED_ID at this point?
207 return newGenParticle;
208}
static HepMC::GenParticlePtr ParticleHelper_convert(const ISF::ISFParticle &particle)

◆ updateParentAfterIncidentProperties()

void ISF::ISFTruthIncident::updateParentAfterIncidentProperties ( )

Update the id and particleLink properties of the parentAfterIncident (to be called after registerTruthIncident)

Definition at line 211 of file ISFTruthIncident.cxx.

211 {
212 // FIXME Check that we correctly deal with the case that the parent
213 // particle survives the interaction, but is rejected by
214 // registerTruthIncident
215 const ISF::TruthBinding *parentAfterIncidentTruthBinding = m_parent.getTruthBinding();
216 auto parentAfterIncidentGenParticle = (parentAfterIncidentTruthBinding) ? parentAfterIncidentTruthBinding->getCurrentGenParticle() : nullptr;
217 const int parentAfterIncidentID = (parentAfterIncidentGenParticle) ? HepMC::uniqueID(parentAfterIncidentGenParticle) : HepMC::UNDEFINED_ID;
218 HepMcParticleLink* parentAfterIncidentHMPL{};
219 const HepMcParticleLink* parentBeforeIncidentHMPL = m_parent.getParticleLink();
220 int eventIndex{0};
221 if (parentAfterIncidentGenParticle) { eventIndex = parentAfterIncidentGenParticle->parent_event()->event_number(); }
222 else if (parentBeforeIncidentHMPL) { eventIndex = parentBeforeIncidentHMPL->eventIndex(); }
223 const HepMcParticleLink::PositionFlag idxFlag =
224 (eventIndex==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM;
225 if (parentBeforeIncidentHMPL) {
226 delete parentBeforeIncidentHMPL;
227 }
228 if (!parentAfterIncidentGenParticle) {
229 parentAfterIncidentHMPL = new HepMcParticleLink(parentAfterIncidentID, eventIndex, idxFlag, HepMcParticleLink::IS_ID);
230 }
231 else {
232 parentAfterIncidentHMPL = new HepMcParticleLink(parentAfterIncidentGenParticle, eventIndex, idxFlag);
233 }
234 m_parent.setId(parentAfterIncidentID);
235 m_parent.setParticleLink(parentAfterIncidentHMPL);
236}

Member Data Documentation

◆ m_childPassedFilters

std::vector<bool> ISF::ITruthIncident::m_childPassedFilters
protectedinherited

Definition at line 131 of file ITruthIncident.h.

◆ m_children

const ISFParticleVector& ISF::ISFTruthIncident::m_children
private

Definition at line 107 of file ISFTruthIncident.h.

◆ m_geoID

AtlasDetDescr::AtlasRegion ISF::ITruthIncident::m_geoID
privateinherited

region that the TruthIncident is located in

Definition at line 127 of file ITruthIncident.h.

◆ m_killsPrimary

const ISF::KillPrimary ISF::ISFTruthIncident::m_killsPrimary
private

Definition at line 109 of file ISFTruthIncident.h.

◆ m_numChildren

int ISF::ITruthIncident::m_numChildren
protectedinherited

Definition at line 129 of file ITruthIncident.h.

◆ m_parent

ISF::ISFParticle& ISF::ISFTruthIncident::m_parent
private

Definition at line 106 of file ISFTruthIncident.h.

◆ m_passWholeVertex

bool ISF::ITruthIncident::m_passWholeVertex
protectedinherited

Definition at line 130 of file ITruthIncident.h.

◆ m_position

const HepMC::FourVector* ISF::ISFTruthIncident::m_position
private

Definition at line 110 of file ISFTruthIncident.h.

◆ m_process

const int ISF::ISFTruthIncident::m_process
private

Definition at line 108 of file ISFTruthIncident.h.


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