BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Register for all fields to be built and volumes to be attached to. More...
#include <BDSFieldBuilder.hh>
Public Member Functions | |
void | RegisterFieldForConstruction (const BDSFieldInfo *info, G4LogicalVolume *logicalVolume, const G4bool propagateToDaughters=false, const BDSMagnetStrength *magnetStrengthForScaling=nullptr, const G4String &scalingKey="none") |
void | RegisterFieldForConstruction (const BDSFieldInfo *info, const std::vector< G4LogicalVolume * > &logicalVolumes, const G4bool propagateToDaughters=false, const BDSMagnetStrength *magnetStrengthForScaling=nullptr, const G4String &scalingKey="none") |
Similar version but vectorised. | |
void | RegisterFieldForConstruction (const BDSFieldInfo *info, const std::set< G4LogicalVolume * > &logicalVolumes, const G4bool propagateToDaughters=false, const BDSMagnetStrength *magnetStrengthForScaling=nullptr, const G4String &scalingKey="none") |
Similar version but for a set. | |
std::vector< BDSFieldObjects * > | CreateAndAttachAll () |
Static Public Member Functions | |
static BDSFieldBuilder * | Instance () |
Singleton pattern accessor. | |
Private Member Functions | |
BDSFieldBuilder () | |
Private default constructor to enforce singleton pattern. | |
Private Attributes | |
std::vector< const BDSFieldInfo * > | infos |
Register of components to build. | |
std::vector< std::vector< G4LogicalVolume * > > | lvs |
Register of components to build. | |
std::vector< G4bool > | propagators |
Register of components to build. | |
std::map< G4int, const BDSMagnetStrength * > | scalingStrengths |
Optional register of scaling strengths and keys. | |
std::map< G4int, G4String > | scalingKeys |
Optional register of scaling strengths and keys. | |
Static Private Attributes | |
static BDSFieldBuilder * | instance = nullptr |
Singleton instance. | |
Register for all fields to be built and volumes to be attached to.
This keeps a registry of the field info (the template for a field) and the volume to attach it to, so all fields can actually be constructed at one time irrespective of when they're apparently 'created' in the geometry / individual BDSAcceleratorComponents.
This register does not retain ownership of anything so multiple logical volumes may be safely registered along with a single BDSFieldInfo instance.
Definition at line 47 of file BDSFieldBuilder.hh.
BDSFieldBuilder::~BDSFieldBuilder | ( | ) |
Definition at line 40 of file BDSFieldBuilder.cc.
|
private |
Private default constructor to enforce singleton pattern.
Definition at line 45 of file BDSFieldBuilder.cc.
References infos, lvs, and propagators.
Referenced by Instance().
std::vector< BDSFieldObjects * > BDSFieldBuilder::CreateAndAttachAll | ( | ) |
Definition at line 112 of file BDSFieldBuilder.cc.
|
static |
Singleton pattern accessor.
Definition at line 33 of file BDSFieldBuilder.cc.
References BDSFieldBuilder(), and instance.
Referenced by BDSTeleporter::Build(), BDSUndulator::Build(), BDSCavityElement::BuildField(), BDSMagnet::BuildOuterField(), BDSMagnet::BuildVacuumField(), BDSDetectorConstruction::ConstructSDandField(), and BDSAcceleratorComponent::Initialise().
void BDSFieldBuilder::RegisterFieldForConstruction | ( | const BDSFieldInfo * | info, |
const std::set< G4LogicalVolume * > & | logicalVolumes, | ||
const G4bool | propagateToDaughters = false , |
||
const BDSMagnetStrength * | magnetStrengthForScaling = nullptr , |
||
const G4String & | scalingKey = "none" |
||
) |
Similar version but for a set.
Definition at line 94 of file BDSFieldBuilder.cc.
References RegisterFieldForConstruction().
void BDSFieldBuilder::RegisterFieldForConstruction | ( | const BDSFieldInfo * | info, |
const std::vector< G4LogicalVolume * > & | logicalVolumes, | ||
const G4bool | propagateToDaughters = false , |
||
const BDSMagnetStrength * | magnetStrengthForScaling = nullptr , |
||
const G4String & | scalingKey = "none" |
||
) |
Similar version but vectorised.
Definition at line 53 of file BDSFieldBuilder.cc.
References infos, lvs, propagators, scalingKeys, and scalingStrengths.
void BDSFieldBuilder::RegisterFieldForConstruction | ( | const BDSFieldInfo * | info, |
G4LogicalVolume * | logicalVolume, | ||
const G4bool | propagateToDaughters = false , |
||
const BDSMagnetStrength * | magnetStrengthForScaling = nullptr , |
||
const G4String & | scalingKey = "none" |
||
) |
Register a field for construction - ie the field specification along with which logical volume to attach it to. The same field specification (info) can be registered for multiple logical volumes as this builder does not retain ownership of anything.
Definition at line 80 of file BDSFieldBuilder.cc.
References RegisterFieldForConstruction().
Referenced by BDSTeleporter::Build(), BDSUndulator::Build(), BDSCavityElement::BuildField(), BDSMagnet::BuildOuterField(), BDSMagnet::BuildVacuumField(), BDSAcceleratorComponent::Initialise(), and RegisterFieldForConstruction().
|
private |
Register of components to build.
Definition at line 89 of file BDSFieldBuilder.hh.
Referenced by BDSFieldBuilder(), and RegisterFieldForConstruction().
|
staticprivate |
|
private |
Register of components to build.
Definition at line 90 of file BDSFieldBuilder.hh.
Referenced by BDSFieldBuilder(), and RegisterFieldForConstruction().
|
private |
Register of components to build.
Definition at line 91 of file BDSFieldBuilder.hh.
Referenced by BDSFieldBuilder(), and RegisterFieldForConstruction().
|
private |
Optional register of scaling strengths and keys.
Definition at line 96 of file BDSFieldBuilder.hh.
Referenced by RegisterFieldForConstruction().
|
private |
Optional register of scaling strengths and keys.
Definition at line 95 of file BDSFieldBuilder.hh.
Referenced by RegisterFieldForConstruction().