ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
8namespace 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
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; }
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
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
size_t size() const
Duplicate of fullSize for backwards compatability.
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
const Muon::IMuonIdHelperSvc * idHelperSvc() const
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
VectorBranch< float > & m_RPC_dig_time
RpcDigitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
ScalarBranch< unsigned int > & m_RPC_nDigits
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...
VectorBranch< float > & m_RPC_tot
SG::ReadHandleKey< RpcDigitContainer > m_key
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TTree * tree() override final
Returns the underlying TTree object.
Use IdentifiableContainer with RpcDigitCollection.
size_type digit_size() const
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...
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D