BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Base class for external geometry loading factories. More...
#include <BDSGeometryFactoryBase.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 > *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 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 |
Protected Attributes | |
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. | |
Base class for external geometry loading factories.
Definition at line 48 of file BDSGeometryFactoryBase.hh.
BDSGeometryFactoryBase::BDSGeometryFactoryBase | ( | ) |
Definition at line 41 of file BDSGeometryFactoryBase.cc.
|
virtual |
Definition at line 46 of file BDSGeometryFactoryBase.cc.
|
virtual |
Apply a colour mapping to a set of logical volumes. This applies a colour from the map if the key value is found as a substring or whole part of the logical volume name. Ie the BDSColour* (red) is defined to key 'quad' and any logical volume with 'quad' (case sensitive) will be set as red. Caches common G4VisAttributes (so no repeats for same colour) and returns those constructed. Map is searched through so key order gives precedence order.
Definition at line 49 of file BDSGeometryFactoryBase.cc.
References BDSColourFromMaterial::GetColour(), BDSColourFromMaterial::Instance(), BDSColours::Instance(), and BDS::StrContains().
Referenced by BDSGeometryFactoryGDML::Build(), and BDSGeometryFactorySQL::Build().
|
virtual |
Attach the relevant general and vacuum sensitivity to each volume.
Definition at line 123 of file BDSGeometryFactoryBase.cc.
References BDSGeometryComponent::RegisterSensitiveVolume().
Referenced by BDSGeometryFactoryGDML::Build().
|
virtual |
Attach a set of user limits to every logical volume supplied.
Definition at line 116 of file BDSGeometryFactoryBase.cc.
Referenced by BDSGeometryFactoryGDML::Build().
|
pure virtual |
Main method to load and construct geometry.
Implemented in BDSGeometryFactoryGDML, and BDSGeometryFactorySQL.
Referenced by BDSGeometryFactory::BuildGeometry().
|
protectedvirtual |
Virtual clean up that derived classes can override that calls CleanUpBase().
Reimplemented in BDSGeometryFactorySQL.
Definition at line 143 of file BDSGeometryFactoryBase.cc.
References CleanUpBase().
Referenced by BDSGeometryFactoryGDML::Build(), and BDSGeometryFactorySQL::CleanUp().
|
protected |
Initialise variables - used to reset variables before each use of the factory. Non-virtual as used in constructor.
Definition at line 185 of file BDSGeometryFactoryBase.cc.
References BDSFactoryBase::FactoryBaseCleanUp(), xmax, xmin, ymax, ymin, zmax, and zmin.
Referenced by CleanUp().
|
protected |
Expand the acuumulated extents using a (possibly asymmetric) extent instance.
Definition at line 196 of file BDSGeometryFactoryBase.cc.
References xmax, xmin, BDSExtent::XNeg(), BDSExtent::XPos(), ymax, ymin, BDSExtent::YNeg(), BDSExtent::YPos(), zmax, zmin, BDSExtent::ZNeg(), and BDSExtent::ZPos().
Referenced by BDSGeometryFactorySQL::PlaceComponents().
|
protected |
|
protected |
|
inlineprotected |
Definition at line 132 of file BDSGeometryFactoryBase.hh.
|
protected |
Get the volumes that match the name. Volume names are matched exactly and are case sensitive.
Definition at line 152 of file BDSGeometryFactoryBase.cc.
Referenced by BDSGeometryFactoryGDML::Build().
|
protectedvirtual |
Provide the preprocessed object (such as volume) names in case they're processed whilst loading from external formats. By default, no action.
Reimplemented in BDSGeometryFactoryGDML.
Definition at line 148 of file BDSGeometryFactoryBase.cc.
|
protected |
Extent in one dimension.
Definition at line 125 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().
|
protected |
Extent in one dimension.
Definition at line 124 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().
|
protected |
Extent in one dimension.
Definition at line 127 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().
|
protected |
Extent in one dimension.
Definition at line 126 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().
|
protected |
Extent in one dimension.
Definition at line 129 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().
|
protected |
Extent in one dimension.
Definition at line 128 of file BDSGeometryFactoryBase.hh.
Referenced by CleanUpBase(), and ExpandExtent().