ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonValidation
MuonPRDTestR4
Root
TesterModuleBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTestR4/TesterModuleBase.h
"
6
#include "GeoModelKernel/throwExcept.h"
7
#include "
StoreGate/ReadHandle.h
"
8
#include "
StoreGate/ReadCondHandle.h
"
9
#include "
StoreGate/StoreGateSvc.h
"
10
11
namespace
MuonValR4
{
12
TesterModuleBase::TesterModuleBase
(
MuonTesterTree
&
tree
,
13
const
std::string& grp_name,
14
MSG::Level msglvl) :
15
MuonTesterBranch
(
tree
,
" R4 tester module "
+ grp_name) {
16
setLevel
(msglvl);
17
m_idHelperSvc
.retrieve().ignore();
18
}
19
const
Muon::IMuonIdHelperSvc
*
TesterModuleBase::idHelperSvc
()
const
{
return
m_idHelperSvc
.get(); }
20
const
MuonGMR4::MuonDetectorManager
*
TesterModuleBase::getDetMgr
()
const
{
21
return
m_detMgr
;
22
}
23
const
ActsTrk::GeometryContext
&
TesterModuleBase::getGeoCtx
(
const
EventContext& ctx)
const
{
24
const
ActsTrk::GeometryContext
* geoCtx{
nullptr
};
25
if
(!
SG::get
(geoCtx,
m_geoCtxKey
, ctx).isSuccess()) {
26
THROW_EXCEPTION
(
"Failed to retrieve "
<<
m_geoCtxKey
.fullKey());
27
}
28
return
*geoCtx;
29
}
30
31
bool
TesterModuleBase::init
() {
32
ServiceHandle<StoreGateSvc>
detStore{
"StoreGateSvc/DetectorStore"
,
name
()};
33
if
(!detStore.retrieve().isSuccess() || !detStore->retrieve(
m_detMgr
).isSuccess())
return
false
;
34
if
(!
declare_dependency
(
m_geoCtxKey
))
return
false
;
35
if
(!
m_idHelperSvc
.retrieve().isSuccess())
return
false
;
36
return
declare_keys
();
37
}
38
}
// namespace MuonPRDTest
ReadCondHandle.h
StoreGateSvc.h
ReadHandle.h
Handle class for reading from StoreGate.
TesterModuleBase.h
ActsTrk::GeometryContext
Definition
GeometryContext.h:30
AthMessaging::setLevel
void setLevel(MSG::Level lvl)
Change the current logging level.
Definition
AthMessaging.cxx:28
MuonGMR4::MuonDetectorManager
Definition
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonValR4::TesterModuleBase::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition
TesterModuleBase.cxx:19
MuonValR4::TesterModuleBase::declare_keys
virtual bool declare_keys()=0
MuonValR4::TesterModuleBase::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
TesterModuleBase.h:33
MuonValR4::TesterModuleBase::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition
TesterModuleBase.h:32
MuonValR4::TesterModuleBase::TesterModuleBase
TesterModuleBase(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl=MSG::Level::INFO)
Definition
TesterModuleBase.cxx:12
MuonValR4::TesterModuleBase::getDetMgr
const MuonGMR4::MuonDetectorManager * getDetMgr() const
Definition
TesterModuleBase.cxx:20
MuonValR4::TesterModuleBase::m_geoCtxKey
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Definition
TesterModuleBase.h:34
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:31
MuonValR4::TesterModuleBase::getGeoCtx
const ActsTrk::GeometryContext & getGeoCtx(const EventContext &ctx) const
Definition
TesterModuleBase.cxx:23
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
MuonVal::MuonTesterBranch::name
std::string name() const override final
Returns the name of the branch.
Definition
MuonTesterBranch.cxx:51
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition
IMuonIdHelperSvc.h:27
ServiceHandle
Definition
ClusterMakerTool.h:36
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition
SpacePointWriter.cxx:32
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition
ReadCondHandle.h:282
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0