ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
iGeant4::Geant4TruthIncident Class Reference

#include <Geant4TruthIncident.h>

Inheritance diagram for iGeant4::Geant4TruthIncident:
Collaboration diagram for iGeant4::Geant4TruthIncident:

Public Member Functions

 Geant4TruthIncident (const G4Step *, const ISF::ISFParticle &baseISP, AtlasDetDescr::AtlasRegion geoID, AtlasG4EventUserInfo *atlasG4EvtUserInfo)
 
virtual ~Geant4TruthIncident ()
 
const HepMC::FourVector & position () const override final
 Return HepMC position of the truth vertex. More...
 
int physicsProcessCategory () const override final
 Return category of the physics process represented by the truth incident (eg hadronic, em, ..) More...
 
int physicsProcessCode () const override final
 Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung, ..) More...
 
double parentP2 () const override final
 Return p^2 of the parent particle. More...
 
double parentPt2 () const override final
 Return pT^2 of the parent particle. More...
 
double parentEkin () const override final
 Return Ekin of the parent particle. More...
 
int parentPdgCode () const override final
 Return the PDG Code of the parent particle. More...
 
int parentBarcode () override final
 Return the barcode of the parent particle. More...
 
int parentUniqueID () override final
 Return the unique ID of the parent particle. More...
 
int parentStatus () override final
 Return the status of the parent particle. More...
 
bool parentSurvivesIncident () const override final
 Return a boolean whether or not the parent particle survives the incident. More...
 
HepMC::GenParticlePtr parentParticleAfterIncident (int newBC) override final
 Return the parent particle after the TruthIncident vertex (and give it a new barcode) More...
 
const G4ThreeVector childP (unsigned short index) const
 Return p of the i-th child particle. More...
 
double childP2 (unsigned short index) const override final
 Return p^2 of the i-th child particle. More...
 
double childPt2 (unsigned short index) const override final
 Return pT^2 of the i-th child particle. More...
 
double childEkin (unsigned short index) const override final
 Return Ekin of the i-th child particle. More...
 
int childPdgCode (unsigned short index) const override final
 Return the PDG Code of the i-th child particle. More...
 
int childBarcode (unsigned short index) const override final
 Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise return 0. More...
 
ISF::InteractionClass_t interactionClassification () const override final
 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. More...
 
HepMC::GenParticlePtr parentParticle () override final
 Return the parent particle as a HepMC particle type. More...
 
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. More...
 
AtlasDetDescr::AtlasRegion geoID ()
 Return the SimGeoID corresponding to the vertex of the truth incident. More...
 
unsigned short numberOfChildren () const
 Return total number of child particles. More...
 
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) More...
 
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) More...
 
bool childrenEkinPass (double ekincut)
 Return true if at least one child particle passes the given Ekin cut (= at least one child with Ekin >= ekincut) More...
 
void setChildPassedFilters (unsigned short index)
 Record that a particular child passed a check. More...
 
bool childPassedFilters (unsigned short index) const
 Should a particular child be written out to the GenEvent. More...
 
void setPassWholeVertices (bool passWholeVertex)
 Set whether this TruthIncident should pass the vertex as a whole or individual children. More...
 

Protected Attributes

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

Private Member Functions

 Geant4TruthIncident ()
 
void prepareChildren ()
 prepare the child particles More...
 
bool particleAlive (const G4Track *track) const
 check if the given G4Track represents a particle that is alive in ISF or ISF-G4 More...
 
HepMC::GenParticlePtr convert (const G4Track *particle, const int barcode, const bool secondary) const
 

Private Attributes

bool m_positionSet
 
HepMC::FourVector m_position
 
const G4Step * m_step {}
 
const ISF::ISFParticlem_baseISP
 
AtlasG4EventUserInfo *m_atlasG4EvtUserInfo ATLAS_THREAD_SAFE {}
 
std::vector< const G4Track * > m_children
 
HepMC::GenParticlePtr m_parentParticleAfterIncident {}
 
AtlasDetDescr::AtlasRegion m_geoID
 region that the TruthIncident is located in More...
 

Detailed Description

ISF_Geant4 specific implementation of the ISF::ITruthIncident

Author
Andre.nosp@m.as.S.nosp@m.chael.nosp@m.icke.nosp@m.@cern.nosp@m..ch

Definition at line 44 of file Geant4TruthIncident.h.

Constructor & Destructor Documentation

◆ Geant4TruthIncident() [1/2]

iGeant4::Geant4TruthIncident::Geant4TruthIncident ( const G4Step *  step,
const ISF::ISFParticle baseISP,
AtlasDetDescr::AtlasRegion  geoID,
AtlasG4EventUserInfo atlasG4EvtUserInfo 
)

Definition at line 61 of file Geant4TruthIncident.cxx.

64  :
65  ITruthIncident(geoID, step->GetSecondaryInCurrentStep()->size()), // switch to G4Step::GetNumberOfSecondariesInCurrentStep() once we're using G4 10.2 or later
66  m_positionSet(false),
67  m_position(),
68  m_step(step),
69  m_baseISP(baseISP),
70  m_atlasG4EvtUserInfo(atlasG4EvtUserInfo)
71 {
72  // prepare children:
74 
75  // calculate position:
76  const G4StepPoint *postStepPoint = m_step->GetPostStepPoint();
77  const G4ThreeVector &pos = postStepPoint->GetPosition();
78  const G4double time = postStepPoint->GetGlobalTime()*Gaudi::Units::c_light;
79  m_position.set( pos.x(), pos.y(), pos.z(), time );
80 }

◆ ~Geant4TruthIncident()

virtual iGeant4::Geant4TruthIncident::~Geant4TruthIncident ( )
inlinevirtual

Definition at line 50 of file Geant4TruthIncident.h.

50 {};

◆ Geant4TruthIncident() [2/2]

iGeant4::Geant4TruthIncident::Geant4TruthIncident ( )
private

Member Function Documentation

◆ childBarcode()

int iGeant4::Geant4TruthIncident::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 211 of file Geant4TruthIncident.cxx.

211  {
212  // the G4Track instance for the current child particle
213  const G4Track* track = m_children[index];
214  // This should be a *secondary* track. If it has a primary, it was a decay and
215  // we are running with quasi-stable particle simulation. Note that if the primary
216  // track is passed in as a secondary that survived the interaction, then this was
217  // *not* a decay and we should not treat it in this way
218  if (track->GetDynamicParticle() &&
219  track->GetDynamicParticle()->GetPrimaryParticle() &&
220  track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation()){
221  // Then the new particle should use the same barcode as the old one!!
222  PrimaryParticleInformation* primaryPartInfo = dynamic_cast<PrimaryParticleInformation*>( track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation() );
223  return primaryPartInfo->GetParticleBarcode();
224  }
225  return 0;
226 }

◆ childEkin()

double iGeant4::Geant4TruthIncident::childEkin ( unsigned short  index) const
finaloverridevirtual

Return Ekin of the i-th child particle.

Implements ISF::ITruthIncident.

Definition at line 203 of file Geant4TruthIncident.cxx.

203  {
204  return (m_children[i]->GetKineticEnergy()/CLHEP::MeV);
205 }

◆ childP()

const G4ThreeVector iGeant4::Geant4TruthIncident::childP ( unsigned short  index) const

Return p of the i-th child particle.

Definition at line 193 of file Geant4TruthIncident.cxx.

193  {
194  const G4ThreeVector & mom= m_children[i]->GetMomentum();
195  return mom;
196 }

◆ childP2()

double iGeant4::Geant4TruthIncident::childP2 ( unsigned short  index) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 188 of file Geant4TruthIncident.cxx.

188  {
189  const G4ThreeVector & mom= m_children[i]->GetMomentum();
190  return mom.mag2();
191 }

◆ childParticle()

HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::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.

Implements ISF::ITruthIncident.

Definition at line 228 of file Geant4TruthIncident.cxx.

229  {
230  // the G4Track instance for the current child particle
231  const G4Track* thisChildTrack = m_children[i];
232 
233  // NB: NOT checking if secondary is actually alive. Even with zero momentum,
234  // secondary could decay right away and create further particles which pass the
235  // truth strategies.
236 
237  HepMC::GenParticlePtr hepParticle = convert( thisChildTrack, newBarcode, true );
238  TrackHelper tHelper(thisChildTrack);
239  TrackInformation *trackInfo = tHelper.GetTrackInformation();
240 
241  // needed to make AtlasG4 work with ISF TruthService
242  if (trackInfo==nullptr) {
243  trackInfo = new TrackInformation( hepParticle );
244  thisChildTrack->SetUserInformation( trackInfo );
245  }
246 
247  trackInfo->SetCurrentGenParticle(hepParticle);
249  trackInfo->SetRegenerationNr(0);
250 
251  return hepParticle;
252 }

◆ 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  {
187  return m_childPassedFilters[index];
188  }

◆ childPdgCode()

int iGeant4::Geant4TruthIncident::childPdgCode ( unsigned short  index) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 207 of file Geant4TruthIncident.cxx.

207  {
208  return m_children[i]->GetDefinition()->GetPDGEncoding();
209 }

◆ childPt2()

double iGeant4::Geant4TruthIncident::childPt2 ( unsigned short  index) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 198 of file Geant4TruthIncident.cxx.

198  {
199  const G4ThreeVector & mom= m_children[i]->GetMomentum();
200  return mom.perp2();
201 }

◆ 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  }

◆ 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  }

◆ 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  }

◆ convert()

HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::convert ( const G4Track *  particle,
const int  barcode,
const bool  secondary 
) const
private

Definition at line 276 of file Geant4TruthIncident.cxx.

276  {
277 #endif
278 
279  const G4ThreeVector & mom = track->GetMomentum();
280  const double energy = track->GetTotalEnergy();
281  const int pdgCode = track->GetDefinition()->GetPDGEncoding();
282  const HepMC::FourVector fourMomentum( mom.x(), mom.y(), mom.z(), energy);
283 
284  const HepMC::GenParticlePtr parent = m_atlasG4EvtUserInfo->GetCurrentGenParticle();
285  int status = (secondary) ? 1 + HepMC::SIM_STATUS_THRESHOLD : parent->status() + HepMC::SIM_STATUS_INCREMENT;
286  // Treat child particles of pre-defined decays differently
288  const G4DynamicParticle* dynPart = track->GetDynamicParticle();
289  bool hasPredefinedDecay = (dynPart && (nullptr!=(dynPart->GetPreAssignedDecayProducts())));
290  status = (hasPredefinedDecay)? 2 : 1;
291  }
292  HepMC::GenParticlePtr newParticle = HepMC::newGenParticlePtr(fourMomentum, pdgCode, status);
293 
294 #ifndef HEPMC3
295  // This should be a *secondary* track. If it has a primary, it was a decay and
296  // we are running with quasi-stable particle simulation. Note that if the primary
297  // track is passed in as a secondary that survived the interaction, then this was
298  // *not* a decay and we should not treat it in this way
299  if (secondary &&
300  track->GetDynamicParticle() &&
301  track->GetDynamicParticle()->GetPrimaryParticle() &&
302  track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation()){
303  // Then the new particle should use the same barcode as the old one!!
304  PrimaryParticleInformation* primaryPartInfo = dynamic_cast<PrimaryParticleInformation*>( track->GetDynamicParticle()->GetPrimaryParticle()->GetUserInformation() );
305  HepMC::suggest_barcode( newParticle, primaryPartInfo->GetParticleBarcode() );
306  } else {
307  HepMC::suggest_barcode( newParticle, barcode );
308  }
309 #endif
310 
311  return newParticle;
312 }

◆ 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; };

◆ interactionClassification()

ISF::InteractionClass_t iGeant4::Geant4TruthIncident::interactionClassification ( ) const
finaloverridevirtual

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 from ISF::ITruthIncident.

Definition at line 332 of file Geant4TruthIncident.cxx.

332  {
333  G4Track* track=m_step->GetTrack();
334  const G4DynamicParticle* dynPart = track->GetDynamicParticle();
335  bool parentIsQuasiStable = (nullptr!=(dynPart->GetPreAssignedDecayProducts()));
336  const G4VProcess *process = m_step->GetPostStepPoint()->GetProcessDefinedStep();
337  const int processType = process->GetProcessType();
338  const int processSubType = process->GetProcessSubType();
339  ISF::InteractionClass_t classification(ISF::STD_VTX);
340  if(parentIsQuasiStable) {
341  if(this->parentSurvivesIncident()) {
342  classification = ISF::QS_SURV_VTX;
343  }
344  else if(processType==6 && processSubType==201) {
345  classification = ISF::QS_PREDEF_VTX;
346  }
347  else {
348  classification = ISF::QS_DEST_VTX;
349  }
350  }
351  return classification;
352  // end of code to determine interaction type
353 }

◆ 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  }

◆ parentBarcode()

int iGeant4::Geant4TruthIncident::parentBarcode ( )
finaloverridevirtual

Return the barcode of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 116 of file Geant4TruthIncident.cxx.

116  { // TODO Remove this method
117  auto parent = parentParticle();
118 
120 }

◆ parentEkin()

double iGeant4::Geant4TruthIncident::parentEkin ( ) const
finaloverridevirtual

Return Ekin of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 108 of file Geant4TruthIncident.cxx.

108  {
109  return (m_step->GetPreStepPoint()->GetKineticEnergy()/CLHEP::MeV);
110 }

◆ parentP2()

double iGeant4::Geant4TruthIncident::parentP2 ( ) const
finaloverridevirtual

Return p^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 98 of file Geant4TruthIncident.cxx.

98  {
99  const G4ThreeVector & mom= m_step->GetPreStepPoint()->GetMomentum();
100  return mom.mag2();
101 }

◆ parentParticle()

HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::parentParticle ( )
finaloverridevirtual

Return the parent particle as a HepMC particle type.

Implements ISF::ITruthIncident.

Definition at line 134 of file Geant4TruthIncident.cxx.

134  {
135  return m_atlasG4EvtUserInfo->GetCurrentGenParticle();
136 }

◆ parentParticleAfterIncident()

HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::parentParticleAfterIncident ( int  newBC)
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 149 of file Geant4TruthIncident.cxx.

149  {
150  const G4Track *track = m_step->GetTrack();
151 
152  // check if particle is a alive in G4 or in ISF
153  if ( !parentSurvivesIncident() ) {
154  return nullptr;
155  }
156 
157  // internally cache the HepMC representation of the parent particle
158  // (to allow multiple calls to this method on the same instance)
160  // create new HepMC particle, using momentum and energy
161  // from G4DynamicParticle (which should be equivalent to postStep)
162  m_parentParticleAfterIncident = convert(track, newBarcode, false);
163 
164  m_atlasG4EvtUserInfo->SetCurrentGenParticle( m_parentParticleAfterIncident );
165 
166  // store (new) hepmc particle in track's UserInformation
167  TrackHelper tHelper(track);
168  TrackInformation *tInfo = tHelper.GetTrackInformation();
169  if (tInfo) {
170  // do NOT update the TrackInformation for regenerated particles!
171  // (most recent truth info is kept in AtlasG4EventUserInfo)
172  //tInfo->SetCurrentGenParticle( m_parentParticleAfterIncident );
173  int regenerationNr = tInfo->GetRegenerationNr();
174  regenerationNr++;
175  tInfo->SetRegenerationNr(regenerationNr);
176  if ( tHelper.IsPrimary() ) {
178  }
179  }
180 
181  } // <-- end if m_parentParticleAfterIncident is not filled
182 
183 
184  // return the HepMC particle representation of the parent
186 }

◆ parentPdgCode()

int iGeant4::Geant4TruthIncident::parentPdgCode ( ) const
finaloverridevirtual

Return the PDG Code of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 112 of file Geant4TruthIncident.cxx.

112  {
113  return m_step->GetTrack()->GetDefinition()->GetPDGEncoding();
114 }

◆ parentPt2()

double iGeant4::Geant4TruthIncident::parentPt2 ( ) const
finaloverridevirtual

Return pT^2 of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 103 of file Geant4TruthIncident.cxx.

103  {
104  const G4ThreeVector & mom= m_step->GetPreStepPoint()->GetMomentum();
105  return mom.perp2();
106 }

◆ parentStatus()

int iGeant4::Geant4TruthIncident::parentStatus ( )
finaloverridevirtual

Return the status of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 128 of file Geant4TruthIncident.cxx.

128  {
129  auto parent = parentParticle();
130 
131  return (parent) ? parent->status() : 0;
132 }

◆ parentSurvivesIncident()

bool iGeant4::Geant4TruthIncident::parentSurvivesIncident ( ) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 138 of file Geant4TruthIncident.cxx.

138  {
139  const G4Track *track = m_step->GetTrack();
140 
141  // check if particle is a alive in G4 or in ISF
142  if ( particleAlive(track) ) {
143  return true;
144  } else {
145  return false;
146  }
147 }

◆ parentUniqueID()

int iGeant4::Geant4TruthIncident::parentUniqueID ( )
finaloverridevirtual

Return the unique ID of the parent particle.

Implements ISF::ITruthIncident.

Definition at line 122 of file Geant4TruthIncident.cxx.

122  {
123  auto parent = parentParticle();
124 
126 }

◆ particleAlive()

bool iGeant4::Geant4TruthIncident::particleAlive ( const G4Track *  track) const
inlineprivate

check if the given G4Track represents a particle that is alive in ISF or ISF-G4

Definition at line 255 of file Geant4TruthIncident.cxx.

255  {
256  G4TrackStatus trackStatus = track->GetTrackStatus();
257 
258  if ( trackStatus != fAlive && trackStatus != fStopButAlive ) {
259  // parent does not exist in G4 anymore after this step
260 
261  // check whether the particle was returned to ISF
263  bool returnedToISF = trackInfo ? trackInfo->GetReturnedToISF() : false;
264  if ( !returnedToISF ) {
265  // particle was not sent to ISF either
266  return false;
267  }
268  }
269 
270  return true;
271 }

◆ physicsProcessCategory()

int iGeant4::Geant4TruthIncident::physicsProcessCategory ( ) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 86 of file Geant4TruthIncident.cxx.

86  {
87  const G4VProcess *process = m_step->GetPostStepPoint()->GetProcessDefinedStep();
88  // TODO: need to check that G4ProcessSubTypes Match int
89  return process->GetProcessType();
90 }

◆ physicsProcessCode()

int iGeant4::Geant4TruthIncident::physicsProcessCode ( ) const
finaloverridevirtual

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

Implements ISF::ITruthIncident.

Definition at line 92 of file Geant4TruthIncident.cxx.

92  {
93  const G4VProcess *process = m_step->GetPostStepPoint()->GetProcessDefinedStep();
94  // TODO: need to check that G4ProcessSubTypes Match int
95  return process->GetProcessSubType();
96 }

◆ position()

const HepMC::FourVector & iGeant4::Geant4TruthIncident::position ( ) const
finaloverridevirtual

Return HepMC position of the truth vertex.

Implements ISF::ITruthIncident.

Definition at line 82 of file Geant4TruthIncident.cxx.

82  {
83  return m_position;
84 }

◆ prepareChildren()

void iGeant4::Geant4TruthIncident::prepareChildren ( )
inlineprivate

prepare the child particles

Definition at line 315 of file Geant4TruthIncident.cxx.

315  {
316 
317  const std::vector<const G4Track*>* tracks = m_step->GetSecondaryInCurrentStep();
318  const int iSize = tracks->size();
319  const int iLast = iSize - numberOfChildren() - 1; //NB can be -1.
320  for(int i=iSize-1;i>iLast;i--) {
321  m_children.push_back((*tracks)[i]);
322  }
323 }

◆ 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  {
182  m_childPassedFilters[index] = true;
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  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

AtlasG4EventUserInfo* m_atlasG4EvtUserInfo iGeant4::Geant4TruthIncident::ATLAS_THREAD_SAFE {}
private

Definition at line 125 of file Geant4TruthIncident.h.

◆ m_baseISP

const ISF::ISFParticle& iGeant4::Geant4TruthIncident::m_baseISP
private

Definition at line 123 of file Geant4TruthIncident.h.

◆ m_childPassedFilters

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

Definition at line 131 of file ITruthIncident.h.

◆ m_children

std::vector<const G4Track*> iGeant4::Geant4TruthIncident::m_children
private

Definition at line 126 of file Geant4TruthIncident.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_numChildren

int ISF::ITruthIncident::m_numChildren
protectedinherited

Definition at line 129 of file ITruthIncident.h.

◆ m_parentParticleAfterIncident

HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::m_parentParticleAfterIncident {}
private

Definition at line 128 of file Geant4TruthIncident.h.

◆ m_passWholeVertex

bool ISF::ITruthIncident::m_passWholeVertex
protectedinherited

Definition at line 130 of file ITruthIncident.h.

◆ m_position

HepMC::FourVector iGeant4::Geant4TruthIncident::m_position
private

Definition at line 121 of file Geant4TruthIncident.h.

◆ m_positionSet

bool iGeant4::Geant4TruthIncident::m_positionSet
private

Definition at line 120 of file Geant4TruthIncident.h.

◆ m_step

const G4Step* iGeant4::Geant4TruthIncident::m_step {}
private

Definition at line 122 of file Geant4TruthIncident.h.


The documentation for this class was generated from the following files:
iGeant4::Geant4TruthIncident::parentParticle
HepMC::GenParticlePtr parentParticle() override final
Return the parent particle as a HepMC particle type.
Definition: Geant4TruthIncident.cxx:134
HepMC::suggest_barcode
bool suggest_barcode(T &p, int i)
Definition: GenEvent.h:670
iGeant4::Geant4TruthIncident::m_baseISP
const ISF::ISFParticle & m_baseISP
Definition: Geant4TruthIncident.h:123
ISF::STD_VTX
@ STD_VTX
Definition: ITruthIncident.h:28
HepMC::SIM_STATUS_INCREMENT
constexpr int SIM_STATUS_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
Definition: MagicNumbers.h:42
ISF::ITruthIncident::ITruthIncident
ITruthIncident(AtlasDetDescr::AtlasRegion geoID, unsigned short numChildren)
Definition: ITruthIncident.h:47
ISF::QS_PREDEF_VTX
@ QS_PREDEF_VTX
Definition: ITruthIncident.h:31
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
ISF::ITruthIncident::m_numChildren
int m_numChildren
Definition: ITruthIncident.h:129
ISF::ITruthIncident::childEkin
virtual double childEkin(unsigned short index) const =0
Return Ekin of the i-th child particle.
iGeant4::Geant4TruthIncident::convert
HepMC::GenParticlePtr convert(const G4Track *particle, const int barcode, const bool secondary) const
Definition: Geant4TruthIncident.cxx:276
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
ISF::ITruthIncident::childP2
virtual double childP2(unsigned short index) const =0
Return p^2 of the i-th child particle.
iGeant4::Geant4TruthIncident::m_step
const G4Step * m_step
Definition: Geant4TruthIncident.h:122
iGeant4::Geant4TruthIncident::m_position
HepMC::FourVector m_position
Definition: Geant4TruthIncident.h:121
PrimaryParticleInformation::GetParticleBarcode
int GetParticleBarcode() const
Definition: PrimaryParticleInformation.cxx:18
iGeant4::Geant4TruthIncident::m_children
std::vector< const G4Track * > m_children
Definition: Geant4TruthIncident.h:126
TrackHelper
Definition: TrackHelper.h:14
ISF::ITruthIncident::numberOfChildren
unsigned short numberOfChildren() const
Return total number of child particles.
Definition: ITruthIncident.h:139
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ISF::ITruthIncident::m_geoID
AtlasDetDescr::AtlasRegion m_geoID
region that the TruthIncident is located in
Definition: ITruthIncident.h:125
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
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
VTrackInformation::SetClassification
void SetClassification(TrackClassification tc)
update the classification of the currently tracked particle, usually called when a new G4Track is cre...
Definition: VTrackInformation.h:45
ISF::QS_DEST_VTX
@ QS_DEST_VTX
Definition: ITruthIncident.h:30
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrackInformation::SetRegenerationNr
void SetRegenerationNr(int i)
update the number of times the particle represented by the G4Track has undergone a non-destructive in...
Definition: TrackInformation.h:96
trackInfo
Definition: TrigInDetUtils.h:13
TrackInformation
Implementation of VTrackInformation. Instances of this class are attached as UserInformation to G4Tra...
Definition: TrackInformation.h:41
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
TrackInformation::GetRegenerationNr
int GetRegenerationNr() const
return the number of times the particle represented by the G4Track has undergone a non-destructive in...
Definition: TrackInformation.h:90
iGeant4::Geant4TruthIncident::prepareChildren
void prepareChildren()
prepare the child particles
Definition: Geant4TruthIncident.cxx:315
runSelector.processType
processType
Definition: runSelector.py:225
HepMC::SIM_STATUS_THRESHOLD
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Definition: MagicNumbers.h:45
ISF::InteractionClass_t
InteractionClass_t
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:27
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
iGeant4::Geant4TruthIncident::m_parentParticleAfterIncident
HepMC::GenParticlePtr m_parentParticleAfterIncident
Definition: Geant4TruthIncident.h:128
iGeant4::Geant4TruthIncident::parentSurvivesIncident
bool parentSurvivesIncident() const override final
Return a boolean whether or not the parent particle survives the incident.
Definition: Geant4TruthIncident.cxx:138
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
PrimaryParticleInformation
This class is attached to G4PrimaryParticle objects as UserInformation. The member variable m_thePart...
Definition: PrimaryParticleInformation.h:39
DeMoScan.index
string index
Definition: DeMoScan.py:364
iGeant4::Geant4TruthIncident::particleAlive
bool particleAlive(const G4Track *track) const
check if the given G4Track represents a particle that is alive in ISF or ISF-G4
Definition: Geant4TruthIncident.cxx:255
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
HepMC
Definition: Barcode.h:14
ISF::ITruthIncident::m_passWholeVertex
bool m_passWholeVertex
Definition: ITruthIncident.h:130
LArCellBinning.step
step
Definition: LArCellBinning.py:158
merge.status
status
Definition: merge.py:17
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
iGeant4::Geant4TruthIncident::m_positionSet
bool m_positionSet
Definition: Geant4TruthIncident.h:120
iGeant4::Geant4TruthIncident::interactionClassification
ISF::InteractionClass_t interactionClassification() const override final
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: Geant4TruthIncident.cxx:332
iGeant4::ISFG4Helper::getISFTrackInfo
static VTrackInformation * getISFTrackInfo(const G4Track &aTrack)
return a valid UserInformation object of the G4Track for use within the ISF
Definition: ISFG4Helper.cxx:69
ISF::ITruthIncident::setChildPassedFilters
void setChildPassedFilters(unsigned short index)
Record that a particular child passed a check.
Definition: ITruthIncident.h:181
VTrackInformation::RegisteredSecondary
@ RegisteredSecondary
Definition: VTrackInformation.h:32
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
VTrackInformation::RegeneratedPrimary
@ RegeneratedPrimary
Definition: VTrackInformation.h:32