|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef LARG4CODE_SDWRAPPER_H
6 #define LARG4CODE_SDWRAPPER_H
14 #include "G4VSensitiveDetector.hh"
51 template<
class SDType,
class HitContainerType>
58 using SDList_t = std::vector< std::unique_ptr<SDType> >;
61 SDWrapper(
const std::string&
name,
const std::string& hitCollectionName,
const std::string& deadHitCollectionName=
"");
70 virtual void Initialize(G4HCofThisEvent*)
override final;
73 virtual bool ProcessHits(G4Step*, G4TouchableHistory*)
override final;
78 #ifdef SDWRAPPER_TEST//here use conditional compiling to solve the private members accessing problem from test code since adding-friend method can not work in this context(where there are two layer namespaces)
A template class which wraps multiple sensitive detectors.
std::string m_hitCollName
The hit container name.
void EndOfAthenaEvent()
Gather the hits into the WriteHandle from all the SDs.
virtual bool ProcessHits(G4Step *, G4TouchableHistory *) override final
This method should not be called. It will throw.
void addSD(std::unique_ptr< SDType > sd)
Add an SD to this wrapper.
SDList_t m_sdList
The list of sensitive detectors that I own and manage.
std::string m_deadHitCollName
The hit container name.
Common sensitive detector class for LAr systems.
SDWrapper(const std::string &name, const std::string &hitCollectionName, const std::string &deadHitCollectionName="")
Construct the wrapper from the output collection name.
virtual void Initialize(G4HCofThisEvent *) override final
Beginning of G4 event; initialize the hit collection.
Handle class for recording to StoreGate.
std::string m_fastSimSDName
A fastsim SD name that I do not own but invoke in order to share my hit container.
A specialized SD class for saving LAr calibration hits.
std::vector< std::unique_ptr< SDType > > SDList_t
Alias to the SD list type.
SG::WriteHandle< HitContainerType > m_deadHitColl
The hit container handle.
void addFastSimSD(const std::string &fastSimSDName)
Add a (non-owned) fast-sim SD by name.
SG::WriteHandle< HitContainerType > m_hitColl
The hit container handle.