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

Factory for user specified accelerator components. More...

#include <BDSComponentFactoryUser.hh>

Collaboration diagram for BDSComponentFactoryUser:
Collaboration graph

Public Member Functions

void RegisterComponent (const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
 Register a constructor instance by a given name. More...
 
G4bool CanConstructComponentByName (const G4String &componentTypeName) const
 Check whether a component can be constructed - ie if the name exists. More...
 
BDSAcceleratorComponentConstructComponent (const G4String &componentTypeName, GMAD::Element const *elementIn, GMAD::Element const *prevElementIn, GMAD::Element const *nextElementIn, G4double currentArcLength=0)
 
void SetDesignParticle (const BDSParticleDefinition *designParticleIn)
 Update values for nominal rigidity and relativisitic beta of the beam particle. More...
 

Private Attributes

std::map< G4String, BDSComponentConstructor * > userFunctions
 Map of user component name with constructors to build a component. More...
 
const BDSParticleDefinitiondesignParticle
 Particle w.r.t. which elements are built. More...
 
G4double brho
 Cache of nominal beam rigidity. More...
 
G4double beta0
 Cache of nominal relativistic beta for the beam particle. More...
 

Detailed Description

Factory for user specified accelerator components.

Author
Laurie Nevay

Definition at line 60 of file BDSComponentFactoryUser.hh.

Constructor & Destructor Documentation

◆ BDSComponentFactoryUser()

BDSComponentFactoryUser::BDSComponentFactoryUser ( )

Definition at line 28 of file BDSComponentFactoryUser.cc.

◆ ~BDSComponentFactoryUser()

BDSComponentFactoryUser::~BDSComponentFactoryUser ( )

Definition at line 34 of file BDSComponentFactoryUser.cc.

Member Function Documentation

◆ CanConstructComponentByName()

G4bool BDSComponentFactoryUser::CanConstructComponentByName ( const G4String &  componentTypeName) const

Check whether a component can be constructed - ie if the name exists.

Definition at line 53 of file BDSComponentFactoryUser.cc.

References userFunctions.

Referenced by BDSComponentFactory::CreateComponent().

Here is the caller graph for this function:

◆ ConstructComponent()

BDSAcceleratorComponent * BDSComponentFactoryUser::ConstructComponent ( const G4String &  componentTypeName,
GMAD::Element const *  elementIn,
GMAD::Element const *  prevElementIn,
GMAD::Element const *  nextElementIn,
G4double  currentArcLength = 0 
)

Find and call the constructor. This assumes the name definitely exists otherwise an STL access exception will be thrown.

Definition at line 58 of file BDSComponentFactoryUser.cc.

References beta0, brho, and userFunctions.

Referenced by BDSComponentFactory::CreateComponent().

Here is the caller graph for this function:

◆ RegisterComponent()

void BDSComponentFactoryUser::RegisterComponent ( const G4String &  componentTypeName,
BDSComponentConstructor componentConstructor 
)

Register a constructor instance by a given name.

Definition at line 47 of file BDSComponentFactoryUser.cc.

References userFunctions.

Referenced by BDSIM::RegisterUserComponent().

Here is the caller graph for this function:

◆ SetDesignParticle()

void BDSComponentFactoryUser::SetDesignParticle ( const BDSParticleDefinition designParticleIn)

Update values for nominal rigidity and relativisitic beta of the beam particle.

Definition at line 40 of file BDSComponentFactoryUser.cc.

References BDSParticleDefinition::Beta(), beta0, brho, BDSParticleDefinition::BRho(), and designParticle.

Referenced by BDSDetectorConstruction::BuildBeamline().

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

Field Documentation

◆ beta0

G4double BDSComponentFactoryUser::beta0
private

Cache of nominal relativistic beta for the beam particle.

Definition at line 91 of file BDSComponentFactoryUser.hh.

Referenced by ConstructComponent(), and SetDesignParticle().

◆ brho

G4double BDSComponentFactoryUser::brho
private

Cache of nominal beam rigidity.

Definition at line 90 of file BDSComponentFactoryUser.hh.

Referenced by ConstructComponent(), and SetDesignParticle().

◆ designParticle

const BDSParticleDefinition* BDSComponentFactoryUser::designParticle
private

Particle w.r.t. which elements are built.

Definition at line 89 of file BDSComponentFactoryUser.hh.

Referenced by SetDesignParticle().

◆ userFunctions

std::map<G4String, BDSComponentConstructor*> BDSComponentFactoryUser::userFunctions
private

Map of user component name with constructors to build a component.

Definition at line 87 of file BDSComponentFactoryUser.hh.

Referenced by CanConstructComponentByName(), ConstructComponent(), and RegisterComponent().


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