BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private 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, G4bool batchMode)
 Bunch must have a valid particle definition (ie not nullptr).
 
virtual void GeneratePrimaries (G4Event *)
 Main interface for Geant4. Prepare primary(ies) for the event.
 
void SetWorldExtent (const BDSExtent worldExtentIn)
 Set the world extent that particle coordinates will be checked against.
 
void RegisterPTCOneTurnMap (BDSPTCOneTurnMap *otmIn)
 

Private Member Functions

void GeneratePrimariesFromFile (G4Event *anEvent)
 For a file-based event generator there are a few checks we have to do - put in a function to keep tidy.
 

Private Attributes

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

Detailed Description

Generates primary particle vertices using BDSBunch.

Definition at line 45 of file BDSPrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

◆ BDSPrimaryGeneratorAction()

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

◆ ~BDSPrimaryGeneratorAction()

BDSPrimaryGeneratorAction::~BDSPrimaryGeneratorAction ( )
virtual

Definition at line 88 of file BDSPrimaryGeneratorAction.cc.

Member Function Documentation

◆ GeneratePrimaries()

void BDSPrimaryGeneratorAction::GeneratePrimaries ( G4Event *  anEvent)
virtual

◆ GeneratePrimariesFromFile()

void BDSPrimaryGeneratorAction::GeneratePrimariesFromFile ( G4Event *  anEvent)
private

For a file-based event generator there are a few checks we have to do - put in a function to keep tidy.

Definition at line 218 of file BDSPrimaryGeneratorAction.cc.

References distrFileMatchLength, BDSPrimaryGeneratorFile::DistributionIsFinished(), BDSPrimaryGeneratorFile::GeneratePrimaryVertexSafe(), BDSGlobalConstants::Instance(), and BDSPrimaryGeneratorFile::NEventsReadThatPassedFilters().

Referenced by GeneratePrimaries().

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

◆ 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 61 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 58 of file BDSPrimaryGeneratorAction.hh.

References worldExtent.

Field Documentation

◆ bunch

BDSBunch* BDSPrimaryGeneratorAction::bunch
private

BDSIM particle generator.

Definition at line 68 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ distrFileMatchLength

G4bool BDSPrimaryGeneratorAction::distrFileMatchLength
private

Match external file length for event generator.

Definition at line 75 of file BDSPrimaryGeneratorAction.hh.

Referenced by GeneratePrimariesFromFile().

◆ eventOffset

G4int BDSPrimaryGeneratorAction::eventOffset
private

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

Definition at line 72 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ generatorFromFile

BDSPrimaryGeneratorFile* BDSPrimaryGeneratorAction::generatorFromFile
private

Definition at line 87 of file BDSPrimaryGeneratorAction.hh.

◆ 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 74 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and 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 67 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 71 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ recreateFile

BDSOutputLoader* BDSPrimaryGeneratorAction::recreateFile
private

Optional output handler for restoring seed state.

Definition at line 70 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().

◆ useASCIISeedState

G4bool BDSPrimaryGeneratorAction::useASCIISeedState
private

Whether to use the ascii seed state each time.

Definition at line 73 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 69 of file BDSPrimaryGeneratorAction.hh.

Referenced by BDSPrimaryGeneratorAction(), and GeneratePrimaries().


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