ATLAS Offline Software
MuonSpectrometer
MuonPhaseII
MuonValidation
MuonPRDTestR4
Root
TesterModuleBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTestR4/TesterModuleBase.h
"
6
#include "GeoModelHelpers/throwExcept.h"
7
#include "
StoreGate/ReadHandle.h
"
8
#include "
StoreGate/StoreGateSvc.h
"
9
10
namespace
MuonValR4
{
11
TesterModuleBase::TesterModuleBase
(
MuonTesterTree
&
tree
,
12
const
std::string& grp_name,
13
MSG::Level
msglvl) :
14
MuonTesterBranch
(
tree
,
" R4 tester module "
+ grp_name) {
15
setLevel
(msglvl);
16
m_idHelperSvc
.retrieve().ignore();
17
}
18
const
Muon::IMuonIdHelperSvc
*
TesterModuleBase::idHelperSvc
()
const
{
return
m_idHelperSvc
.get(); }
19
const
MuonGMR4::MuonDetectorManager
*
TesterModuleBase::getDetMgr
()
const
{
20
return
m_detMgr
;
21
}
22
const
ActsGeometryContext
&
TesterModuleBase::getGeoCtx
(
const
EventContext& ctx)
const
{
23
SG::ReadHandle
handle{
m_geoCtxKey
, ctx};
24
if
(!handle.isValid()) {
25
THROW_EXCEPTION
(
"Failed to retrieve "
<<
m_geoCtxKey
.fullKey());
26
}
27
return
*handle;
28
}
29
30
bool
TesterModuleBase::init
() {
31
ServiceHandle<StoreGateSvc>
detStore
{
"StoreGateSvc/DetectorStore"
,
name
()};
32
if
(!
detStore
.retrieve().isSuccess() || !
detStore
->retrieve(
m_detMgr
).isSuccess())
return
false
;
33
if
(!
declare_dependency
(
m_geoCtxKey
))
return
false
;
34
if
(!
m_idHelperSvc
.retrieve().isSuccess())
return
false
;
35
return
declare_keys
();
36
}
37
}
// namespace MuonPRDTest
TesterModuleBase.h
MuonGMR4::MuonDetectorManager
Definition:
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
MuonVal::MuonTesterBranch
Definition:
MuonTesterBranch.h:21
tree
TChain * tree
Definition:
tile_monitor.h:30
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition:
MMReadoutElement.cxx:48
MuonValR4::TesterModuleBase::TesterModuleBase
TesterModuleBase(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl=MSG::Level::INFO)
Definition:
TesterModuleBase.cxx:11
MuonValR4::TesterModuleBase::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition:
TesterModuleBase.h:32
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
MuonValR4::TesterModuleBase::getGeoCtx
const ActsGeometryContext & getGeoCtx(const EventContext &ctx) const
Definition:
TesterModuleBase.cxx:22
AthMessaging::setLevel
void setLevel(MSG::Level lvl)
Change the current logging level.
Definition:
AthMessaging.cxx:28
TrigConf::MSGTC::Level
Level
Definition:
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
MuonVal::MuonTesterTree
Definition:
MuonTesterTree.h:30
MuonValR4::TesterModuleBase::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition:
TesterModuleBase.cxx:18
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition:
ActsGeometryContext.h:27
MuonVal::MuonTesterBranch::name
std::string name() const override final
Returns the name of the branch.
Definition:
MuonTesterBranch.cxx:51
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition:
IPatternVisualizationTool.h:23
python.PyKernel.detStore
detStore
Definition:
PyKernel.py:41
MuonValR4::TesterModuleBase::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition:
TesterModuleBase.h:34
MuonValR4::TesterModuleBase::getDetMgr
const MuonGMR4::MuonDetectorManager * getDetMgr() const
Definition:
TesterModuleBase.cxx:19
MuonValR4::TesterModuleBase::declare_keys
virtual bool declare_keys()=0
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition:
IMuonIdHelperSvc.h:26
ReadHandle.h
Handle class for reading from StoreGate.
MuonValR4::TesterModuleBase::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition:
TesterModuleBase.cxx:30
StoreGateSvc.h
MuonValR4::TesterModuleBase::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition:
TesterModuleBase.h:33
ServiceHandle< StoreGateSvc >
Generated on Thu Nov 7 2024 21:27:27 for ATLAS Offline Software by
1.8.18