19 if (!MuonDetMgr) {
return false; }
29 unsigned int numHits{0};
30 for (
const TGCSimHit& hit : *tgcContainer) {
31 HitID hitid = hit.TGCid();
36 int gasgap = tgchhelper->
GetGasGap(hitid);
41 ATH_MSG_WARNING(
"Cannot build a valid Identifier for TGC stationName=" << stname <<
", eta=" << steta <<
", phi=" << stphi
42 <<
", gasgap=" <<gasgap <<
"; skipping...");
48 ATH_MSG_ERROR(
"TGCSimHitVariables::fillVariables() - Failed to retrieve TgcReadoutElement for "
66 int pdgId{-999}, barcode{-999};
72 pdgId = genP->pdg_id();
75 ATH_MSG_WARNING(
"GenParticle is nullptr for hit in " << stname <<
" (eta=" << steta <<
", phi=" << stphi <<
", gasgap=" << gasgap <<
")");
79 if (
msgLvl(barcode == 0 ? MSG::DEBUG : MSG::WARNING)) {
80 msg(barcode == 0 ? MSG::DEBUG : MSG::WARNING)
81 <<
"HepMcParticleLink with barcode=" << barcode <<
" is not valid for hit in " << stname <<
" (eta=" << steta
82 <<
", phi=" << stphi <<
", gasgap=" << gasgap <<
")" <<
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.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const Amg::Vector3D globalPosition() const
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
Returns the local -> global transformation x-axis: Parallel to the wires (strips) if the Identifier b...
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
const Muon::IMuonIdHelperSvc * idHelperSvc() const
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
VectorBranch< float > & m_TGC_depositEnergy
VectorBranch< float > & m_TGC_globalTime
VectorBranch< int > & m_TGC_trackId
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...
ThreeVectorBranch m_TGC_detector_globalPosition
TGCSimHitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
ThreeVectorBranch m_TGC_hitLocalPosition
ScalarBranch< unsigned int > & m_TGC_nSimHits
ThreeVectorBranch m_TGC_hitGlobalPosition
VectorBranch< float > & m_TGC_StepLength
VectorBranch< int > & m_TGC_truthEl
TgcIdentifierBranch m_TGC_id
VectorBranch< int > & m_TGC_particleEncoding
VectorBranch< float > & m_TGC_kineticEnergy
bool declare_keys() override final
SG::ReadHandleKey< TGCSimHitCollection > m_key
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 TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
virtual bool isValid() override final
Can the handle be successfully dereferenced?
int GetStationPhi(const int &hid) const
std::string GetStationName(const int &hid) const
int GetStationEta(const int &hid) const
int GetGasGap(const int &hid) const
static const TgcHitIdHelper * GetHelper()
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Eigen::Matrix< double, 3, 1 > Vector3D
const GenParticle * ConstGenParticlePtr