BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
BDSComponentFactory Class Reference

Factory to produce all types of BDSAcceleratorComponents. More...

#include <BDSComponentFactory.hh>

Collaboration diagram for BDSComponentFactory:
Collaboration graph

Public Member Functions

 BDSComponentFactory (BDSComponentFactoryUser *userComponentFactoryIn=nullptr, G4bool usualPrintOut=true)
 
BDSAcceleratorComponentCreateComponent (GMAD::Element const *elementIn, GMAD::Element const *prevElementIn, GMAD::Element const *nextElementIn, BDSBeamlineIntegral &integral)
 
BDSAcceleratorComponentCreateTerminator (G4double witdth)
 
BDSAcceleratorComponentCreateTeleporter (const G4double teleporterLength, const G4double teleporterWidth, const G4Transform3D &transformIn)
 
BDSCrystalInfoPrepareCrystalInfo (const G4String &crystalName) const
 

Static Public Member Functions

static BDSTiltOffsetCreateTiltOffset (GMAD::Element const *el)
 Create the tilt and offset information object by inspecting the parser element.
 
static G4Transform3D CreateFieldTransform (const BDSTiltOffset *tiltOffset)
 Create a transform from a tilt offset. If nullptr, returns identity transform.
 
static G4Transform3D CreateFieldTransform (GMAD::Element const *el)
 
static BDSBeamPipeInfoPrepareBeamPipeInfo (GMAD::Element const *el, const G4ThreeVector &inputFaceNormal=G4ThreeVector(0, 0,-1), const G4ThreeVector &outputFaceNormal=G4ThreeVector(0, 0, 1))
 
static BDSBeamPipeInfoPrepareBeamPipeInfo (GMAD::Element const *el, G4double angleIn, G4double angleOut)
 
static G4bool YokeOnLeft (const GMAD::Element *el, const BDSMagnetStrength *st)
 
static G4double PrepareHorizontalWidth (GMAD::Element const *el, G4double defaultHorizontalWidth=-1)
 Prepare the element horizontal width in Geant4 units - if not set, use the global default.
 
static G4double ScalingFieldOuter (const GMAD::Element *ele)
 Get the scaling factor for a particular outer field depending on the global and individual setting.
 
static BDSFieldInfoPrepareMagnetOuterFieldInfo (const BDSMagnetStrength *vacuumSt, const BDSFieldType &fieldType, const BDSBeamPipeInfo *bpInfo, const BDSMagnetOuterInfo *outerInfo, const G4Transform3D &fieldTransform, const BDSIntegratorSet *integratorSetIn, G4double brhoIn, G4double outerFieldScaling=1.0, BDSModulatorInfo *modulatorInfo=nullptr)
 Prepare the field definition for the yoke of a magnet.
 
static BDSMagnetOuterInfoPrepareMagnetOuterInfo (const G4String &elementNameIn, const GMAD::Element *el, const BDSMagnetStrength *st, const BDSBeamPipeInfo *beamPipe, G4double defaultHorizontalWidth=-1, G4double defaultVHRatio=1.0, G4double defaultCoilWidthFraction=-1, G4double defaultCoilHeightFraction=-1)
 
static BDSMagnetGeometryType MagnetGeometryType (const GMAD::Element *el)
 
static BDSMagnetOuterInfoPrepareMagnetOuterInfo (const G4String &elementNameIn, const GMAD::Element *el, const G4double angleIn, const G4double angleOut, const BDSBeamPipeInfo *beamPipe, const G4bool yokeOnLeft=false, G4double defaultHorizontalWidth=-1, G4double defaultVHRatio=-1, G4double defaultCoilWidthFraction=-1, G4double defaultCoilHeightFraction=-1)
 
static G4Colour * PrepareColour (GMAD::Element const *element, const G4Material *material=nullptr)
 
static G4Material * PrepareMaterial (GMAD::Element const *element, const G4String &defaultMaterialName)
 Checks if a material is named in Element::material, else uses the supplied default.
 
static G4Material * PrepareMaterial (GMAD::Element const *element)
 Try and get a material and exit if no such material.
 
static G4Material * PrepareTipMaterial (GMAD::Element const *element, const G4String &defaultMaterialName)
 Checks if a material is named in Element::tipMaterial, else uses the supplied default.
 
static G4Material * PrepareTipMaterial (GMAD::Element const *element)
 Try and get a tipmaterial and exit if no such material.
 
static void CheckBendLengthAngleWidthCombo (G4double arcLength, G4double angle, G4double horizontalWidth, const G4String &name="not given")
 
static void PoleFaceRotationsNotTooLarge (const GMAD::Element *el, G4double maxAngle=0.5 *CLHEP::halfpi)
 Check whether the pole face rotation angles are too big for practical construction.
 
static G4double EFieldFromElement (GMAD::Element const *el, BDSFieldType fieldType, G4double cavityLength, const BDSParticleDefinition &incomingParticle)
 
static void CalculateAngleAndFieldRBend (const GMAD::Element *el, G4double brhoIn, G4double &arcLength, G4double &chordLength, G4double &field, G4double &angle)
 

Private Types

enum class  KickerType { horizontal , vertical , general }
 Private enum for kicker types. More...
 
enum class  RFFieldDirection { x , y , z }
 Private enum for RF cavity principle accelerating direction. More...
 

Private Member Functions

 BDSComponentFactory ()=delete
 No default constructor.
 
void SetBeta0 (BDSMagnetStrength *stIn) const
 Simple setter used to add Beta0 to a strength instance.
 
G4double BRho () const
 Simple accessor to simplify repetitive code.
 
BDSAcceleratorComponentCreateDrift (G4double angleIn, G4double angleOut)
 
BDSAcceleratorComponentCreateRF (RFFieldDirection direction)
 
BDSAcceleratorComponentCreateSBend ()
 
BDSAcceleratorComponentCreateRBend ()
 
BDSAcceleratorComponentCreateKicker (KickerType type)
 
BDSAcceleratorComponentCreateQuad ()
 
BDSAcceleratorComponentCreateSextupole ()
 
BDSAcceleratorComponentCreateOctupole ()
 
BDSAcceleratorComponentCreateDecapole ()
 
BDSAcceleratorComponentCreateMultipole ()
 
BDSAcceleratorComponentCreateThinMultipole (G4double angleIn)
 
BDSAcceleratorComponentCreateElement ()
 
BDSAcceleratorComponentCreateSolenoid ()
 
BDSAcceleratorComponentCreateParallelTransporter ()
 
BDSAcceleratorComponentCreateRectangularCollimator ()
 
BDSAcceleratorComponentCreateBeamMaskCollimator ()
 
BDSAcceleratorComponentCreateGasCapillary ()
 
BDSAcceleratorComponentCreateGasJet ()
 
BDSAcceleratorComponentCreateTarget ()
 
BDSAcceleratorComponentCreateEllipticalCollimator ()
 
BDSAcceleratorComponentCreateJawCollimator ()
 
BDSAcceleratorComponentCreateTipJawCollimator ()
 
BDSAcceleratorComponentCreateMuonCooler ()
 
BDSAcceleratorComponentCreateMuonSpoiler ()
 
BDSAcceleratorComponentCreateShield ()
 
BDSAcceleratorComponentCreateDegrader ()
 
BDSAcceleratorComponentCreateGap ()
 
BDSAcceleratorComponentCreateCrystalCollimator ()
 
BDSAcceleratorComponentCreateLaser ()
 
BDSAcceleratorComponentCreateScreen ()
 
BDSAcceleratorComponentCreateTransform3D ()
 
BDSAcceleratorComponentCreateWireScanner ()
 
BDSAcceleratorComponentCreateRMatrix ()
 
BDSAcceleratorComponentCreateThinRMatrix (G4double angleIn, const G4String &name)
 
BDSAcceleratorComponentCreateThinRMatrix (G4double angleIn, BDSMagnetStrength *stIn, const G4String &name, BDSIntegratorType intType=BDSIntegratorType::rmatrixthin, BDSFieldType fieldType=BDSFieldType::rmatrix, G4double beamPipeRadius=0, BDSModulatorInfo *fieldModulator=nullptr)
 
BDSAcceleratorComponentCreateUndulator ()
 
BDSAcceleratorComponentCreateDump ()
 
BDSAcceleratorComponentCreateLaserwire (G4double currentArcLength)
 
BDSAcceleratorComponentCreateCT ()
 
BDSAcceleratorComponentCreateCavityFringe (G4double angleIn, BDSMagnetStrength *stIn, const G4String &name, G4double irisRadius, BDSModulatorInfo *fieldModulator=nullptr)
 
BDSAcceleratorComponentCreateGaborLens ()
 
BDSAcceleratorComponentCreateAwakeScreen ()
 
BDSAcceleratorComponentCreateAwakeSpectrometer ()
 
BDSMagnetCreateMagnet (const GMAD::Element *el, BDSMagnetStrength *st, BDSFieldType fieldType, BDSMagnetType magnetType, G4double angle=0.0, const G4String &nameSuffix="") const
 Helper method for common magnet construction.
 
G4bool HasSufficientMinimumLength (GMAD::Element const *el, G4bool printWarning=true)
 Test the component length is sufficient for practical construction.
 
G4Material * PrepareVacuumMaterial (GMAD::Element const *el) const
 Prepare the vacuum material from the element or resort to default in options.
 
void PrepareCavityModels ()
 
void PrepareColours ()
 Prepare all colours defined in the parser.
 
void PrepareCrystals ()
 Prepare all crystals in defined the parser.
 
void PrepareLasers ()
 Prepare all lasers defined in the parser.
 
BDSLaserPrepareLaser (GMAD::Element const *el) const
 
BDSCavityInfoPrepareCavityModelInfo (GMAD::Element const *el, G4double frequency) const
 
BDSCavityInfoPrepareCavityModelInfoForElement (GMAD::Element const *el, G4double frequency) const
 
BDSMagnetStrengthPrepareCavityStrength (GMAD::Element const *el, BDSFieldType fieldType, G4double cavityLength, BDSMagnetStrength *&fringeIn, BDSMagnetStrength *&fringeOut) const
 
void SetFieldDefinitions (GMAD::Element const *el, BDSAcceleratorComponent *component) const
 
void SetModulatorDefinition (GMAD::Element const *el, BDSFieldInfo *info) const
 
BDSMagnetStrengthPrepareMagnetStrengthForMultipoles (GMAD::Element const *el) const
 Prepare magnet strength for multipoles.
 
BDSMagnetStrengthPrepareMagnetStrengthForRMatrix (GMAD::Element const *el) const
 Prepare magnet strength for rmatrix.
 
G4double FieldFromAngle (const G4double angle, const G4double arcLength) const
 
G4double AngleFromField (const G4double field, const G4double arcLength) const
 
void CalculateAngleAndFieldSBend (GMAD::Element const *el, G4double &angle, G4double &field) const
 
G4double BendAngle (const GMAD::Element *el) const
 Calculate the angle of a bend whether it's an rbend or an sbend.
 
G4double OutgoingFaceAngle (const GMAD::Element *el) const
 
G4double IncomingFaceAngle (const GMAD::Element *el) const
 
BDSModulatorInfoModulatorDefinition (const GMAD::Element *el, G4bool inDevelopment=false) const
 
void INDEVELOPMENTERROR () const
 TBC - remove when modulators are implemented fully.
 
void GetKickValue (G4double &hkick, G4double &vkick, const KickerType type) const
 
void CalculateGaborLensStrength (BDSMagnetStrength *st) const
 Calculate the electric field strength of the confined plasma in a Gabor lens.
 

Private Attributes

BDSComponentFactoryUseruserComponentFactory
 User component factory if any.
 
G4double lengthSafety
 Length safety from global constants.
 
G4double thinElementLength
 Length of a thin element.
 
G4bool includeFringeFields
 Cache of whether to include fringe fields.
 
G4bool yokeFields
 Cache of whether to include yoke magnetic fields.
 
BDSModulatorInfodefaultModulator
 Default modulator for all components.
 
BDSBeamlineIntegralintegralUpToThisComponent
 To save passing it through many functions arguments.
 
G4double synchronousTAtMiddleOfThisComponent
 
GMAD::Element const * element = nullptr
 element for storing instead of passing around
 
GMAD::Element const * prevElement = nullptr
 element access to previous element (can be nullptr)
 
GMAD::Element const * nextElement = nullptr
 element access to previous element (can be nullptr)
 
std::map< G4String, BDSCavityInfo * > cavityInfos
 Map of cavity model info instances by name.
 
std::map< G4String, BDSCrystalInfo * > crystalInfos
 Maps of crystal info instances by name.
 
std::map< G4String, BDSLaser * > lasers
 Map of laser instances by name. Owned by this class.
 
const BDSIntegratorSetintegratorSet
 Local copy of reference to integrator set to use.
 
const BDSIntegratorSetType integratorSetType
 Local copy of enum of the integrator set, i.e. which one it is specifically.
 
std::map< G4String, G4int > modifiedElements
 
G4String elementName
 Variable used to pass around the possibly modified name of an element.
 

Static Private Attributes

static G4bool coloursInitialised = false
 

Detailed Description

Factory to produce all types of BDSAcceleratorComponents.

Creates from a parser Element the appropriate object (that inherits BDSAcceleratorComponent) and returns it. Will return nullptr if invalid type or nothing to be constructed for that particular type. Calculations on field strength and angle as well as basic parameter validity (minimum length) are done here.

The main interface requires both a previous and next GMAD::Element that the element is constructed with respect to. This is so that drifts can be matched to the faces of bends with pole face rotations etc. If required in future, a simple interface for a single element could be added that uses this one with nullptrs.

Functions for common functionality, checks and preparation of recipe classes are provided publicly (and statically) for use elsewhere.

Definition at line 78 of file BDSComponentFactory.hh.

Member Enumeration Documentation

◆ KickerType

enum class BDSComponentFactory::KickerType
strongprivate

Private enum for kicker types.

Definition at line 260 of file BDSComponentFactory.hh.

◆ RFFieldDirection

enum class BDSComponentFactory::RFFieldDirection
strongprivate

Private enum for RF cavity principle accelerating direction.

Definition at line 263 of file BDSComponentFactory.hh.

Constructor & Destructor Documentation

◆ BDSComponentFactory()

BDSComponentFactory::BDSComponentFactory ( BDSComponentFactoryUser userComponentFactoryIn = nullptr,
G4bool  usualPrintOut = true 
)
explicit

Definition at line 126 of file BDSComponentFactory.cc.

◆ ~BDSComponentFactory()

BDSComponentFactory::~BDSComponentFactory ( )

Definition at line 151 of file BDSComponentFactory.cc.

Member Function Documentation

◆ AngleFromField()

G4double BDSComponentFactory::AngleFromField ( const G4double  field,
const G4double  arcLength 
) const
private

Calculate the angle through a length of field - uses member rigidity and charge. Length & field in g4 m / tesla units

Definition at line 3255 of file BDSComponentFactory.cc.

References BRho(), and BDS::IsFinite().

Referenced by CalculateAngleAndFieldSBend().

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

◆ BendAngle()

G4double BDSComponentFactory::BendAngle ( const GMAD::Element el) const
private

Calculate the angle of a bend whether it's an rbend or an sbend.

Definition at line 3293 of file BDSComponentFactory.cc.

References GMAD::Element::angle, BRho(), CalculateAngleAndFieldRBend(), CalculateAngleAndFieldSBend(), and GMAD::Element::type.

Referenced by IncomingFaceAngle(), and OutgoingFaceAngle().

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

◆ BRho()

G4double BDSComponentFactory::BRho ( ) const
inlineprivate

Simple accessor to simplify repetitive code.

Definition at line 250 of file BDSComponentFactory.hh.

References BDSParticleDefinition::BRho(), and integralUpToThisComponent.

Referenced by AngleFromField(), BendAngle(), CreateMagnet(), CreateTeleporter(), and FieldFromAngle().

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

◆ CalculateAngleAndFieldRBend()

void BDSComponentFactory::CalculateAngleAndFieldRBend ( const GMAD::Element el,
G4double  brhoIn,
G4double &  arcLength,
G4double &  chordLength,
G4double &  field,
G4double &  angle 
)
static

Calculate the field and angle of an rbend from information in the element noting the 'l' in an element is the chord length of an rbend. Variables passed by reference and are updated as output. Note, this uses the MADX convention of +ve angle -> deflection in -ve x.

Definition at line 2945 of file BDSComponentFactory.cc.

References GMAD::Element::angle, GMAD::Element::angleSet, GMAD::Element::B, BDS::IsFinite(), and GMAD::Element::l.

Referenced by BendAngle(), and BDSBeamlineIntegral::Integrate().

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

◆ CalculateAngleAndFieldSBend()

void BDSComponentFactory::CalculateAngleAndFieldSBend ( GMAD::Element const *  el,
G4double &  angle,
G4double &  field 
) const
private

Calculate field and angle of a sector bend. Note, this uses the MADX convention of +ve angle -> deflection in -ve x.

Definition at line 3264 of file BDSComponentFactory.cc.

References GMAD::Element::angle, AngleFromField(), GMAD::Element::angleSet, GMAD::Element::B, FieldFromAngle(), BDSGlobalConstants::Instance(), BDS::IsFinite(), and GMAD::Element::l.

Referenced by BendAngle().

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

◆ CalculateGaborLensStrength()

void BDSComponentFactory::CalculateGaborLensStrength ( BDSMagnetStrength st) const
private

Calculate the electric field strength of the confined plasma in a Gabor lens.

Definition at line 3420 of file BDSComponentFactory.cc.

References GMAD::Element::anodeRadius, GMAD::Element::B, element, elementName, BDSParticleDefinition::Gamma(), integralUpToThisComponent, BDS::IsFinite(), GMAD::Element::kg, BDSParticleDefinition::Mass(), BDSParticleDefinition::Momentum(), and GMAD::Element::scaling.

Here is the call graph for this function:

◆ CheckBendLengthAngleWidthCombo()

void BDSComponentFactory::CheckBendLengthAngleWidthCombo ( G4double  arcLength,
G4double  angle,
G4double  horizontalWidth,
const G4String &  name = "not given" 
)
static

Utility function to check if the combination of horizontal width, angle and length will result in overlapping entrance and exit faces and therefore whether to abort.

Definition at line 2657 of file BDSComponentFactory.cc.

Referenced by BDS::BuildSBendLine().

Here is the caller graph for this function:

◆ CreateAwakeScreen()

BDSAcceleratorComponent * BDSComponentFactory::CreateAwakeScreen ( )
private

Definition at line 1990 of file BDSComponentFactory.cc.

◆ CreateAwakeSpectrometer()

BDSAcceleratorComponent * BDSComponentFactory::CreateAwakeSpectrometer ( )
private

Definition at line 2001 of file BDSComponentFactory.cc.

◆ CreateBeamMaskCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateBeamMaskCollimator ( )
private

Definition at line 1487 of file BDSComponentFactory.cc.

◆ CreateCavityFringe()

BDSAcceleratorComponent * BDSComponentFactory::CreateCavityFringe ( G4double  angleIn,
BDSMagnetStrength stIn,
const G4String &  name,
G4double  irisRadius,
BDSModulatorInfo fieldModulator = nullptr 
)
private

Definition at line 2161 of file BDSComponentFactory.cc.

◆ CreateComponent()

BDSAcceleratorComponent * BDSComponentFactory::CreateComponent ( GMAD::Element const *  elementIn,
GMAD::Element const *  prevElementIn,
GMAD::Element const *  nextElementIn,
BDSBeamlineIntegral integral 
)

Create component from parser Element pointers to next and previous Element are used to ensure the component will fit and may optionally be made to be so in the case of a drift. The optional last argument is the current s position at the end of the beam line for components that are distance or phase dependent such as an RF cavity.

Definition at line 171 of file BDSComponentFactory.cc.

References GMAD::Element::biasMaterialList, GMAD::Element::biasMaterialLVList, GMAD::Element::biasVacuumList, BDSParticleDefinition::BRho(), BDSComponentFactoryUser::CanConstructComponentByName(), BDSComponentFactoryUser::ConstructComponent(), element, elementName, BDSAcceleratorComponentRegistry::GetComponent(), HasSufficientMinimumLength(), includeFringeFields, IncomingFaceAngle(), BDSAcceleratorComponent::Initialise(), BDSAcceleratorComponentRegistry::Instance(), BDSGlobalConstants::Instance(), integralUpToThisComponent, BDSBeamlineIntegral::Integrate(), BDS::IsFinite(), GMAD::Element::l, GMAD::Element::minimumKineticEnergy, modifiedElements, nextElement, OutgoingFaceAngle(), prevElement, BDSBeamlineIntegral::ProvideSynchronousTAtCentreOfNextElement(), GMAD::Element::region, BDSAcceleratorComponentRegistry::RegisterComponent(), BDSBeamlineIntegral::rigidityCount, BDSAcceleratorComponent::SetBiasMaterialList(), BDSAcceleratorComponent::SetBiasMaterialLVList(), BDSAcceleratorComponent::SetBiasVacuumList(), SetFieldDefinitions(), BDSAcceleratorComponent::SetMinimumKineticEnergy(), BDSAcceleratorComponent::SetRegion(), GMAD::Element::type, userComponentFactory, and GMAD::Element::userTypeName.

Referenced by BDSDetectorConstruction::BuildBeamline(), and BDS::BuildPlacementGeometry().

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

◆ CreateCrystalCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateCrystalCollimator ( )
private

Definition at line 1879 of file BDSComponentFactory.cc.

◆ CreateCT()

BDSAcceleratorComponent * BDSComponentFactory::CreateCT ( )
private

Definition at line 1855 of file BDSComponentFactory.cc.

◆ CreateDecapole()

BDSAcceleratorComponent * BDSComponentFactory::CreateDecapole ( )
private

Definition at line 1236 of file BDSComponentFactory.cc.

◆ CreateDegrader()

BDSAcceleratorComponent * BDSComponentFactory::CreateDegrader ( )
private

Definition at line 1717 of file BDSComponentFactory.cc.

◆ CreateDrift()

BDSAcceleratorComponent * BDSComponentFactory::CreateDrift ( G4double  angleIn,
G4double  angleOut 
)
private

Definition at line 536 of file BDSComponentFactory.cc.

◆ CreateDump()

BDSAcceleratorComponent * BDSComponentFactory::CreateDump ( )
private

Definition at line 1831 of file BDSComponentFactory.cc.

◆ CreateElement()

BDSAcceleratorComponent * BDSComponentFactory::CreateElement ( )
private

Definition at line 1294 of file BDSComponentFactory.cc.

◆ CreateEllipticalCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateEllipticalCollimator ( )
private

Definition at line 1574 of file BDSComponentFactory.cc.

◆ CreateFieldTransform() [1/2]

G4Transform3D BDSComponentFactory::CreateFieldTransform ( const BDSTiltOffset tiltOffset)
static

Create a transform from a tilt offset. If nullptr, returns identity transform.

Definition at line 2644 of file BDSComponentFactory.cc.

References BDSTiltOffset::Transform3D().

Referenced by BDS::BuildDipoleFringe(), BDS::BuildRBendLine(), BDS::BuildSBendLine(), BDS::BuildSingleSBend(), CreateFieldTransform(), CreateMagnet(), and SetFieldDefinitions().

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

◆ CreateFieldTransform() [2/2]

G4Transform3D BDSComponentFactory::CreateFieldTransform ( GMAD::Element const *  el)
static

Create a transform for the field for a given element to account for the difference from the curvilinear coordinates for the tilt and offset of the magnet.

Definition at line 2649 of file BDSComponentFactory.cc.

References CreateFieldTransform(), and CreateTiltOffset().

Here is the call graph for this function:

◆ CreateGaborLens()

BDSAcceleratorComponent * BDSComponentFactory::CreateGaborLens ( )
private

Definition at line 2173 of file BDSComponentFactory.cc.

◆ CreateGap()

BDSAcceleratorComponent * BDSComponentFactory::CreateGap ( )
private

Definition at line 1869 of file BDSComponentFactory.cc.

◆ CreateGasCapillary()

BDSAcceleratorComponent * BDSComponentFactory::CreateGasCapillary ( )
private

Definition at line 1514 of file BDSComponentFactory.cc.

◆ CreateGasJet()

BDSAcceleratorComponent * BDSComponentFactory::CreateGasJet ( )
private

Definition at line 1538 of file BDSComponentFactory.cc.

◆ CreateJawCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateJawCollimator ( )
private

Definition at line 1597 of file BDSComponentFactory.cc.

◆ CreateKicker()

BDSAcceleratorComponent * BDSComponentFactory::CreateKicker ( KickerType  type)
private

Definition at line 882 of file BDSComponentFactory.cc.

◆ CreateLaser()

BDSAcceleratorComponent * BDSComponentFactory::CreateLaser ( )
private

Definition at line 1925 of file BDSComponentFactory.cc.

◆ CreateLaserwire()

BDSAcceleratorComponent * BDSComponentFactory::CreateLaserwire ( G4double  currentArcLength)
private

Definition at line 2237 of file BDSComponentFactory.cc.

◆ CreateMagnet()

BDSMagnet * BDSComponentFactory::CreateMagnet ( const GMAD::Element el,
BDSMagnetStrength st,
BDSFieldType  fieldType,
BDSMagnetType  magnetType,
G4double  angle = 0.0,
const G4String &  nameSuffix = "" 
) const
private

◆ CreateMultipole()

BDSAcceleratorComponent * BDSComponentFactory::CreateMultipole ( )
private

Definition at line 1247 of file BDSComponentFactory.cc.

◆ CreateMuonCooler()

BDSAcceleratorComponent * BDSComponentFactory::CreateMuonCooler ( )
private

Definition at line 1680 of file BDSComponentFactory.cc.

◆ CreateMuonSpoiler()

BDSAcceleratorComponent * BDSComponentFactory::CreateMuonSpoiler ( )
private

Definition at line 1643 of file BDSComponentFactory.cc.

◆ CreateOctupole()

BDSAcceleratorComponent * BDSComponentFactory::CreateOctupole ( )
private

Definition at line 1225 of file BDSComponentFactory.cc.

◆ CreateParallelTransporter()

BDSAcceleratorComponent * BDSComponentFactory::CreateParallelTransporter ( )
private

Definition at line 1459 of file BDSComponentFactory.cc.

◆ CreateQuad()

BDSAcceleratorComponent * BDSComponentFactory::CreateQuad ( )
private

Definition at line 1203 of file BDSComponentFactory.cc.

◆ CreateRBend()

BDSAcceleratorComponent * BDSComponentFactory::CreateRBend ( )
private

Definition at line 789 of file BDSComponentFactory.cc.

◆ CreateRectangularCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateRectangularCollimator ( )
private

Definition at line 1465 of file BDSComponentFactory.cc.

◆ CreateRF()

BDSAcceleratorComponent * BDSComponentFactory::CreateRF ( RFFieldDirection  direction)
private

Definition at line 585 of file BDSComponentFactory.cc.

◆ CreateRMatrix()

BDSAcceleratorComponent * BDSComponentFactory::CreateRMatrix ( )
private

Definition at line 2079 of file BDSComponentFactory.cc.

◆ CreateSBend()

BDSAcceleratorComponent * BDSComponentFactory::CreateSBend ( )
private

Definition at line 748 of file BDSComponentFactory.cc.

◆ CreateScreen()

BDSAcceleratorComponent * BDSComponentFactory::CreateScreen ( )
private

Definition at line 1940 of file BDSComponentFactory.cc.

◆ CreateSextupole()

BDSAcceleratorComponent * BDSComponentFactory::CreateSextupole ( )
private

Definition at line 1214 of file BDSComponentFactory.cc.

◆ CreateShield()

BDSAcceleratorComponent * BDSComponentFactory::CreateShield ( )
private

Definition at line 1696 of file BDSComponentFactory.cc.

◆ CreateSolenoid()

BDSAcceleratorComponent * BDSComponentFactory::CreateSolenoid ( )
private

Definition at line 1321 of file BDSComponentFactory.cc.

◆ CreateTarget()

BDSAcceleratorComponent * BDSComponentFactory::CreateTarget ( )
private

Definition at line 1557 of file BDSComponentFactory.cc.

◆ CreateTeleporter()

BDSAcceleratorComponent * BDSComponentFactory::CreateTeleporter ( const G4double  teleporterLength,
const G4double  teleporterWidth,
const G4Transform3D &  transformIn 
)

Public creation for object that accounts for slight offset between ends of a ring. The z component of the delta three vector is used for the length of the teleporter.

Definition at line 518 of file BDSComponentFactory.cc.

References BRho().

Referenced by BDSDetectorConstruction::BuildBeamline().

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

◆ CreateTerminator()

BDSAcceleratorComponent * BDSComponentFactory::CreateTerminator ( G4double  witdth)

Public creation for object that dynamically stops all particles once the primary has completed a certain number of turns.

Definition at line 2071 of file BDSComponentFactory.cc.

Referenced by BDSDetectorConstruction::BuildBeamline().

Here is the caller graph for this function:

◆ CreateThinMultipole()

BDSAcceleratorComponent * BDSComponentFactory::CreateThinMultipole ( G4double  angleIn)
private

Definition at line 1258 of file BDSComponentFactory.cc.

◆ CreateThinRMatrix() [1/2]

BDSAcceleratorComponent * BDSComponentFactory::CreateThinRMatrix ( G4double  angleIn,
BDSMagnetStrength stIn,
const G4String &  name,
BDSIntegratorType  intType = BDSIntegratorType::rmatrixthin,
BDSFieldType  fieldType = BDSFieldType::rmatrix,
G4double  beamPipeRadius = 0,
BDSModulatorInfo fieldModulator = nullptr 
)
private

Definition at line 2116 of file BDSComponentFactory.cc.

◆ CreateThinRMatrix() [2/2]

BDSAcceleratorComponent * BDSComponentFactory::CreateThinRMatrix ( G4double  angleIn,
const G4String &  name 
)
private

Definition at line 2108 of file BDSComponentFactory.cc.

◆ CreateTiltOffset()

BDSTiltOffset * BDSComponentFactory::CreateTiltOffset ( GMAD::Element const *  el)
static

Create the tilt and offset information object by inspecting the parser element.

Definition at line 2629 of file BDSComponentFactory.cc.

References BDS::IsFinite(), GMAD::Element::offsetX, GMAD::Element::offsetY, and GMAD::Element::tilt.

Referenced by BDSDetectorConstruction::BuildBeamline(), and CreateFieldTransform().

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

◆ CreateTipJawCollimator()

BDSAcceleratorComponent * BDSComponentFactory::CreateTipJawCollimator ( )
private

Definition at line 1618 of file BDSComponentFactory.cc.

◆ CreateTransform3D()

BDSAcceleratorComponent * BDSComponentFactory::CreateTransform3D ( )
private

Definition at line 2042 of file BDSComponentFactory.cc.

◆ CreateUndulator()

BDSAcceleratorComponent * BDSComponentFactory::CreateUndulator ( )
private

Definition at line 1786 of file BDSComponentFactory.cc.

◆ CreateWireScanner()

BDSAcceleratorComponent * BDSComponentFactory::CreateWireScanner ( )
private

Definition at line 1764 of file BDSComponentFactory.cc.

◆ EFieldFromElement()

G4double BDSComponentFactory::EFieldFromElement ( GMAD::Element const *  el,
BDSFieldType  fieldType,
G4double  cavityLength,
const BDSParticleDefinition incomingParticle 
)
static

Get either the "gradient" member or the voltage and divide by the cavityLength argument (provided in case of reduced length) to get the E field in Geant4 units. BRho is required to ensure the field is accelerating for the given particle. This is a static function so we can't use the member variable integral.

Definition at line 2896 of file BDSComponentFactory.cc.

References BDSParticleDefinition::Beta(), BDSParticleDefinition::BRho(), GMAD::Element::E, GMAD::Element::frequency, GMAD::Element::gradient, BDS::IsFinite(), GMAD::Element::phase, GMAD::Element::scaling, BDSFieldEMRFCavity::TransitTimeFactor(), and BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDSBeamlineIntegral::Integrate(), and PrepareCavityStrength().

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

◆ FieldFromAngle()

G4double BDSComponentFactory::FieldFromAngle ( const G4double  angle,
const G4double  arcLength 
) const
private

Calculate the field from a given angle through a length of field - uses member rigidity and charge. Length & angle in g4 m / rad units.

Definition at line 3246 of file BDSComponentFactory.cc.

References BRho(), and BDS::IsFinite().

Referenced by CalculateAngleAndFieldSBend().

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

◆ GetKickValue()

void BDSComponentFactory::GetKickValue ( G4double &  hkick,
G4double &  vkick,
const KickerType  type 
) const
private

Pull out the right value - either 'kick' or 'h/vkick' for the appropriate type of kicker from the current member element.

Definition at line 842 of file BDSComponentFactory.cc.

References GMAD::Element::angle, element, elementName, GMAD::Element::hkick, BDS::IsFinite(), GMAD::Element::kick, and GMAD::Element::vkick.

Here is the call graph for this function:

◆ HasSufficientMinimumLength()

G4bool BDSComponentFactory::HasSufficientMinimumLength ( GMAD::Element const *  el,
G4bool  printWarning = true 
)
private

Test the component length is sufficient for practical construction.

Definition at line 2315 of file BDSComponentFactory.cc.

References GMAD::Element::l.

Referenced by CreateComponent().

Here is the caller graph for this function:

◆ IncomingFaceAngle()

G4double BDSComponentFactory::IncomingFaceAngle ( const GMAD::Element el) const
private

Calculate the incoming angel of the face (in the horizontal plane) for a given element. Calculates the bend angle and applies e1 / e2 pole face rotations the correct way depending on sign of angle. The angle is w.r.t. incoming curvilinear coordinates, so for an rbend with e1=0, the returned angle will be half the bend angle. For an sbend, with e1=0, it'll be 0.

Definition at line 3359 of file BDSComponentFactory.cc.

References BendAngle(), GMAD::Element::e1, BDSGlobalConstants::Instance(), integratorSet, BDS::IsFinite(), BDSIntegratorSet::IsMatrixIntegratorSet(), GMAD::Element::k1, and GMAD::Element::type.

Referenced by CreateComponent().

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

◆ INDEVELOPMENTERROR()

void BDSComponentFactory::INDEVELOPMENTERROR ( ) const
private

TBC - remove when modulators are implemented fully.

Definition at line 3414 of file BDSComponentFactory.cc.

References element, and elementName.

Referenced by ModulatorDefinition().

Here is the caller graph for this function:

◆ MagnetGeometryType()

BDSMagnetGeometryType BDSComponentFactory::MagnetGeometryType ( const GMAD::Element el)
static

Determine the magnet geometry type. If not specified or the global option to ignore local magnet geometry definitions is on, then the global default is used

Definition at line 2459 of file BDSComponentFactory.cc.

References BDS::DetermineMagnetGeometryType(), and BDSGlobalConstants::Instance().

Referenced by PrepareMagnetOuterInfo(), and YokeOnLeft().

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

◆ ModulatorDefinition()

BDSModulatorInfo * BDSComponentFactory::ModulatorDefinition ( const GMAD::Element el,
G4bool  inDevelopment = false 
) const
private

Return the modulator definition for a given element if one is specified in fieldModulator, else return the global default which could also be nullptr.

Definition at line 3406 of file BDSComponentFactory.cc.

References defaultModulator, BDSFieldFactory::GetModulatorDefinition(), INDEVELOPMENTERROR(), and BDSFieldFactory::Instance().

Referenced by CreateMagnet(), and SetModulatorDefinition().

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

◆ OutgoingFaceAngle()

G4double BDSComponentFactory::OutgoingFaceAngle ( const GMAD::Element el) const
private

Calculate the outgoing angle of the face (in the horizontal plane) for a given element. Calculates the bend angle and applies e1 / e2 pole face rotations the correct way depending on sign of angle. The angle is w.r.t. outgoing curvilinear coordinates, so for an rbend with e2=0, the returned angle will be half the bend angle. For an sbend, with e2=0, it'll be 0.

Definition at line 3312 of file BDSComponentFactory.cc.

References BendAngle(), GMAD::Element::e2, BDSGlobalConstants::Instance(), integratorSet, BDS::IsFinite(), BDSIntegratorSet::IsMatrixIntegratorSet(), GMAD::Element::k1, and GMAD::Element::type.

Referenced by CreateComponent().

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

◆ PoleFaceRotationsNotTooLarge()

void BDSComponentFactory::PoleFaceRotationsNotTooLarge ( const GMAD::Element el,
G4double  maxAngle = 0.5*CLHEP::halfpi 
)
static

Check whether the pole face rotation angles are too big for practical construction.

Definition at line 2328 of file BDSComponentFactory.cc.

References GMAD::Element::e1, GMAD::Element::e2, and element.

◆ PrepareBeamPipeInfo() [1/2]

BDSBeamPipeInfo * BDSComponentFactory::PrepareBeamPipeInfo ( GMAD::Element const *  el,
const G4ThreeVector &  inputFaceNormal = G4ThreeVector(0,0,-1),
const G4ThreeVector &  outputFaceNormal = G4ThreeVector(0,0,1) 
)
static

◆ PrepareBeamPipeInfo() [2/2]

BDSBeamPipeInfo * BDSComponentFactory::PrepareBeamPipeInfo ( GMAD::Element const *  el,
G4double  angleIn,
G4double  angleOut 
)
static

Interface to other PrepareBeamPipeInfo() for convenience to avoid preparing face normal vectors repeatedly.

Definition at line 2620 of file BDSComponentFactory.cc.

References BDS::CalculateFaces(), and PrepareBeamPipeInfo().

Here is the call graph for this function:

◆ PrepareCavityModelInfo()

BDSCavityInfo * BDSComponentFactory::PrepareCavityModelInfo ( GMAD::Element const *  el,
G4double  frequency 
) const
private

Utility function to prepare model info. Retrieve from cache of ones translated parser objects or create a default based on the element's aperture if none specified. Will always return a unique object that's not owned by this class. We need the frequency in case there are no good defaults and we'll make the cavity size according to the wavelength of the rf field.

Definition at line 2800 of file BDSComponentFactory.cc.

References cavityInfos, GMAD::Element::cavityModel, elementName, BDSCavityInfo::equatorRadius, BDSMaterials::GetMaterial(), BDSMaterials::Instance(), lengthSafety, BDSCavityInfo::material, PrepareCavityModelInfoForElement(), PrepareHorizontalWidth(), and BDSCavityInfo::thickness.

Here is the call graph for this function:

◆ PrepareCavityModelInfoForElement()

BDSCavityInfo * BDSComponentFactory::PrepareCavityModelInfoForElement ( GMAD::Element const *  el,
G4double  frequency 
) const
private

Create a default cavity model based on an element's aperture and material. Will always return a unique object that's not owned by this class.

prepare aperture information for this element to base default cavity on.

Definition at line 2845 of file BDSComponentFactory.cc.

References BDSBeamPipeInfo::aper1, BDSBeamPipeInfo::beamPipeThickness, BDSMaterials::Instance(), BDS::IsFinite(), GMAD::Element::l, PrepareBeamPipeInfo(), and PrepareHorizontalWidth().

Referenced by PrepareCavityModelInfo().

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

◆ PrepareCavityModels()

void BDSComponentFactory::PrepareCavityModels ( )
private

Prepare all RF cavity models in the component factory. Kept here and copies delivered. This class deletes them upon destruction.

Definition at line 2671 of file BDSComponentFactory.cc.

References cavityInfos, BDS::DetermineCavityType(), BDSParser::GetCavityModels(), BDSMaterials::GetMaterial(), BDSMaterials::Instance(), and BDSParser::Instance().

Here is the call graph for this function:

◆ PrepareCavityStrength()

BDSMagnetStrength * BDSComponentFactory::PrepareCavityStrength ( GMAD::Element const *  el,
BDSFieldType  fieldType,
G4double  cavityLength,
BDSMagnetStrength *&  fringeIn,
BDSMagnetStrength *&  fringeOut 
) const
private

Utility function to prepare field strength object for rf cavity. This takes a pointer for both incoming and outgoing strengths that this function will allocate by reference.

Definition at line 3004 of file BDSComponentFactory.cc.

References GMAD::Element::E, EFieldFromElement(), element, GMAD::Element::frequency, integralUpToThisComponent, BDS::IsFinite(), GMAD::Element::l, GMAD::Element::phase, SetBeta0(), GMAD::Element::tOffset, and BDSTypeSafeEnum< def, inner >::underlying().

Here is the call graph for this function:

◆ PrepareColour()

G4Colour * BDSComponentFactory::PrepareColour ( GMAD::Element const *  element,
const G4Material *  material = nullptr 
)
static

Checks if colour is specified for element, else uses the default for that element type. If the optional material is given and also element->autoColour is true then the material colouring is used.

Definition at line 3066 of file BDSComponentFactory.cc.

References GMAD::Element::autoColour, GMAD::Element::colour, BDSColourFromMaterial::GetColour(), BDSColours::GetColour(), BDSColourFromMaterial::Instance(), BDSColours::Instance(), GMAD::Element::type, and GMAD::typestr().

Referenced by PrepareMagnetOuterInfo().

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

◆ PrepareColours()

void BDSComponentFactory::PrepareColours ( )
private

Prepare all colours defined in the parser.

Definition at line 2740 of file BDSComponentFactory.cc.

References coloursInitialised, BDSColours::DefineColour(), BDSParser::GetColours(), BDSColours::Instance(), and BDSParser::Instance().

Here is the call graph for this function:

◆ PrepareCrystalInfo()

BDSCrystalInfo * BDSComponentFactory::PrepareCrystalInfo ( const G4String &  crystalName) const

Utility function to prepare crystal recipe for an element. Produces a unique object this class doesn't own.

Definition at line 2784 of file BDSComponentFactory.cc.

References crystalInfos.

◆ PrepareCrystals()

void BDSComponentFactory::PrepareCrystals ( )
private

Prepare all crystals in defined the parser.

Definition at line 2757 of file BDSComponentFactory.cc.

References crystalInfos, BDS::DetermineCrystalType(), BDSParser::GetCrystals(), BDSMaterials::GetMaterial(), BDSMaterials::Instance(), and BDSParser::Instance().

Here is the call graph for this function:

◆ PrepareHorizontalWidth()

G4double BDSComponentFactory::PrepareHorizontalWidth ( GMAD::Element const *  el,
G4double  defaultHorizontalWidth = -1 
)
static

Prepare the element horizontal width in Geant4 units - if not set, use the global default.

Definition at line 2558 of file BDSComponentFactory.cc.

References BDSGlobalConstants::Instance().

Referenced by BDS::BuildSBendLine(), PrepareCavityModelInfo(), PrepareCavityModelInfoForElement(), and PrepareMagnetOuterInfo().

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

◆ PrepareLaser()

BDSLaser * BDSComponentFactory::PrepareLaser ( GMAD::Element const *  el) const
private

Utility function to prepare laser. Prepares a unique object this class doesn't own.

Definition at line 2724 of file BDSComponentFactory.cc.

References GMAD::Element::laserBeam, and lasers.

◆ PrepareLasers()

void BDSComponentFactory::PrepareLasers ( )
private

Prepare all lasers defined in the parser.

Definition at line 2698 of file BDSComponentFactory.cc.

References BDSParser::GetLasers(), BDSParser::Instance(), BDS::IsFinite(), and lasers.

Here is the call graph for this function:

◆ PrepareMagnetOuterFieldInfo()

BDSFieldInfo * BDSComponentFactory::PrepareMagnetOuterFieldInfo ( const BDSMagnetStrength vacuumSt,
const BDSFieldType fieldType,
const BDSBeamPipeInfo bpInfo,
const BDSMagnetOuterInfo outerInfo,
const G4Transform3D &  fieldTransform,
const BDSIntegratorSet integratorSetIn,
G4double  brhoIn,
G4double  outerFieldScaling = 1.0,
BDSModulatorInfo modulatorInfo = nullptr 
)
static

Prepare the field definition for the yoke of a magnet.

Definition at line 2371 of file BDSComponentFactory.cc.

References BDSBeamPipeInfo::IndicativeRadius(), BDSGlobalConstants::Instance(), BDSIntegratorSet::Integrator(), BDSFieldInfo::SetFieldType(), and BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDS::BuildRBendLine(), BDS::BuildSBendLine(), and CreateMagnet().

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

◆ PrepareMagnetOuterInfo() [1/2]

BDSMagnetOuterInfo * BDSComponentFactory::PrepareMagnetOuterInfo ( const G4String &  elementNameIn,
const GMAD::Element el,
const BDSMagnetStrength st,
const BDSBeamPipeInfo beamPipe,
G4double  defaultHorizontalWidth = -1,
G4double  defaultVHRatio = 1.0,
G4double  defaultCoilWidthFraction = -1,
G4double  defaultCoilHeightFraction = -1 
)
static

Prepare the recipe for magnet outer geometry for an element. This uses a strength instance which (we assume) represents the element. Evenly splits angle between input and output faces.

Definition at line 2442 of file BDSComponentFactory.cc.

References PrepareMagnetOuterInfo(), and YokeOnLeft().

Referenced by BDS::BuildDipoleFringe(), BDS::BuildRBendLine(), BDS::BuildSBendLine(), BDS::BuildSingleSBend(), CreateMagnet(), and PrepareMagnetOuterInfo().

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

◆ PrepareMagnetOuterInfo() [2/2]

BDSMagnetOuterInfo * BDSComponentFactory::PrepareMagnetOuterInfo ( const G4String &  elementNameIn,
const GMAD::Element el,
const G4double  angleIn,
const G4double  angleOut,
const BDSBeamPipeInfo beamPipe,
const G4bool  yokeOnLeft = false,
G4double  defaultHorizontalWidth = -1,
G4double  defaultVHRatio = -1,
G4double  defaultCoilWidthFraction = -1,
G4double  defaultCoilHeightFraction = -1 
)
static

Prepare the recipe for magnet outer geometry with full control of the angled faces and which side the yoke is on. The angle in and out are the face angles relative to a chord for a straight section of outer magnet geometry.

Definition at line 2471 of file BDSComponentFactory.cc.

References GMAD::Element::autoColour, GMAD::Element::coilHeightFraction, GMAD::Element::coilWidthFraction, BDSMaterials::GetMaterial(), BDSMagnetOuterInfo::hStyle, GMAD::Element::hStyle, BDSBeamPipeInfo::IndicativeRadius(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), MagnetGeometryType(), PrepareColour(), PrepareHorizontalWidth(), GMAD::Element::stripOuterVolume, and GMAD::Element::vhRatio.

Here is the call graph for this function:

◆ PrepareMagnetStrengthForMultipoles()

BDSMagnetStrength * BDSComponentFactory::PrepareMagnetStrengthForMultipoles ( GMAD::Element const *  el) const
private

◆ PrepareMagnetStrengthForRMatrix()

BDSMagnetStrength * BDSComponentFactory::PrepareMagnetStrengthForRMatrix ( GMAD::Element const *  el) const
private

◆ PrepareMaterial() [1/2]

G4Material * BDSComponentFactory::PrepareMaterial ( GMAD::Element const *  element)
static

Try and get a material and exit if no such material.

Definition at line 3087 of file BDSComponentFactory.cc.

References BDSMaterials::GetMaterial(), and BDSMaterials::Instance().

Here is the call graph for this function:

◆ PrepareMaterial() [2/2]

G4Material * BDSComponentFactory::PrepareMaterial ( GMAD::Element const *  element,
const G4String &  defaultMaterialName 
)
static

Checks if a material is named in Element::material, else uses the supplied default.

Definition at line 3077 of file BDSComponentFactory.cc.

References BDSMaterials::GetMaterial(), and BDSMaterials::Instance().

Here is the call graph for this function:

◆ PrepareTipMaterial() [1/2]

G4Material * BDSComponentFactory::PrepareTipMaterial ( GMAD::Element const *  element)
static

Try and get a tipmaterial and exit if no such material.

Definition at line 3106 of file BDSComponentFactory.cc.

References BDSMaterials::GetMaterial(), BDSMaterials::Instance(), and GMAD::Element::tipMaterial.

Here is the call graph for this function:

◆ PrepareTipMaterial() [2/2]

G4Material * BDSComponentFactory::PrepareTipMaterial ( GMAD::Element const *  element,
const G4String &  defaultMaterialName 
)
static

Checks if a material is named in Element::tipMaterial, else uses the supplied default.

Definition at line 3096 of file BDSComponentFactory.cc.

References BDSMaterials::GetMaterial(), BDSMaterials::Instance(), and GMAD::Element::tipMaterial.

Here is the call graph for this function:

◆ PrepareVacuumMaterial()

G4Material * BDSComponentFactory::PrepareVacuumMaterial ( GMAD::Element const *  el) const
private

Prepare the vacuum material from the element or resort to default in options.

Definition at line 2572 of file BDSComponentFactory.cc.

References element, BDSMaterials::GetMaterial(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), and GMAD::Element::vacuumMaterial.

Here is the call graph for this function:

◆ ScalingFieldOuter()

G4double BDSComponentFactory::ScalingFieldOuter ( const GMAD::Element ele)
static

Get the scaling factor for a particular outer field depending on the global and individual setting.

Definition at line 2366 of file BDSComponentFactory.cc.

References BDSGlobalConstants::Instance(), and GMAD::Element::scalingFieldOuter.

Referenced by BDS::BuildRBendLine(), BDS::BuildSBendLine(), CreateMagnet(), and SetFieldDefinitions().

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

◆ SetBeta0()

void BDSComponentFactory::SetBeta0 ( BDSMagnetStrength stIn) const
inlineprivate

Simple setter used to add Beta0 to a strength instance.

Definition at line 248 of file BDSComponentFactory.hh.

References BDSParticleDefinition::Beta(), and integralUpToThisComponent.

Referenced by CreateMagnet(), PrepareCavityStrength(), PrepareMagnetStrengthForMultipoles(), and PrepareMagnetStrengthForRMatrix().

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

◆ SetFieldDefinitions()

void BDSComponentFactory::SetFieldDefinitions ( GMAD::Element const *  el,
BDSAcceleratorComponent component 
) const
private

Set the field definition on a BDSAcceleratorComponent from the string definition name in a parser element. In the case of a BDSMagnet, (exclusively) set the vacuum and outer field in place of the one general field.

Definition at line 3115 of file BDSComponentFactory.cc.

References BDSFieldInfo::CompoundBScaling(), CreateFieldTransform(), element, elementName, GMAD::Element::fieldAll, GMAD::Element::fieldOuter, GMAD::Element::fieldVacuum, BDSFieldFactory::Instance(), BDSFieldInfo::ProvideGlobal(), ScalingFieldOuter(), GMAD::Element::scalingFieldOuter, BDSAcceleratorComponent::SetField(), SetFieldDefinitions(), SetModulatorDefinition(), BDSFieldInfo::SetTransformBeamline(), and GMAD::Element::type.

Referenced by CreateComponent(), and SetFieldDefinitions().

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

◆ SetModulatorDefinition()

void BDSComponentFactory::SetModulatorDefinition ( GMAD::Element const *  el,
BDSFieldInfo info 
) const
private

Check the info doesn't already have a modulator definition (exception if it does). and update it.

Definition at line 3169 of file BDSComponentFactory.cc.

References elementName, ModulatorDefinition(), and BDSFieldInfo::ModulatorInfo().

Referenced by SetFieldDefinitions().

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

◆ YokeOnLeft()

G4bool BDSComponentFactory::YokeOnLeft ( const GMAD::Element el,
const BDSMagnetStrength st 
)
static

Determine which side the yoke of an asymmetric bend should go on based on the angle of the bend and the overriding setting in the element.

Definition at line 2339 of file BDSComponentFactory.cc.

References element, BDS::IsFinite(), and MagnetGeometryType().

Referenced by BDS::BuildRBendLine(), BDS::BuildSBendLine(), and PrepareMagnetOuterInfo().

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

Field Documentation

◆ cavityInfos

std::map<G4String, BDSCavityInfo*> BDSComponentFactory::cavityInfos
private

Map of cavity model info instances by name.

Definition at line 396 of file BDSComponentFactory.hh.

Referenced by PrepareCavityModelInfo(), and PrepareCavityModels().

◆ coloursInitialised

G4bool BDSComponentFactory::coloursInitialised = false
staticprivate

Only allow colours to be constructed from parser definitions once. Static so we can use a component factory many times without calling multiple times.

Definition at line 471 of file BDSComponentFactory.hh.

Referenced by PrepareColours().

◆ crystalInfos

std::map<G4String, BDSCrystalInfo*> BDSComponentFactory::crystalInfos
private

Maps of crystal info instances by name.

Definition at line 399 of file BDSComponentFactory.hh.

Referenced by PrepareCrystalInfo(), and PrepareCrystals().

◆ defaultModulator

BDSModulatorInfo* BDSComponentFactory::defaultModulator
private

Default modulator for all components.

Definition at line 243 of file BDSComponentFactory.hh.

Referenced by ModulatorDefinition().

◆ element

GMAD::Element const* BDSComponentFactory::element = nullptr
private

◆ elementName

G4String BDSComponentFactory::elementName
private

Variable used to pass around the possibly modified name of an element.

Definition at line 467 of file BDSComponentFactory.hh.

Referenced by CalculateGaborLensStrength(), CreateComponent(), CreateMagnet(), GetKickValue(), INDEVELOPMENTERROR(), PrepareCavityModelInfo(), SetFieldDefinitions(), and SetModulatorDefinition().

◆ includeFringeFields

G4bool BDSComponentFactory::includeFringeFields
private

Cache of whether to include fringe fields.

Definition at line 241 of file BDSComponentFactory.hh.

Referenced by CreateComponent().

◆ integralUpToThisComponent

BDSBeamlineIntegral* BDSComponentFactory::integralUpToThisComponent
private

To save passing it through many functions arguments.

Definition at line 244 of file BDSComponentFactory.hh.

Referenced by BRho(), CalculateGaborLensStrength(), CreateComponent(), PrepareCavityStrength(), and SetBeta0().

◆ integratorSet

const BDSIntegratorSet* BDSComponentFactory::integratorSet
private

Local copy of reference to integrator set to use.

Definition at line 405 of file BDSComponentFactory.hh.

Referenced by CreateMagnet(), IncomingFaceAngle(), and OutgoingFaceAngle().

◆ integratorSetType

const BDSIntegratorSetType BDSComponentFactory::integratorSetType
private

Local copy of enum of the integrator set, i.e. which one it is specifically.

Definition at line 408 of file BDSComponentFactory.hh.

◆ lasers

std::map<G4String, BDSLaser*> BDSComponentFactory::lasers
private

Map of laser instances by name. Owned by this class.

Definition at line 402 of file BDSComponentFactory.hh.

Referenced by PrepareLaser(), and PrepareLasers().

◆ lengthSafety

G4double BDSComponentFactory::lengthSafety
private

Length safety from global constants.

Definition at line 239 of file BDSComponentFactory.hh.

Referenced by PrepareCavityModelInfo().

◆ modifiedElements

std::map<G4String, G4int> BDSComponentFactory::modifiedElements
private

Registry of modified elements stored by original name and number of times modified - 0 counting. This is so when we modify elements beyond their definition they get a unique name as they're literally not the same object as the unmodified one so they don't share the placement counter for unique naming. This allows accurate geometry trees in the visualiser.

Definition at line 464 of file BDSComponentFactory.hh.

Referenced by CreateComponent().

◆ nextElement

GMAD::Element const* BDSComponentFactory::nextElement = nullptr
private

element access to previous element (can be nullptr)

Definition at line 257 of file BDSComponentFactory.hh.

Referenced by CreateComponent().

◆ prevElement

GMAD::Element const* BDSComponentFactory::prevElement = nullptr
private

element access to previous element (can be nullptr)

Definition at line 255 of file BDSComponentFactory.hh.

Referenced by CreateComponent().

◆ synchronousTAtMiddleOfThisComponent

G4double BDSComponentFactory::synchronousTAtMiddleOfThisComponent
private

Definition at line 245 of file BDSComponentFactory.hh.

◆ thinElementLength

G4double BDSComponentFactory::thinElementLength
private

Length of a thin element.

Definition at line 240 of file BDSComponentFactory.hh.

◆ userComponentFactory

BDSComponentFactoryUser* BDSComponentFactory::userComponentFactory
private

User component factory if any.

Definition at line 238 of file BDSComponentFactory.hh.

Referenced by CreateComponent().

◆ yokeFields

G4bool BDSComponentFactory::yokeFields
private

Cache of whether to include yoke magnetic fields.

Definition at line 242 of file BDSComponentFactory.hh.

Referenced by CreateMagnet().


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