17 if (!MuonDetMgr) {
return false; }
27 unsigned int numHits{0};
28 for (
const MDTSimHit& hit : *mdtContainer) {
29 HitID hitid = hit.MDTid();
35 int tl = mdthhelper->
GetLayer(hitid);
36 int tube = mdthhelper->
GetTube(hitid);
41 ATH_MSG_WARNING(
"Cannot build a valid Identifier for MDT stationName=" << stname <<
", eta=" << steta <<
", phi=" << stphi
42 <<
", multiLayer=" << ml <<
", tubeLayer=" << tl
43 <<
", tube=" << tube <<
"; skipping...");
49 ATH_MSG_ERROR(
"MDTSimHitVariables::fillVariables() - Failed to retrieve MdtReadoutElement for "
67 int pdgId{-999}, barcode{-999};
73 pdgId = genP->pdg_id();
76 ATH_MSG_WARNING(
"GenParticle is nullptr for hit in " << stname <<
" (eta=" << steta <<
", phi=" << stphi <<
", ml="
77 << ml <<
", tubelayer=" << tl <<
", tube=" << tube <<
")");
81 if (
msgLvl(barcode == 0 ? MSG::DEBUG : MSG::WARNING)) {
82 msg(barcode == 0 ? MSG::DEBUG : MSG::WARNING)
83 <<
"HepMcParticleLink with barcode=" << barcode <<
" is not valid for hit in " << stname <<
" (eta=" << steta
84 <<
", phi=" << stphi <<
", ml=" << ml <<
", tubelayer=" << tl <<
", tube=" << tube <<
")" <<
endmsg;
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Helpers for checking error return status codes and reporting errors.
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
a link optimized in size for a GenParticle in a McEventCollection
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
int barcode() const
Return the barcode of the target particle.
static const MdtHitIdHelper * GetHelper(unsigned int nTubes=78)
int GetPhiSector(const int &hid) const
int GetMultiLayer(const int &hid) const
std::string GetStationName(const int &hid) const
int GetZSector(const int &hid) const
int GetLayer(const int &hid) const
int GetTube(const int &hid) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const Amg::Vector3D globalPosition() const
MdtIdentifierBranch m_MDT_id
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
bool declare_keys() override final
MDTSimHitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
ThreeVectorBranch m_MDT_detector_globalPosition
ThreeVectorBranch m_MDT_hitLocalPosition
VectorBranch< int > & m_MDT_trackId
ScalarBranch< unsigned int > & m_MDT_nSimHits
VectorBranch< float > & m_MDT_kineticEnergy
SG::ReadHandleKey< MDTSimHitCollection > m_simHitKey
ThreeVectorBranch m_MDT_hitGlobalPosition
VectorBranch< float > & m_MDT_driftRadius
VectorBranch< float > & m_MDT_globalTime
VectorBranch< float > & m_MDT_StepLength
VectorBranch< int > & m_MDT_particleEncoding
VectorBranch< float > & m_MDT_depositEnergy
VectorBranch< int > & m_MDT_truthEl
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
const Muon::IMuonIdHelperSvc * idHelperSvc() const
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TTree * tree() override final
Returns the underlying TTree object.
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Eigen::Matrix< double, 3, 1 > Vector3D
const GenParticle * ConstGenParticlePtr