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::FourVectorposition () 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::FourVectorm_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 33 of file ISFTruthIncident.cxx.

38 :
40 m_parent(parent),
41 m_children(children),
43 m_killsPrimary(killsPrimary),
45{
46 if ( !m_position) {
47 // No position was given, so compute it.
48 // Default to the parent particle position in the case that there are no child particles.
49 const ISF::ISFParticle *particle = (m_children.empty()) ? &m_parent : m_children.front();
50 if ( !particle) particle = &m_parent; // protection against nullptrs in m_children ISFParticleVector - this would indicate a bug upstream, better to throw an exception here?
51 const Amg::Vector3D &pos = particle->position();
52
53 double time = 0.; //<! TODO: FIXME
54 m_position = new HepMC::FourVector( pos.x(), pos.y(), pos.z(), time );
55 }
56}
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)
HepMC3::FourVector FourVector
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ ~ISFTruthIncident()

ISF::ISFTruthIncident::~ISFTruthIncident ( )
virtual

Definition at line 58 of file ISFTruthIncident.cxx.

58 {
59 delete m_position;
60}

◆ 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 146 of file ISFTruthIncident.cxx.

146 {
147 return numberOfChildren() > index ? HepMC::barcode(m_children[index]) : HepMC::UNDEFINED_ID;
148}
unsigned short numberOfChildren() const
Return total number of child particles.
str index
Definition DeMoScan.py:362
int barcode(const T *p)
Definition Barcode.h:15
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 137 of file ISFTruthIncident.cxx.

137 {
138 return m_children[index]->ekin();
139}

◆ 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 129 of file ISFTruthIncident.cxx.

129 {
130 return m_children[index]->momentum().mag2();
131}

◆ 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 150 of file ISFTruthIncident.cxx.

151 {
152 // the child particle
153 ISF::ISFParticle *sec = m_children[index];
154
155 // set particle barcode of the child particle
156 if (bc) {
157 sec->setBarcode( bc);
158 }
159
160 // Enforce that the status is set correctly
162
163 // FIXME At this point the sec ISFParticle's id, truthBinding
164 // and particleLink all still need to be updated
165
166 // and update truth info (including the ISFParticle's HMPL)
167 return updateHepMCTruthParticle( *sec, &m_parent );
168}
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 142 of file ISFTruthIncident.cxx.

142 {
143 return m_children[index]->pdgCode();
144}

◆ 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 133 of file ISFTruthIncident.cxx.

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

◆ 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 172 of file ISFTruthIncident.cxx.

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

◆ 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 98 of file ISFTruthIncident.cxx.

98 { // TODO Remove this method
99 return HepMC::barcode(m_parent); // FIXME barcode-based
100}

◆ parentEkin()

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

Return Ekin of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 82 of file ISFTruthIncident.cxx.

82 {
83 return m_parent.ekin();
84}

◆ parentP2()

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

Return p^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 74 of file ISFTruthIncident.cxx.

74 {
75 return m_parent.momentum().mag2();
76}

◆ 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 94 of file ISFTruthIncident.cxx.

94 {
96}
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 110 of file ISFTruthIncident.cxx.

110 {
111 // if parent is killed in the interaction -> return nullptr
112 if (m_killsPrimary==ISF::fKillsPrimary) return nullptr;
113
114 // only update the parent particle, if it survived the interaction
115
116 // set a new barcode
117 m_parent.setBarcode( newBC );
118
119 // set a new status
121
122 // FIXME At this point the m_parent ISFParticle's id, truthBinding
123 // and particleLink all still need to be updated
124
125 // and update truth info (including the ISFParticle's HMPL)
127}
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 86 of file ISFTruthIncident.cxx.

86 {
87 return m_parent.pdgCode();
88}

◆ parentPt2()

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

Return pT^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 78 of file ISFTruthIncident.cxx.

78 {
79 return m_parent.momentum().perp2();
80}

◆ parentStatus()

int ISF::ISFTruthIncident::parentStatus ( )
finaloverridevirtual

Implements ISF::ITruthIncident.

Definition at line 90 of file ISFTruthIncident.cxx.

90 {
91 return m_parent.status();
92}

◆ 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 106 of file ISFTruthIncident.cxx.

106 {
108}

◆ parentUniqueID()

int ISF::ISFTruthIncident::parentUniqueID ( )
finaloverridevirtual

Return the unique ID of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 102 of file ISFTruthIncident.cxx.

102 {
103 return m_parent.id();
104}

◆ 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 66 of file ISFTruthIncident.cxx.

66 {
67 return -1;
68}

◆ 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 70 of file ISFTruthIncident.cxx.

70 {
71 return m_process;
72}

◆ position()

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

Return HepMC position of the truth vertex.

Implements ISF::ITruthIncident.

Definition at line 62 of file ISFTruthIncident.cxx.

62 {
63 return *m_position;
64}

◆ 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 236 of file ISFTruthIncident.cxx.

236 {
237 unsigned short numSec = numberOfChildren();
238 for (unsigned short i=0; i<numSec; i++) {
239 // the current particle
240 ISF::ISFParticle *child = m_children[i];
241 ISF::TruthBinding *childTruthBinding = child->getTruthBinding();
242 if (!childTruthBinding) {
243 // Child particles which were rejected during
244 // registerTruthIncident need a TruthBinding
245 auto parentTruthBinding = m_parent.getTruthBinding();
246 if (parentTruthBinding) {
247 childTruthBinding = parentTruthBinding->childTruthBinding(nullptr);
248 }
249 else {
250 // FIXME We really shouldn't end up here, possibly abort if we hit this?
251 childTruthBinding = new TruthBinding( nullptr, nullptr, nullptr );
252 }
253 child->setTruthBinding(childTruthBinding);
254 }
255 auto childGenParticle = childTruthBinding->getCurrentGenParticle();
256 const int childID = (childGenParticle) ? HepMC::uniqueID(childGenParticle) : HepMC::UNDEFINED_ID;
257 HepMcParticleLink* childHMPL{};
258 const HepMcParticleLink* oldChildHMPL = child->getParticleLink();
259 int eventIndex{0};
260 if (childGenParticle) { eventIndex = childGenParticle->parent_event()->event_number(); }
261 else if (oldChildHMPL) { eventIndex = oldChildHMPL->eventIndex(); }
262 const HepMcParticleLink::PositionFlag idxFlag =
263 (eventIndex==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM;
264 if (oldChildHMPL) {
265 delete oldChildHMPL;
266 }
267 if (!childGenParticle) {
268 childHMPL = new HepMcParticleLink(childID, eventIndex, idxFlag, HepMcParticleLink::IS_ID);
269 }
270 else {
271 childHMPL = new HepMcParticleLink(childGenParticle, eventIndex, idxFlag);
272 }
273 child->setId(childID);
274 child->setParticleLink(childHMPL);
275 }
276}
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.
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 185 of file ISFTruthIncident.cxx.

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

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

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: