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

#include <AtlasG4SyncEventUserInfo.h>

Inheritance diagram for AtlasG4SyncEventUserInfo:
Collaboration diagram for AtlasG4SyncEventUserInfo:

Public Types

using EventFactoryFunction = std::function<StatusCode(G4Event&, std::unique_ptr<AtlasG4SyncEventUserInfo>)>
using SPSyncInterface = std::shared_ptr<G4EventSynchronizationInterface>

Public Member Functions

 AtlasG4SyncEventUserInfo (CLHEP::HepRandomEngine *, EventFactoryFunction &&, const EventContext &)
event_number_t AthenaEventID () const
CLHEP::HepRandomEngine * HepRandomEngine ()
EventFactoryFunction EventFactory () const
SPSyncInterface SyncInterface () const
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

CLHEP::HepRandomEngine * m_rng_engine {nullptr}
EventFactoryFunction m_event_factory
SPSyncInterface m_sync_interface
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

Definition at line 52 of file AtlasG4SyncEventUserInfo.h.

Member Typedef Documentation

◆ EventFactoryFunction

using AtlasG4SyncEventUserInfo::EventFactoryFunction = std::function<StatusCode(G4Event&, std::unique_ptr<AtlasG4SyncEventUserInfo>)>

Definition at line 55 of file AtlasG4SyncEventUserInfo.h.

◆ SPSyncInterface

Constructor & Destructor Documentation

◆ AtlasG4SyncEventUserInfo()

AtlasG4SyncEventUserInfo::AtlasG4SyncEventUserInfo ( CLHEP::HepRandomEngine * rng_engine,
AtlasG4SyncEventUserInfo::EventFactoryFunction && event_factory,
const EventContext & ctx )

Definition at line 14 of file AtlasG4SyncEventUserInfo.cxx.

18 , m_rng_engine(rng_engine)
19 , m_event_factory(std::move(event_factory))
20 , m_sync_interface(std::make_shared<G4EventSynchronizationInterface>())
21{
22}
AtlasG4EventUserInfo(const EventContext &ctx)
EventFactoryFunction m_event_factory
CLHEP::HepRandomEngine * m_rng_engine

Member Function Documentation

◆ AthenaEventID()

event_number_t AtlasG4SyncEventUserInfo::AthenaEventID ( ) const
inline

Definition at line 60 of file AtlasG4SyncEventUserInfo.h.

60 {
61 return GetEventContext().eventID().event_number();
62 }
const EventContext & GetEventContext() const

◆ EventFactory()

EventFactoryFunction AtlasG4SyncEventUserInfo::EventFactory ( ) const
inline

Definition at line 68 of file AtlasG4SyncEventUserInfo.h.

68 {
69 return m_event_factory;
70 }

◆ GetCurrentGenParticle() [1/2]

HepMC::GenParticlePtr AtlasG4EventUserInfo::GetCurrentGenParticle ( )
inlineinherited

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
inlineinherited

Definition at line 70 of file AtlasG4EventUserInfo.h.

◆ GetCurrentPrimaryGenParticle()

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

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
inlineinherited

Definition at line 123 of file AtlasG4EventUserInfo.h.

123{ return m_eventContext; }
const EventContext & m_eventContext

◆ GetEventStore()

IProxyDict * AtlasG4EventUserInfo::GetEventStore ( )
inlineinherited

Definition at line 125 of file AtlasG4EventUserInfo.h.

125{ return m_eventStore; }

◆ GetEventUserInfo()

AtlasG4EventUserInfo * AtlasG4EventUserInfo::GetEventUserInfo ( )
inlinestaticinherited

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 }

◆ GetHepMCEvent()

HepMC::GenEvent * AtlasG4EventUserInfo::GetHepMCEvent ( )
inherited

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
inlineinherited

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
inlineinherited

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
inlineinherited

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.

◆ HepRandomEngine()

CLHEP::HepRandomEngine * AtlasG4SyncEventUserInfo::HepRandomEngine ( )
inline

Definition at line 64 of file AtlasG4SyncEventUserInfo.h.

64 {
65 return m_rng_engine;
66 }

◆ Print()

void AtlasG4EventUserInfo::Print ( ) const
inlineinherited

Definition at line 127 of file AtlasG4EventUserInfo.h.

127{}

◆ SetCurrentGenParticle()

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

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)
inlineinherited

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)
inherited

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)
inlineinherited

Set the HitCollectionMap object.

Definition at line 121 of file AtlasG4EventUserInfo.h.

121{ m_hitCollectionMap = hitCollections; }

◆ SetLastProcessedStep()

void AtlasG4EventUserInfo::SetLastProcessedStep ( int stepNumber)
inlineinherited

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)
inlineinherited

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

◆ SyncInterface()

SPSyncInterface AtlasG4SyncEventUserInfo::SyncInterface ( ) const
inline

Definition at line 72 of file AtlasG4SyncEventUserInfo.h.

72 {
73 return m_sync_interface;
74 }

Member Data Documentation

◆ m_currentGenParticle

HepMC::GenParticlePtr AtlasG4EventUserInfo::m_currentGenParticle {}
privateinherited

Definition at line 147 of file AtlasG4EventUserInfo.h.

147{};

◆ m_currentPrimaryGenParticle

HepMC::ConstGenParticlePtr AtlasG4EventUserInfo::m_currentPrimaryGenParticle {}
privateinherited

Definition at line 146 of file AtlasG4EventUserInfo.h.

146{};

◆ m_event_factory

EventFactoryFunction AtlasG4SyncEventUserInfo::m_event_factory
private

Definition at line 80 of file AtlasG4SyncEventUserInfo.h.

◆ m_eventContext

const EventContext& AtlasG4EventUserInfo::m_eventContext
privateinherited

Definition at line 143 of file AtlasG4EventUserInfo.h.

◆ m_eventStore

IProxyDict* AtlasG4EventUserInfo::m_eventStore {}
privateinherited

Definition at line 144 of file AtlasG4EventUserInfo.h.

144{};

◆ m_hitCollectionMap

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

Definition at line 149 of file AtlasG4EventUserInfo.h.

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

◆ m_lastProcessedStep

int AtlasG4EventUserInfo::m_lastProcessedStep {0}
privateinherited

Definition at line 157 of file AtlasG4EventUserInfo.h.

157{0};

◆ m_lastProcessedTrackID

int AtlasG4EventUserInfo::m_lastProcessedTrackID {0}
privateinherited

Definition at line 156 of file AtlasG4EventUserInfo.h.

156{0};

◆ m_rng_engine

CLHEP::HepRandomEngine* AtlasG4SyncEventUserInfo::m_rng_engine {nullptr}
private

Definition at line 78 of file AtlasG4SyncEventUserInfo.h.

78{nullptr};

◆ m_sync_interface

SPSyncInterface AtlasG4SyncEventUserInfo::m_sync_interface
private

Definition at line 83 of file AtlasG4SyncEventUserInfo.h.

◆ m_theEvent

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

Definition at line 145 of file AtlasG4EventUserInfo.h.

145{};

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