BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Member Functions | Private Attributes
BDSEventAction Class Reference

Process information at the event level. More...

#include <BDSEventAction.hh>

Inheritance diagram for BDSEventAction:
Inheritance graph
Collaboration diagram for BDSEventAction:
Collaboration graph

Public Member Functions

 BDSEventAction (BDSOutput *outputIn)
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
void StoreSeedState (G4String seedState)
 
G4int CurrentEventIndex () const
 
void SetPrimaryAbsorbedInCollimator (G4bool stoppedIn)
 Flag that the primary was absorbed in a collimator - can be done externally to this class. More...
 
void SetSamplerIDsForTrajectories (const std::vector< G4int > &samplerIDsIn)
 Update the vector of sampler IDs to match for trajectories. More...
 
void IncrementNTracks ()
 Interface for tracking action to increment the number of tracks in each event. More...
 
void RegisterPrimaryTrajectory (const BDSTrajectoryPrimary *trajectoryIn)
 Append this trajectory to vector of primaries we keep to avoid sifting at the end of event. More...
 

Protected Member Functions

BDSTrajectoriesToStoreIdentifyTrajectoriesForStorage (const G4Event *evt, G4bool verboseThisEvent, BDSHitsCollectionEnergyDeposition *eCounterHits, BDSHitsCollectionEnergyDeposition *eCounterFullHits, const std::vector< BDSHitsCollectionSampler * > &allSamplerHits, G4int nChar=50) const
 Sift through all trajectories (if any) and mark for storage. More...
 
void ConnectTrajectory (std::map< BDSTrajectory *, bool > &interestingTraj, BDSTrajectory *trajectoryToConnect, std::map< BDSTrajectory *, std::bitset< BDS::NTrajectoryFilters > > &trajectoryFilters) const
 

Private Attributes

BDSOutputoutput
 Cache of output instance. Not owned by this class. More...
 
G4bool verboseEventBDSIM
 
G4int verboseEventStart
 
G4int verboseEventStop
 
G4bool storeTrajectory
 Cache of whether to store trajectories or not. More...
 
G4bool storeTrajectoryAll
 Store all trajectories irrespective of filters. More...
 
G4int printModulo
 
G4int samplerCollID_plane
 Collection ID for plane sampler hits. More...
 
G4int samplerCollID_cylin
 Collection ID for cylindrical sampler hits. More...
 
G4int samplerCollID_sphere
 Collection ID for spherical sampler hits. More...
 
G4int eCounterID
 Collection ID for general energy deposition hits. More...
 
G4int eCounterFullID
 Collection ID for general energy deposition full hits. More...
 
G4int eCounterVacuumID
 Collection ID for the vacuum energy deposition hits. More...
 
G4int eCounterTunnelID
 Collection ID for the tunnel energy deposition hits. More...
 
G4int eCounterWorldID
 Collection ID for the world energy deposition hits. More...
 
G4int eCounterWorldContentsID
 Collection ID for the world energy deposition hits. More...
 
G4int worldExitCollID
 Collection ID for the world exit hits. More...
 
G4int collimatorCollID
 Collection ID for the collimator hits. More...
 
G4int apertureCollID
 Collection ID for the aperture hits. More...
 
G4int thinThingCollID
 Collection ID for the thin thing hits. More...
 
std::map< G4String, G4int > scorerCollectionIDs
 Collection IDs for all scorers. More...
 
std::map< G4String, G4int > extraSamplerCollectionIDs
 Collection IDs for extra samplers. More...
 
std::map< G4String, G4int > extraSamplerCylinderCollectionIDs
 Collection IDs for extra samplers. More...
 
std::map< G4String, G4int > extraSamplerSphereCollectionIDs
 Collection IDs for extra samplers. More...
 
time_t startTime
 Time at the start of the event. More...
 
time_t stopTime
 Time at the end of the event. More...
 
G4double starts
 Precise start time in seconds. More...
 
G4double stops
 Precise stop time in seconds. More...
 
std::clock_t cpuStartTime
 CPU time at the start of the event. More...
 
G4bool primaryAbsorbedInCollimator
 Whether primary stopped in a collimator. More...
 
std::string seedStateAtStart
 Seed state at start of the event. More...
 
G4int currentEventIndex
 
BDSEventInfoeventInfo
 
long long int nTracks
 Accumulated number of tracks for the event. More...
 
std::map< G4int, const BDSTrajectoryPrimary * > primaryTrajectoriesCache
 
G4bool trajectoryFilterLogicAND
 Cache of variable from global constants. More...
 
G4double trajectoryEnergyThreshold
 Cache of variable from global constants. More...
 
G4double trajectoryCutZ
 Cache of variable from global constants. More...
 
G4double trajectoryCutR
 Cache of variable from global constants. More...
 
G4bool trajConnect
 Cache of variable from global constants. More...
 
G4String trajParticleNameToStore
 Cache of variable from global constants. More...
 
G4String trajParticleIDToStore
 Cache of variable from global constants. More...
 
std::vector< int > trajParticleIDIntToStore
 Cache of variable from global constants. More...
 
G4int trajDepth
 Cache of variable from global constants. More...
 
std::vector< int > trajectorySamplerID
 Cache of variable from global constants. More...
 
std::vector< std::pair< double, double > > trajSRangeToStore
 Cache of variable from global constants. More...
 
std::bitset< BDS::NTrajectoryFilters > trajFiltersSet
 Cache of variable from global constants. More...
 

Detailed Description

Process information at the event level.

Definition at line 47 of file BDSEventAction.hh.

Constructor & Destructor Documentation

◆ BDSEventAction()

BDSEventAction::BDSEventAction ( BDSOutput outputIn)
explicit

Definition at line 80 of file BDSEventAction.cc.

◆ ~BDSEventAction()

BDSEventAction::~BDSEventAction ( )
virtual

Definition at line 131 of file BDSEventAction.cc.

Member Function Documentation

◆ BeginOfEventAction()

void BDSEventAction::BeginOfEventAction ( const G4Event *  evt)
virtual

Definition at line 134 of file BDSEventAction.cc.

◆ ConnectTrajectory()

void BDSEventAction::ConnectTrajectory ( std::map< BDSTrajectory *, bool > &  interestingTraj,
BDSTrajectory trajectoryToConnect,
std::map< BDSTrajectory *, std::bitset< BDS::NTrajectoryFilters > > &  trajectoryFilters 
) const
protected

Recursively (using this function) mark each parent trajectory as true - to be stored, and also flag the bitset for 'connect' as true.

Definition at line 677 of file BDSEventAction.cc.

References ConnectTrajectory().

Referenced by ConnectTrajectory(), and IdentifyTrajectoriesForStorage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CurrentEventIndex()

G4int BDSEventAction::CurrentEventIndex ( ) const
inline

Definition at line 57 of file BDSEventAction.hh.

◆ EndOfEventAction()

void BDSEventAction::EndOfEventAction ( const G4Event *  evt)
virtual

Definition at line 232 of file BDSEventAction.cc.

◆ IdentifyTrajectoriesForStorage()

BDSTrajectoriesToStore * BDSEventAction::IdentifyTrajectoriesForStorage ( const G4Event *  evt,
G4bool  verboseThisEvent,
BDSHitsCollectionEnergyDeposition eCounterHits,
BDSHitsCollectionEnergyDeposition eCounterFullHits,
const std::vector< BDSHitsCollectionSampler * > &  allSamplerHits,
G4int  nChar = 50 
) const
protected

◆ IncrementNTracks()

void BDSEventAction::IncrementNTracks ( )
inline

Interface for tracking action to increment the number of tracks in each event.

Definition at line 66 of file BDSEventAction.hh.

References nTracks.

Referenced by BDSTrackingAction::PreUserTrackingAction().

Here is the caller graph for this function:

◆ RegisterPrimaryTrajectory()

void BDSEventAction::RegisterPrimaryTrajectory ( const BDSTrajectoryPrimary trajectoryIn)

Append this trajectory to vector of primaries we keep to avoid sifting at the end of event.

Definition at line 692 of file BDSEventAction.cc.

References primaryTrajectoriesCache.

Referenced by BDSTrackingAction::PreUserTrackingAction().

Here is the caller graph for this function:

◆ SetPrimaryAbsorbedInCollimator()

void BDSEventAction::SetPrimaryAbsorbedInCollimator ( G4bool  stoppedIn)
inline

Flag that the primary was absorbed in a collimator - can be done externally to this class.

Definition at line 60 of file BDSEventAction.hh.

References primaryAbsorbedInCollimator.

Referenced by BDSTrackingAction::PostUserTrackingAction().

Here is the caller graph for this function:

◆ SetSamplerIDsForTrajectories()

void BDSEventAction::SetSamplerIDsForTrajectories ( const std::vector< G4int > &  samplerIDsIn)
inline

Update the vector of sampler IDs to match for trajectories.

Definition at line 63 of file BDSEventAction.hh.

References trajectorySamplerID.

Referenced by BDSRunAction::SetTrajectorySamplerIDs().

Here is the caller graph for this function:

◆ StoreSeedState()

void BDSEventAction::StoreSeedState ( G4String  seedState)
inline

Definition at line 56 of file BDSEventAction.hh.

Field Documentation

◆ apertureCollID

G4int BDSEventAction::apertureCollID
private

Collection ID for the aperture hits.

Definition at line 106 of file BDSEventAction.hh.

◆ collimatorCollID

G4int BDSEventAction::collimatorCollID
private

Collection ID for the collimator hits.

Definition at line 105 of file BDSEventAction.hh.

◆ cpuStartTime

std::clock_t BDSEventAction::cpuStartTime
private

CPU time at the start of the event.

Definition at line 122 of file BDSEventAction.hh.

◆ currentEventIndex

G4int BDSEventAction::currentEventIndex
private

Definition at line 142 of file BDSEventAction.hh.

◆ eCounterFullID

G4int BDSEventAction::eCounterFullID
private

Collection ID for general energy deposition full hits.

Definition at line 99 of file BDSEventAction.hh.

◆ eCounterID

G4int BDSEventAction::eCounterID
private

Collection ID for general energy deposition hits.

Definition at line 98 of file BDSEventAction.hh.

◆ eCounterTunnelID

G4int BDSEventAction::eCounterTunnelID
private

Collection ID for the tunnel energy deposition hits.

Definition at line 101 of file BDSEventAction.hh.

◆ eCounterVacuumID

G4int BDSEventAction::eCounterVacuumID
private

Collection ID for the vacuum energy deposition hits.

Definition at line 100 of file BDSEventAction.hh.

◆ eCounterWorldContentsID

G4int BDSEventAction::eCounterWorldContentsID
private

Collection ID for the world energy deposition hits.

Definition at line 103 of file BDSEventAction.hh.

◆ eCounterWorldID

G4int BDSEventAction::eCounterWorldID
private

Collection ID for the world energy deposition hits.

Definition at line 102 of file BDSEventAction.hh.

◆ eventInfo

BDSEventInfo* BDSEventAction::eventInfo
private

A copy of the pointer to event info instance that is registered to the event. Geant4 deletes this as necessary.

Definition at line 146 of file BDSEventAction.hh.

◆ extraSamplerCollectionIDs

std::map<G4String, G4int> BDSEventAction::extraSamplerCollectionIDs
private

Collection IDs for extra samplers.

Definition at line 109 of file BDSEventAction.hh.

◆ extraSamplerCylinderCollectionIDs

std::map<G4String, G4int> BDSEventAction::extraSamplerCylinderCollectionIDs
private

Collection IDs for extra samplers.

Definition at line 110 of file BDSEventAction.hh.

◆ extraSamplerSphereCollectionIDs

std::map<G4String, G4int> BDSEventAction::extraSamplerSphereCollectionIDs
private

Collection IDs for extra samplers.

Definition at line 111 of file BDSEventAction.hh.

◆ nTracks

long long int BDSEventAction::nTracks
private

Accumulated number of tracks for the event.

Definition at line 148 of file BDSEventAction.hh.

Referenced by IncrementNTracks().

◆ output

BDSOutput* BDSEventAction::output
private

Cache of output instance. Not owned by this class.

Definition at line 87 of file BDSEventAction.hh.

◆ primaryAbsorbedInCollimator

G4bool BDSEventAction::primaryAbsorbedInCollimator
private

Whether primary stopped in a collimator.

Definition at line 124 of file BDSEventAction.hh.

Referenced by SetPrimaryAbsorbedInCollimator().

◆ primaryTrajectoriesCache

std::map<G4int, const BDSTrajectoryPrimary*> BDSEventAction::primaryTrajectoriesCache
private

Cache of primary trajectories as constructed. Do this as a map because the primary trajectory may be update and appended (merged) at some point leading to more than one temporary object per final one trajectory. Therefore we can't end up with degenerate ones here.

Definition at line 154 of file BDSEventAction.hh.

Referenced by RegisterPrimaryTrajectory().

◆ printModulo

G4int BDSEventAction::printModulo
private

Definition at line 93 of file BDSEventAction.hh.

◆ samplerCollID_cylin

G4int BDSEventAction::samplerCollID_cylin
private

Collection ID for cylindrical sampler hits.

Definition at line 96 of file BDSEventAction.hh.

◆ samplerCollID_plane

G4int BDSEventAction::samplerCollID_plane
private

Collection ID for plane sampler hits.

Definition at line 95 of file BDSEventAction.hh.

◆ samplerCollID_sphere

G4int BDSEventAction::samplerCollID_sphere
private

Collection ID for spherical sampler hits.

Definition at line 97 of file BDSEventAction.hh.

◆ scorerCollectionIDs

std::map<G4String, G4int> BDSEventAction::scorerCollectionIDs
private

Collection IDs for all scorers.

Definition at line 108 of file BDSEventAction.hh.

◆ seedStateAtStart

std::string BDSEventAction::seedStateAtStart
private

Seed state at start of the event.

Definition at line 141 of file BDSEventAction.hh.

◆ starts

G4double BDSEventAction::starts
private

Precise start time in seconds.

Definition at line 116 of file BDSEventAction.hh.

◆ startTime

time_t BDSEventAction::startTime
private

Time at the start of the event.

Definition at line 113 of file BDSEventAction.hh.

◆ stops

G4double BDSEventAction::stops
private

Precise stop time in seconds.

Definition at line 117 of file BDSEventAction.hh.

◆ stopTime

time_t BDSEventAction::stopTime
private

Time at the end of the event.

Definition at line 114 of file BDSEventAction.hh.

◆ storeTrajectory

G4bool BDSEventAction::storeTrajectory
private

Cache of whether to store trajectories or not.

Definition at line 91 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ storeTrajectoryAll

G4bool BDSEventAction::storeTrajectoryAll
private

Store all trajectories irrespective of filters.

Definition at line 92 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ thinThingCollID

G4int BDSEventAction::thinThingCollID
private

Collection ID for the thin thing hits.

Definition at line 107 of file BDSEventAction.hh.

◆ trajConnect

G4bool BDSEventAction::trajConnect
private

Cache of variable from global constants.

Definition at line 131 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajDepth

G4int BDSEventAction::trajDepth
private

Cache of variable from global constants.

Definition at line 135 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajectoryCutR

G4double BDSEventAction::trajectoryCutR
private

Cache of variable from global constants.

Definition at line 130 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajectoryCutZ

G4double BDSEventAction::trajectoryCutZ
private

Cache of variable from global constants.

Definition at line 129 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajectoryEnergyThreshold

G4double BDSEventAction::trajectoryEnergyThreshold
private

Cache of variable from global constants.

Definition at line 128 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajectoryFilterLogicAND

G4bool BDSEventAction::trajectoryFilterLogicAND
private

Cache of variable from global constants.

Definition at line 127 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajectorySamplerID

std::vector<int> BDSEventAction::trajectorySamplerID
private

Cache of variable from global constants.

Definition at line 136 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage(), and SetSamplerIDsForTrajectories().

◆ trajFiltersSet

std::bitset<BDS::NTrajectoryFilters> BDSEventAction::trajFiltersSet
private

Cache of variable from global constants.

Definition at line 138 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajParticleIDIntToStore

std::vector<int> BDSEventAction::trajParticleIDIntToStore
private

Cache of variable from global constants.

Definition at line 134 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajParticleIDToStore

G4String BDSEventAction::trajParticleIDToStore
private

Cache of variable from global constants.

Definition at line 133 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajParticleNameToStore

G4String BDSEventAction::trajParticleNameToStore
private

Cache of variable from global constants.

Definition at line 132 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ trajSRangeToStore

std::vector<std::pair<double,double> > BDSEventAction::trajSRangeToStore
private

Cache of variable from global constants.

Definition at line 137 of file BDSEventAction.hh.

Referenced by IdentifyTrajectoriesForStorage().

◆ verboseEventBDSIM

G4bool BDSEventAction::verboseEventBDSIM
private

Definition at line 88 of file BDSEventAction.hh.

◆ verboseEventStart

G4int BDSEventAction::verboseEventStart
private

Definition at line 89 of file BDSEventAction.hh.

◆ verboseEventStop

G4int BDSEventAction::verboseEventStop
private

Definition at line 90 of file BDSEventAction.hh.

◆ worldExitCollID

G4int BDSEventAction::worldExitCollID
private

Collection ID for the world exit hits.

Definition at line 104 of file BDSEventAction.hh.


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