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

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

#include <AtlasG4EventUserInfo.h>

Inheritance diagram for AtlasG4EventUserInfo:
Collaboration diagram for AtlasG4EventUserInfo:

Public Member Functions

 AtlasG4EventUserInfo (const EventContext &ctx)
HepMC::GenEvent * GetHepMCEvent ()
 return a pointer to the HepMC::GenEvent used to create the G4Event.
void SetHepMCEvent (HepMC::GenEvent *)
 set m_theEvent, the pointer to the HepMC::GenEvent used to create the G4Event.
HepMC::ConstGenParticlePtr GetCurrentPrimaryGenParticle () const
 return a pointer to the HepMC::GenParticle used to create the current G4PrimaryParticle.
void SetCurrentPrimaryGenParticle (HepMC::ConstGenParticlePtr p)
 set m_currentPrimaryGenParticle, the pointer to the HepMC::GenParticle used to create the current G4PrimaryParticle.
HepMC::GenParticlePtr GetCurrentGenParticle ()
 return a pointer to the GenParticle corresponding to the current G4Track (if there is one).
HepMC::ConstGenParticlePtr GetCurrentGenParticle () const
void SetCurrentGenParticle (HepMC::GenParticlePtr p)
 set m_currentGenParticle, the pointer to the GenParticle corresponding to the current G4Track.
int GetLastProcessedTrackID () const
 return the value of G4Track::GetTrackID() for the last G4Step processed by a CaloCalibrationHit Sensitive Detector.
void SetLastProcessedTrackID (int trackID)
 record the value of G4Track::GetTrackID() for the current G4Step.
int GetLastProcessedStep () const
 return the value of the G4Track::GetCurrentStepNumber() for the last G4Step processed by a CaloCalibrationHit Sensitive Detector.
void SetLastProcessedStep (int stepNumber)
 record value of the G4Track::GetCurrentStepNumber() for the current G4Step.
std::shared_ptr< HitCollectionMapGetHitCollectionMap () const
 Get the HitCollectionMap object with shared ownership.
void SetHitCollectionMap (std::shared_ptr< HitCollectionMap > hitCollections)
 Set the HitCollectionMap object.
const EventContext & GetEventContext () const
IProxyDictGetEventStore ()
void Print () const

Static Public Member Functions

static AtlasG4EventUserInfoGetEventUserInfo ()

Private Attributes

const EventContext & m_eventContext
IProxyDictm_eventStore {}
HepMC::GenEvent * m_theEvent {}
HepMC::ConstGenParticlePtr m_currentPrimaryGenParticle {}
HepMC::GenParticlePtr m_currentGenParticle {}
std::shared_ptr< HitCollectionMapm_hitCollectionMap {std::make_shared<HitCollectionMap>()}
int m_lastProcessedTrackID {0}
int m_lastProcessedStep {0}

Detailed Description

This class is attached to G4Event objects as UserInformation.

It holds a pointer to the HepMC::GenEvent which was used to create the G4Event. NB As with VTrackInformation, the GenParticlePtr held by the AtlasG4EventUserInfo object can change during simulation (i.e. each time the track undergoes a non-destructive interaction).

Definition at line 29 of file AtlasG4EventUserInfo.h.

Constructor & Destructor Documentation

◆ AtlasG4EventUserInfo()

AtlasG4EventUserInfo::AtlasG4EventUserInfo ( const EventContext & ctx)
inline

Definition at line 31 of file AtlasG4EventUserInfo.h.

32 : G4VUserEventInformation()
33 , m_eventContext(ctx)
35 {}
const EventContext & m_eventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.

Member Function Documentation

◆ GetCurrentGenParticle() [1/2]

HepMC::GenParticlePtr AtlasG4EventUserInfo::GetCurrentGenParticle ( )
inline

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

TODO Rename

Definition at line 69 of file AtlasG4EventUserInfo.h.

HepMC::GenParticlePtr m_currentGenParticle

◆ GetCurrentGenParticle() [2/2]

HepMC::ConstGenParticlePtr AtlasG4EventUserInfo::GetCurrentGenParticle ( ) const
inline

Definition at line 70 of file AtlasG4EventUserInfo.h.

◆ GetCurrentPrimaryGenParticle()

HepMC::ConstGenParticlePtr AtlasG4EventUserInfo::GetCurrentPrimaryGenParticle ( ) const
inline

return a pointer to the HepMC::GenParticle used to create the current G4PrimaryParticle.

(Used in G4VFastSimulationModel implementations and Sensitive Detectors which record CaloCalibrationHits.) TODO Rename

Definition at line 54 of file AtlasG4EventUserInfo.h.

HepMC::ConstGenParticlePtr m_currentPrimaryGenParticle

◆ GetEventContext()

const EventContext & AtlasG4EventUserInfo::GetEventContext ( ) const
inline

Definition at line 123 of file AtlasG4EventUserInfo.h.

123{ return m_eventContext; }

◆ GetEventStore()

IProxyDict * AtlasG4EventUserInfo::GetEventStore ( )
inline

Definition at line 125 of file AtlasG4EventUserInfo.h.

125{ return m_eventStore; }

◆ GetEventUserInfo()

AtlasG4EventUserInfo * AtlasG4EventUserInfo::GetEventUserInfo ( )
inlinestatic

Definition at line 130 of file AtlasG4EventUserInfo.h.

131 {
132 // Event manager may be null in unit tests.
133 G4EventManager* eventManager = G4EventManager::GetEventManager();
134 if (!eventManager) {
135 return nullptr;
136 }
137 // User info may be null
138 return static_cast<AtlasG4EventUserInfo*>(eventManager->GetUserInformation());
139 }
AtlasG4EventUserInfo(const EventContext &ctx)

◆ GetHepMCEvent()

HepMC::GenEvent * AtlasG4EventUserInfo::GetHepMCEvent ( )

return a pointer to the HepMC::GenEvent used to create the G4Event.

(Never called. Remove?)

Definition at line 8 of file AtlasG4EventUserInfo.cxx.

9{
10 return m_theEvent;
11}
HepMC::GenEvent * m_theEvent

◆ GetHitCollectionMap()

std::shared_ptr< HitCollectionMap > AtlasG4EventUserInfo::GetHitCollectionMap ( ) const
inline

Get the HitCollectionMap object with shared ownership.

Geant4 deleting this UserInfo object will not delete the HitCollectionMap.

Definition at line 116 of file AtlasG4EventUserInfo.h.

116{ return m_hitCollectionMap; }
std::shared_ptr< HitCollectionMap > m_hitCollectionMap

◆ GetLastProcessedStep()

int AtlasG4EventUserInfo::GetLastProcessedStep ( ) const
inline

return the value of the G4Track::GetCurrentStepNumber() for the last G4Step processed by a CaloCalibrationHit Sensitive Detector.

Used in CalibrationDefaultProcessing::UserSteppingAction(...) to ensure that unprocessed G4Steps are passed to the default CaloCalibrationHit sensitive detector.

Definition at line 103 of file AtlasG4EventUserInfo.h.

◆ GetLastProcessedTrackID()

int AtlasG4EventUserInfo::GetLastProcessedTrackID ( ) const
inline

return the value of G4Track::GetTrackID() for the last G4Step processed by a CaloCalibrationHit Sensitive Detector.

Used in CalibrationDefaultProcessing::UserSteppingAction(...) to ensure that unprocessed G4Steps are passed to the default CaloCalibrationHit sensitive detector. TODO Rename

Definition at line 86 of file AtlasG4EventUserInfo.h.

◆ Print()

void AtlasG4EventUserInfo::Print ( ) const
inline

Definition at line 127 of file AtlasG4EventUserInfo.h.

127{}

◆ SetCurrentGenParticle()

void AtlasG4EventUserInfo::SetCurrentGenParticle ( HepMC::GenParticlePtr p)
inline

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. TODO Rename

Definition at line 77 of file AtlasG4EventUserInfo.h.

77{m_currentGenParticle = std::move(p);}

◆ SetCurrentPrimaryGenParticle()

void AtlasG4EventUserInfo::SetCurrentPrimaryGenParticle ( HepMC::ConstGenParticlePtr p)
inline

set m_currentPrimaryGenParticle, the pointer to the HepMC::GenParticle used to create the current G4PrimaryParticle.

This pointer is updated each time there is a new G4PrimaryParticle. Called from (AthenaTrackingAction/TrackProcessorUserActionBase):: PreUserTrackingAction(...). TODO Rename

Definition at line 63 of file AtlasG4EventUserInfo.h.

63{m_currentPrimaryGenParticle = std::move(p);}

◆ SetHepMCEvent()

void AtlasG4EventUserInfo::SetHepMCEvent ( HepMC::GenEvent * ev)

set m_theEvent, the pointer to the HepMC::GenEvent used to create the G4Event.

Only called in ISF::InputConverter::ISF_to_G4Event(...).

Definition at line 13 of file AtlasG4EventUserInfo.cxx.

14{
16}
int ev
Definition globals.cxx:25

◆ SetHitCollectionMap()

void AtlasG4EventUserInfo::SetHitCollectionMap ( std::shared_ptr< HitCollectionMap > hitCollections)
inline

Set the HitCollectionMap object.

Definition at line 121 of file AtlasG4EventUserInfo.h.

121{ m_hitCollectionMap = hitCollections; }

◆ SetLastProcessedStep()

void AtlasG4EventUserInfo::SetLastProcessedStep ( int stepNumber)
inline

record value of the G4Track::GetCurrentStepNumber() for the current G4Step.

Should be called by all CaloCalibrationHit Sensitive Detectors after they process a G4Step. TODO Check this is done.

Definition at line 110 of file AtlasG4EventUserInfo.h.

110{ m_lastProcessedStep = stepNumber; }

◆ SetLastProcessedTrackID()

void AtlasG4EventUserInfo::SetLastProcessedTrackID ( int trackID)
inline

record the value of G4Track::GetTrackID() for the current G4Step.

Should be called by all CaloCalibrationHit Sensitive Detectors after they process a G4Step. TODO Check this. TODO Rename

Definition at line 93 of file AtlasG4EventUserInfo.h.

93{ m_lastProcessedTrackID = trackID; }

Member Data Documentation

◆ m_currentGenParticle

HepMC::GenParticlePtr AtlasG4EventUserInfo::m_currentGenParticle {}
private

Definition at line 147 of file AtlasG4EventUserInfo.h.

147{};

◆ m_currentPrimaryGenParticle

HepMC::ConstGenParticlePtr AtlasG4EventUserInfo::m_currentPrimaryGenParticle {}
private

Definition at line 146 of file AtlasG4EventUserInfo.h.

146{};

◆ m_eventContext

const EventContext& AtlasG4EventUserInfo::m_eventContext
private

Definition at line 143 of file AtlasG4EventUserInfo.h.

◆ m_eventStore

IProxyDict* AtlasG4EventUserInfo::m_eventStore {}
private

Definition at line 144 of file AtlasG4EventUserInfo.h.

144{};

◆ m_hitCollectionMap

std::shared_ptr<HitCollectionMap> AtlasG4EventUserInfo::m_hitCollectionMap {std::make_shared<HitCollectionMap>()}
private

Definition at line 149 of file AtlasG4EventUserInfo.h.

149{std::make_shared<HitCollectionMap>()};

◆ m_lastProcessedStep

int AtlasG4EventUserInfo::m_lastProcessedStep {0}
private

Definition at line 157 of file AtlasG4EventUserInfo.h.

157{0};

◆ m_lastProcessedTrackID

int AtlasG4EventUserInfo::m_lastProcessedTrackID {0}
private

Definition at line 156 of file AtlasG4EventUserInfo.h.

156{0};

◆ m_theEvent

HepMC::GenEvent* AtlasG4EventUserInfo::m_theEvent {}
private

Definition at line 145 of file AtlasG4EventUserInfo.h.

145{};

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