![]() |
ATLAS Offline Software
|
Common base class for tools that create and manage Geant4 sensitive detectors. More...
#include <SensitiveDetectorBase.h>
Inherits extends< AthAlgTool, ISensitiveDetector >.
Inherited by AFP_SensitiveDetectorTool, AFP_SiDSensitiveDetectorTool, AFP_TDSensitiveDetectorTool, ALFA_SensitiveDetectorTool, BCMSensorSDTool, BLMSensorSDTool, CSCSensitiveDetectorCosmicsTool, CSCSensitiveDetectorTool, CaloCellContainerSDTool, FCS_Param::FCS_StepInfoSDTool, GenericMuonSensitiveDetectorTool, HGTDSensorSDTool, LArG4::CalibSDTool, LArG4::SimpleSDTool, LArG4SDTool, LUCID_SensitiveDetectorTool, MDTSensitiveDetectorCosmicsTool, MDTSensitiveDetectorTool, MicromegasSensitiveDetectorTool, MinBiasScintillatorSDTool, MuonG4R4::MuonSensitiveDetectorTool, MuonWallSDTool, PixelSensorSDTool, RPCSensitiveDetectorCosmicsTool, RPCSensitiveDetectorTool, SctSensorSDTool, SctSensor_CTBTool, TGCSensitiveDetectorCosmicsTool, TGCSensitiveDetectorTool, TRTSensitiveDetectorTool, TileGeoG4CalibSDTool, TileGeoG4SDTool, TrackFastSimSDTool, TrackRecorderSDTool, ZDC_FiberSDTool, ZDC_G4CalibSDTool, and sTGCSensitiveDetectorTool.
Public Member Functions | |
| SensitiveDetectorBase (const std::string &type, const std::string &name, const IInterface *parent) | |
| Standard constructor. | |
| virtual | ~SensitiveDetectorBase ()=default |
| Empty virtual destructor. | |
| StatusCode | initializeSD () override |
| Setup an SD in the current thread. | |
| virtual StatusCode | SetupEvent (HitCollectionMap &) override |
| Beginning of an athena event. | |
| virtual StatusCode | Gather (HitCollectionMap &) override |
| End of an athena event. | |
Protected Member Functions | |
| StatusCode | assignSD (std::unique_ptr< G4VSensitiveDetector > sd, const std::vector< std::string > &volumes) const |
| Assign SD to a list of volumes. | |
| void | SetSensitiveDetector (G4LogicalVolume *, G4VSensitiveDetector *) const |
| Method stolen from G4VUserDetectorConstruction in G4 10.2. | |
Protected Attributes | |
| Gaudi::Property< std::vector< std::string > > | m_volumeNames {this, "LogicalVolumeNames", {}} |
| All the volumes to which this SD is assigned. | |
| Gaudi::Property< std::vector< std::string > > | m_outputCollectionNames {this, "OutputCollectionNames", {}} |
| Names of all output collections written out by this SD. | |
| Gaudi::Property< bool > | m_noVolumes {this, "NoVolumes", false} |
| This SensitiveDetector has no volumes associated with it. | |
Static Private Member Functions | |
| static bool | matchStrings (const char *first, const char *second) |
| Match two strings with wildcard support. | |
Common base class for tools that create and manage Geant4 sensitive detectors.
Concrete tools must implement the makeSD method of ISensitiveDetector to create an SD on demand. In multi-threading mode, SDs are created once per thread by the infrastructure invoking initializeSDs.
Concrete tools can optionally implement the SetupEvent and Gather methods for preparing and post-processing output collections at the beginning or end of an Athena event.
Definition at line 38 of file SensitiveDetectorBase.h.
| SensitiveDetectorBase::SensitiveDetectorBase | ( | const std::string & | type, |
| const std::string & | name, | ||
| const IInterface * | parent ) |
Standard constructor.
Definition at line 17 of file SensitiveDetectorBase.cxx.
|
virtualdefault |
Empty virtual destructor.
|
protected |
Assign SD to a list of volumes.
This method supports wild card matching
Definition at line 55 of file SensitiveDetectorBase.cxx.
|
inlineoverridevirtual |
End of an athena event.
Store the output collection in SG at this point. If we are using a WriteHandle, then this can be empty!
Reimplemented in AFP_SensitiveDetectorTool, AFP_SiDSensitiveDetectorTool, AFP_TDSensitiveDetectorTool, ALFA_SensitiveDetectorTool, BCMSensorSDTool, BLMSensorSDTool, CaloCellContainerSDTool, CSCSensitiveDetectorCosmicsTool, CSCSensitiveDetectorTool, FCS_Param::FCS_StepInfoSDTool, GenericMuonSensitiveDetectorTool, HGTDSensorSDTool, LArG4::CalibSDTool, LArG4::SimpleSDTool, LUCID_SensitiveDetectorTool, MDTSensitiveDetectorCosmicsTool, MDTSensitiveDetectorTool, MicromegasSensitiveDetectorTool, MinBiasScintillatorSDTool, MuonG4R4::MuonSensitiveDetectorTool, MuonWallSDTool, PixelSensorSDTool, RPCSensitiveDetectorCosmicsTool, RPCSensitiveDetectorTool, SctSensor_CTBTool, SctSensorSDTool, sTGCSensitiveDetectorTool, TGCSensitiveDetectorCosmicsTool, TGCSensitiveDetectorTool, TileGeoG4CalibSDTool, TileGeoG4SDTool, TrackFastSimSDTool, TrackRecorderSDTool, TRTSensitiveDetectorTool, ZDC_FiberSDTool, and ZDC_G4CalibSDTool.
Definition at line 66 of file SensitiveDetectorBase.h.
|
override |
Setup an SD in the current thread.
Separate from the AthAlgTool initialize() method because it needs to be called once per worker thread in AthenaMT. Don't confuse this with the G4 SD method Initialize which is called at the beginning of every G4 event.
Definition at line 25 of file SensitiveDetectorBase.cxx.
Match two strings with wildcard support.
Compares two strings character by character with optional * wildcard in the first argument
Definition at line 115 of file SensitiveDetectorBase.cxx.
|
protected |
Method stolen from G4VUserDetectorConstruction in G4 10.2.
Definition at line 142 of file SensitiveDetectorBase.cxx.
|
inlineoverridevirtual |
Beginning of an athena event.
This is where collection initialization should happen. If we are using a WriteHandle, then this could be empty.
Reimplemented in AFP_SensitiveDetectorTool, AFP_SiDSensitiveDetectorTool, AFP_TDSensitiveDetectorTool, ALFA_SensitiveDetectorTool, BCMSensorSDTool, BLMSensorSDTool, CaloCellContainerSDTool, CSCSensitiveDetectorCosmicsTool, CSCSensitiveDetectorTool, GenericMuonSensitiveDetectorTool, HGTDSensorSDTool, LArG4::CalibSDTool, LArG4::SimpleSDTool, LUCID_SensitiveDetectorTool, MDTSensitiveDetectorCosmicsTool, MDTSensitiveDetectorTool, MicromegasSensitiveDetectorTool, MinBiasScintillatorSDTool, MuonG4R4::MuonSensitiveDetectorTool, MuonWallSDTool, PixelSensorSDTool, RPCSensitiveDetectorCosmicsTool, RPCSensitiveDetectorTool, SctSensor_CTBTool, SctSensorSDTool, sTGCSensitiveDetectorTool, TGCSensitiveDetectorCosmicsTool, TGCSensitiveDetectorTool, TileGeoG4CalibSDTool, TileGeoG4SDTool, TrackFastSimSDTool, TrackRecorderSDTool, TRTSensitiveDetectorTool, ZDC_FiberSDTool, and ZDC_G4CalibSDTool.
Definition at line 59 of file SensitiveDetectorBase.h.
|
protected |
This SensitiveDetector has no volumes associated with it.
Definition at line 83 of file SensitiveDetectorBase.h.
|
protected |
Names of all output collections written out by this SD.
Definition at line 80 of file SensitiveDetectorBase.h.
|
protected |
All the volumes to which this SD is assigned.
Definition at line 78 of file SensitiveDetectorBase.h.