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

Control over the beginning and end of run actions. More...

#include <BDSRunAction.hh>

Inheritance diagram for BDSRunAction:
Inheritance graph
Collaboration diagram for BDSRunAction:
Collaboration graph

Public Member Functions

 BDSRunAction (BDSOutput *outputIn, BDSBunch *bunchGeneratorIn, G4bool usingIonsIn, BDSEventAction *eventActionIn, G4String trajectorySamplerIDIn)
 
virtual void BeginOfRunAction (const G4Run *)
 
virtual void EndOfRunAction (const G4Run *)
 

Private Member Functions

void PrintAllProcessesForAllParticles () const
 
void SetTrajectorySamplerIDs () const
 
void CheckTrajectoryOptions () const
 

Private Attributes

BDSOutputoutput
 Cache of output instance. Not owned by this class. More...
 
time_t starttime
 
std::string seedStateAtStart
 Seed state at start of the run. More...
 
BDSEventInfoinfo
 
BDSBunchbunchGenerator
 Cache of bunch generator. More...
 
const G4bool usingIons
 Cache of whether ions are being used (for particle table writing out). More...
 
std::clock_t cpuStartTime
 Start time of run. More...
 
BDSEventActioneventAction
 Event action for updating information at start of run. More...
 
G4String trajectorySamplerID
 Copy of option. More...
 

Detailed Description

Control over the beginning and end of run actions.

Unlike the regular Geant4 run action we call a beginning of run action on the bunch distribution (when we know the number of events to run).

Definition at line 43 of file BDSRunAction.hh.

Constructor & Destructor Documentation

◆ BDSRunAction()

BDSRunAction::BDSRunAction ( BDSOutput outputIn,
BDSBunch bunchGeneratorIn,
G4bool  usingIonsIn,
BDSEventAction eventActionIn,
G4String  trajectorySamplerIDIn 
)

Definition at line 58 of file BDSRunAction.cc.

◆ ~BDSRunAction()

BDSRunAction::~BDSRunAction ( )
virtual

Definition at line 74 of file BDSRunAction.cc.

Member Function Documentation

◆ BeginOfRunAction()

void BDSRunAction::BeginOfRunAction ( const G4Run *  aRun)
virtual

Definition at line 79 of file BDSRunAction.cc.

◆ CheckTrajectoryOptions()

void BDSRunAction::CheckTrajectoryOptions ( ) const
private

Check whether various trajectory options that are geometry dependent make sense and warn if not. Done now because geometry is built before run.

Definition at line 213 of file BDSRunAction.cc.

References BDSAcceleratorModel::BeamlineMain(), BDSBeamline::GetTotalArcLength(), and BDSGlobalConstants::Instance().

Here is the call graph for this function:

◆ EndOfRunAction()

void BDSRunAction::EndOfRunAction ( const G4Run *  aRun)
virtual

Definition at line 135 of file BDSRunAction.cc.

◆ PrintAllProcessesForAllParticles()

void BDSRunAction::PrintAllProcessesForAllParticles ( ) const
private

Iterate over all particles and print out all process names for each. This is private as using at the wrong time will result in Geant4 crashing.

Definition at line 162 of file BDSRunAction.cc.

◆ SetTrajectorySamplerIDs()

void BDSRunAction::SetTrajectorySamplerIDs ( ) const
private

Access the sampler registry and find the integer sampler IDs for any samplers named in the trajectorySamplerID string. Do this at the beginning of a run and update event action because it should only happen once and it depends on the construction of the geometry being complete.

Definition at line 183 of file BDSRunAction.cc.

References eventAction, BDSSamplerRegistry::Instance(), BDSEventAction::SetSamplerIDsForTrajectories(), and trajectorySamplerID.

Here is the call graph for this function:

Field Documentation

◆ bunchGenerator

BDSBunch* BDSRunAction::bunchGenerator
private

Cache of bunch generator.

Definition at line 77 of file BDSRunAction.hh.

◆ cpuStartTime

std::clock_t BDSRunAction::cpuStartTime
private

Start time of run.

Definition at line 79 of file BDSRunAction.hh.

◆ eventAction

BDSEventAction* BDSRunAction::eventAction
private

Event action for updating information at start of run.

Definition at line 80 of file BDSRunAction.hh.

Referenced by SetTrajectorySamplerIDs().

◆ info

BDSEventInfo* BDSRunAction::info
private

Definition at line 76 of file BDSRunAction.hh.

◆ output

BDSOutput* BDSRunAction::output
private

Cache of output instance. Not owned by this class.

Definition at line 73 of file BDSRunAction.hh.

◆ seedStateAtStart

std::string BDSRunAction::seedStateAtStart
private

Seed state at start of the run.

Definition at line 75 of file BDSRunAction.hh.

◆ starttime

time_t BDSRunAction::starttime
private

Definition at line 74 of file BDSRunAction.hh.

◆ trajectorySamplerID

G4String BDSRunAction::trajectorySamplerID
private

Copy of option.

Definition at line 81 of file BDSRunAction.hh.

Referenced by SetTrajectorySamplerIDs().

◆ usingIons

const G4bool BDSRunAction::usingIons
private

Cache of whether ions are being used (for particle table writing out).

Definition at line 78 of file BDSRunAction.hh.


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