BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Interface to Geant4's GDML loader. More...
#include <BDSGeometryFactoryGDML.hh>
Public Member Functions | |
virtual BDSGeometryExternal * | Build (G4String componentName, G4String fileName, 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, G4UserLimits *userLimitsToAttachToAllLVs=nullptr) |
![]() | |
virtual BDSGeometryExternal * | Build (G4String componentName, G4String fileName, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *vacuumBiasVolumeNames=nullptr, G4bool makeSensitive=true, BDSSDType sensitivityType=BDSSDType::energydep, BDSSDType vacuumSensitivityType=BDSSDType::energydepvacuum, G4UserLimits *userLimitsToAttachToAllLVs=nullptr)=0 |
Main method to load and construct geometry. | |
virtual std::set< G4VisAttributes * > | ApplyColourMapping (std::set< G4LogicalVolume * > &lvs, std::map< G4String, G4Colour * > *mapping, G4bool autoColour, const G4String &preprocessPrefix="") |
virtual void | ApplyUserLimits (const std::set< G4LogicalVolume * > &lvsIn, G4UserLimits *userLimits) |
Attach a set of user limits to every logical volume supplied. | |
virtual void | ApplySensitivity (BDSGeometryExternal *result, const std::set< G4LogicalVolume * > &allLogicalVolumesIn, BDSSDType generalSensitivity, const std::set< G4LogicalVolume * > &vacuumLogicalVolumes, BDSSDType vacuumSensitivity) |
Attach the relevant general and vacuum sensitivity to each volume. | |
![]() | |
virtual void | FactoryBaseCleanUp () |
Empty containers for next use - factories are never deleted so can't rely on scope. | |
Protected Member Functions | |
virtual G4String | PreprocessedName (const G4String &objectName, const G4String &acceleratorComponentName) const |
Use the GDML preprocessing scheme to prepare the preprocesseed volume names. | |
![]() | |
virtual void | CleanUp () |
Virtual clean up that derived classes can override that calls CleanUpBase(). | |
virtual G4String | PreprocessedName (const G4String &objectName, const G4String &acceleratorComponentName) const |
std::set< G4LogicalVolume * > | GetVolumes (const std::set< G4LogicalVolume * > &allLVs, std::vector< G4String > *volumeNames, G4bool preprocessGDML, const G4String &componentName) const |
Get the volumes that match the name. Volume names are matched exactly and are case sensitive. | |
void | CleanUpBase () |
void | ExpandExtent (const BDSExtent &extent) |
Expand the acuumulated extents using a (possibly asymmetric) extent instance. | |
void | ExpandExtent (G4double xO, G4double rx, G4double y0, G4double ry, G4double z0, G4double rz) |
void | ExpandExtent (G4double x0, G4double xLow, G4double xHigh, G4double y0, G4double yLow, G4double yHigh, G4double z0, G4double zLow, G4double zHigh) |
Expand the extent but asymmetrically. | |
BDSExtent | Extent () const |
Private Member Functions | |
void | ReplaceStringInFile (const G4String &filename, const G4String &outputFileName, const G4String &key, const G4String &replacement) |
void | GetAllLogicalPhysicalAndMaterials (const G4VPhysicalVolume *volume, std::set< G4VPhysicalVolume * > &pvs, std::set< G4LogicalVolume * > &lvs, std::map< G4String, G4Material * > &materialsGDML) |
Additional Inherited Members | |
![]() | |
G4double | xmin |
Extent in one dimension. | |
G4double | xmax |
Extent in one dimension. | |
G4double | ymin |
Extent in one dimension. | |
G4double | ymax |
Extent in one dimension. | |
G4double | zmin |
Extent in one dimension. | |
G4double | zmax |
Extent in one dimension. | |
![]() | |
std::set< G4LogicalVolume * > | allLogicalVolumes |
std::set< G4VPhysicalVolume * > | allPhysicalVolumes |
std::set< G4RotationMatrix * > | allRotationMatrices |
std::set< G4UserLimits * > | allUserLimits |
std::set< G4VSolid * > | allSolids |
std::set< G4VisAttributes * > | allVisAttributes |
G4double | lengthSafety |
Cache of global constants variable. | |
G4double | lengthSafetyLarge |
Cache of global constants variable. | |
G4bool | checkOverlaps |
Cache of global constants variable. | |
G4bool | visDebug |
Cache of global constants variable. | |
G4int | nSegmentsPerCircle |
Cache of global constants variable. | |
G4VisAttributes * | containerVisAttr |
Cache of global constants variable. | |
G4UserLimits * | defaultUserLimits |
Cache of global constants variable. | |
Interface to Geant4's GDML loader.
Definition at line 44 of file BDSGeometryFactoryGDML.hh.
BDSGeometryFactoryGDML::BDSGeometryFactoryGDML | ( | ) |
Definition at line 53 of file BDSGeometryFactoryGDML.cc.
|
inlinevirtual |
Definition at line 48 of file BDSGeometryFactoryGDML.hh.
|
virtual |
Main interface overrides base class method to construct a file with optional colour mapping.
Implements BDSGeometryFactoryBase.
Definition at line 56 of file BDSGeometryFactoryGDML.cc.
References BDSGeometryFactoryBase::ApplyColourMapping(), BDSGeometryFactoryBase::ApplySensitivity(), BDSGeometryFactoryBase::ApplyUserLimits(), BDSMaterials::CacheMaterialsFromGDML(), BDSMaterials::CheckForConflictingMaterialsAfterLoad(), BDSGeometryFactoryBase::CleanUp(), BDS::DetermineExtents(), GetAllLogicalPhysicalAndMaterials(), BDSGeometryComponent::GetAllLogicalVolumes(), BDSColourFromMaterial::GetColour(), BDSColours::GetColour(), BDSGeometryFactoryBase::GetVolumes(), BDSColourFromMaterial::Instance(), BDSColours::Instance(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), BDSGeometryComponent::RegisterLogicalVolume(), BDSGeometryComponent::RegisterPhysicalVolume(), BDSGeometryExternal::RegisterVacuumVolumes(), BDSGeometryComponent::RegisterVisAttributes(), and BDSGeometryExternal::VacuumVolumes().
|
private |
Recursively append pvs and lvs from a given mother volume. Pass by reference the output vectors
Definition at line 194 of file BDSGeometryFactoryGDML.cc.
References GetAllLogicalPhysicalAndMaterials().
Referenced by Build(), and GetAllLogicalPhysicalAndMaterials().
|
protectedvirtual |
Use the GDML preprocessing scheme to prepare the preprocesseed volume names.
Reimplemented from BDSGeometryFactoryBase.
Definition at line 190 of file BDSGeometryFactoryGDML.cc.
References BDSGDMLPreprocessor::ProcessedNodeName().
|
private |
Create a temporary file in the current working directory (even though the geometry file may not exist there) and create a copy of the input geometry file line by line, but replacing a 'key' with 'replacement'. Returns the temporary file name created. Naming only allows one temporary file per component - so far, not a problem.
Definition at line 211 of file BDSGeometryFactoryGDML.cc.