BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Interface to external geometry construction. More...
#include <BDSGeometryFactory.hh>
Public Member Functions | |
BDSGeometryExternal * | BuildGeometry (G4String componentName, const G4String &formatAndFilePath, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *namedVacuumVolumes=nullptr, G4bool makeSensitive=true, BDSSDType sensitivityType=BDSSDType::energydep, BDSSDType vacuumSensitivityType=BDSSDType::energydepvacuum, G4bool stripOuterVolumeAndMakeAssembly=false, G4UserLimits *userLimitsToAttachToAllLVs=nullptr, G4bool dontReloadGeometry=false) |
Static Public Member Functions | |
static BDSGeometryFactory * | Instance () |
Singleton accessor. | |
Private Member Functions | |
BDSGeometryFactory () | |
Private accessor as singleton. | |
BDSGeometryFactoryBase * | GetAppropriateFactory (BDSGeometryType type) |
Get the appropriate geometry factory. | |
Private Attributes | |
std::map< std::pair< std::string, std::string >, BDSGeometryExternal * > | registry |
std::set< BDSGeometryExternal * > | storage |
BDSGeometryFactoryBase * | gdml |
Factory instance. | |
BDSGeometryFactoryBase * | sql |
Factory instance. | |
Static Private Attributes | |
static BDSGeometryFactory * | instance = nullptr |
Singleton instance. | |
Interface to external geometry construction.
A factory that uses the correct derived singleton factory of BDSGeometryFactoryBase to construct the required geometry with extents.
Definition at line 48 of file BDSGeometryFactory.hh.
BDSGeometryFactory::~BDSGeometryFactory | ( | ) |
Definition at line 59 of file BDSGeometryFactory.cc.
|
private |
Private accessor as singleton.
Definition at line 49 of file BDSGeometryFactory.cc.
Referenced by Instance().
BDSGeometryExternal * BDSGeometryFactory::BuildGeometry | ( | G4String | componentName, |
const G4String & | formatAndFilePath, | ||
std::map< G4String, G4Colour * > * | colourMapping = nullptr , |
||
G4bool | autoColour = true , |
||
G4double | suggestedLength = 0 , |
||
G4double | suggestedHorizontalWidth = 0 , |
||
std::vector< G4String > * | namedVacuumVolumes = nullptr , |
||
G4bool | makeSensitive = true , |
||
BDSSDType | sensitivityType = BDSSDType::energydep , |
||
BDSSDType | vacuumSensitivityType = BDSSDType::energydepvacuum , |
||
G4bool | stripOuterVolumeAndMakeAssembly = false , |
||
G4UserLimits * | userLimitsToAttachToAllLVs = nullptr , |
||
G4bool | dontReloadGeometry = false |
||
) |
Determine the geometry format, load it and build the geometry. Optional suggested length and horizontalWidth are in for some cases where it is not possible to query the geometry file for the extent information. Assign a default sensitivity to every volume recursively.
Definition at line 86 of file BDSGeometryFactory.cc.
References BDSGeometryFactoryBase::Build(), BDS::DetermineGeometryType(), BDS::FileExists(), GetAppropriateFactory(), BDS::GetFullPath(), registry, BDS::SplitOnColon(), storage, and BDSGeometryComponent::StripOuterAndMakeAssemblyVolume().
Referenced by BDS::BuildBLMs(), BDSElement::BuildContainerLogicalVolume(), BDS::BuildPlacementGeometry(), BDSDetectorConstruction::BuildWorld(), BDSParallelWorldImportance::BuildWorld(), BDSBLMFactory::CreateBLM(), and BDSMagnetOuterFactory::CreateExternal().
|
private |
Get the appropriate geometry factory.
Definition at line 68 of file BDSGeometryFactory.cc.
References gdml, sql, and BDSTypeSafeEnum< def, inner >::underlying().
Referenced by BuildGeometry().
|
static |
Singleton accessor.
Definition at line 42 of file BDSGeometryFactory.cc.
References BDSGeometryFactory(), and instance.
Referenced by BDS::BuildBLMs(), BDSElement::BuildContainerLogicalVolume(), BDS::BuildPlacementGeometry(), BDSDetectorConstruction::BuildWorld(), BDSParallelWorldImportance::BuildWorld(), BDSBLMFactory::CreateBLM(), BDSMagnetOuterFactory::CreateExternal(), BDSIM::~BDSIM(), and BDSIMLink::~BDSIMLink().
|
private |
Factory instance.
Definition at line 95 of file BDSGeometryFactory.hh.
Referenced by BDSGeometryFactory(), and GetAppropriateFactory().
|
staticprivate |
|
private |
A registry of all previously constructed components. We use a map instead of an unordered map because map uses operator< whereas unordered_map uses std::hash(key). Hashing isn't provided for std::pair by default but operator< is, so we use map. Map is pair<file name, component name to be used in> : geometry.
Definition at line 85 of file BDSGeometryFactory.hh.
Referenced by BuildGeometry().
|
private |
Factory instance.
Definition at line 96 of file BDSGeometryFactory.hh.
Referenced by BDSGeometryFactory(), and GetAppropriateFactory().
|
private |
This is where the geometry components are stored and used to manage the associated memory of the pieces of geometry.
Definition at line 89 of file BDSGeometryFactory.hh.
Referenced by BuildGeometry().