ATLAS Offline Software
Loading...
Searching...
No Matches
PrimaryParticleInformation Class Reference

This class is attached to G4PrimaryParticle objects as UserInformation. More...

#include <PrimaryParticleInformation.h>

Inheritance diagram for PrimaryParticleInformation:
Collaboration diagram for PrimaryParticleInformation:

Public Member Functions

 PrimaryParticleInformation ()
 PrimaryParticleInformation (HepMC::GenParticlePtr p, ISF::ISFParticle *isp=nullptr)
HepMC::ConstGenParticlePtr GetHepMCParticle () const
 return a pointer to the GenParticle used to create the G4PrimaryParticle
HepMC::GenParticlePtr GetHepMCParticle ()
int GetRegenerationNr ()
 return the number of times the particle represented by the G4PrimaryParticle has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent.
void SetRegenerationNr (int i)
 update the number of times the particle represented by the G4PrimaryParticle has undergone a non-destructive interaction that was recorded in the HepMC::GenEvent.
const ISF::ISFParticleGetISFParticle () const
 return a pointer to the ISFParticle used to create the G4PrimaryParticle
ISF::ISFParticleGetISFParticle ()
void SetISFParticle (ISF::ISFParticle *isp)
int GetParticleBarcode () const
int GetParticleUniqueID () const
void Print () const

Private Attributes

HepMC::GenParticlePtr m_theParticle {}
ISF::ISFParticlem_theISFParticle {}
int m_regenerationNr {0}
int m_barcode ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE
int m_uniqueID ATLAS_THREAD_SAFE = HepMC::INVALID_PARTICLE_BARCODE

Detailed Description

This class is attached to G4PrimaryParticle objects as UserInformation.

The member variable m_theParticle holds a pointer to the HepMC::GenParticle which was used to create the G4PrimaryParticle. Tthe member variable m_theISFParticle holds a pointer to the ISFParticle used to create the G4PrimaryParticle. (See ISF::InputConverter::getG4PrimaryParticle().) The behaviour is slightly different inside and outside ISF:

  • outside of ISF: m_theParticle is used to build the initial VTrackInformation attached as UserInformation to G4Tracks created from G4PrimaryParticles. (See AthenaStackingAction::ClassifyNewTrack(...))
  • inside ISF: The TruthBinding of m_theISFParticle is used to build the VTrackInformation object attached as UserInformation to G4Tracks created from G4PrimaryParticles. (See TrackProcessorUserActionBase::setupPrimary(...)) NB While the GenParticlePtr held by the VTrackInformation object can change during simulation (i.e. each time the track undergoes a non-destructive interaction). The GenParticlePtr held by PrimaryParticleInformation never changes.

Definition at line 39 of file PrimaryParticleInformation.h.

Constructor & Destructor Documentation

◆ PrimaryParticleInformation() [1/2]

PrimaryParticleInformation::PrimaryParticleInformation ( )

Definition at line 8 of file PrimaryParticleInformation.cxx.

9{
10}

◆ PrimaryParticleInformation() [2/2]

PrimaryParticleInformation::PrimaryParticleInformation ( HepMC::GenParticlePtr p,
ISF::ISFParticle * isp = nullptr )

Definition at line 12 of file PrimaryParticleInformation.cxx.

13 : m_theParticle(std::move(p))
14 , m_theISFParticle(isp)
15{
16}

Member Function Documentation

◆ GetHepMCParticle() [1/2]

HepMC::GenParticlePtr PrimaryParticleInformation::GetHepMCParticle ( )
inline

Definition at line 48 of file PrimaryParticleInformation.h.

48{ return m_theParticle; }

◆ GetHepMCParticle() [2/2]

HepMC::ConstGenParticlePtr PrimaryParticleInformation::GetHepMCParticle ( ) const
inline

return a pointer to the GenParticle used to create the G4PrimaryParticle

Definition at line 47 of file PrimaryParticleInformation.h.

47{ return m_theParticle; }

◆ GetISFParticle() [1/2]

ISF::ISFParticle * PrimaryParticleInformation::GetISFParticle ( )
inline

Definition at line 67 of file PrimaryParticleInformation.h.

67{ return m_theISFParticle; }

◆ GetISFParticle() [2/2]

const ISF::ISFParticle * PrimaryParticleInformation::GetISFParticle ( ) const
inline

return a pointer to the ISFParticle used to create the G4PrimaryParticle

Definition at line 66 of file PrimaryParticleInformation.h.

66{ return m_theISFParticle; }

◆ GetParticleBarcode()

int PrimaryParticleInformation::GetParticleBarcode ( ) const

Definition at line 18 of file PrimaryParticleInformation.cxx.

19{
20 if (m_barcode != HepMC::INVALID_PARTICLE_BARCODE) return m_barcode;
21 if (m_theParticle) {
22 m_barcode = HepMC::barcode(m_theParticle);
23 return m_barcode;
24 }
25 return 0;
26}
int barcode(const T *p)
Definition Barcode.h:16
constexpr int INVALID_PARTICLE_BARCODE

◆ GetParticleUniqueID()

int PrimaryParticleInformation::GetParticleUniqueID ( ) const

Definition at line 28 of file PrimaryParticleInformation.cxx.

29{
30 if (m_uniqueID != HepMC::INVALID_PARTICLE_BARCODE) return m_uniqueID;
31 if (m_theParticle) {
33 m_uniqueID = HepMC::uniqueID(particle);
34 return m_uniqueID;
35 }
36 return 0;
37}
int uniqueID(const T &p)
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ GetRegenerationNr()

int PrimaryParticleInformation::GetRegenerationNr ( )
inline

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

Definition at line 55 of file PrimaryParticleInformation.h.

◆ Print()

void PrimaryParticleInformation::Print ( ) const
inline

Definition at line 72 of file PrimaryParticleInformation.h.

72{}

◆ SetISFParticle()

void PrimaryParticleInformation::SetISFParticle ( ISF::ISFParticle * isp)

◆ SetRegenerationNr()

void PrimaryParticleInformation::SetRegenerationNr ( int i)
inline

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

Definition at line 61 of file PrimaryParticleInformation.h.

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

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

Definition at line 78 of file PrimaryParticleInformation.h.

◆ ATLAS_THREAD_SAFE [2/2]

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

Definition at line 79 of file PrimaryParticleInformation.h.

◆ m_regenerationNr

int PrimaryParticleInformation::m_regenerationNr {0}
private

Definition at line 77 of file PrimaryParticleInformation.h.

77{0};

◆ m_theISFParticle

ISF::ISFParticle* PrimaryParticleInformation::m_theISFParticle {}
private

Definition at line 75 of file PrimaryParticleInformation.h.

75{};

◆ m_theParticle

HepMC::GenParticlePtr PrimaryParticleInformation::m_theParticle {}
private

Definition at line 74 of file PrimaryParticleInformation.h.

74{};

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