ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
RPCDigitVariables.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 "
MuonPRDTest/RPCDigitVariables.h
"
6
7
#include "
MuonReadoutGeometry/RpcReadoutElement.h
"
8
namespace
MuonPRDTest
{
9
RpcDigitVariables::RpcDigitVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
10
PrdTesterModule
(
tree
,
"Digits_RPC"
, msglvl),
m_key
{container_name} {}
11
12
bool
RpcDigitVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
13
bool
RpcDigitVariables::fill
(
const
EventContext& ctx) {
14
ATH_MSG_DEBUG
(
"do fillMDTSimHitVariables()"
);
15
const
MuonGM::MuonDetectorManager
* MuonDetMgr =
getDetMgr
(ctx);
16
if
(!MuonDetMgr) {
return
false
; }
17
SG::ReadHandle<RpcDigitContainer>
RpcDigitContainer
{
m_key
, ctx};
18
if
(!
RpcDigitContainer
.isValid()) {
19
ATH_MSG_FATAL
(
"Failed to retrieve digit container "
<<
m_key
.fullKey());
20
return
false
;
21
}
22
23
ATH_MSG_DEBUG
(
"retrieved RPC Digit Container with size "
<<
RpcDigitContainer
->
digit_size
());
24
25
if
(
RpcDigitContainer
->
size
() == 0)
ATH_MSG_DEBUG
(
" RPC Digit Container empty "
);
26
unsigned
int
n_digits{0};
27
for
(
const
RpcDigitCollection
* coll : *
RpcDigitContainer
) {
28
ATH_MSG_DEBUG
(
"processing collection with size "
<< coll->size());
29
for
(
const
RpcDigit
* digit: *coll) {
30
Identifier
Id = digit->identify();
31
32
ATH_MSG_DEBUG
(
"RPC Digit Offline id: "
<<
idHelperSvc
()->toString(Id));
33
34
const
MuonGM::RpcReadoutElement
* rdoEl = MuonDetMgr->
getRpcReadoutElement
(Id);
35
if
(!rdoEl) {
36
ATH_MSG_ERROR
(
"RPCDigitVariables::fillVariables() - Failed to retrieve PRCReadoutElement for "
<<
idHelperSvc
()->rpcIdHelper().print_to_string(Id).c_str());
37
return
false
;
38
}
39
40
const
Amg::Vector3D
gpos{rdoEl->
stripPos
(Id)};
41
Amg::Vector2D
lpos{Amg::Vector2D::Zero()};
42
43
rdoEl->
surface
(Id).
globalToLocal
(gpos, Amg::Vector3D::Zero(), lpos);
44
m_RPC_dig_globalPos
.push_back(gpos);
45
m_RPC_dig_localPos
.push_back(lpos);
46
m_RPC_dig_time
.push_back(digit->time());
47
m_RPC_tot
.push_back(digit->ToT());
48
m_RPC_dig_id
.push_back(Id);
49
++n_digits;
50
}
51
}
52
m_RPC_nDigits
= n_digits;
53
ATH_MSG_DEBUG
(
" finished fillRpcDigitVariables()"
);
54
return
true
;
55
}
56
}
// namespace MuonPRDTest
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
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
RPCDigitVariables.h
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition
IdentifiableContainerMT.h:209
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
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
MuonGM::RpcReadoutElement::stripPos
Amg::Vector3D stripPos(const Identifier &id) const
Definition
MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx:177
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::RpcDigitVariables::m_RPC_dig_time
VectorBranch< float > & m_RPC_dig_time
Definition
RPCDigitVariables.h:25
MuonPRDTest::RpcDigitVariables::m_RPC_dig_globalPos
ThreeVectorBranch m_RPC_dig_globalPos
Definition
RPCDigitVariables.h:27
MuonPRDTest::RpcDigitVariables::RpcDigitVariables
RpcDigitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
RPCDigitVariables.cxx:9
MuonPRDTest::RpcDigitVariables::m_RPC_dig_id
RpcIdentifierBranch m_RPC_dig_id
Definition
RPCDigitVariables.h:29
MuonPRDTest::RpcDigitVariables::declare_keys
bool declare_keys() override final
Definition
RPCDigitVariables.cxx:12
MuonPRDTest::RpcDigitVariables::m_RPC_nDigits
ScalarBranch< unsigned int > & m_RPC_nDigits
Definition
RPCDigitVariables.h:24
MuonPRDTest::RpcDigitVariables::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
RPCDigitVariables.cxx:13
MuonPRDTest::RpcDigitVariables::m_RPC_dig_localPos
TwoVectorBranch m_RPC_dig_localPos
Definition
RPCDigitVariables.h:28
MuonPRDTest::RpcDigitVariables::m_RPC_tot
VectorBranch< float > & m_RPC_tot
Definition
RPCDigitVariables.h:26
MuonPRDTest::RpcDigitVariables::m_key
SG::ReadHandleKey< RpcDigitContainer > m_key
Definition
RPCDigitVariables.h:23
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
RpcDigitCollection
Definition
RpcDigitCollection.h:17
RpcDigitContainer
Use IdentifiableContainer with RpcDigitCollection.
Definition
RpcDigitContainer.h:53
RpcDigitContainer::digit_size
size_type digit_size() const
Definition
RpcDigitContainer.cxx:57
RpcDigit
Definition
RpcDigit.h:16
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
Trk::PlaneSurface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
Definition
PlaneSurface.cxx:212
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
Generated on
for ATLAS Offline Software by
1.17.0