 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef G4ATLASTOOLS_SENSITIVEDETECTORBASE_H
6 #define G4ATLASTOOLS_SENSITIVEDETECTORBASE_H
8 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
21 #include "G4VSensitiveDetector.hh"
23 #ifdef G4MULTITHREADED
24 # include "tbb/concurrent_unordered_map.h"
33 class G4LogicalVolume;
34 class G4VSensitiveDetector;
88 const std::vector<std::string>& volumes)
const;
93 G4VSensitiveDetector*
getSD();
96 Gaudi::Property<std::vector<std::string> >
m_volumeNames{
this,
"LogicalVolumeNames", {}};
110 void setSD(G4VSensitiveDetector*);
117 #ifdef G4MULTITHREADED
118 using SDThreadMap_t = tbb::concurrent_unordered_map
120 <
std::thread::id, G4VSensitiveDetector*, std::hash<std::thread::id> >;
122 SDThreadMap_t m_sdThreadMap;
124 G4VSensitiveDetector*
m_SD{};
130 #pragma GCC diagnostic pop
virtual StatusCode SetupEvent() override
Beginning of an athena event.
Small wrapper around hit collection map to facilitate accessing the hit collection.
G4VSensitiveDetector * m_SD
The sensitive detector to which this thing corresponds.
virtual ~SensitiveDetectorBase()
Empty virtual destructor.
Common base class for tools that create and manage Geant4 sensitive detectors.
SensitiveDetectorBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
G4VSensitiveDetector * getSD()
Retrieve the current SD.
virtual StatusCode SetupEvent(HitCollectionMap &) override
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode Gather(HitCollectionMap &) override
StatusCode initializeSD() override
Setup an SD in the current thread.
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
void SetSensitiveDetector(G4LogicalVolume *, G4VSensitiveDetector *) const
Method stolen from G4VUserDetectorConstruction in G4 10.2.
static bool matchStrings(const char *first, const char *second)
Match two strings with wildcard support.
Gaudi::Property< std::vector< std::string > > m_volumeNames
All the volumes to which this SD is assigned.
Gaudi::Property< bool > m_noVolumes
This SensitiveDetector has no volumes associated with it.
virtual StatusCode Gather() override
End of an athena event.
void setSD(G4VSensitiveDetector *)
Set the current SD.
StatusCode assignSD(G4VSensitiveDetector *sd, const std::vector< std::string > &volumes) const
Assign SD to a list of volumes.