BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Process information at the event level. More...
#include <BDSEventAction.hh>
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. | |
void | SetSamplerIDsForTrajectories (const std::vector< G4int > &samplerIDsIn) |
Update the vector of sampler IDs to match for trajectories. | |
void | IncrementNTracks () |
Interface for tracking action to increment the number of tracks in each event. | |
void | RegisterPrimaryTrajectory (const BDSTrajectoryPrimary *trajectoryIn) |
Append this trajectory to vector of primaries we keep to avoid sifting at the end of event. | |
Protected Member Functions | |
BDSTrajectoriesToStore * | IdentifyTrajectoriesForStorage (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. | |
void | ConnectTrajectory (std::map< BDSTrajectory *, bool > &interestingTraj, BDSTrajectory *trajectoryToConnect, std::map< BDSTrajectory *, std::bitset< BDS::NTrajectoryFilters > > &trajectoryFilters) const |
Private Attributes | |
BDSOutput * | output |
Cache of output instance. Not owned by this class. | |
G4bool | verboseEventBDSIM |
G4int | verboseEventStart |
G4int | verboseEventStop |
G4bool | storeTrajectory |
Cache of whether to store trajectories or not. | |
G4bool | storeTrajectoryAll |
Store all trajectories irrespective of filters. | |
G4bool | storeTrajectorySecondary |
G4int | printModulo |
G4int | samplerCollID_plane |
Collection ID for plane sampler hits. | |
G4int | samplerCollID_cylin |
Collection ID for cylindrical sampler hits. | |
G4int | samplerCollID_sphere |
Collection ID for spherical sampler hits. | |
G4int | eCounterID |
Collection ID for general energy deposition hits. | |
G4int | eCounterFullID |
Collection ID for general energy deposition full hits. | |
G4int | eCounterVacuumID |
Collection ID for the vacuum energy deposition hits. | |
G4int | eCounterTunnelID |
Collection ID for the tunnel energy deposition hits. | |
G4int | eCounterWorldID |
Collection ID for the world energy deposition hits. | |
G4int | eCounterWorldContentsID |
Collection ID for the world energy deposition hits. | |
G4int | worldExitCollID |
Collection ID for the world exit hits. | |
G4int | collimatorCollID |
Collection ID for the collimator hits. | |
G4int | apertureCollID |
Collection ID for the aperture hits. | |
G4int | thinThingCollID |
Collection ID for the thin thing hits. | |
std::map< G4String, G4int > | scorerCollectionIDs |
Collection IDs for all scorers. | |
std::map< G4String, G4int > | extraSamplerCollectionIDs |
Collection IDs for extra samplers. | |
std::map< G4String, G4int > | extraSamplerCylinderCollectionIDs |
Collection IDs for extra samplers. | |
std::map< G4String, G4int > | extraSamplerSphereCollectionIDs |
Collection IDs for extra samplers. | |
time_t | startTime |
Time at the start of the event. | |
time_t | stopTime |
Time at the end of the event. | |
G4double | starts |
Precise start time in seconds. | |
G4double | stops |
Precise stop time in seconds. | |
std::clock_t | cpuStartTime |
CPU time at the start of the event. | |
G4bool | primaryAbsorbedInCollimator |
Whether primary stopped in a collimator. | |
std::string | seedStateAtStart |
Seed state at start of the event. | |
G4int | currentEventIndex |
BDSEventInfo * | eventInfo |
long long int | nTracks |
Accumulated number of tracks for the event. | |
std::map< G4int, const BDSTrajectoryPrimary * > | primaryTrajectoriesCache |
G4bool | trajectoryFilterLogicAND |
Cache of variable from global constants. | |
G4double | trajectoryEnergyThreshold |
Cache of variable from global constants. | |
G4double | trajectoryCutZ |
Cache of variable from global constants. | |
G4double | trajectoryCutR |
Cache of variable from global constants. | |
G4bool | trajConnect |
Cache of variable from global constants. | |
G4String | trajParticleNameToStore |
Cache of variable from global constants. | |
G4String | trajParticleIDToStore |
Cache of variable from global constants. | |
std::vector< int > | trajParticleIDIntToStore |
Cache of variable from global constants. | |
G4int | trajDepth |
Cache of variable from global constants. | |
std::vector< int > | trajectorySamplerID |
Cache of variable from global constants. | |
std::vector< std::pair< double, double > > | trajSRangeToStore |
Cache of variable from global constants. | |
std::bitset< BDS::NTrajectoryFilters > | trajFiltersSet |
Cache of variable from global constants. | |
Process information at the event level.
Definition at line 47 of file BDSEventAction.hh.
|
explicit |
Definition at line 81 of file BDSEventAction.cc.
|
virtual |
Definition at line 132 of file BDSEventAction.cc.
|
virtual |
Definition at line 135 of file BDSEventAction.cc.
|
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 687 of file BDSEventAction.cc.
References ConnectTrajectory().
Referenced by ConnectTrajectory(), and IdentifyTrajectoriesForStorage().
|
inline |
Definition at line 57 of file BDSEventAction.hh.
|
virtual |
Definition at line 235 of file BDSEventAction.cc.
|
protected |
Sift through all trajectories (if any) and mark for storage.
Definition at line 465 of file BDSEventAction.cc.
References ConnectTrajectory(), BDSSamplerRegistry::GetInfo(), BDSTrajectory::GetPoint(), BDSTrajectory::GetPointEntries(), BDSHitEnergyDeposition::GetTrackID(), BDSSamplerRegistry::Instance(), BDSTrajectoryPoint::PostPosR(), BDSTrajectory::SetParent(), storeTrajectory, storeTrajectoryAll, trajConnect, trajDepth, trajectoryCutR, trajectoryCutZ, trajectoryEnergyThreshold, trajectoryFilterLogicAND, trajectorySamplerID, trajFiltersSet, trajParticleIDIntToStore, trajParticleIDToStore, trajParticleNameToStore, and trajSRangeToStore.
|
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().
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 702 of file BDSEventAction.cc.
References primaryTrajectoriesCache.
Referenced by BDSTrackingAction::PreUserTrackingAction().
|
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().
|
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().
|
inline |
Definition at line 56 of file BDSEventAction.hh.
|
private |
Collection ID for the aperture hits.
Definition at line 107 of file BDSEventAction.hh.
|
private |
Collection ID for the collimator hits.
Definition at line 106 of file BDSEventAction.hh.
|
private |
CPU time at the start of the event.
Definition at line 123 of file BDSEventAction.hh.
|
private |
Definition at line 143 of file BDSEventAction.hh.
|
private |
Collection ID for general energy deposition full hits.
Definition at line 100 of file BDSEventAction.hh.
|
private |
Collection ID for general energy deposition hits.
Definition at line 99 of file BDSEventAction.hh.
|
private |
Collection ID for the tunnel energy deposition hits.
Definition at line 102 of file BDSEventAction.hh.
|
private |
Collection ID for the vacuum energy deposition hits.
Definition at line 101 of file BDSEventAction.hh.
|
private |
Collection ID for the world energy deposition hits.
Definition at line 104 of file BDSEventAction.hh.
|
private |
Collection ID for the world energy deposition hits.
Definition at line 103 of file BDSEventAction.hh.
|
private |
A copy of the pointer to event info instance that is registered to the event. Geant4 deletes this as necessary.
Definition at line 147 of file BDSEventAction.hh.
|
private |
Collection IDs for extra samplers.
Definition at line 110 of file BDSEventAction.hh.
|
private |
Collection IDs for extra samplers.
Definition at line 111 of file BDSEventAction.hh.
|
private |
Collection IDs for extra samplers.
Definition at line 112 of file BDSEventAction.hh.
|
private |
Accumulated number of tracks for the event.
Definition at line 149 of file BDSEventAction.hh.
Referenced by IncrementNTracks().
|
private |
Cache of output instance. Not owned by this class.
Definition at line 87 of file BDSEventAction.hh.
|
private |
Whether primary stopped in a collimator.
Definition at line 125 of file BDSEventAction.hh.
Referenced by SetPrimaryAbsorbedInCollimator().
|
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 155 of file BDSEventAction.hh.
Referenced by RegisterPrimaryTrajectory().
|
private |
Definition at line 94 of file BDSEventAction.hh.
|
private |
Collection ID for cylindrical sampler hits.
Definition at line 97 of file BDSEventAction.hh.
|
private |
Collection ID for plane sampler hits.
Definition at line 96 of file BDSEventAction.hh.
|
private |
Collection ID for spherical sampler hits.
Definition at line 98 of file BDSEventAction.hh.
|
private |
Collection IDs for all scorers.
Definition at line 109 of file BDSEventAction.hh.
|
private |
Seed state at start of the event.
Definition at line 142 of file BDSEventAction.hh.
|
private |
Precise start time in seconds.
Definition at line 117 of file BDSEventAction.hh.
|
private |
Time at the start of the event.
Definition at line 114 of file BDSEventAction.hh.
|
private |
Precise stop time in seconds.
Definition at line 118 of file BDSEventAction.hh.
|
private |
Time at the end of the event.
Definition at line 115 of file BDSEventAction.hh.
|
private |
Cache of whether to store trajectories or not.
Definition at line 91 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Store all trajectories irrespective of filters.
Definition at line 92 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Definition at line 93 of file BDSEventAction.hh.
|
private |
Collection ID for the thin thing hits.
Definition at line 108 of file BDSEventAction.hh.
|
private |
Cache of variable from global constants.
Definition at line 132 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 136 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 131 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 130 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 129 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 128 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 137 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage(), and SetSamplerIDsForTrajectories().
|
private |
Cache of variable from global constants.
Definition at line 139 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 135 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 134 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 133 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Cache of variable from global constants.
Definition at line 138 of file BDSEventAction.hh.
Referenced by IdentifyTrajectoriesForStorage().
|
private |
Definition at line 88 of file BDSEventAction.hh.
|
private |
Definition at line 89 of file BDSEventAction.hh.
|
private |
Definition at line 90 of file BDSEventAction.hh.
|
private |
Collection ID for the world exit hits.
Definition at line 105 of file BDSEventAction.hh.