8#include "G4SDManager.hh"
25template <
class SDType,
class HitContainerType>
27 const std::string& name,
const std::string& hitCollectionName)
28 : G4VSensitiveDetector(name),
35template <
class SDType,
class HitContainerType>
43template <
class SDType,
class HitContainerType>
46 if (verboseLevel >= 5) {
47 G4cout << GetName() <<
" \tDEBUG\t"
50 m_hitColl = std::make_unique<HitContainerType>();
57template <
class SDType,
class HitContainerType>
59 G4TouchableHistory*) {
61 description <<
"ProcessHits: this SD shouldn't be assigned to volumes!";
62 G4Exception(GetName(),
"SDError", FatalException,
description);
69template <
class SDType,
class HitContainerType>
72 G4cerr << GetName() <<
" \tERROR\t" <<
"Hit collection WriteHandle is "
73 <<
"invalid!" << G4endl;
74 throw std::runtime_error(
"Invalid hit container WriteHandle: " +
A template class which wraps multiple sensitive detectors.
virtual bool ProcessHits(G4Step *, G4TouchableHistory *) override final
This method should not be called. It will throw.
virtual void Initialize(G4HCofThisEvent *) override final
Beginning of G4 event; initialize the hit collection.
SDWrapper(const std::string &name, const std::string &hitCollectionName)
Construct the wrapper from the output collection name.
void EndOfAthenaEvent()
Gather the hits into the WriteHandle from all the SDs.
std::string m_hitCollName
The hit container name.
SDList_t m_sdList
The list of sensitive detectors that I own and manage.
void addSD(SDType *sd)
Add an SD to this wrapper.
SG::WriteHandle< HitContainerType > m_hitColl
The hit container handle.
Common sensitive detector class for LAr systems.
Class for collection of StepInfo class (G4 hits) copied and modified version to ISF.
std::string description
glabal timer - how long have I taken so far?