BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Factory for user specified accelerator components. More...
#include <BDSComponentFactoryUser.hh>
Public Member Functions | |
void | RegisterComponent (const G4String &componentTypeName, BDSComponentConstructor *componentConstructor) |
Register a constructor instance by a given name. | |
G4bool | CanConstructComponentByName (const G4String &componentTypeName) const |
Check whether a component can be constructed - ie if the name exists. | |
BDSAcceleratorComponent * | ConstructComponent (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. | |
Private Attributes | |
std::map< G4String, BDSComponentConstructor * > | userFunctions |
Map of user component name with constructors to build a component. | |
const BDSParticleDefinition * | designParticle |
Particle w.r.t. which elements are built. | |
G4double | brho |
Cache of nominal beam rigidity. | |
G4double | beta0 |
Cache of nominal relativistic beta for the beam particle. | |
Factory for user specified accelerator components.
Definition at line 60 of file BDSComponentFactoryUser.hh.
BDSComponentFactoryUser::BDSComponentFactoryUser | ( | ) |
Definition at line 28 of file BDSComponentFactoryUser.cc.
BDSComponentFactoryUser::~BDSComponentFactoryUser | ( | ) |
Definition at line 34 of file BDSComponentFactoryUser.cc.
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().
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().
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().
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().
|
private |
Cache of nominal relativistic beta for the beam particle.
Definition at line 91 of file BDSComponentFactoryUser.hh.
Referenced by ConstructComponent(), and SetDesignParticle().
|
private |
Cache of nominal beam rigidity.
Definition at line 90 of file BDSComponentFactoryUser.hh.
Referenced by ConstructComponent(), and SetDesignParticle().
|
private |
Particle w.r.t. which elements are built.
Definition at line 89 of file BDSComponentFactoryUser.hh.
Referenced by SetDesignParticle().
|
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().