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

Generates primary particle vertices using BDSBunch. More...

#include <BDSPrimaryGeneratorAction.hh>

Inheritance diagram for BDSPrimaryGeneratorAction:
Inheritance graph
Collaboration diagram for BDSPrimaryGeneratorAction:
Collaboration graph

Public Member Functions

 BDSPrimaryGeneratorAction (BDSBunch *bunchIn, const GMAD::Beam &beam)
 Bunch must have a valid particle definition (ie not nullptr). More...
 
virtual void GeneratePrimaries (G4Event *)
 Main interface for Geant4. Prepare primary(ies) for the event. More...
 
void SetWorldExtent (const BDSExtent worldExtentIn)
 Set the world extent that particle coordinates will be checked against. More...
 
void RegisterPTCOneTurnMap (BDSPTCOneTurnMap *otmIn)
 

Private Attributes

G4ParticleGun * particleGun
 Geant4 particle gun that creates single particles. More...
 
BDSBunchbunch
 BDSIM particle generator.
More...
 
G4bool writeASCIISeedState
 Cache of whether to write seed state as ASCII per event. More...
 
BDSOutputLoaderrecreateFile
 Optional output handler for restoring seed state. More...
 
G4bool recreate
 Whether to load seed state at start of event from rootevent file. More...
 
G4int eventOffset
 The offset in the file to read events from when setting the seed. More...
 
G4bool useASCIISeedState
 Whether to use the ascii seed state each time. More...
 
G4bool ionPrimary
 The primary particle will be an ion. More...
 
G4bool useEventGeneratorFile
 Whether to use event generator file. More...
 
G4bool useSamplerLoader
 Whether to use a sampler loader. More...
 
BDSExtent worldExtent
 World extent that particle coordinates are checked against to ensure they're inside it. More...
 
G4bool ionCached
 
BDSPTCOneTurnMaponeTurnMap
 Cached OTM for setting first turn primary coords. More...
 
BDSHepMC3ReaderhepMC3Reader
 Event generator file loader. More...
 
BDSROOTSamplerReadersamplerReader
 

Detailed Description

Generates primary particle vertices using BDSBunch.

Definition at line 48 of file BDSPrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

◆ BDSPrimaryGeneratorAction()

BDSPrimaryGeneratorAction::BDSPrimaryGeneratorAction ( BDSBunch bunchIn,
const GMAD::Beam beam 
)

◆ ~BDSPrimaryGeneratorAction()

BDSPrimaryGeneratorAction::~BDSPrimaryGeneratorAction ( )
virtual

Definition at line 120 of file BDSPrimaryGeneratorAction.cc.

Member Function Documentation

◆ GeneratePrimaries()

void BDSPrimaryGeneratorAction::GeneratePrimaries ( G4Event *  anEvent)
virtual

◆ RegisterPTCOneTurnMap()

void BDSPrimaryGeneratorAction::RegisterPTCOneTurnMap ( BDSPTCOneTurnMap otmIn)
inline

Register a PTC map instance used in the teleporter which this class will set initial (first turn) primary coordinates for.

Definition at line 63 of file BDSPrimaryGeneratorAction.hh.

References oneTurnMap.

Referenced by BDSFieldFactory::CreateTeleporter().

Here is the caller graph for this function:

◆ SetWorldExtent()

void BDSPrimaryGeneratorAction::SetWorldExtent ( const BDSExtent  worldExtentIn)
inline

Set the world extent that particle coordinates will be checked against.

Definition at line 60 of file BDSPrimaryGeneratorAction.hh.

References worldExtent.

Field Documentation

◆ bunch

BDSBunch* BDSPrimaryGeneratorAction::bunch
private

BDSIM particle generator.

Definition at line 67 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ eventOffset

G4int BDSPrimaryGeneratorAction::eventOffset
private

The offset in the file to read events from when setting the seed.

Definition at line 71 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ hepMC3Reader

BDSHepMC3Reader* BDSPrimaryGeneratorAction::hepMC3Reader
private

Event generator file loader.

Definition at line 89 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ ionCached

G4bool BDSPrimaryGeneratorAction::ionCached
private

Can only get a G4ParticleDefinition for an ion when primary generator is called so cache the first time. This is the flag of that cache.

Definition at line 82 of file BDSPrimaryGeneratorAction.hh.

Referenced by GeneratePrimaries().

◆ ionPrimary

G4bool BDSPrimaryGeneratorAction::ionPrimary
private

The primary particle will be an ion.

Definition at line 73 of file BDSPrimaryGeneratorAction.hh.

Referenced by GeneratePrimaries().

◆ oneTurnMap

BDSPTCOneTurnMap* BDSPrimaryGeneratorAction::oneTurnMap
private

Cached OTM for setting first turn primary coords.

Definition at line 85 of file BDSPrimaryGeneratorAction.hh.

Referenced by GeneratePrimaries(), and RegisterPTCOneTurnMap().

◆ particleGun

G4ParticleGun* BDSPrimaryGeneratorAction::particleGun
private

Geant4 particle gun that creates single particles.

Definition at line 66 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ recreate

G4bool BDSPrimaryGeneratorAction::recreate
private

Whether to load seed state at start of event from rootevent file.

Definition at line 70 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ recreateFile

BDSOutputLoader* BDSPrimaryGeneratorAction::recreateFile
private

Optional output handler for restoring seed state.

Definition at line 69 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ samplerReader

BDSROOTSamplerReader* BDSPrimaryGeneratorAction::samplerReader
private

Definition at line 91 of file BDSPrimaryGeneratorAction.hh.

◆ useASCIISeedState

G4bool BDSPrimaryGeneratorAction::useASCIISeedState
private

Whether to use the ascii seed state each time.

Definition at line 72 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ useEventGeneratorFile

G4bool BDSPrimaryGeneratorAction::useEventGeneratorFile
private

Whether to use event generator file.

Definition at line 74 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ useSamplerLoader

G4bool BDSPrimaryGeneratorAction::useSamplerLoader
private

Whether to use a sampler loader.

Definition at line 75 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ worldExtent

BDSExtent BDSPrimaryGeneratorAction::worldExtent
private

World extent that particle coordinates are checked against to ensure they're inside it.

Definition at line 78 of file BDSPrimaryGeneratorAction.hh.

Referenced by GeneratePrimaries(), and SetWorldExtent().

◆ writeASCIISeedState

G4bool BDSPrimaryGeneratorAction::writeASCIISeedState
private

Cache of whether to write seed state as ASCII per event.

Definition at line 68 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().


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