|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
A singleton class that holds all required sensitive detector class instances.
More...
#include <BDSSDManager.hh>

Public Member Functions | |
| BDSSDManager (const BDSSDManager &)=delete | |
| Singleton accessor. | |
| BDSSDManager & | operator= (const BDSSDManager &)=delete |
| G4VSensitiveDetector * | SensitiveDetector (const BDSSDType sdType, G4bool applyOptions=false) const |
| BDSSDSampler * | SamplerPlane () const |
| SD for samplers (plane type). See also SamplerPlaneWithFilter below. | |
| BDSSDSamplerCylinder * | SamplerCylinder () const |
| SD for samplers (cylinder type). | |
| BDSSDSamplerSphere * | SamplerSphere () const |
| SD for samplers (sphere type). | |
| BDSSDSamplerLink * | SamplerLink () const |
| SD for link samplers. | |
| BDSSDTerminator * | Terminator () const |
| BDSSDEnergyDeposition * | EnergyDeposition () const |
| SD for general energy deposition. | |
| BDSSDEnergyDeposition * | EnergyDepositionFull () const |
| SD for general energy deposition but always include extra half of information. | |
| BDSSDEnergyDeposition * | EnergyDepositionVacuum () const |
| SD for energy deposition in vacuum volumes. | |
| BDSSDEnergyDeposition * | EnergyDepositionTunnel () const |
| SD for tunnel energy counter. | |
| BDSSDEnergyDepositionGlobal * | EnergyDepositionWorld () const |
| SD for energy deposition in the world volume. | |
| BDSSDEnergyDepositionGlobal * | EnergyDepositionWorldContents () const |
| SD for energy deposition in things that were already placed in the externally provided world. | |
| BDSSDVolumeExit * | WorldExit () const |
| SD for world exit hits. | |
| BDSSDApertureImpacts * | ApertureImpacts () const |
| SD for aperture impact hits. | |
| G4VSensitiveDetector * | WorldComplete () const |
| SD for multiple SDs for world - energy loss and exit. | |
| G4VSensitiveDetector * | ApertureComplete () const |
| G4VSensitiveDetector * | WorldComplete () const |
| G4VSensitiveDetector * | ApertureComplete () const |
| BDSSDCollimator * | Collimator () const |
| SD for collimator impact locations. | |
| BDSMultiSensitiveDetectorOrdered * | CollimatorComplete () const |
| SD for collimator impacts + energy deposition at the same time in order. | |
| BDSSDThinThing * | ThinThing () const |
| BDSMultiSensitiveDetectorOrdered * | WireComplete () const |
| SD for wire scanner wires that is a composite of thin things + energy deposition full. | |
| void | RegisterPrimitiveScorerName (const G4String &nameIn, G4double unit=1.0) |
| void | RegisterPrimitiveScorerNames (const std::vector< G4String > &namesIn, const std::vector< G4double > *units=nullptr) |
| Loop over a vector and apply above single name function. | |
| const std::vector< G4String > & | PrimitiveScorerNamesComplete () const |
| Access a vector the full primitive scorer names as registered. | |
| const std::vector< G4String > & | PrimitiveScorerNames () const |
| Access a vector of the just primitive scorer part of the names. | |
| const std::map< G4String, G4double > & | PrimitiveScorerUnits () const |
| Access the map of units for primitive scorers. | |
| void | SetLinkRegistry (BDSLinkRegistry *registry) |
| If samplerLink member exists, set the registry to look up links for that SD. | |
| void | SetLinkMinimumEK (G4double minimumEKIn) |
| void | SetLinkProtonsAndIonsOnly (G4bool protonsAndIonsOnlyIn) |
| void | ConstructSamplerSDsForParticleSets (const std::map< int, std::set< int > > &samplerFilterIDtoPDGSetIn) |
| const std::vector< G4String > & | ExtraSamplerWithFilterNamesComplete () const |
| Access a vector of names of extra samplers so we can identify the hits collections. | |
| const std::vector< G4String > & | ExtraSamplerCylinderWithFilterNamesComplete () const |
| Access a vector of names of extra samplers so we can identify the hits collections. | |
| const std::vector< G4String > & | ExtraSamplerSphereWithFilterNamesComplete () const |
| Access a vector of names of extra samplers so we can identify the hits collections. | |
| BDSSDSampler * | SamplerPlaneWithFilter (G4int ID) const |
| Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid. | |
| BDSSDSamplerCylinder * | SamplerCylinderWithFilter (G4int ID) const |
| Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid. | |
| BDSSDSamplerSphere * | SamplerSphereWithFilter (G4int ID) const |
| Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid. | |
Static Public Member Functions | |
| static BDSSDManager * | Instance () |
Private Member Functions | |
| BDSSDManager () | |
| Private default constructor for singleton. | |
Private Attributes | |
| BDSSDCollimator * | collimatorSD |
| BDSMultiSensitiveDetectorOrdered * | collimatorCompleteSD |
| BDSSDThinThing * | thinThingSD |
| BDSMultiSensitiveDetectorOrdered * | wireCompleteSD |
| std::map< G4String, G4VSDFilter * > | filters |
| Map of all filters used. This class owns a single instance of each. | |
| std::vector< G4String > | primitiveScorerNamesComplete |
| Vector of complete (including mesh name) primitive scorer names. | |
| std::vector< G4String > | primitiveScorerNames |
| Just the primitive scorer part of the name. | |
| std::map< G4String, G4double > | primitiveScorerNameToUnit |
| Map of primitive scorer names to units. | |
| std::map< G4int, BDSSDSampler * > | extraSamplersWithFilters |
| std::map< G4int, BDSSDSamplerCylinder * > | extraSamplerCylindersWithFilters |
| std::map< G4int, BDSSDSamplerSphere * > | extraSamplerSpheresWithFilters |
| std::map< G4int, BDSSDFilterPDGIDSet * > | extraSamplerFilters |
| std::vector< G4String > | extraSamplerWithFilterNamesComplete |
| std::vector< G4String > | extraSamplerCylinderWithFilterNamesComplete |
| std::vector< G4String > | extraSamplerSphereWithFilterNamesComplete |
| BDSSDSampler * | samplerPlane |
| SD instance. | |
| BDSSDSamplerCylinder * | samplerCylinder |
| SD instance. | |
| BDSSDSamplerSphere * | samplerSphere |
| SD instance. | |
| BDSSDSamplerLink * | samplerLink |
| SD instance. | |
| BDSSDTerminator * | terminator |
| SD instance. | |
| BDSSDEnergyDeposition * | energyDeposition |
| SD instance. | |
| BDSSDEnergyDeposition * | energyDepositionFull |
| SD instance. | |
| BDSSDEnergyDeposition * | energyDepositionVacuum |
| SD instance. | |
| BDSSDEnergyDeposition * | energyDepositionTunnel |
| SD instance. | |
| BDSSDEnergyDepositionGlobal * | energyDepositionWorld |
| SD instance. | |
| BDSSDEnergyDepositionGlobal * | energyDepositionWorldContents |
| SD instance. | |
| BDSSDVolumeExit * | worldExit |
| SD instance. | |
| BDSSDApertureImpacts * | apertureImpacts |
| SD instance. | |
| G4VSensitiveDetector * | worldCompleteSD |
| SD instance. | |
| G4VSensitiveDetector * | apertureCompleteSD |
| SD instance. | |
| G4bool | storeCollimatorHitsAll |
| Cache of global constant option. | |
| G4bool | storeCollimatorHitsIons |
| Cache of global constant option. | |
| G4double | collimatorHitsMinimumKE |
| Cache of global constant option. | |
| G4bool | generateApertureImpacts |
| Cache of global constant option. | |
| G4bool | storeApertureImpactsAll |
| Cache of global constant option. | |
| G4bool | storeApertureImpactsIons |
| Cache of global constant option. | |
| G4double | apertureImpactsMinimumKE |
| Cache of global constant option. | |
| G4bool | generateELossHits |
| Cache of global constant option. | |
| G4bool | generateELossVacuumHits |
| Cache of global constant option. | |
| G4bool | generateELossTunnelHits |
| Cache of global constant option. | |
| G4bool | generateELossWorldContents |
| Cache of global constant option. | |
| G4bool | storeELossWorld |
| Cache of global constant option. | |
| G4bool | storeELossExtras |
| Cache of global constant option. | |
| G4bool | generateCollimatorHits |
| Cache of global constant option. | |
Static Private Attributes | |
| static BDSSDManager * | instance = nullptr |
A singleton class that holds all required sensitive detector class instances.
Each sensitive detector class need only be instantiated once and attached to the relevant volume. This instantiates all necessary SDs and holds them.
Definition at line 66 of file BDSSDManager.hh.
| BDSSDManager::~BDSSDManager | ( | ) |
Definition at line 64 of file BDSSDManager.cc.
|
private |
Private default constructor for singleton.
Definition at line 75 of file BDSSDManager.cc.
References apertureCompleteSD, apertureImpacts, apertureImpactsMinimumKE, collimatorHitsMinimumKE, energyDeposition, energyDepositionFull, energyDepositionTunnel, energyDepositionVacuum, energyDepositionWorld, energyDepositionWorldContents, filters, generateApertureImpacts, generateCollimatorHits, generateELossHits, generateELossTunnelHits, generateELossVacuumHits, generateELossWorldContents, BDSGlobalConstants::Instance(), BDSSDFilterOr::RegisterFilter(), samplerCylinder, samplerLink, samplerPlane, samplerSphere, storeApertureImpactsAll, storeApertureImpactsIons, storeCollimatorHitsAll, storeCollimatorHitsIons, storeELossExtras, storeELossWorld, BDSGlobalConstants::StoreTrajectoryOptions(), terminator, BDSGlobalConstants::UseImportanceSampling(), worldCompleteSD, and worldExit.

|
inline |
Definition at line 127 of file BDSSDManager.hh.
|
inline |
Definition at line 132 of file BDSSDManager.hh.
|
inline |
SD for aperture impact hits.
Definition at line 122 of file BDSSDManager.hh.
References apertureImpacts.
|
inline |
SD for collimator impact locations.
Definition at line 136 of file BDSSDManager.hh.
|
inline |
SD for collimator impacts + energy deposition at the same time in order.
Definition at line 139 of file BDSSDManager.hh.
| void BDSSDManager::ConstructSamplerSDsForParticleSets | ( | const std::map< int, std::set< int > > & | samplerFilterIDtoPDGSetIn | ) |
Construct extra instances of the sampler SD but with a filter of a set of PDG codes. Associate it with an integer ID we can use to match up to a set. The IDs are given by the parser and we follow those in BDSIM consistently.
Definition at line 412 of file BDSSDManager.cc.
Referenced by BDSDetectorConstruction::PrepareExtraSamplerSDs().

|
inline |
SD for general energy deposition.
Definition at line 101 of file BDSSDManager.hh.
References energyDeposition.
|
inline |
SD for general energy deposition but always include extra half of information.
Definition at line 104 of file BDSSDManager.hh.
References energyDepositionFull.
|
inline |
SD for tunnel energy counter.
Definition at line 110 of file BDSSDManager.hh.
References energyDepositionTunnel.
|
inline |
SD for energy deposition in vacuum volumes.
Definition at line 107 of file BDSSDManager.hh.
References energyDepositionVacuum.
|
inline |
SD for energy deposition in the world volume.
Definition at line 113 of file BDSSDManager.hh.
References energyDepositionWorld.
|
inline |
SD for energy deposition in things that were already placed in the externally provided world.
Definition at line 116 of file BDSSDManager.hh.
References energyDepositionWorldContents.
|
inline |
Access a vector of names of extra samplers so we can identify the hits collections.
Definition at line 179 of file BDSSDManager.hh.
|
inline |
Access a vector of names of extra samplers so we can identify the hits collections.
Definition at line 182 of file BDSSDManager.hh.
|
inline |
Access a vector of names of extra samplers so we can identify the hits collections.
Definition at line 176 of file BDSSDManager.hh.
|
static |
Definition at line 57 of file BDSSDManager.cc.
|
inline |
Access a vector of the just primitive scorer part of the names.
Definition at line 160 of file BDSSDManager.hh.
References primitiveScorerNames.
Referenced by BDSOutput::CreateHistograms().

|
inline |
Access a vector the full primitive scorer names as registered.
Definition at line 157 of file BDSSDManager.hh.
References primitiveScorerNamesComplete.
Referenced by BDSOutput::CreateHistograms().

|
inline |
Access the map of units for primitive scorers.
Definition at line 163 of file BDSSDManager.hh.
References primitiveScorerNameToUnit.
Referenced by BDSOutput::CreateHistograms().

| void BDSSDManager::RegisterPrimitiveScorerName | ( | const G4String & | nameIn, |
| G4double | unit = 1.0 |
||
| ) |
Make a record of a primitive scorer name. If it has a '/' in it, we take the last bit of the name as the just primitive scorer name. We store both versions in member vectors.
Definition at line 376 of file BDSSDManager.cc.
References primitiveScorerNames, primitiveScorerNamesComplete, and primitiveScorerNameToUnit.
Referenced by RegisterPrimitiveScorerNames().

| void BDSSDManager::RegisterPrimitiveScorerNames | ( | const std::vector< G4String > & | namesIn, |
| const std::vector< G4double > * | units = nullptr |
||
| ) |
Loop over a vector and apply above single name function.
Definition at line 389 of file BDSSDManager.cc.
References RegisterPrimitiveScorerName().
Referenced by BDS::BuildBLMs(), and BDSDetectorConstruction::ConstructScoringMeshes().


|
inline |
SD for samplers (cylinder type).
Definition at line 88 of file BDSSDManager.hh.
References samplerCylinder.
| BDSSDSamplerCylinder * BDSSDManager::SamplerCylinderWithFilter | ( | G4int | ID | ) | const |
Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid.
Definition at line 461 of file BDSSDManager.cc.
|
inline |
|
inline |
SD for samplers (plane type). See also SamplerPlaneWithFilter below.
Definition at line 85 of file BDSSDManager.hh.
References samplerPlane.
| BDSSDSampler * BDSSDManager::SamplerPlaneWithFilter | ( | G4int | ID | ) | const |
Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid.
Definition at line 455 of file BDSSDManager.cc.
|
inline |
SD for samplers (sphere type).
Definition at line 91 of file BDSSDManager.hh.
References samplerSphere.
| BDSSDSamplerSphere * BDSSDManager::SamplerSphereWithFilter | ( | G4int | ID | ) | const |
Access the relevant SD for a given particle filter set ID. It will return nullptr if the ID is invalid.
Definition at line 467 of file BDSSDManager.cc.
| G4VSensitiveDetector * BDSSDManager::SensitiveDetector | ( | const BDSSDType | sdType, |
| G4bool | applyOptions = false |
||
| ) | const |
Access a sensitive detector by the class enum. Default is a nullptr and also in the case of Geant < 4.10.3 for world complete as requires multiple sensitive detector. It's safe to set a nullptr to the SD of a logical volume. If applyOptions is used, the correct SD will only be returned if required according to the options in BDSGlobalConstants for storing hits. This way only hits are generated that are required (cpu and memory efficient).
Definition at line 248 of file BDSSDManager.cc.
References apertureCompleteSD, apertureImpacts, energyDeposition, energyDepositionTunnel, energyDepositionVacuum, energyDepositionWorld, energyDepositionWorldContents, generateApertureImpacts, generateCollimatorHits, generateELossHits, generateELossTunnelHits, generateELossVacuumHits, generateELossWorldContents, samplerCylinder, samplerLink, samplerPlane, storeELossWorld, terminator, BDSTypeSafeEnum< def, inner >::underlying(), worldCompleteSD, and worldExit.
Referenced by BDSGeometryComponent::AttachSensitiveDetectors().


|
inline |
Definition at line 167 of file BDSSDManager.hh.
|
inline |
Definition at line 168 of file BDSSDManager.hh.
| void BDSSDManager::SetLinkRegistry | ( | BDSLinkRegistry * | registry | ) |
If samplerLink member exists, set the registry to look up links for that SD.
Definition at line 406 of file BDSSDManager.cc.
References samplerLink, and BDSSDSamplerLink::SetLinkRegistry().
Referenced by BDSLinkDetectorConstruction::BDSLinkDetectorConstruction().


|
inline |
SD for measuring turns around circular machine and terminating particles appropriately.
Definition at line 98 of file BDSSDManager.hh.
References terminator.
|
inline |
SD for generating primary hits for thin elements where discrete processes may not work regularly.
Definition at line 143 of file BDSSDManager.hh.
|
inline |
SD for wire scanner wires that is a composite of thin things + energy deposition full.
Definition at line 146 of file BDSSDManager.hh.
|
inline |
SD for multiple SDs for world - energy loss and exit.
Definition at line 126 of file BDSSDManager.hh.
References worldCompleteSD.
|
inline |
SD for world energy loss as in Geant earlier than 4.10.3 we can only have one SD for each logical volume.
Definition at line 131 of file BDSSDManager.hh.
References energyDepositionWorld.
|
inline |
|
private |
SD instance.
Definition at line 215 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 212 of file BDSSDManager.hh.
Referenced by ApertureImpacts(), BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 250 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Definition at line 219 of file BDSSDManager.hh.
|
private |
Cache of global constant option.
Definition at line 246 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Definition at line 218 of file BDSSDManager.hh.
|
private |
SD instance.
Definition at line 205 of file BDSSDManager.hh.
Referenced by BDSSDManager(), EnergyDeposition(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 206 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and EnergyDepositionFull().
|
private |
SD instance.
Definition at line 208 of file BDSSDManager.hh.
Referenced by BDSSDManager(), EnergyDepositionTunnel(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 207 of file BDSSDManager.hh.
Referenced by BDSSDManager(), EnergyDepositionVacuum(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 209 of file BDSSDManager.hh.
Referenced by BDSSDManager(), EnergyDepositionWorld(), SensitiveDetector(), and WorldComplete().
|
private |
SD instance.
Definition at line 210 of file BDSSDManager.hh.
Referenced by BDSSDManager(), EnergyDepositionWorldContents(), and SensitiveDetector().
|
private |
Definition at line 236 of file BDSSDManager.hh.
|
private |
Definition at line 240 of file BDSSDManager.hh.
|
private |
Definition at line 238 of file BDSSDManager.hh.
|
private |
Definition at line 237 of file BDSSDManager.hh.
|
private |
Definition at line 241 of file BDSSDManager.hh.
|
private |
Definition at line 235 of file BDSSDManager.hh.
|
private |
Definition at line 239 of file BDSSDManager.hh.
|
private |
Map of all filters used. This class owns a single instance of each.
Definition at line 224 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 247 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 257 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 251 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 253 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 252 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
Cache of global constant option.
Definition at line 254 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
staticprivate |
Definition at line 197 of file BDSSDManager.hh.
|
private |
Just the primitive scorer part of the name.
Definition at line 230 of file BDSSDManager.hh.
Referenced by PrimitiveScorerNames(), and RegisterPrimitiveScorerName().
|
private |
Vector of complete (including mesh name) primitive scorer names.
Definition at line 227 of file BDSSDManager.hh.
Referenced by PrimitiveScorerNamesComplete(), and RegisterPrimitiveScorerName().
|
private |
Map of primitive scorer names to units.
Definition at line 233 of file BDSSDManager.hh.
Referenced by PrimitiveScorerUnits(), and RegisterPrimitiveScorerName().
|
private |
SD instance.
Definition at line 201 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SamplerCylinder(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 203 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SamplerLink(), SensitiveDetector(), and SetLinkRegistry().
|
private |
SD instance.
Definition at line 200 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SamplerPlane(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 202 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SamplerSphere().
|
private |
Cache of global constant option.
Definition at line 248 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 249 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 244 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 245 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 256 of file BDSSDManager.hh.
Referenced by BDSSDManager().
|
private |
Cache of global constant option.
Definition at line 255 of file BDSSDManager.hh.
Referenced by BDSSDManager(), and SensitiveDetector().
|
private |
SD instance.
Definition at line 204 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SensitiveDetector(), and Terminator().
|
private |
Definition at line 220 of file BDSSDManager.hh.
|
private |
Definition at line 221 of file BDSSDManager.hh.
|
private |
SD instance.
Definition at line 214 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SensitiveDetector(), and WorldComplete().
|
private |
SD instance.
Definition at line 211 of file BDSSDManager.hh.
Referenced by BDSSDManager(), SensitiveDetector(), and WorldExit().