ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
RPCSDOVariables.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTest/RPCSDOVariables.h
"
6
#include "
MuonReadoutGeometry/RpcReadoutElement.h
"
7
8
namespace
MuonPRDTest
{
9
RpcSDOVariables::RpcSDOVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
10
PrdTesterModule
(
tree
,
"SDO_RPC"
, msglvl),
m_key
{container_name} {}
11
12
bool
RpcSDOVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
13
14
bool
RpcSDOVariables::fill
(
const
EventContext& ctx) {
15
ATH_MSG_DEBUG
(
"do fill RpcSDOVariable()"
);
16
SG::ReadHandle<MuonSimDataCollection>
rpcSdoContainer{
m_key
, ctx};
17
18
const
MuonGM::MuonDetectorManager
* MuonDetMgr =
getDetMgr
(ctx);
19
if
(!MuonDetMgr) {
return
false
; }
20
21
if
(!rpcSdoContainer.
isValid
()) {
22
ATH_MSG_FATAL
(
"Failed to retrieve digit container "
<<
m_key
.fullKey());
23
return
false
;
24
}
25
unsigned
int
n_sdo{0};
26
for
(
const
auto
& coll : *rpcSdoContainer) {
27
const
Identifier
&
id
= coll.first;
28
const
MuonSimData
& rpc_sdo = coll.second;
29
m_rpc_sdo_id
.push_back(
id
);
30
m_rpc_sdo_globaltime
.push_back(rpc_sdo.
getTime
());
31
m_rpc_sdo_word
.push_back(rpc_sdo.
word
());
32
33
ATH_MSG_DEBUG
(
"RPC SDO: "
<<
idHelperSvc
()->toString(
id
));
34
35
ATH_MSG_DEBUG
(
"Get the truth deposits from the SDO."
);
36
std::vector<MuonSimData::Deposit> deposits;
37
rpc_sdo.
deposits
(deposits);
38
m_RPC_dig_globalPos
.push_back(rpc_sdo.
globalPosition
());
39
40
Amg::Vector2D
locPos{Amg::Vector2D::Zero()};
41
const
Trk::Surface
& surf{MuonDetMgr->
getRpcReadoutElement
(
id
)->
surface
(
id
)};
42
surf.
globalToLocal
(rpc_sdo.
globalPosition
(), Amg::Vector3D::Zero(), locPos);
43
m_RPC_dig_localPos
.push_back(locPos);
44
45
// use the information of the first deposit
46
int
barcode = deposits[0].first.barcode();
47
48
ATH_MSG_DEBUG
(
"RPC SDO barcode="
<< barcode);
49
50
m_rpc_sdo_barcode
.push_back(barcode);
51
++n_sdo;
52
}
53
m_rpc_nsdo
= n_sdo;
54
55
ATH_MSG_DEBUG
(
"Processed "
<< n_sdo <<
" RPC SDOs"
);
56
return
true
;
57
}
58
}
// namespace MuonPRDTest
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
RpcReadoutElement.h
RPCSDOVariables.h
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition
MuonClusterReadoutElement.h:123
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
MuonGM::MuonDetectorManager::getRpcReadoutElement
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition
MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:180
MuonPRDTest::PrdTesterModule::getDetMgr
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
Definition
PrdTesterModule.cxx:16
MuonPRDTest::PrdTesterModule::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition
PrdTesterModule.cxx:15
MuonPRDTest::PrdTesterModule::PrdTesterModule
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
Definition
PrdTesterModule.cxx:8
MuonPRDTest::RpcSDOVariables::m_rpc_nsdo
ScalarBranch< unsigned int > & m_rpc_nsdo
Definition
RPCSDOVariables.h:28
MuonPRDTest::RpcSDOVariables::m_rpc_sdo_id
RpcIdentifierBranch m_rpc_sdo_id
Definition
RPCSDOVariables.h:29
MuonPRDTest::RpcSDOVariables::m_rpc_sdo_globaltime
VectorBranch< float > & m_rpc_sdo_globaltime
Definition
RPCSDOVariables.h:32
MuonPRDTest::RpcSDOVariables::m_rpc_sdo_word
VectorBranch< int > & m_rpc_sdo_word
Definition
RPCSDOVariables.h:30
MuonPRDTest::RpcSDOVariables::m_rpc_sdo_barcode
VectorBranch< int > & m_rpc_sdo_barcode
Definition
RPCSDOVariables.h:31
MuonPRDTest::RpcSDOVariables::declare_keys
bool declare_keys() override final
Definition
RPCSDOVariables.cxx:12
MuonPRDTest::RpcSDOVariables::m_RPC_dig_globalPos
ThreeVectorBranch m_RPC_dig_globalPos
Definition
RPCSDOVariables.h:34
MuonPRDTest::RpcSDOVariables::fill
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...
Definition
RPCSDOVariables.cxx:14
MuonPRDTest::RpcSDOVariables::RpcSDOVariables
RpcSDOVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
RPCSDOVariables.cxx:9
MuonPRDTest::RpcSDOVariables::m_RPC_dig_localPos
TwoVectorBranch m_RPC_dig_localPos
Definition
RPCSDOVariables.h:35
MuonPRDTest::RpcSDOVariables::m_key
SG::ReadHandleKey< MuonSimDataCollection > m_key
Definition
RPCSDOVariables.h:26
MuonSimData
Definition
MuonSimData.h:62
MuonSimData::word
int word() const
Definition
MuonSimData.h:89
MuonSimData::deposits
void deposits(std::vector< Deposit > &deposits) const
Definition
MuonSimData.h:99
MuonSimData::globalPosition
const Amg::Vector3D globalPosition() const
Definition
MuonSimData.h:113
MuonSimData::getTime
float getTime() const
Definition
MuonSimData.h:124
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::Surface
Abstract Base Class for tracking surfaces.
Definition
Surface.h:79
Trk::Surface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
Generated on
for ATLAS Offline Software by
1.17.0