ATLAS Offline Software
Loading...
Searching...
No Matches
MuonG4R4::MmSensitiveDetector Class Reference

#include <MmSensitiveDetector.h>

Inheritance diagram for MuonG4R4::MmSensitiveDetector:
Collaboration diagram for MuonG4R4::MmSensitiveDetector:

Public Member Functions

 ~MmSensitiveDetector ()=default
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist) override final
 member functions
 MuonSensitiveDetector (const std::string &name, const std::string &output_key, const std::string &trf_storeKey, const MuonGMR4::MuonDetectorManager *detMgr)
 Constructor.
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

bool processStep (const G4Step *step) const
 Checks whether the current step shall be processed at all.
ActsTrk::GeometryContext getGeoContext () const
 Returns the current geometry context in the event.
xAOD::MuonSimHitlastSnapShot (const Identifier &gasGapId, const G4Step *hitStep)
 Returns the last snap shot of the traversing particle.
xAOD::MuonSimHitpropagateAndSaveStrip (const Identifier &hitId, const Amg::Transform3D &toGasGap, const G4Step *hitStep)
xAOD::MuonSimHitsaveHit (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::MuonDetectorManagerm_detMgr {nullptr}
 Pointer to the underlying detector manager.

Private Member Functions

const MuonGMR4::MmReadoutElementgetReadoutElement (const ActsTrk::GeometryContext &gctx, const G4TouchableHistory *touchHist) const
 Retrieves the matching readout element to a G4 hit.
Identifier getIdentifier (const ActsTrk::GeometryContext &gctx, const MuonGMR4::MmReadoutElement *readOutEle, const Amg::Vector3D &hitAtGapPlane) const
 Identify the gasGap layer of the hit.
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

SG::WriteHandle< xAOD::MuonSimHitContainerm_writeHandle
SG::ReadHandleKey< ActsTrk::DetectorAlignStorem_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)

Detailed Description

Definition at line 29 of file MmSensitiveDetector.h.

Constructor & Destructor Documentation

◆ ~MmSensitiveDetector()

MuonG4R4::MmSensitiveDetector::~MmSensitiveDetector ( )
default

Member Function Documentation

◆ getGeoContext()

ActsTrk::GeometryContext MuonG4R4::MuonSensitiveDetector::getGeoContext ( ) const
protectedinherited

Returns the current geometry context in the event.

Definition at line 48 of file MuonSensitiveDetector.cxx.

48 {
49 ActsTrk::GeometryContext gctx{};
50 SG::ReadHandle trfStoreHandle{m_trfCacheKey};
51 if (!trfStoreHandle.isValid()) {
52 THROW_EXCEPTION("Failed to retrieve "<<m_trfCacheKey.fullKey()<<".");
53 }
54 gctx.setStore(std::make_unique<DetectorAlignStore>(*trfStoreHandle));
55 return gctx;
56 }
void setStore(AlignmentStorePtr store)
Adds the store to the Geometry context.
SG::ReadHandleKey< ActsTrk::DetectorAlignStore > m_trfCacheKey
ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event...
virtual bool isValid() override final
Can the handle be successfully dereferenced?
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ getIdentifier()

Identifier MmSensitiveDetector::getIdentifier ( const ActsTrk::GeometryContext & gctx,
const MuonGMR4::MmReadoutElement * readOutEle,
const Amg::Vector3D & hitAtGapPlane ) const
private

Identify the gasGap layer of the hit.

that's the poor man's solution to find out in which gas gap we're

Definition at line 57 of file MmSensitiveDetector.cxx.

59 {
61 for (unsigned int gap = 1; gap <= readOutEle->nGasGaps(); ++gap){
62 const Amg::Vector3D gapCentre = readOutEle->center(gctx, MmReadoutElement::createHash(gap, 0));
63 ATH_MSG_VERBOSE("Try to match "<<Amg::toString(hitAtGapPlane)<<" to "<<Amg::toString(gapCentre)
64 <<" in "<<m_detMgr->idHelperSvc()->toStringDetEl(readOutEle->identify())<<" dZ: "
65 <<std::abs(gapCentre.z() - hitAtGapPlane.z()));
66 if (std::abs(gapCentre.z() - hitAtGapPlane.z()) < tolerance) {
67 ATH_MSG_VERBOSE("Assign hit "<<Amg::toString(hitAtGapPlane)<<" to "
68 <<m_detMgr->idHelperSvc()->toStringDetEl(readOutEle->identify())<<" gasGap: "<<gap);
69 return readOutEle->measurementId(MmReadoutElement::createHash(gap, 1));
70 }
71 }
72 THROW_EXCEPTION("Invalid gasgap matching for hit "<<Amg::toString(hitAtGapPlane)<<" and detector element "
73 <<m_detMgr->idHelperSvc()->toStringDetEl(readOutEle->identify()));
74 return Identifier{};
75}
#define ATH_MSG_VERBOSE(x)
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the underlying detector manager.
unsigned int nGasGaps() const
Returns the number of gas gaps.
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
static IdentifierHash createHash(const int gasGap, const int strip)
Amg::Vector3D center(const ActsTrk::GeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
Identifier identify() const override final
Return the athena identifier.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 3, 1 > Vector3D
gap(flags, cells_name, *args, **kw)
constexpr double tolerance

◆ getReadoutElement()

const MuonGMR4::MmReadoutElement * MmSensitiveDetector::getReadoutElement ( const ActsTrk::GeometryContext & gctx,
const G4TouchableHistory * touchHist ) const
private

Retrieves the matching readout element to a G4 hit.

The fourth volume is the envelope volume of the NSW station. It will tell us the sector and station eta

av_4375_impr_1_MuonR4::NSW_SM2_StationMuonStation_pv_9_NSW_SM2_Station_-2_1

Find the Detector element from the Identifier

retrieve the translation of the transformation going into the current current gasVolume

Let's use the position of the first gasGap in the second quad as a reference. If the absolute z value is smaller than its z value the hit must be located in quad number one

Definition at line 76 of file MmSensitiveDetector.cxx.

77 {
79 const std::string& stationVolume = touchHist->GetVolume(4)->GetName();
81 const std::vector<std::string> volumeTokens = tokenize(stationVolume.substr(stationVolume.rfind("NSW") + 4), "_");
82 ATH_MSG_VERBOSE("Name of the station volume is "<<volumeTokens);
83 if (volumeTokens.size() != 4) {
84 THROW_EXCEPTION(" Cannot deduce the station name from "<<stationVolume);
85 }
87 const std::string stName = volumeTokens[0][0] == 'S' ? "MMS" : "MML";
88 const int stationEta = atoi(volumeTokens[2]);
89 const int stationPhi = atoi(volumeTokens[3]);
90
91 const MmIdHelper& idHelper{m_detMgr->idHelperSvc()->mmIdHelper()};
92 const Identifier detElIdMl1 = idHelper.channelID(idHelper.stationNameIndex(stName), stationEta, stationPhi, 1, 1, 1);
93 const Identifier detElIdMl2 = idHelper.multilayerID(detElIdMl1, 2);
94 const MmReadoutElement* readOutElemMl1 = m_detMgr->getMmReadoutElement(detElIdMl1);
95 const MmReadoutElement* readOutElemMl2 = m_detMgr->getMmReadoutElement(detElIdMl2);
96 if (!readOutElemMl1 || !readOutElemMl2) {
97 THROW_EXCEPTION(" Failed to retrieve a valid detector element from "
98 <<m_detMgr->idHelperSvc()->toStringDetEl(detElIdMl1)<<" "<<stationVolume);
99 }
101 const Amg::Vector3D transformCenter = getTransform(touchHist, 0).translation();
104 const Amg::Vector3D centerMl2 = readOutElemMl2->center(gctx, detElIdMl2);
105 ATH_MSG_VERBOSE("Local gap position "<<Amg::toString(centerMl2)<<" transform center "<<Amg::toString(transformCenter));
106 return std::abs(centerMl2.z()) - tolerance <= std::abs(transformCenter.z()) ? readOutElemMl2 : readOutElemMl1;
107}
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Identifier multilayerID(const Identifier &channeldID) const
int stationNameIndex(const std::string &name) const
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Amg::Transform3D getTransform(const G4VTouchable *history, unsigned int level)
Extracts the local -> global transformation from a TouchableHistory at a given level.
const std::string & stName(StIndex index)
convert StIndex into a string
constexpr uint8_t stationPhi
station Phi 1 to 8

◆ Initialize()

void MuonG4R4::MuonSensitiveDetector::Initialize ( G4HCofThisEvent * HCE)
finaloverridevirtualinherited

Create the output container at the beginning of the event.

Definition at line 37 of file MuonSensitiveDetector.cxx.

37 {
38 if (m_writeHandle.isValid()) {
39 ATH_MSG_VERBOSE("Simulation hit container "<<m_writeHandle.fullKey()<<" is already written");
40 return;
41 }
42 if (!m_writeHandle.recordNonConst(std::make_unique<xAOD::MuonSimHitContainer>(),
43 std::make_unique<xAOD::MuonSimHitAuxContainer>()).isSuccess()) {
44 THROW_EXCEPTION(" Failed to record "<<m_writeHandle.fullKey());
45 }
46 ATH_MSG_DEBUG("Output container "<<m_writeHandle.fullKey()<<" has been successfully created");
47 }
#define ATH_MSG_DEBUG(x)
SG::WriteHandle< xAOD::MuonSimHitContainer > m_writeHandle

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ lastSnapShot()

xAOD::MuonSimHit * MuonG4R4::MuonSensitiveDetector::lastSnapShot ( const Identifier & gasGapId,
const G4Step * hitStep )
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

Parameters
gasGapIdIdentifier of the gasGap to consider
hitStepPointer to the current step

There's only a snapshot if the last saved hit has the same Identifier & the same particle Link + G4Track Id

Definition at line 146 of file MuonSensitiveDetector.cxx.

147 {
148 TrackHelper trkHelper{hitStep->GetTrack()};
151 if (m_writeHandle->empty() ||
152 m_writeHandle->back()->identify() != hitId ||
153 trkHelper.GenerateParticleLink() != m_writeHandle->back()->genParticleLink() ||
154 dec_G4TrkId(*m_writeHandle->back()) != hitStep->GetTrack()->GetTrackID()) {
155 return nullptr;
156 }
157 return m_writeHandle->back();
158 }
HepMcParticleLink GenerateParticleLink()
Generates a creates new HepMcParticleLink object on the stack based on GetUniqueID(),...
Definition TrackHelper.h:52

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
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 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
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 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ MuonSensitiveDetector()

MuonG4R4::MuonSensitiveDetector::MuonSensitiveDetector ( const std::string & name,
const std::string & output_key,
const std::string & trf_storeKey,
const MuonGMR4::MuonDetectorManager * detMgr )

Constructor.

Parameters
nameName of the Sensitive detctor / AthMessaging module
output_keyKey under which the sim hits are written into store gate
trf_storeKeyLocation of the DetctorAlignmentStore holding the transformations per event
detMgrPointer to the run-4 detector manager

Definition at line 29 of file MuonSensitiveDetector.cxx.

29 :
30 G4VSensitiveDetector{name},
32 m_writeHandle{output_key},
33 m_trfCacheKey{trfStore_key},
34 m_detMgr{detMgr} {
35 m_trfCacheKey.initialize().ignore();
36 }
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.

◆ ProcessHits()

G4bool MmSensitiveDetector::ProcessHits ( G4Step * aStep,
G4TouchableHistory * ROhist )
finaloverridevirtual

member functions

Fetch the local -> global transformation

Definition at line 32 of file MmSensitiveDetector.cxx.

32 {
33
34 if (!processStep(aStep)) {
35 return true;
36 }
37 const ActsTrk::GeometryContext gctx{getGeoContext()};
38
39 const G4TouchableHistory* touchHist = static_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
40 const MuonGMR4::MmReadoutElement* readOutEle = getReadoutElement(gctx, touchHist);
41
42 const Amg::Transform3D localToGlobal = getTransform(touchHist, 0);
43 ATH_MSG_VERBOSE(" Track is inside volume "<< touchHist->GetHistory()->GetTopVolume()->GetName()
44 <<" transformation: "<<Amg::toString(localToGlobal));
45
46 const Identifier hitID = getIdentifier(gctx, readOutEle, localToGlobal.translation());
47 if (!hitID.is_valid()) {
48 ATH_MSG_VERBOSE("No valid hit found");
49 return true;
50 }
52 const Amg::Transform3D toGasGap{readOutEle->globalToLocalTrans(gctx, hitID)};
53 propagateAndSaveStrip(hitID, toGasGap, aStep);
54 return true;
55}
bool is_valid() const
Check if id is in a valid state.
const MuonGMR4::MmReadoutElement * getReadoutElement(const ActsTrk::GeometryContext &gctx, const G4TouchableHistory *touchHist) const
Retrieves the matching readout element to a G4 hit.
Identifier getIdentifier(const ActsTrk::GeometryContext &gctx, const MuonGMR4::MmReadoutElement *readOutEle, const Amg::Vector3D &hitAtGapPlane) const
Identify the gasGap layer of the hit.
xAOD::MuonSimHit * propagateAndSaveStrip(const Identifier &hitId, const Amg::Transform3D &toGasGap, const G4Step *hitStep)
bool processStep(const G4Step *step) const
Checks whether the current step shall be processed at all.
ActsTrk::GeometryContext getGeoContext() const
Returns the current geometry context in the event.
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Eigen::Affine3d Transform3D

◆ processStep()

bool MuonG4R4::MuonSensitiveDetector::processStep ( const G4Step * step) const
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

Parameters
stepG4 step to consider

Reject secondary particles

Sensitive detector is only sensitive to charged particles or Geantinos

Definition at line 57 of file MuonSensitiveDetector.cxx.

57 {
58 const G4Track* currentTrack = aStep->GetTrack();
59 ATH_MSG_VERBOSE("Check whether step pdgId: "<<(*currentTrack)<<" will be processed.");
61 constexpr double velCutOff = 10.*Gaudi::Units::micrometer / Gaudi::Units::second;
62 if (aStep->GetStepLength() < std::numeric_limits<float>::epsilon() || currentTrack->GetVelocity() < velCutOff) {
63 ATH_MSG_VERBOSE("Step length is too short ");
64 return false;
65 }
67 if (currentTrack->GetDefinition()->GetPDGCharge() == 0.0) {
68 ATH_MSG_VERBOSE("Particle is neutral");
69 return currentTrack->GetDefinition() == G4Geantino::GeantinoDefinition() ||
70 currentTrack->GetDefinition() == G4ChargedGeantino::ChargedGeantinoDefinition();
71 }
72 return true;
73 }

◆ propagateAndSaveStrip()

xAOD::MuonSimHit * MuonG4R4::MuonSensitiveDetector::propagateAndSaveStrip ( const Identifier & hitId,
const Amg::Transform3D & toGasGap,
const G4Step * hitStep )
protectedinherited

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 74 of file MuonSensitiveDetector.cxx.

76 {
77
78 const G4Track* currentTrack = aStep->GetTrack();
80 const Amg::Vector3D locPostStep{toGasGap*Amg::Hep3VectorToEigen(aStep->GetPostStepPoint()->GetPosition())};
81 Amg::Vector3D locPreStep{toGasGap*Amg::Hep3VectorToEigen(aStep->GetPreStepPoint()->GetPosition())};
82
84 Amg::Vector3D locHitDir = toGasGap.linear() * Amg::Hep3VectorToEigen(currentTrack->GetMomentumDirection());
85
88 xAOD::MuonSimHit* prevHit = lastSnapShot(hitID, aStep);
89 if (std::abs(currentTrack->GetParticleDefinition()->GetPDGEncoding()) == 11 && prevHit) {
90 locPreStep = xAOD::toEigen(prevHit->localPosition()) - 0.5* prevHit->stepLength() *
91 xAOD::toEigen(prevHit->localDirection());
92
93 locHitDir = (locPostStep - locPreStep).unit();
94 }
95 const Amg::Vector3D locHitPos = 0.5* (locPreStep + locPostStep);
96 ATH_MSG_VERBOSE( m_detMgr->idHelperSvc()->toStringGasGap(hitID)<<" - track: "<<(*currentTrack)
97 <<", deposit: "<<aStep->GetTotalEnergyDeposit()<<", -- local coords: "
98 <<"prestep: "<<Amg::toString(locPreStep)<<", post step: "<<Amg::toString(locPostStep)
99 <<" mid point: "<< Amg::toString(locHitPos)<<", direction: "<<Amg::toString(locHitDir)
100 <<", deposit: "<<aStep->GetTotalEnergyDeposit());
101
102 const double globalTime = currentTrack->GetGlobalTime() + locHitDir.dot(locPostStep - locHitPos) / currentTrack->GetVelocity();
103
104 xAOD::MuonSimHit* newHit = saveHit(hitID, locHitPos, locHitDir, globalTime, aStep);
105 if (prevHit) {
106 newHit->setStepLength((locPostStep - locPreStep).mag());
107 }
108 return newHit;
109 }
Scalar mag() const
mag method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
xAOD::MuonSimHit * lastSnapShot(const Identifier &gasGapId, const G4Step *hitStep)
Returns the last snap shot of the traversing particle.
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.
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
float stepLength() const
Returns the path length of the G4 step.
void setStepLength(const float length)
Set the path length of the G4 step.
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
Amg::Vector3D Hep3VectorToEigen(const CLHEP::Hep3Vector &CLHEPvector)
Converts a CLHEP-based CLHEP::Hep3Vector into an Eigen-based Amg::Vector3D.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
Definition MuonSimHit.h:12

◆ saveHit()

xAOD::MuonSimHit * MuonG4R4::MuonSensitiveDetector::saveHit ( const Identifier & hitId,
const Amg::Vector3D & hitPos,
const Amg::Vector3D & hitDir,
const double globTime,
const G4Step * hitStep )
protectedinherited

Saves the current Step as a xAOD::MuonSimHit snapshot.

Parameters
hitIdIdentifier of the gasGap/ tube where the hit was deposited
hitPosLocal position of the hit expressed w.r.t gas gap coordinate system
hitDirLocal direction of the hit expressed w.r.t gas gap coordinate system
globTimeGlobal time of the hit
hitStepPointer to the step from which the hit information was derived.

Definition at line 110 of file MuonSensitiveDetector.cxx.

114 {
115 const G4Track* currentTrack = aStep->GetTrack();
116 TrackHelper trHelper{currentTrack};
117 // If Geant4 propagates the same track through the same volume just update the last hit and don't write a new one
118 xAOD::MuonSimHit* hit = lastSnapShot(hitId, aStep);
119 bool newHit{false};
120 if (!hit) {
121 hit = m_writeHandle->push_back(std::make_unique<xAOD::MuonSimHit>());
122 newHit = true;
123 }
124 dec_G4TrkId(*hit) = currentTrack->GetTrackID();
125 hit->setIdentifier(hitId);
126 hit->setLocalPosition(xAOD::toStorage(hitPos));
128 hit->setMass(currentTrack->GetDefinition()->GetPDGMass());
129 hit->setGlobalTime(globTime);
130 hit->setPdgId(currentTrack->GetDefinition()->GetPDGEncoding());
131 hit->setEnergyDeposit(aStep->GetTotalEnergyDeposit() + (newHit ? 0. : hit->energyDeposit()));
132 hit->setKineticEnergy(currentTrack->GetKineticEnergy());
134 hit->setStepLength(aStep->GetStepLength());
135
136 ATH_MSG_VERBOSE("Save new hit "<<m_detMgr->idHelperSvc()->toString(hitId)
137 <<", pdgId: "<<hit->pdgId()
138 <<", "<<hit->genParticleLink()
139 <<", trackId: "<<currentTrack->GetTrackID()<<", "
140 <<", "<<hit->genParticleLink().cptr()<<std::endl
141 <<"pos: "<<Amg::toString(hitPos)<<", dir: "<<Amg::toString(hitDir)<<", time: "<<globTime
142 <<", energy: "<<hit->kineticEnergy()<<", stepLength: "<<hit->stepLength()<<", "
143 <<", deposit energy: "<<hit->energyDeposit());
144 return hit;
145 }
void setGenParticleLink(const HepMcParticleLink &link)
Sets the link to the HepMC particle producing this hit.
void setGlobalTime(const float time)
Sets the time of the traversing particle.
void setLocalDirection(MeasVector< 3 > vec)
Sets the local direction of the traversing particle.
void setEnergyDeposit(const float deposit)
Sets the energy deposited by the traversing particle inside the gas volume.
void setMass(const float m)
set the rest-mass of the traversing particle
int pdgId() const
Returns the pdgID of the traversing particle.
void setIdentifier(const Identifier &id)
Sets the global ATLAS identifier.
float energyDeposit() const
Returns the energy deposited by the traversing particle inside the gas volume.
void setKineticEnergy(const float energy)
Sets the kinetic energy of the traversing particle.
const HepMcParticleLink & genParticleLink() const
Returns the link to the HepMC particle producing this hit.
void setLocalPosition(MeasVector< 3 > vec)
Sets the local position of the traversing particle.
void setPdgId(int id)
Sets the pdgID of the traversing particle.
float kineticEnergy() const
Returns the kinetic energy of the traversing particle.
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
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.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonG4R4::MuonSensitiveDetector::m_detMgr {nullptr}
protectedinherited

Pointer to the underlying detector manager.

Definition at line 81 of file MuonSensitiveDetector.h.

81{nullptr};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_trfCacheKey

SG::ReadHandleKey<ActsTrk::DetectorAlignStore> MuonG4R4::MuonSensitiveDetector::m_trfCacheKey
privateinherited

ReadHandleKey to the DetectorAlignmentStore caching the relevant transformations needed in this event.

Definition at line 45 of file MuonSensitiveDetector.h.

◆ m_writeHandle

SG::WriteHandle<xAOD::MuonSimHitContainer> MuonG4R4::MuonSensitiveDetector::m_writeHandle
privateinherited

Definition at line 42 of file MuonSensitiveDetector.h.


The documentation for this class was generated from the following files: