ATLAS Offline Software
MdtSensitiveDetector.h
Go to the documentation of this file.
1 #ifndef MUONG4R4_MDTSENSITIVEDETECTOR_H
2 #define MUONG4R4_MDTSENSITIVEDETECTOR_H
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
70 
71 #include <StoreGate/WriteHandle.h>
75 
76 #include <G4VSensitiveDetector.hh>
77 
78 
79 
80 class G4TouchableHistory;
81 
82 
83 namespace MuonG4R4 {
84 
85 
86 class MdtSensitiveDetector : public G4VSensitiveDetector, public AthMessaging {
87 
88 public:
95  MdtSensitiveDetector(const std::string& name,
96  const std::string& output_key,
97  const std::string& trf_storKey,
98  const MuonGMR4::MuonDetectorManager* detMgr);
99 
101 
103  void Initialize(G4HCofThisEvent* HCE) override final;
104  G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist) override final;
105 
106 private:
108  const MuonGMR4::MdtReadoutElement* getReadoutElement(const G4TouchableHistory* touchHist) const;
111  const MuonGMR4::MdtReadoutElement* reElement,
112  const G4TouchableHistory* touchHist) const;
113  /*
114  * For the moment use write handles because the sensitive detectors are
115  * managed by a service which must not have a data dependency
116  */
125 
126 };
127 
128 }
129 #endif
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:61
MuonG4R4::MdtSensitiveDetector::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the underlying detector manager.
Definition: MdtSensitiveDetector.h:124
MuonG4R4::MdtSensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *HCE) override final
member functions
Definition: MdtSensitiveDetector.cxx:38
SG::ReadHandleKey< ActsTrk::DetectorAlignStore >
MuonG4R4::MdtSensitiveDetector::getReadoutElement
const MuonGMR4::MdtReadoutElement * getReadoutElement(const G4TouchableHistory *touchHist) const
Retrieves the matching readout element to a G4 hit.
Definition: MdtSensitiveDetector.cxx:50
GeoPrimitives.h
WriteHandle.h
Handle class for recording to StoreGate.
MuonG4R4
Include the common definitions from the MuonReadoutGeometry.
Definition: MuonSpectrometer/MuonPhaseII/MuonG4/MuonSensitiveDetectorsR4/MuonSensitiveDetectorsR4/Utils.h:14
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MuonG4R4::MdtSensitiveDetector::getIdentifier
Identifier getIdentifier(const ActsGeometryContext &gctx, const MuonGMR4::MdtReadoutElement *reElement, const G4TouchableHistory *touchHist) const
Retrieves from the Readoutelement & the touchable history the Identifier.
Definition: MdtSensitiveDetector.cxx:148
MuonDetectorManager.h
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonSimHitContainer.h
MuonG4R4::MdtSensitiveDetector::MdtSensitiveDetector
MdtSensitiveDetector(const std::string &name, const std::string &output_key, const std::string &trf_storKey, const MuonGMR4::MuonDetectorManager *detMgr)
Constructor.
Definition: MdtSensitiveDetector.cxx:26
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonG4R4::MdtSensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) override final
Definition: MdtSensitiveDetector.cxx:76
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonG4R4::MdtSensitiveDetector
Definition: MdtSensitiveDetector.h:86
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthMessaging.h
MuonG4R4::MdtSensitiveDetector::~MdtSensitiveDetector
~MdtSensitiveDetector()=default
MuonG4R4::MdtSensitiveDetector::m_trfCacheKey
SG::ReadHandleKey< ActsTrk::DetectorAlignStore > m_trfCacheKey
ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event...
Definition: MdtSensitiveDetector.h:122
MuonG4R4::MdtSensitiveDetector::m_writeHandle
SG::WriteHandle< xAOD::MuonSimHitContainer > m_writeHandle
Definition: MdtSensitiveDetector.h:117