Geant4 VMC Version 6.6
|
Sensitive detectors services. More...
#include <TG4SDServices.h>
Public Member Functions | |
TG4SDServices () | |
~TG4SDServices () | |
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 |
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::map< G4int, G4LogicalVolume * > | fVolIdToLVMap |
map volume id -> logical volume | |
std::map< G4LogicalVolume *, G4int > | fLVToVolIdMap |
map logical volume -> volume 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 41 of file TG4SDServices.h.
TG4SDServices::TG4SDServices | ( | ) |
Default constructor
Definition at line 38 of file TG4SDServices.cxx.
TG4SDServices::~TG4SDServices | ( | ) |
Destructor
Definition at line 55 of file TG4SDServices.cxx.
|
private |
Not implemented.
|
inlinestatic |
Returns this instance.
Definition at line 120 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 126 of file TG4SDServices.h.
Referenced by TG4SDConstruction::MapVolumesToInstanceIds().
void TG4SDServices::MapVolume | ( | G4LogicalVolume * | lv, |
G4int | id, | ||
G4bool | fillLVToVolIdMap ) |
Add the given volume in the maps. Do nothing if a given volume id or name is already present.
Definition at line 66 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 87 of file TG4SDServices.cxx.
Referenced by TG4SDManager::SetSensitiveDetector().
void TG4SDServices::PrintStatistics | ( | G4bool | open, |
G4bool | close ) const |
Print G4 SD statistics
Definition at line 120 of file TG4SDServices.cxx.
Referenced by TG4RunManager::LateInitialize().
void TG4SDServices::PrintVolNameToIdMap | ( | ) | const |
Print volume name -> volume id map
Definition at line 133 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
void TG4SDServices::PrintVolIdToLVMap | ( | ) | const |
Print volume id -> lv map
Definition at line 153 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
void TG4SDServices::PrintSensitiveVolumes | ( | ) | const |
Print volumes which have defined SD
Definition at line 174 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct().
void TG4SDServices::PrintUserSensitiveDetectors | ( | ) | const |
Print volumes which have defined SD
Definition at line 193 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 132 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 216 of file TG4SDServices.cxx.
Referenced by TG4StepManager::CurrentVolID(), TG4StepManager::CurrentVolOffID(), NofVolDaughters(), PrintSensitiveVolumes(), PrintUserSensitiveDetectors(), VolDaughterCopyNo(), VolDaughterName(), and TG4SDManager::VolId().
G4int TG4SDServices::GetVolumeID | ( | G4LogicalVolume * | volume | ) | const |
Return the volume ID of the specified logical volume. The volume ID is defined via associated sensitive detector ID or is taken from a map (if user applies sentitive volumes selection.)
Definition at line 234 of file TG4SDServices.cxx.
G4int TG4SDServices::GetMediumID | ( | G4LogicalVolume * | volume | ) | const |
Return the medium ID for the specified logical volume.
Definition at line 282 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 332 of file TG4SDServices.cxx.
Referenced by TG4SDManager::VolName().
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 352 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 375 of file TG4SDServices.cxx.
Referenced by TG4SDManager::VolId2Mate().
TVirtualMCSensitiveDetector * TG4SDServices::GetUserSD | ( | G4String | volumeName, |
G4bool | warn = true ) const |
Definition at line 310 of file TG4SDServices.cxx.
Referenced by TG4SDConstruction::Construct(), and TG4SDManager::GetSensitiveDetector().
|
inline |
Returns flag for notifying about stopping run by a user.
Definition at line 138 of file TG4SDServices.h.
Referenced by TG4RunManager::FinishRun().
Int_t TG4SDServices::NofSensitiveDetectors | ( | ) | const |
Return the total number of sensitive detectors.
Definition at line 384 of file TG4SDServices.cxx.
Referenced by TG4SDManager::NofVolumes(), and PrintStatistics().
TG4SensitiveDetector * TG4SDServices::GetSensitiveDetector | ( | G4VSensitiveDetector * | sd | ) | const |
Check and convert type of the sensitive detector.
Definition at line 392 of file TG4SDServices.cxx.
Referenced by GetMediumID(), GetVolumeID(), TG4SteppingAction::ProcessTrackOnBoundary(), and TG4TrackingAction::UserProcessHits().
|
inline |
Returns the user SD vector
Definition at line 144 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 411 of file TG4SDServices.cxx.
Referenced by TG4SDManager::NofVolDaughters().
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 424 of file TG4SDServices.cxx.
Referenced by TG4SDManager::VolDaughterName().
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 450 of file TG4SDServices.cxx.
Referenced by TG4SDManager::VolDaughterCopyNo().
|
private |
Not implemented.
|
staticprivate |
this instance
Definition at line 92 of file TG4SDServices.h.
Referenced by Instance(), TG4SDServices(), and ~TG4SDServices().
|
staticprivate |
the first volume id
Definition at line 94 of file TG4SDServices.h.
Referenced by GetFirstVolumeId(), and GetVolumeID().
|
private |
info about run stopping by user
Definition at line 96 of file TG4SDServices.h.
Referenced by GetIsStopRun(), and SetIsStopRun().
|
private |
map volume name -> volume id
Definition at line 99 of file TG4SDServices.h.
Referenced by GetVolumeID(), MapVolume(), and PrintVolNameToIdMap().
|
private |
map volume id -> logical volume
Definition at line 102 of file TG4SDServices.h.
Referenced by GetLogicalVolume(), MapVolume(), and PrintVolIdToLVMap().
|
private |
map logical volume -> volume id
Definition at line 105 of file TG4SDServices.h.
Referenced by GetVolumeID(), and MapVolume().
|
staticprivate |
vector of user SDs
Definition at line 108 of file TG4SDServices.h.
Referenced by GetUserSDs(), and MapUserSD().
|
staticprivate |
map volume name -> user SD
Definition at line 112 of file TG4SDServices.h.
Referenced by GetUserSD(), and MapUserSD().
|
private |
info about user SDs
Definition at line 115 of file TG4SDServices.h.
Referenced by GetMediumID(), GetVolumeID(), and MapUserSD().