ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Muon::RPC_RawDataProviderToolMT Class Reference

Tool to do decoding of RPC RAW data. More...

#include <RPC_RawDataProviderToolMT.h>

Inheritance diagram for Muon::RPC_RawDataProviderToolMT:
Collaboration diagram for Muon::RPC_RawDataProviderToolMT:

Public Member Functions

 RPC_RawDataProviderToolMT (const std::string &t, const std::string &n, const IInterface *p)
 
virtual ~RPC_RawDataProviderToolMT ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode convert (const ROBFragmentList &vecRobs) const override
 Decoding method. More...
 
virtual StatusCode convert (const ROBFragmentList &vecRobs, const std::vector< IdentifierHash > &coll) const override
 
virtual StatusCode convert () const override
 the new ones More...
 
virtual StatusCode convert (const std::vector< IdentifierHash > &) const override
 for a selection of rdo collections More...
 
virtual StatusCode convert (const std::vector< uint32_t > &) const override
 
virtual StatusCode convert (const ROBFragmentList &, const EventContext &) const override
 EventContext ones. More...
 
virtual StatusCode convert (const ROBFragmentList &, const std::vector< IdentifierHash > &, const EventContext &) const override
 
virtual StatusCode convert (const EventContext &) const override
 
virtual StatusCode convert (const std::vector< IdentifierHash > &, const EventContext &) const override
 
virtual StatusCode convert (const std::vector< uint32_t > &, const EventContext &) const override
 

Private Attributes

SG::UpdateHandleKey< RpcPad_Cachem_rdoContainerCacheKey
 RPC container cache key. More...
 
Gaudi::Property< bool > m_WriteOutRpcSectorLogic {this, "WriteOutRpcSectorLogic", true, "Turn on/off RpcSectorLogic writing"}
 Turn on/off RpcSectorConfig writing. More...
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 

Detailed Description

Tool to do decoding of RPC RAW data.

This tool should be safe to use with athenaMT. It will not work with the legacy run-2 trigger code, since the tool creates a new container each time.

The main work of decoding is done in the RPC_RawDataProviderToolCore class.

Definition at line 25 of file RPC_RawDataProviderToolMT.h.

Constructor & Destructor Documentation

◆ RPC_RawDataProviderToolMT()

Muon::RPC_RawDataProviderToolMT::RPC_RawDataProviderToolMT ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 13 of file RPC_RawDataProviderToolMT.cxx.

13  :
14  base_class(t, n, p) {
15 }

◆ ~RPC_RawDataProviderToolMT()

virtual Muon::RPC_RawDataProviderToolMT::~RPC_RawDataProviderToolMT ( )
virtualdefault

Member Function Documentation

◆ convert() [1/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( ) const
overridevirtual

the new ones

for the entire event

Definition at line 38 of file RPC_RawDataProviderToolMT.cxx.

38 { return this->convert(Gaudi::Hive::currentContext()); }

◆ convert() [2/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const EventContext &  ctx) const
overridevirtual

Definition at line 40 of file RPC_RawDataProviderToolMT.cxx.

40  {
41  SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey, ctx};
42  const RpcCablingCondData* readCdo{*readHandle};
43  // CALLGRIND_START_INSTRUMENTATION
45  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
46  std::vector<uint32_t> robIds = readCdo->giveFullListOfRobIds();
47  m_robDataProvider->getROBData(robIds, vecOfRobf);
48  // CALLGRIND_STOP_INSTRUMENTATION
49  return convert(vecOfRobf, ctx); // using the old one
50 }

◆ convert() [3/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs,
const EventContext &  ctx 
) const
overridevirtual

EventContext ones.

Definition at line 56 of file RPC_RawDataProviderToolMT.cxx.

56  {
57  // CALLGRIND_START_INSTRUMENTATION
58  std::vector<IdentifierHash> collections;
59  // CALLGRIND_STOP_INSTRUMENTATION
60  return convert(vecRobs, collections, ctx);
61 }

◆ convert() [4/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs,
const std::vector< IdentifierHash > &  collections,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 98 of file RPC_RawDataProviderToolMT.cxx.

99  {
100  // CALLGRIND_START_INSTRUMENTATION
101 
102  SG::WriteHandle<RpcPadContainer> rdoContainerHandle(m_containerKey, ctx);
103  SG::WriteHandle<RpcSectorLogicContainer> logicHandle(m_sec, ctx);
104 
105  // run 3 mode, here we always try to write the containers
106 
107  // Split the methods to have one where we use the cache and one where we just setup the container
108  const bool externalCacheRDO = !m_rdoContainerCacheKey.key().empty();
109  if (!externalCacheRDO) {
110  ATH_CHECK(rdoContainerHandle.record(std::make_unique<RpcPadContainer>(m_idHelperSvc->rpcIdHelper().module_hash_max())));
111  ATH_MSG_DEBUG("Created RpcPadContainer");
112  } else {
114  ATH_CHECK(update.isValid());
115  ATH_CHECK(rdoContainerHandle.record(std::make_unique<RpcPadContainer>(update.ptr())));
116  ATH_MSG_DEBUG("Created container using cache for " << m_rdoContainerCacheKey.key());
117  }
118  RpcPadContainer* pad = rdoContainerHandle.ptr();
119 
120  RpcSectorLogicContainer* logic = nullptr;
122  ATH_MSG_DEBUG("Writing out RpcSectorLogicContainer");
123  ATH_CHECK(logicHandle.record(std::make_unique<RpcSectorLogicContainer>()));
124  logic = logicHandle.ptr();
125  }
126 
127  // pass the containers to the convertIntoContainers function in the RPC_RawDataProviderToolCore base class
128  ATH_CHECK(convertIntoContainers(vecRobs, collections, pad, logic, true));
129 
130  return StatusCode::SUCCESS;
131 }

◆ convert() [5/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs) const
overridevirtual

Decoding method.

  • current methods: let's keep them!

Definition at line 52 of file RPC_RawDataProviderToolMT.cxx.

52  {
53  return this->convert(vecRobs, Gaudi::Hive::currentContext());
54 }

◆ convert() [6/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const ROBFragmentList &  vecRobs,
const std::vector< IdentifierHash > &  coll 
) const
overridevirtual

Definition at line 94 of file RPC_RawDataProviderToolMT.cxx.

94  {
95  return this->convert(vecRobs, collections, Gaudi::Hive::currentContext());
96 }

◆ convert() [7/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > &  rdoIdhVect) const
overridevirtual

for a selection of rdo collections

Definition at line 78 of file RPC_RawDataProviderToolMT.cxx.

78  {
79  return this->convert(rdoIdhVect, Gaudi::Hive::currentContext());
80 }

◆ convert() [8/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > &  rdoIdhVect,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 82 of file RPC_RawDataProviderToolMT.cxx.

82  {
83  SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey, ctx};
84  const RpcCablingCondData* readCdo{*readHandle};
85  // CALLGRIND_START_INSTRUMENTATION
86  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
87  std::vector<uint32_t> robIds;
88  CHECK(readCdo->giveROB_fromRDO(rdoIdhVect, robIds));
89  m_robDataProvider->getROBData(robIds, vecOfRobf);
90  // CALLGRIND_STOP_INSTRUMENTATION
91  return convert(vecOfRobf, rdoIdhVect, ctx); // using the old one
92 }

◆ convert() [9/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  robIds) const
overridevirtual

Definition at line 64 of file RPC_RawDataProviderToolMT.cxx.

64  {
65  return this->convert(robIds, Gaudi::Hive::currentContext());
66 }

◆ convert() [10/10]

StatusCode Muon::RPC_RawDataProviderToolMT::convert ( const std::vector< uint32_t > &  robIds,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 68 of file RPC_RawDataProviderToolMT.cxx.

68  {
69  // CALLGRIND_START_INSTRUMENTATION
70  std::vector<IdentifierHash> collections;
71  std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
72  m_robDataProvider->getROBData(robIds, vecOfRobf);
73  // CALLGRIND_STOP_INSTRUMENTATION
74  return convert(vecOfRobf, collections, ctx);
75 }

◆ initialize()

StatusCode Muon::RPC_RawDataProviderToolMT::initialize ( )
overridevirtual

Definition at line 17 of file RPC_RawDataProviderToolMT.cxx.

17  {
19 
20  ATH_CHECK(m_rdoContainerCacheKey.initialize(!m_rdoContainerCacheKey.key().empty()));
21  ATH_CHECK(m_idHelperSvc.retrieve());
22 
23  // We should only turn off the sector logic when running with cached data a la trigger mode
24  if (!m_rdoContainerCacheKey.key().empty() && m_WriteOutRpcSectorLogic) {
26  "Cannot write out RpcSectorLogic while running with cached RpcPad containers"
27  " as the RpcSectorLogic is not cached at the same time and the written containers will desync."
28  " Please turn off RpcSectorLogic writing when running with cached bytestream container");
29  return StatusCode::FAILURE;
30  }
31 
32  ATH_MSG_INFO("initialize() successful in " << name());
33 
34  return StatusCode::SUCCESS;
35 }

Member Data Documentation

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::RPC_RawDataProviderToolMT::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 54 of file RPC_RawDataProviderToolMT.h.

◆ m_rdoContainerCacheKey

SG::UpdateHandleKey<RpcPad_Cache> Muon::RPC_RawDataProviderToolMT::m_rdoContainerCacheKey
private
Initial value:
{this,"RpcContainerCacheKey",
"", "Optional external cache for the RPC container"}

RPC container cache key.

Definition at line 49 of file RPC_RawDataProviderToolMT.h.

◆ m_WriteOutRpcSectorLogic

Gaudi::Property<bool> Muon::RPC_RawDataProviderToolMT::m_WriteOutRpcSectorLogic {this, "WriteOutRpcSectorLogic", true, "Turn on/off RpcSectorLogic writing"}
private

Turn on/off RpcSectorConfig writing.

Definition at line 52 of file RPC_RawDataProviderToolMT.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Muon::RPC_RawDataProviderToolMT::m_rdoContainerCacheKey
SG::UpdateHandleKey< RpcPad_Cache > m_rdoContainerCacheKey
RPC container cache key.
Definition: RPC_RawDataProviderToolMT.h:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
RpcCablingCondData
Definition: RpcCablingCondData.h:21
Muon::RPC_RawDataProviderToolCore::initialize
virtual StatusCode initialize() override
Definition: RPC_RawDataProviderToolCore.cxx:14
Muon::RPC_RawDataProviderToolMT::convert
virtual StatusCode convert() const override
the new ones
Definition: RPC_RawDataProviderToolMT.cxx:38
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::RPC_RawDataProviderToolMT::m_WriteOutRpcSectorLogic
Gaudi::Property< bool > m_WriteOutRpcSectorLogic
Turn on/off RpcSectorConfig writing.
Definition: RPC_RawDataProviderToolMT.h:52
RpcSectorLogicContainer
Definition: RpcSectorLogicContainer.h:20
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::UpdateHandle
Definition: UpdateHandle.h:94
Muon::RPC_RawDataProviderToolMT::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: RPC_RawDataProviderToolMT.h:54
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
dqt_zlumi_pandas.update
update
Definition: dqt_zlumi_pandas.py:42
RpcCablingCondData::giveFullListOfRobIds
const std::vector< uint32_t > & giveFullListOfRobIds() const
Definition: RpcCablingCondData.cxx:108
RpcPadContainer
Use IdentifiableContainer with RpcPad.
Definition: RpcPadContainer.h:23