BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Member Functions | Private Member Functions
BDSGeometryFactoryGDML Class Reference

Interface to Geant4's GDML loader. More...

#include <BDSGeometryFactoryGDML.hh>

Inheritance diagram for BDSGeometryFactoryGDML:
Inheritance graph
Collaboration diagram for BDSGeometryFactoryGDML:
Collaboration graph

Public Member Functions

virtual BDSGeometryExternalBuild (G4String componentName, G4String fileName, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *namedVacuumVolumes=nullptr, G4UserLimits *userLimitsToAttachToAllLVs=nullptr)
 
- Public Member Functions inherited from BDSGeometryFactoryBase
virtual BDSGeometryExternalBuild (G4String componentName, G4String fileName, std::map< G4String, G4Colour * > *colourMapping=nullptr, G4bool autoColour=true, G4double suggestedLength=0, G4double suggestedHorizontalWidth=0, std::vector< G4String > *vacuumBiasVolumeNames=nullptr, G4UserLimits *userLimitsToAttachToAllLVs=nullptr)=0
 Main method to load and construct geometry. More...
 
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. More...
 
- Public Member Functions inherited from BDSFactoryBase
virtual void FactoryBaseCleanUp ()
 Empty containers for next use - factories are never deleted so can't rely on scope. More...
 

Protected Member Functions

virtual G4String PreprocessedName (const G4String &objectName, const G4String &acceleratorComponentName) const
 Use the GDML preprocessing scheme to prepare the preprocesseed volume names. More...
 
- Protected Member Functions inherited from BDSGeometryFactoryBase
virtual void CleanUp ()
 Virtual clean up that derived classes can override that calls CleanUpBase(). More...
 
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. More...
 
void CleanUpBase ()
 
void ExpandExtent (const BDSExtent &extent)
 Expand the acuumulated extents using a (possibly asymmetric) extent instance. More...
 
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. More...
 
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

- Protected Attributes inherited from BDSGeometryFactoryBase
G4double xmin
 Extent in one dimension. More...
 
G4double xmax
 Extent in one dimension. More...
 
G4double ymin
 Extent in one dimension. More...
 
G4double ymax
 Extent in one dimension. More...
 
G4double zmin
 Extent in one dimension. More...
 
G4double zmax
 Extent in one dimension. More...
 
- Protected Attributes inherited from BDSFactoryBase
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. More...
 
G4double lengthSafetyLarge
 Cache of global constants variable. More...
 
G4bool checkOverlaps
 Cache of global constants variable. More...
 
G4bool visDebug
 Cache of global constants variable. More...
 
G4double nSegmentsPerCircle
 Cache of global constants variable. More...
 
G4VisAttributes * containerVisAttr
 Cache of global constants variable. More...
 
G4UserLimits * defaultUserLimits
 Cache of global constants variable. More...
 

Detailed Description

Interface to Geant4's GDML loader.

Author
Stewart Boogert, Lawrence Deacon, Laurie Nevay

Definition at line 44 of file BDSGeometryFactoryGDML.hh.

Constructor & Destructor Documentation

◆ BDSGeometryFactoryGDML()

BDSGeometryFactoryGDML::BDSGeometryFactoryGDML ( )

Definition at line 53 of file BDSGeometryFactoryGDML.cc.

◆ ~BDSGeometryFactoryGDML()

virtual BDSGeometryFactoryGDML::~BDSGeometryFactoryGDML ( )
inlinevirtual

Definition at line 48 of file BDSGeometryFactoryGDML.hh.

Member Function Documentation

◆ Build()

BDSGeometryExternal * BDSGeometryFactoryGDML::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,
G4UserLimits *  userLimitsToAttachToAllLVs = nullptr 
)
virtual

◆ GetAllLogicalPhysicalAndMaterials()

void BDSGeometryFactoryGDML::GetAllLogicalPhysicalAndMaterials ( const G4VPhysicalVolume *  volume,
std::set< G4VPhysicalVolume * > &  pvs,
std::set< G4LogicalVolume * > &  lvs,
std::map< G4String, G4Material * > &  materialsGDML 
)
private

Recursively append pvs and lvs from a given mother volume. Pass by reference the output vectors

Definition at line 180 of file BDSGeometryFactoryGDML.cc.

References GetAllLogicalPhysicalAndMaterials().

Referenced by Build(), and GetAllLogicalPhysicalAndMaterials().

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

◆ PreprocessedName()

G4String BDSGeometryFactoryGDML::PreprocessedName ( const G4String &  objectName,
const G4String &  acceleratorComponentName 
) const
protectedvirtual

Use the GDML preprocessing scheme to prepare the preprocesseed volume names.

Reimplemented from BDSGeometryFactoryBase.

Definition at line 176 of file BDSGeometryFactoryGDML.cc.

References BDSGDMLPreprocessor::ProcessedNodeName().

Here is the call graph for this function:

◆ ReplaceStringInFile()

void BDSGeometryFactoryGDML::ReplaceStringInFile ( const G4String &  filename,
const G4String &  outputFileName,
const G4String &  key,
const G4String &  replacement 
)
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 197 of file BDSGeometryFactoryGDML.cc.


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