19#include "BDSComponentConstructor.hh"
20#include "BDSComponentFactoryUser.hh"
21#include "BDSParticleDefinition.hh"
28BDSComponentFactoryUser::BDSComponentFactoryUser():
29 designParticle(nullptr),
34BDSComponentFactoryUser::~BDSComponentFactoryUser()
37 {
delete constructor.second;}
62 G4double currentArcLengthIn)
Abstract class that represents a component of an accelerator.
Interface class the developer should derive to construct their element.
const BDSParticleDefinition * designParticle
Particle w.r.t. which elements are built.
G4bool CanConstructComponentByName(const G4String &componentTypeName) const
Check whether a component can be constructed - ie if the name exists.
void RegisterComponent(const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
Register a constructor instance by a given name.
G4double brho
Cache of nominal beam rigidity.
std::map< G4String, BDSComponentConstructor * > userFunctions
Map of user component name with constructors to build a component.
void SetDesignParticle(const BDSParticleDefinition *designParticleIn)
Update values for nominal rigidity and relativisitic beta of the beam particle.
G4double beta0
Cache of nominal relativistic beta for the beam particle.
BDSAcceleratorComponent * ConstructComponent(const G4String &componentTypeName, GMAD::Element const *elementIn, GMAD::Element const *prevElementIn, GMAD::Element const *nextElementIn, G4double currentArcLength=0)
Wrapper for particle definition.
G4double BRho() const
Accessor.
G4double Beta() const
Accessor.