ATLAS Offline Software
RPCPRDVariables.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 
11 namespace MuonPRDTest {
12  RPCPRDVariables::RPCPRDVariables(MuonTesterTree& tree, const std::string& container_name, MSG::Level msglvl) :
13  PrdTesterModule(tree, "PRD_RPC", msglvl), m_key{container_name} {}
15 
16  bool RPCPRDVariables::fill(const EventContext& ctx) {
17  ATH_MSG_DEBUG("do fillRPCPRDVariables()");
18 
20  if (!rpcprdContainer.isValid()) {
21  ATH_MSG_FATAL("Failed to retrieve prd container " << m_key.fullKey());
22  return false;
23  }
24 
25  ATH_MSG_DEBUG("retrieved RPC PRD Container with size " << rpcprdContainer->size());
26 
27  unsigned int n_PRD{0};
28  for(const Muon::RpcPrepDataCollection* coll : *rpcprdContainer ) {
29  for (const Muon::RpcPrepData* prd: *coll) {
30 
31  m_RPC_PRD_id.push_back(prd->identify());
32  m_RPC_PRD_globalPos.push_back(prd->globalPosition());
33  m_RPC_PRD_locX.push_back(prd->localPosition().x());
34  m_RPC_PRD_error.push_back(Amg::error(prd->localCovariance(), Trk::locX));
35  m_RPC_PRD_time.push_back(prd->time());
36  ++n_PRD;
37  }
38  }
39  m_RPC_nPRD = n_PRD;
40  ATH_MSG_DEBUG(" finished fillRPCPRDVariables()");
41  return true;
42  }
43 }
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonPRDTest::RPCPRDVariables::RPCPRDVariables
RPCPRDVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition: RPCPRDVariables.cxx:12
Trk::locX
@ locX
Definition: ParamDefs.h:37
AthMsgStreamMacros.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
EventPrimitivesHelpers.h
tree
TChain * tree
Definition: tile_monitor.h:30
MuonPRDTest::RPCPRDVariables::m_RPC_PRD_id
RpcIdentifierBranch m_RPC_PRD_id
Definition: RPCPRDVariables.h:28
MuonVal::RpcIdentifierBranch::push_back
void push_back(const Identifier &id) override final
Definition: IdentifierBranch.cxx:36
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
MuonVal::ThreeVectorBranch::push_back
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
Definition: ThreeVectorBranch.cxx:23
MuonPRDTest::RPCPRDVariables::m_key
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_key
Definition: RPCPRDVariables.h:24
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
Muon::RpcPrepData
Class to represent RPC measurements.
Definition: RpcPrepData.h:35
MuonPRDTest::RPCPRDVariables::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: RPCPRDVariables.cxx:16
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
RPCPRDVariables.h
MuonPRDTest::RPCPRDVariables::m_RPC_nPRD
ScalarBranch< unsigned int > & m_RPC_nPRD
Definition: RPCPRDVariables.h:25
MuonPRDTest::PrdTesterModule
Definition: PrdTesterModule.h:15
MuonPRDTest::RPCPRDVariables::m_RPC_PRD_globalPos
ThreeVectorBranch m_RPC_PRD_globalPos
Definition: RPCPRDVariables.h:26
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
MuonVal::VectorBranch::push_back
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonPRDTest::RPCPRDVariables::m_RPC_PRD_locX
VectorBranch< double > & m_RPC_PRD_locX
Definition: RPCPRDVariables.h:27
MuonPRDTest::RPCPRDVariables::declare_keys
bool declare_keys() override final
Definition: RPCPRDVariables.cxx:14
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
MuonPRDTest::RPCPRDVariables::m_RPC_PRD_error
VectorBranch< float > & m_RPC_PRD_error
Definition: RPCPRDVariables.h:29
MuonPRDTest
Definition: MuonHitTesterAlg.h:15
GeoPrimitivesToStringConverter.h
MuonPRDTest::RPCPRDVariables::m_RPC_PRD_time
VectorBranch< float > & m_RPC_PRD_time
Definition: RPCPRDVariables.h:30
RpcReadoutElement.h