ATLAS Offline Software
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_FASTCALOSIMSD_SDWRAPPER_H
6 #define ISF_FASTCALOSIMSD_SDWRAPPER_H
7 
8 // System includes
9 #include <string>
10 #include <vector>
11 #include <memory>
12 
13 // External includes
14 #include "G4VSensitiveDetector.hh"
15 
16 // Framework includes
17 #include "StoreGate/WriteHandle.h"
18 
19 
20 // Forward declarations
21 class FCS_StepInfoSD;
22 namespace ISF_FCS_Parametrization {
23  class FCS_StepInfoCollection;
24 }
25 namespace FCS_Param
26 {
27 
28  namespace detail
29  {
30 
49  template<class SDType, class HitContainerType>
50  class SDWrapper : public G4VSensitiveDetector
51  {
52 
53  public:
54 
56  using SDList_t = std::vector< std::unique_ptr<SDType> >;
57 
59  SDWrapper(const std::string& name, const std::string& hitCollectionName);
60 
62  void addSD(std::unique_ptr<SDType> sd);
63 
65  virtual void Initialize(G4HCofThisEvent*) override final;
66 
68  virtual bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
69 
71  void EndOfAthenaEvent();
72 
73  private:
74 
76  std::string m_hitCollName;
77 
80 
83 
84  }; // class SDWrapper
85 
86  } // namespace detail
87 
88 
91 
92 } // namespace FCS_Param
93 
94 #endif
FCS_Param::detail::SDWrapper::m_hitColl
SG::WriteHandle< HitContainerType > m_hitColl
The hit container handle.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h:79
FCS_Param::detail::SDWrapper::m_hitCollName
std::string m_hitCollName
The hit container name.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h:76
detail
Definition: extract_histogram_tag.cxx:14
FCS_Param::detail::SDWrapper::SDList_t
std::vector< std::unique_ptr< SDType > > SDList_t
Alias to the SD list type.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h:56
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:612
WriteHandle.h
Handle class for recording to StoreGate.
FCS_Param::detail::SDWrapper::m_sdList
SDList_t m_sdList
The list of sensitive detectors that I own and manage.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h:82
FCS_Param
Definition: FCS_StepInfoSD.h:39
FCS_Param::detail::SDWrapper::SDWrapper
SDWrapper(const std::string &name, const std::string &hitCollectionName)
Construct the wrapper from the output collection name.
Definition: SDWrapper.cxx:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FCS_Param::detail::SDWrapper::EndOfAthenaEvent
void EndOfAthenaEvent()
Gather the hits into the WriteHandle from all the SDs.
Definition: SDWrapper.cxx:79
SG::WriteHandle< HitContainerType >
FCS_Param::detail::SDWrapper::Initialize
virtual void Initialize(G4HCofThisEvent *) override final
Beginning of G4 event; initialize the hit collection.
Definition: SDWrapper.cxx:50
FCS_StepInfoSD
Common sensitive detector class for LAr systems.
Definition: FCS_StepInfoSD.h:93
FCS_Param::detail::SDWrapper
A template class which wraps multiple sensitive detectors.
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/src/SDWrapper.h:51
FCS_Param::detail::SDWrapper::addSD
void addSD(std::unique_ptr< SDType > sd)
Add an SD to this wrapper.
Definition: SDWrapper.cxx:40
FCS_Param::detail::SDWrapper::ProcessHits
virtual bool ProcessHits(G4Step *, G4TouchableHistory *) override final
This method should not be called. It will throw.
Definition: SDWrapper.cxx:66
ISF_FCS_Parametrization
Definition: FCS_StepInfo.h:25