ATLAS Offline Software
PrdTesterModule.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 namespace MuonPRDTest {
8  PrdTesterModule::PrdTesterModule(MuonTesterTree& tree, const std::string& grp_name, bool useCondGeo, MSG::Level msglvl) :
9  MuonTesterBranch(tree, " prd module " + grp_name),
10  m_useCondDetMgr{useCondGeo} {
11  setLevel(msglvl);
12  m_idHelperSvc.retrieve().ignore();
13  }
15  const MuonGM::MuonDetectorManager* PrdTesterModule::getDetMgr(const EventContext& ctx) const {
16  if (!m_useCondDetMgr) return m_detMgr;
18  if (!handle.isValid()) {
19  ATH_MSG_ERROR("Failed to retrieve MuonDetectorManager " << m_detMgrKey.fullKey());
20  return nullptr;
21  }
22  return handle.cptr();
23  }
25  if (!m_useCondDetMgr && (!m_detStore.retrieve().isSuccess() || !m_detStore->retrieve(m_detMgr).isSuccess())) return false;
26  if (!m_useCondDetMgr) {
27  m_detMgrKey = std::string{""};
28  }
29  if (!declare_dependency(m_detMgrKey)) return false;
30  if (!m_idHelperSvc.retrieve().isSuccess()) return false;
31  return declare_keys();
32  }
33  bool PrdTesterModule::declare_keys() { return true; }
34 } // namespace MuonPRDTest
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
MuonVal::MuonTesterBranch
Definition: MuonTesterBranch.h:21
tree
TChain * tree
Definition: tile_monitor.h:30
MuonPRDTest::PrdTesterModule::getDetMgr
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
Definition: PrdTesterModule.cxx:15
ReadCondHandle.h
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
pool::DbPrintLvl::setLevel
void setLevel(MsgLevel l)
Definition: DbPrint.h:32
MuonPRDTest::PrdTesterModule::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: PrdTesterModule.h:30
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonPRDTest::PrdTesterModule::m_useCondDetMgr
bool m_useCondDetMgr
Definition: PrdTesterModule.h:33
MuonPRDTest::PrdTesterModule::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: PrdTesterModule.h:31
PrdTesterModule.h
MuonPRDTest::PrdTesterModule::declare_keys
virtual bool declare_keys()=0
Definition: PrdTesterModule.cxx:33
MuonPRDTest::PrdTesterModule::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition: PrdTesterModule.h:29
MuonPRDTest::PrdTesterModule::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition: PrdTesterModule.cxx:24
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
MuonPRDTest
Definition: CSCDigitVariables.h:10
MuonPRDTest::PrdTesterModule::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition: PrdTesterModule.cxx:14
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
MuonPRDTest::PrdTesterModule::PrdTesterModule
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, bool useCondGeo, MSG::Level msglvl)
Definition: PrdTesterModule.cxx:8
MuonPRDTest::PrdTesterModule::m_detMgr
const MuonGM::MuonDetectorManager * m_detMgr
Definition: PrdTesterModule.h:32