|
Geant4 VMC Version 6.8
|
Sensitive detectors services. More...
#include <TG4SDServices.h>
Public Member Functions | |
| TG4SDServices () | |
| ~TG4SDServices () | |
| void | ClearVolumeMaps () |
| void | MapVolume (G4LogicalVolume *lv, G4int id, G4bool fillLVToVolIdMap) |
| void | MapUserSD (const G4String &volumeName, TVirtualMCSensitiveDetector *userSD) |
| void | PrintStatistics (G4bool open, G4bool close) const |
| void | PrintVolNameToIdMap () const |
| void | PrintVolIdToLVMap () const |
| void | PrintSensitiveVolumes () const |
| void | PrintUserSensitiveDetectors () const |
| void | SetIsStopRun (G4bool stopRun) |
| G4int | GetVolumeID (const G4String &volumeName) const |
| G4int | GetVolumeID (G4LogicalVolume *volume) const |
| G4int | GetMediumID (G4LogicalVolume *volume) const |
| G4String | GetVolumeName (G4int volumeId) const |
| std::vector< G4LogicalVolume * > | GetLogicalVolumes (G4int volumeId) const |
| G4LogicalVolume * | GetLogicalVolume (G4int volumeId, G4bool warn=true) const |
| G4int | GetMediumId (G4int volumeId) const |
| TVirtualMCSensitiveDetector * | GetUserSD (G4String volumeName, G4bool warn=true) const |
| G4bool | GetIsStopRun () const |
| Int_t | NofSensitiveDetectors () const |
| TG4SensitiveDetector * | GetSensitiveDetector (G4VSensitiveDetector *sd) const |
| std::set< TVirtualMCSensitiveDetector * > * | GetUserSDs () const |
| Int_t | NofVolDaughters (const char *volName) const |
| const char * | VolDaughterName (const char *volName, Int_t i) const |
| Int_t | VolDaughterCopyNo (const char *volName, Int_t i) const |
Static Public Member Functions | |
| static TG4SDServices * | Instance () |
| static G4int | GetFirstVolumeId () |
Private Member Functions | |
| TG4SDServices (const TG4SDServices &right) | |
| Not implemented. | |
| TG4SDServices & | operator= (const TG4SDServices &right) |
| Not implemented. | |
Private Attributes | |
| G4bool | fIsStopRun |
| info about run stopping by user | |
| std::map< G4String, G4int > | fVolNameToIdMap |
| map volume name -> volume id | |
| std::multimap< G4int, G4LogicalVolume * > | fVolIdToLVMap |
| one VMC source ID -> all its Geant4 representations | |
| std::map< G4LogicalVolume *, G4int > | fLVToVolIdMap |
| map logical volume -> volume id | |
| std::vector< G4int > | fInstanceToVolId |
| Dense read-only stepping cache, indexed by Geant4 instance ID. | |
| G4bool | fIsUserSDs |
| info about user SDs | |
Static Private Attributes | |
| static TG4SDServices * | fgInstance = 0 |
| this instance | |
| static const G4int | fgkFirstVolumeId = 1 |
| the first volume id | |
| static G4ThreadLocal std::set< TVirtualMCSensitiveDetector * > * | fgUserSDs |
| vector of user SDs | |
| static G4ThreadLocal std::map< G4String, TVirtualMCSensitiveDetector * > * | fgUserSDMap = 0 |
| map volume name -> user SD | |
Sensitive detectors services.
The class provides service methods for accessing to Geant4 geometry, namely using TVirtualMC volumes identifiers (implemented via TG4SensitiveDetector instances).
Definition at line 42 of file TG4SDServices.h.
| TG4SDServices::TG4SDServices | ( | ) |
Default constructor
Definition at line 38 of file TG4SDServices.cxx.
Referenced by Instance(), operator=(), and TG4SDServices().
| TG4SDServices::~TG4SDServices | ( | ) |
Destructor
Definition at line 56 of file TG4SDServices.cxx.
|
private |
Not implemented.
|
inlinestatic |
Returns this instance.
Definition at line 127 of file TG4SDServices.h.
Referenced by TG4SDConstruction::Construct(), TG4StepManager::CurrentMedium(), TG4StepManager::CurrentVolID(), TG4StepManager::CurrentVolOffID(), TG4EventAction::EndOfEventAction(), TG4RunManager::FinishRun(), TG4RunManager::LateInitialize(), TG4SDConstruction::MapVolumesToInstanceIds(), TG4SDConstruction::MapVolumesToSDIds(), TG4SteppingAction::ProcessTrackOnBoundary(), TG4SDMessenger::SetNewValue(), TG4StepManager::StopRun(), and TG4TrackingAction::UserProcessHits().
|
inlinestatic |
Returns the first volume id.
Definition at line 133 of file TG4SDServices.h.
Referenced by TG4SDConstruction::MapVolumesToInstanceIds().
| void TG4SDServices::ClearVolumeMaps | ( | ) |
Definition at line 67 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
| void TG4SDServices::MapVolume | ( | G4LogicalVolume * | lv, |
| G4int | id, | ||
| G4bool | fillLVToVolIdMap ) |
Definition at line 77 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::MapVolumesToInstanceIds(), and TG4SDConstruction::MapVolumesToSDIds().
| void TG4SDServices::MapUserSD | ( | const G4String & | volumeName, |
| TVirtualMCSensitiveDetector * | userSD ) |
Add the given user sensitive detector in the map. Print a warning if a fiven volyme name is already present
Definition at line 94 of file TG4SDServices.cxx.
| void TG4SDServices::PrintStatistics | ( | G4bool | open, |
| G4bool | close ) const |
Print G4 SD statistics
Definition at line 127 of file TG4SDServices.cxx.
Referenced by TG4RunManager::LateInitialize().
| void TG4SDServices::PrintVolNameToIdMap | ( | ) | const |
Print volume name -> volume id map
Definition at line 140 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
| void TG4SDServices::PrintVolIdToLVMap | ( | ) | const |
Print volume id -> lv map
Definition at line 160 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
| void TG4SDServices::PrintSensitiveVolumes | ( | ) | const |
Print volumes which have defined SD
Definition at line 181 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
| void TG4SDServices::PrintUserSensitiveDetectors | ( | ) | const |
Print volumes which have defined SD
Definition at line 200 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct(), and TG4SDMessenger::SetNewValue().
|
inline |
Sets flag for notifying about stopping run by a user.
Definition at line 139 of file TG4SDServices.h.
Referenced by TG4RunManager::FinishRun(), and TG4StepManager::StopRun().
| G4int TG4SDServices::GetVolumeID | ( | const G4String & | volumeName | ) | const |
Return the volume identifier from volumes name map.
Definition at line 222 of file TG4SDServices.cxx.
Referenced by TG4StepManager::CurrentVolID(), TG4StepManager::CurrentVolOffID(), NofVolDaughters(), PrintSensitiveVolumes(), PrintUserSensitiveDetectors(), VolDaughterCopyNo(), and VolDaughterName().
| G4int TG4SDServices::GetVolumeID | ( | G4LogicalVolume * | volume | ) | const |
Definition at line 238 of file TG4SDServices.cxx.
| G4int TG4SDServices::GetMediumID | ( | G4LogicalVolume * | volume | ) | const |
Return the medium ID for the specified logical volume.
Definition at line 252 of file TG4SDServices.cxx.
Referenced by TG4StepManager::CurrentMedium().
| G4String TG4SDServices::GetVolumeName | ( | G4int | volumeId | ) | const |
Return the name of the volume with the given identifier. Give a warning in case logical volume is not associated with a sensitive detector.
Definition at line 302 of file TG4SDServices.cxx.
| std::vector< G4LogicalVolume * > TG4SDServices::GetLogicalVolumes | ( | G4int | volumeId | ) | const |
Definition at line 322 of file TG4SDServices.cxx.
| G4LogicalVolume * TG4SDServices::GetLogicalVolume | ( | G4int | volumeId, |
| G4bool | warn = true ) const |
Return the first found logical volume with specified volumeId (sensitive detector ID) in G4LogicalVolumeStore.
Definition at line 331 of file TG4SDServices.cxx.
Referenced by GetMediumId(), GetVolumeName(), NofVolDaughters(), VolDaughterCopyNo(), and VolDaughterName().
| Int_t TG4SDServices::GetMediumId | ( | G4int | volumeId | ) | const |
Return the material number for a given volume Id
Definition at line 354 of file TG4SDServices.cxx.
| TVirtualMCSensitiveDetector * TG4SDServices::GetUserSD | ( | G4String | volumeName, |
| G4bool | warn = true ) const |
Definition at line 280 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
|
inline |
Returns flag for notifying about stopping run by a user.
Definition at line 145 of file TG4SDServices.h.
Referenced by TG4RunManager::FinishRun().
| Int_t TG4SDServices::NofSensitiveDetectors | ( | ) | const |
Return the total number of sensitive detectors.
Definition at line 363 of file TG4SDServices.cxx.
Referenced by PrintStatistics().
| TG4SensitiveDetector * TG4SDServices::GetSensitiveDetector | ( | G4VSensitiveDetector * | sd | ) | const |
Check and convert type of the sensitive detector.
Definition at line 371 of file TG4SDServices.cxx.
Referenced by GetMediumID(), TG4SteppingAction::ProcessTrackOnBoundary(), and TG4TrackingAction::UserProcessHits().
|
inline |
Returns the user SD vector
Definition at line 151 of file TG4SDServices.h.
| Int_t TG4SDServices::NofVolDaughters | ( | const char * | volName | ) | const |
Return the number of daughter of the volume specified by name
Definition at line 390 of file TG4SDServices.cxx.
| const char * TG4SDServices::VolDaughterName | ( | const char * | volName, |
| Int_t | i ) const |
Return the name of the i-th daughter of the volume specified by name.
Definition at line 403 of file TG4SDServices.cxx.
| Int_t TG4SDServices::VolDaughterCopyNo | ( | const char * | volName, |
| Int_t | i ) const |
Return the copyNo of the i-th daughter of the volume specified by name.
Definition at line 430 of file TG4SDServices.cxx.
|
private |
Not implemented.
|
staticprivate |
this instance
Definition at line 96 of file TG4SDServices.h.
Referenced by Instance(), TG4SDServices(), and ~TG4SDServices().
|
staticprivate |
the first volume id
Definition at line 98 of file TG4SDServices.h.
Referenced by GetFirstVolumeId().
|
private |
info about run stopping by user
Definition at line 100 of file TG4SDServices.h.
Referenced by GetIsStopRun(), SetIsStopRun(), and TG4SDServices().
|
private |
map volume name -> volume id
Definition at line 103 of file TG4SDServices.h.
Referenced by ClearVolumeMaps(), GetVolumeID(), MapVolume(), PrintVolNameToIdMap(), and TG4SDServices().
|
private |
one VMC source ID -> all its Geant4 representations
Definition at line 106 of file TG4SDServices.h.
Referenced by ClearVolumeMaps(), GetLogicalVolume(), GetLogicalVolumes(), MapVolume(), PrintVolIdToLVMap(), and TG4SDServices().
|
private |
map logical volume -> volume id
Definition at line 109 of file TG4SDServices.h.
Referenced by ClearVolumeMaps(), MapVolume(), and TG4SDServices().
|
private |
Dense read-only stepping cache, indexed by Geant4 instance ID.
Definition at line 112 of file TG4SDServices.h.
Referenced by ClearVolumeMaps(), GetVolumeID(), MapVolume(), and TG4SDServices().
|
staticprivate |
vector of user SDs
Definition at line 115 of file TG4SDServices.h.
Referenced by GetUserSDs(), and MapUserSD().
|
staticprivate |
map volume name -> user SD
Definition at line 119 of file TG4SDServices.h.
Referenced by GetUserSD(), and MapUserSD().
|
private |
info about user SDs
Definition at line 122 of file TG4SDServices.h.
Referenced by GetMediumID(), MapUserSD(), and TG4SDServices().