![]() |
ATLAS Offline Software
|
Sensitive detector implementation to record G4 hits in the Tgc detectors. More...
#include <TgcSensitiveDetector.h>
Public Member Functions | |
| ~TgcSensitiveDetector ()=default | |
| Default destructor. | |
| virtual G4bool | ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist) override final |
| MuonSensitiveDetector (const std::string &name, const std::string &output_key, const std::string &trf_storeKey, const MuonGMR4::MuonDetectorManager *detMgr) | |
| Recycle the constructor from the MuonSensitiveDetector. | |
| virtual void | Initialize (G4HCofThisEvent *HCE) override final |
| Create the output container at the beginning of the event. | |
| bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. | |
| MsgStream & | msg () const |
| The standard message stream. | |
| MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. | |
| void | setLevel (MSG::Level lvl) |
| Change the current logging level. | |
Protected Member Functions | |
| xAOD::MuonSimHit * | lastSnapShot (const Identifier &gasGapId, const G4Step *hitStep) |
| Returns the last snap shot of the traversing particle. | |
| bool | processStep (const G4Step *step) const |
| Checks whether the current step shall be processed at all. | |
| const EventContext & | eventContext () const |
| Returns the current event context recorded in the G4 event info. | |
| ActsTrk::GeometryContext | getGeoContext () const |
| Returns the current geometry context in the 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. | |
| 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. | |
Protected Attributes | |
| const MuonGMR4::MuonDetectorManager * | m_detMgr {nullptr} |
| Pointer to the underlying detector manager. | |
Private Member Functions | |
| const MuonGMR4::TgcReadoutElement * | getReadoutElement (const G4TouchableHistory *touchHist) const |
| Retrieves the readout element that's associates with the TouchableHistory. | |
| Identifier | getIdentifier (const ActsTrk::GeometryContext &gctx, const MuonGMR4::TgcReadoutElement *readOutEle, const Amg::Vector3D &hitAtGapPlane, bool phiGap) const |
| Constructs the Identifier of the gasGap using the readoutElement and the hit expressed in it's local coordinate frame. | |
| AtlasG4EventUserInfo * | eventInfo () const |
| Returns the event user info for the current G4 event, if available. | |
| xAOD::MuonSimHit * | lastSnapShot (const Identifier &gasGapId, const G4Step *hitStep, const HepMcParticleLink &particleLink) |
| Returns the last snap shot matching an already generated HepMcParticleLink. | |
| void | initMessaging () const |
| Initialize our message level and MessageSvc. | |
Private Attributes | |
| std::string | m_writeKey {} |
| Key under which the output container is stored in the G4 event. | |
| xAOD::MuonSimHitContainer * | m_outContainer {} |
| Pointer to the MuonSimHit output container. | |
| AtlasG4EventUserInfo * | m_g4UserEventInfo {} |
| G4 event user information holding the current event store/context. | |
| SG::ReadHandleKey< ActsTrk::DetectorAlignStore > | m_trfCacheKey |
| ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event. | |
| std::string | m_nm |
| Message source name. | |
| boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| MsgStream instance (a std::cout like with print-out levels). | |
| std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| MessageSvc pointer. | |
| std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| Current logging level. | |
| std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| Messaging initialized (initMessaging). | |
Sensitive detector implementation to record G4 hits in the Tgc detectors.
The ProcessHits hook is called by Geant4 if the track enters a sensible Rpc gas gap volume. The TouchableHistory is used to deduce the associated readout element and then to identify the actual gas gap. The hit is then passed to the MuonSensitiveDetector class for event record
Definition at line 22 of file TgcSensitiveDetector.h.
|
default |
Default destructor.
|
protectedinherited |
Returns the current event context recorded in the G4 event info.
Definition at line 54 of file MuonSensitiveDetector.cxx.
|
privateinherited |
Returns the event user info for the current G4 event, if available.
Definition at line 51 of file MuonSensitiveDetector.cxx.
|
protectedinherited |
Generates a HepMcParticleLink for the Geant4 track using the current event store.
| track | the track for which particle link should be created |
Definition at line 87 of file MuonSensitiveDetector.cxx.
|
protectedinherited |
Returns the current geometry context in the event.
Definition at line 61 of file MuonSensitiveDetector.cxx.
|
private |
Constructs the Identifier of the gasGap using the readoutElement and the hit expressed in it's local coordinate frame.
| gctx | Geometry context to transform the hit accordingly |
| readOutEle | ReadoutElement that's identified from the TouchableHistory |
| hitAtGapPlane | Position of the hit expressed at the gasGap centre in global coordinates |
Definition at line 70 of file TgcSensitiveDetector.cxx.
|
private |
Retrieves the readout element that's associates with the TouchableHistory.
The readout element is decoded from the volume name in the history.
| touchHist | History of the hit to determine the readout element from |
The third volume encodes the information of the Tgc detector
We should have a string which kind of looks like av_319_impr_1_MuonR4::LogVolMuonStation_pv_190_T3E_Station2_-2_46 Of interest are only the T1E part and the last 2 numbers
Definition at line 50 of file TgcSensitiveDetector.cxx.
|
finaloverridevirtualinherited |
Create the output container at the beginning of the event.
Definition at line 38 of file MuonSensitiveDetector.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
protectedinherited |
Returns the last snap shot of the traversing particle.
The G4 track must have stepped through the same volume. Otherwise, a nullptr is returned
| gasGapId | Identifier of the gasGap to consider |
| hitStep | Pointer to the current step |
Definition at line 167 of file MuonSensitiveDetector.cxx.
|
privateinherited |
Returns the last snap shot matching an already generated HepMcParticleLink.
| gasGapId | Identifier of the gasGap to consider |
| hitStep | Pointer to the current step . |
| particleLink | the existing particle link for the G4Track |
There's only a snapshot if the last saved hit has the same Identifier & the same particle Link + G4Track Id
Definition at line 172 of file MuonSensitiveDetector.cxx.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 167 of file AthMessaging.h.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 182 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
| lvl | The message level to test against |
| true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
| MuonG4R4::MuonSensitiveDetector::MuonSensitiveDetector | ( | const std::string & | name, |
| const std::string & | output_key, | ||
| const std::string & | trf_storeKey, | ||
| const MuonGMR4::MuonDetectorManager * | detMgr ) |
Recycle the constructor from the MuonSensitiveDetector.
Definition at line 42 of file MuonSensitiveDetector.cxx.
|
finaloverridevirtual |
Fetch the local -> global transformation
Definition at line 20 of file TgcSensitiveDetector.cxx.
|
protectedinherited |
Checks whether the current step shall be processed at all.
I.e. the particle needs to be charged, there's a minimum velocity needed and the step length must not vanish
| step | G4 step to consider |
Reject secondary particles
Sensitive detector is only sensitive to charged particles or Geantinos
Definition at line 70 of file MuonSensitiveDetector.cxx.
|
protectedinherited |
Records the G4Step in the sim hit.
Hits are usually expressed at the center point of the step. Except for low-energy electrons where the endpoint of the random walk path is just extended
| hitId | Identifier of the gas gap or the tube in which the hit is recorded |
| toGaGap | Transform from the ATLAS global coordinates into the sensitive volume |
| hitStep | Step from which the particle's information and the pre and post step positions are fetched |
Fetch the step end-points
Hit direction as the momentum direction
Electrons randomly work through the gas instead of drifting through the gas -> take the prestep of the first snap shop inside the gas as pre step point
Definition at line 92 of file MuonSensitiveDetector.cxx.
|
protectedinherited |
Saves the current Step as a xAOD::MuonSimHit snapshot.
| hitId | Identifier of the gasGap/ tube where the hit was deposited |
| hitPos | Local position of the hit expressed w.r.t gas gap coordinate system |
| hitDir | Local direction of the hit expressed w.r.t gas gap coordinate system |
| globTime | Global time of the hit |
| hitStep | Pointer to the step from which the hit information was derived. |
Definition at line 128 of file MuonSensitiveDetector.cxx.
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
|
mutableprivateinherited |
Messaging initialized (initMessaging).
Definition at line 141 of file AthMessaging.h.
|
protectedinherited |
Pointer to the underlying detector manager.
Definition at line 123 of file MuonSensitiveDetector.h.
|
privateinherited |
G4 event user information holding the current event store/context.
Definition at line 58 of file MuonSensitiveDetector.h.
|
mutableprivateinherited |
|
mutableprivateinherited |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels).
Definition at line 132 of file AthMessaging.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
privateinherited |
Pointer to the MuonSimHit output container.
Definition at line 56 of file MuonSensitiveDetector.h.
|
privateinherited |
ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event.
Definition at line 61 of file MuonSensitiveDetector.h.
|
privateinherited |
Key under which the output container is stored in the G4 event.
Definition at line 54 of file MuonSensitiveDetector.h.