ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
TrackInformation Class Reference

Implementation of VTrackInformation. Instances of this class are attached as UserInformation to G4Tracks. More...

#include <TrackInformation.h>

Inheritance diagram for TrackInformation:
Collaboration diagram for TrackInformation:

Public Types

enum  TrackClassification {
  Primary, RegeneratedPrimary, RegisteredSecondary, Secondary,
  BarcodeOnly
}
 

Public Member Functions

 TrackInformation ()
 
 TrackInformation (HepMC::GenParticlePtr p, ISF::ISFParticle *baseIsp=nullptr)
 
virtual HepMC::ConstGenParticlePtr GetCurrentGenParticle () const override
 return a pointer to the GenParticle corresponding to the current G4Track (if there is one). More...
 
virtual HepMC::GenParticlePtr GetCurrentGenParticle () override
 
virtual void SetCurrentGenParticle (HepMC::GenParticlePtr) override
 set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track. More...
 
virtual const ISF::ISFParticleGetBaseISFParticle () const override
 return a pointer to the ISFParticle corresponding to the current G4Track. More...
 
virtual ISF::ISFParticleGetBaseISFParticle () override
 
virtual void SetBaseISFParticle (ISF::ISFParticle *) override
 set the pointer to the ISFParticle corresponding to the current G4Track. More...
 
virtual bool GetReturnedToISF () const override
 Is the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF? More...
 
virtual void SetReturnedToISF (bool returned) override
 Flag whether the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF. More...
 
int GetRegenerationNr () const
 return the number of times the particle represented by the G4Track has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent. More...
 
void SetRegenerationNr (int i)
 update the number of times the particle represented by the G4Track has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent. More...
 
virtual int GetParticleBarcode () const override
 
virtual int GetParticleUniqueID () const override
 
virtual int GetParticleStatus () const override
 
TrackClassification GetClassification () const
 return the classification of the current G4Ttrack (Primary, Regenerated Primary, Registered Secondary, Secondary) More...
 
void SetClassification (TrackClassification tc)
 update the classification of the currently tracked particle, usually called when a new G4Track is created or after it survives an interaction. More...
 
HepMC::ConstGenParticlePtr GetPrimaryGenParticle () const
 return a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends. More...
 
HepMC::GenParticlePtr GetPrimaryGenParticle ()
 
void SetPrimaryGenParticle (HepMC::GenParticlePtr)
 set the pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends. More...
 
virtual void Print () const
 

Private Attributes

int m_regenerationNr {0}
 
HepMC::GenParticlePtr m_currentGenParticle {}
 
int m_barcode ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE
 
int m_uniqueID ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE
 
ISF::ISFParticlem_theBaseISFParticle {}
 
bool m_returnedToISF {false}
 
TrackClassification m_classify
 
HepMC::GenParticlePtr m_primaryGenParticle {}
 

Detailed Description

Implementation of VTrackInformation. Instances of this class are attached as UserInformation to G4Tracks.

The GenParticlePtr m_currentGenParticle held by the TrackInformation object points to the GenParticle corresponding to the current G4Track and can change during simulation (i.e. each time the track undergoes a non-destructive interaction).

The other member variables are: m_theBaseISFParticle - a pointer to the ISFParticle corresponding to the current G4Track, m_returnedToISF - a flag indicating whether the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF, m_regenerationNr - the number of times the particle represented by the G4Track has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent, m_barcode and m_uniqueID - convenience variables corresponding to the barcode and id of m_currentGenParticle. The member variables are m_classify: a classification of the current G4Track (Primary, Regenerated Primary, Registered Secondary, Secondary) and m_primaryGenParticle: a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

Definition at line 41 of file TrackInformation.h.

Member Enumeration Documentation

◆ TrackClassification

Enumerator
Primary 
RegeneratedPrimary 
RegisteredSecondary 
Secondary 
BarcodeOnly 

Definition at line 32 of file VTrackInformation.h.

Constructor & Destructor Documentation

◆ TrackInformation() [1/2]

TrackInformation::TrackInformation ( )

Definition at line 10 of file TrackInformation.cxx.

11  : m_regenerationNr(0)
12  , m_currentGenParticle(nullptr)
13  , m_theBaseISFParticle(nullptr)
14  , m_returnedToISF(false)
15 {
16 }

◆ TrackInformation() [2/2]

TrackInformation::TrackInformation ( HepMC::GenParticlePtr  p,
ISF::ISFParticle baseIsp = nullptr 
)

Definition at line 18 of file TrackInformation.cxx.

19  : m_regenerationNr(0)
21  , m_theBaseISFParticle(baseIsp)
22  , m_returnedToISF(false)
23 {
24 }

Member Function Documentation

◆ GetBaseISFParticle() [1/2]

virtual const ISF::ISFParticle* TrackInformation::GetBaseISFParticle ( ) const
inlineoverridevirtual

return a pointer to the ISFParticle corresponding to the current G4Track.

Reimplemented from VTrackInformation.

Definition at line 64 of file TrackInformation.h.

64 {return m_theBaseISFParticle;}

◆ GetBaseISFParticle() [2/2]

virtual ISF::ISFParticle* TrackInformation::GetBaseISFParticle ( )
inlineoverridevirtual

Reimplemented from VTrackInformation.

Definition at line 65 of file TrackInformation.h.

65 {return m_theBaseISFParticle;}

◆ GetClassification()

TrackClassification VTrackInformation::GetClassification ( ) const
inlineinherited

return the classification of the current G4Ttrack (Primary, Regenerated Primary, Registered Secondary, Secondary)

Definition at line 39 of file VTrackInformation.h.

39 {return m_classify;}

◆ GetCurrentGenParticle() [1/2]

virtual HepMC::ConstGenParticlePtr TrackInformation::GetCurrentGenParticle ( ) const
inlineoverridevirtual

return a pointer to the GenParticle corresponding to the current G4Track (if there is one).

Reimplemented from VTrackInformation.

Definition at line 49 of file TrackInformation.h.

49 {return m_currentGenParticle;}

◆ GetCurrentGenParticle() [2/2]

virtual HepMC::GenParticlePtr TrackInformation::GetCurrentGenParticle ( )
inlineoverridevirtual

Reimplemented from VTrackInformation.

Definition at line 50 of file TrackInformation.h.

50 {return m_currentGenParticle;}

◆ GetParticleBarcode()

int TrackInformation::GetParticleBarcode ( ) const
overridevirtual

Implements VTrackInformation.

Definition at line 26 of file TrackInformation.cxx.

27 {
28  if (m_barcode != HepMC::INVALID_PARTICLE_BARCODE) return m_barcode;
31  return m_barcode;
32  }
33  return HepMC::UNDEFINED_ID;
34 }

◆ GetParticleStatus()

int TrackInformation::GetParticleStatus ( ) const
overridevirtual

Implements VTrackInformation.

Definition at line 47 of file TrackInformation.cxx.

48 {
50  return m_currentGenParticle->status();
51  }
52  return 0;
53 }

◆ GetParticleUniqueID()

int TrackInformation::GetParticleUniqueID ( ) const
overridevirtual

Implements VTrackInformation.

Definition at line 36 of file TrackInformation.cxx.

37 {
38  if (m_uniqueID != HepMC::INVALID_PARTICLE_BARCODE) return m_uniqueID;
41  m_uniqueID = HepMC::uniqueID(particle);
42  return m_uniqueID;
43  }
44  return HepMC::UNDEFINED_ID;
45 }

◆ GetPrimaryGenParticle() [1/2]

HepMC::GenParticlePtr VTrackInformation::GetPrimaryGenParticle ( )
inlineinherited

Definition at line 55 of file VTrackInformation.h.

55 {return m_primaryGenParticle;}

◆ GetPrimaryGenParticle() [2/2]

HepMC::ConstGenParticlePtr VTrackInformation::GetPrimaryGenParticle ( ) const
inlineinherited

return a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

Should match the return value of ISF::TruthBinding::getPrimaryGenParticle(). TODO Check that this is required.

Definition at line 54 of file VTrackInformation.h.

54 {return m_primaryGenParticle;}

◆ GetRegenerationNr()

int TrackInformation::GetRegenerationNr ( ) const
inline

return the number of times the particle represented by the G4Track has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent.

Definition at line 90 of file TrackInformation.h.

90 {return m_regenerationNr;}

◆ GetReturnedToISF()

virtual bool TrackInformation::GetReturnedToISF ( ) const
inlineoverridevirtual

Is the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF?

Reimplemented from VTrackInformation.

Definition at line 78 of file TrackInformation.h.

78 {return m_returnedToISF;}

◆ Print()

virtual void VTrackInformation::Print ( ) const
inlinevirtualinherited

Definition at line 105 of file VTrackInformation.h.

105 {}

◆ SetBaseISFParticle()

void TrackInformation::SetBaseISFParticle ( ISF::ISFParticle p)
overridevirtual

set the pointer to the ISFParticle corresponding to the current G4Track.

(Only used to replace the ISFParticle by a copy of itself when the G4Track is killed and the copy is scheduled to be returned to the ISF.)

Reimplemented from VTrackInformation.

Definition at line 62 of file TrackInformation.cxx.

63 {
65 }

◆ SetClassification()

void VTrackInformation::SetClassification ( TrackClassification  tc)
inlineinherited

update the classification of the currently tracked particle, usually called when a new G4Track is created or after it survives an interaction.

Definition at line 45 of file VTrackInformation.h.

45 {m_classify=tc;}

◆ SetCurrentGenParticle()

void TrackInformation::SetCurrentGenParticle ( HepMC::GenParticlePtr  p)
overridevirtual

set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.

This will be updated each time an interaction of the G4Track is recorded to the HepMC::GenEvent. Also invalidates previously cached values in m_barcode and m_uniqueID.

Reimplemented from VTrackInformation.

Definition at line 55 of file TrackInformation.cxx.

56 {
60 }

◆ SetPrimaryGenParticle()

void VTrackInformation::SetPrimaryGenParticle ( HepMC::GenParticlePtr  p)
inherited

set the pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

TODO Check that this is required - if so, ensure it is set consistently.

Definition at line 12 of file VTrackInformation.cxx.

13 {
14  m_primaryGenParticle = std::move(p);
15 }

◆ SetRegenerationNr()

void TrackInformation::SetRegenerationNr ( int  i)
inline

update the number of times the particle represented by the G4Track has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent.

Definition at line 96 of file TrackInformation.h.

◆ SetReturnedToISF()

virtual void TrackInformation::SetReturnedToISF ( bool  returned)
inlineoverridevirtual

Flag whether the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF.

Only called in TrackProcessorUserActionPassBack::returnParticleToISF

Reimplemented from VTrackInformation.

Definition at line 83 of file TrackInformation.h.

83 {m_returnedToISF=returned;}

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

int m_barcode TrackInformation::ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE
mutableprivate

Definition at line 104 of file TrackInformation.h.

◆ ATLAS_THREAD_SAFE [2/2]

int m_uniqueID TrackInformation::ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE
mutableprivate

Definition at line 105 of file TrackInformation.h.

◆ m_classify

TrackClassification VTrackInformation::m_classify
privateinherited

Definition at line 107 of file VTrackInformation.h.

◆ m_currentGenParticle

HepMC::GenParticlePtr TrackInformation::m_currentGenParticle {}
private

Definition at line 103 of file TrackInformation.h.

◆ m_primaryGenParticle

HepMC::GenParticlePtr VTrackInformation::m_primaryGenParticle {}
privateinherited

Definition at line 108 of file VTrackInformation.h.

◆ m_regenerationNr

int TrackInformation::m_regenerationNr {0}
private

Definition at line 102 of file TrackInformation.h.

◆ m_returnedToISF

bool TrackInformation::m_returnedToISF {false}
private

Definition at line 107 of file TrackInformation.h.

◆ m_theBaseISFParticle

ISF::ISFParticle* TrackInformation::m_theBaseISFParticle {}
private

Definition at line 106 of file TrackInformation.h.


The documentation for this class was generated from the following files:
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
TrackInformation::m_currentGenParticle
HepMC::GenParticlePtr m_currentGenParticle
Definition: TrackInformation.h:103
TrackInformation::m_returnedToISF
bool m_returnedToISF
Definition: TrackInformation.h:107
HepMC::INVALID_PARTICLE_BARCODE
constexpr int INVALID_PARTICLE_BARCODE
Definition: MagicNumbers.h:53
VTrackInformation::m_primaryGenParticle
HepMC::GenParticlePtr m_primaryGenParticle
Definition: VTrackInformation.h:108
VTrackInformation::m_classify
TrackClassification m_classify
Definition: VTrackInformation.h:107
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
VTrackInformation::Primary
@ Primary
Definition: VTrackInformation.h:32
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
TrackInformation::m_theBaseISFParticle
ISF::ISFParticle * m_theBaseISFParticle
Definition: TrackInformation.h:106
TrackInformation::m_regenerationNr
int m_regenerationNr
Definition: TrackInformation.h:102
VTrackInformation::Secondary
@ Secondary
Definition: VTrackInformation.h:32
VTrackInformation::BarcodeOnly
@ BarcodeOnly
Definition: VTrackInformation.h:32
VTrackInformation::RegisteredSecondary
@ RegisteredSecondary
Definition: VTrackInformation.h:32
VTrackInformation::RegeneratedPrimary
@ RegeneratedPrimary
Definition: VTrackInformation.h:32