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::GenEventGetHepMCEvent ()
 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.
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::GenEventm_theEvent {}
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 event-wide state such as the HepMC::GenEvent used to create the G4Event and the hit collection map. Per-track truth particles are stored on TrackInformation.

Definition at line 26 of file AtlasG4EventUserInfo.h.

Constructor & Destructor Documentation

◆ AtlasG4EventUserInfo()

AtlasG4EventUserInfo::AtlasG4EventUserInfo ( const EventContext & ctx)
inline

Definition at line 28 of file AtlasG4EventUserInfo.h.

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

Member Function Documentation

◆ GetEventContext()

const EventContext & AtlasG4EventUserInfo::GetEventContext ( ) const
inline

Definition at line 89 of file AtlasG4EventUserInfo.h.

89{ return m_eventContext; }

◆ GetEventStore()

IProxyDict * AtlasG4EventUserInfo::GetEventStore ( )
inline

Definition at line 91 of file AtlasG4EventUserInfo.h.

91{ return m_eventStore; }

◆ GetEventUserInfo()

AtlasG4EventUserInfo * AtlasG4EventUserInfo::GetEventUserInfo ( )
inlinestatic

Definition at line 96 of file AtlasG4EventUserInfo.h.

97 {
98 // Event manager may be null in unit tests.
99 G4EventManager* eventManager = G4EventManager::GetEventManager();
100 if (!eventManager) {
101 return nullptr;
102 }
103 // User info may be null
104 return static_cast<AtlasG4EventUserInfo*>(eventManager->GetUserInformation());
105 }
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 82 of file AtlasG4EventUserInfo.h.

82{ 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 69 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 52 of file AtlasG4EventUserInfo.h.

◆ Print()

void AtlasG4EventUserInfo::Print ( ) const
inline

Definition at line 93 of file AtlasG4EventUserInfo.h.

93{}

◆ 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 87 of file AtlasG4EventUserInfo.h.

87{ 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 76 of file AtlasG4EventUserInfo.h.

76{ 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 59 of file AtlasG4EventUserInfo.h.

59{ m_lastProcessedTrackID = trackID; }

Member Data Documentation

◆ m_eventContext

const EventContext& AtlasG4EventUserInfo::m_eventContext
private

Definition at line 109 of file AtlasG4EventUserInfo.h.

◆ m_eventStore

IProxyDict* AtlasG4EventUserInfo::m_eventStore {}
private

Definition at line 110 of file AtlasG4EventUserInfo.h.

110{};

◆ m_hitCollectionMap

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

Definition at line 113 of file AtlasG4EventUserInfo.h.

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

◆ m_lastProcessedStep

int AtlasG4EventUserInfo::m_lastProcessedStep {0}
private

Definition at line 121 of file AtlasG4EventUserInfo.h.

121{0};

◆ m_lastProcessedTrackID

int AtlasG4EventUserInfo::m_lastProcessedTrackID {0}
private

Definition at line 120 of file AtlasG4EventUserInfo.h.

120{0};

◆ m_theEvent

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

Definition at line 111 of file AtlasG4EventUserInfo.h.

111{};

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