ATLAS Offline Software
|
A template class which wraps multiple sensitive detectors. More...
#include <SDWrapper.h>
Public Types | |
using | SDList_t = std::vector< std::unique_ptr< SDType > > |
Alias to the SD list type. More... | |
Public Member Functions | |
SDWrapper (const std::string &name, const std::string &hitCollectionName, const std::string &deadHitCollectionName="") | |
Construct the wrapper from the output collection name. More... | |
void | addSD (std::unique_ptr< SDType > sd) |
Add an SD to this wrapper. More... | |
void | addFastSimSD (const std::string &fastSimSDName) |
Add a (non-owned) fast-sim SD by name. More... | |
virtual void | Initialize (G4HCofThisEvent *) override final |
Beginning of G4 event; initialize the hit collection. More... | |
virtual bool | ProcessHits (G4Step *, G4TouchableHistory *) override final |
This method should not be called. It will throw. More... | |
void | EndOfAthenaEvent () |
Gather the hits into the WriteHandle from all the SDs. More... | |
void | EndOfAthenaEvent () |
Private Attributes | |
std::string | m_hitCollName |
The hit container name. More... | |
SG::WriteHandle< HitContainerType > | m_hitColl |
The hit container handle. More... | |
std::string | m_deadHitCollName |
The hit container name. More... | |
SG::WriteHandle< HitContainerType > | m_deadHitColl |
The hit container handle. More... | |
SDList_t | m_sdList |
The list of sensitive detectors that I own and manage. More... | |
std::string | m_fastSimSDName |
A fastsim SD name that I do not own but invoke in order to share my hit container. More... | |
A template class which wraps multiple sensitive detectors.
Allows for SD tools to manage several SDs which collaborate to fill one hit container in a multi-threading-friendly way. The wrapper owns the WriteHandle for the hit container and gathers hits from each SD at the end of an event.
The inheritance from G4VSensitiveDetector is merely a trick so the SD tool can save this object in the SensitiveDetectorBase thread-local container. It also allows to create the hit container at the right time via the SD Initialize method invoked by Geant4.
Clients shouldn't use this generic template directly, but should use the explicitly allowed specializations given below.
Definition at line 52 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
using LArG4::detail::SDWrapper< SDType, HitContainerType >::SDList_t = std::vector< std::unique_ptr<SDType> > |
Alias to the SD list type.
Definition at line 58 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
LArG4::detail::SDWrapper< SDType, HitContainerType >::SDWrapper | ( | const std::string & | name, |
const std::string & | hitCollectionName, | ||
const std::string & | deadHitCollectionName = "" |
||
) |
Construct the wrapper from the output collection name.
void LArG4::detail::SDWrapper< SDType, HitContainerType >::addFastSimSD | ( | const std::string & | fastSimSDName | ) |
Add a (non-owned) fast-sim SD by name.
void LArG4::detail::SDWrapper< SDType, HitContainerType >::addSD | ( | std::unique_ptr< SDType > | sd | ) |
Add an SD to this wrapper.
void LArG4::detail::SDWrapper< SDType, HitContainerType >::EndOfAthenaEvent | ( | ) |
Gather the hits into the WriteHandle from all the SDs.
void LArG4::detail::SDWrapper< LArG4CalibSD, CaloCalibrationHitContainer >::EndOfAthenaEvent | ( | ) |
|
finaloverridevirtual |
Beginning of G4 event; initialize the hit collection.
|
finaloverridevirtual |
This method should not be called. It will throw.
|
private |
The hit container handle.
Definition at line 94 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
|
private |
The hit container name.
Definition at line 91 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
|
private |
A fastsim SD name that I do not own but invoke in order to share my hit container.
For now I'm assuming there is only one.
Definition at line 101 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
|
private |
The hit container handle.
Definition at line 88 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
|
private |
The hit container name.
Definition at line 85 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.
|
private |
The list of sensitive detectors that I own and manage.
Definition at line 97 of file LArCalorimeter/LArG4/LArG4Code/LArG4Code/SDWrapper.h.