ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSensitiveDetector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONSENSITIVEDETECTORSR4_MUONSENSITIVEDETECTOR_H
5#define MUONSENSITIVEDETECTORSR4_MUONSENSITIVEDETECTOR_H
6
9
10#include <GaudiKernel/EventContext.h>
18
19#include <G4VSensitiveDetector.hh>
20
22class G4Track;
24
29namespace MuonG4R4 {
34
35 class MuonSensitiveDetector : public G4VSensitiveDetector, public AthMessaging {
36 public:
42 MuonSensitiveDetector(const std::string& name,
43 const std::string& output_key,
44 const std::string& trf_storeKey,
45 const MuonGMR4::MuonDetectorManager* detMgr);
48
50 virtual void Initialize(G4HCofThisEvent* HCE) override final;
51
52 private:
54 std::string m_writeKey{};
62
65
71 const G4Step* hitStep,
72 const HepMcParticleLink& particleLink);
73
74 protected:
79 bool processStep(const G4Step* step) const;
80
82 const EventContext& eventContext() const;
83
86
89 HepMcParticleLink genParticleLink(const G4Track* track) const;
90
96 const G4Step* hitStep);
97
107 const Amg::Transform3D& toGasGap,
108 const G4Step* hitStep);
109
116 xAOD::MuonSimHit* saveHit(const Identifier& hitId,
117 const Amg::Vector3D& hitPos,
118 const Amg::Vector3D& hitDir,
119 const double globTime,
120 const G4Step* hitStep);
121
124
125
126 };
127}
128
129#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This class is attached to G4Event objects as UserInformation.
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the underlying detector manager.
~MuonSensitiveDetector()=default
default desructor
AtlasG4EventUserInfo * eventInfo() const
Returns the event user info for the current G4 event, if available.
const EventContext & eventContext() const
Returns the current event context recorded in the G4 event info.
virtual void Initialize(G4HCofThisEvent *HCE) override final
Create the output container at the beginning of the event.
MuonSensitiveDetector(const std::string &name, const std::string &output_key, const std::string &trf_storeKey, const MuonGMR4::MuonDetectorManager *detMgr)
Constructor.
SG::ReadHandleKey< ActsTrk::DetectorAlignStore > m_trfCacheKey
ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event...
HepMcParticleLink genParticleLink(const G4Track *track) const
Generates a HepMcParticleLink for the Geant4 track using the current event store.
xAOD::MuonSimHit * propagateAndSaveStrip(const Identifier &hitId, const Amg::Transform3D &toGasGap, const G4Step *hitStep)
Records the G4Step in the sim hit.
bool processStep(const G4Step *step) const
Checks whether the current step shall be processed at all.
AtlasG4EventUserInfo * m_g4UserEventInfo
G4 event user information holding the current event store/context.
std::string m_writeKey
Key under which the output container is stored in the G4 event.
xAOD::MuonSimHit * saveHit(const Identifier &hitId, const Amg::Vector3D &hitPos, const Amg::Vector3D &hitDir, const double globTime, const G4Step *hitStep)
Saves the current Step as a xAOD::MuonSimHit snapshot.
ActsTrk::GeometryContext getGeoContext() const
Returns the current geometry context in the event.
xAOD::MuonSimHitContainer * m_outContainer
Pointer to the MuonSimHit output container.
xAOD::MuonSimHit * lastSnapShot(const Identifier &gasGapId, const G4Step *hitStep, const HepMcParticleLink &particleLink)
Returns the last snap shot matching an already generated HepMcParticleLink.
Property holding a SG store/key/clid from which a ReadHandle is made.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Include the common definitions from the MuonReadoutGeometry.
AthHitVec::AuxStoreHitCollection< xAOD::MuonSimHitContainer, xAOD::MuonSimHitAuxContainer > MuonSimHitsVec
Helper type which can be filled into the HitCollectionMap storing the event content in the event.
MuonSimHitAuxContainer_v1 MuonSimHitAuxContainer
Define the version of the pixel cluster container.
MuonSimHitContainer_v1 MuonSimHitContainer
Define the version of the pixel cluster container.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
Definition MuonSimHit.h:12
Helper for event-local xAOD hit collections with a separate auxiliary store.