ATLAS Offline Software
RpcRawDataProvider.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <algorithm>
8 // --------------------------------------------------------------------
9 // Constructor
10 
11 Muon::RpcRawDataProvider::RpcRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
12  AthReentrantAlgorithm(name, pSvcLocator) {}
13 
15  ATH_MSG_INFO("RpcRawDataProvider::initialize");
16  ATH_MSG_INFO(m_seededDecoding);
17 
18  ATH_CHECK(m_rawDataTool.retrieve());
19  ATH_CHECK(m_roiCollectionKey.initialize(m_seededDecoding)); // pass the seeded decoding flag - this marks the RoI collection flag as
20  // not used for the case when we decode the full detector
21 
22  if (m_seededDecoding) {
23  // We only need the region selector in RoI seeded mode
24  if (m_regsel_rpc.retrieve().isFailure()) {
25  ATH_MSG_FATAL("Unable to retrieve RegionSelector Tool");
26  return StatusCode::FAILURE;
27  }
28  } // seededDecoding
29  else
30  m_regsel_rpc.disable();
31 
32  return StatusCode::SUCCESS;
33 }
34 
35 // --------------------------------------------------------------------
36 // Execute
37 
38 StatusCode Muon::RpcRawDataProvider::execute(const EventContext& ctx) const {
39  ATH_MSG_VERBOSE("RpcRawDataProvider::execute");
40 
41  if (m_seededDecoding) {
42  // read in the RoIs to process
43  SG::ReadHandle<TrigRoiDescriptorCollection> muonRoI(m_roiCollectionKey, ctx);
44  if (!muonRoI.isValid()) {
45  ATH_MSG_WARNING("Cannot retrieve muonRoI " << m_roiCollectionKey.key());
46  return StatusCode::FAILURE;
47  }
48 
49  // loop on RoIs
50  std::vector<uint32_t> rpcrobs;
51  for (auto roi : *muonRoI) {
52  ATH_MSG_DEBUG("Get ROBs for RoI " << *roi);
53  // get list of ROBs from region selector
54  m_regsel_rpc->ROBIDList(*roi, rpcrobs);
55 
56  // decode the ROBs
57  if (m_rawDataTool->convert(rpcrobs, ctx).isFailure()) { ATH_MSG_ERROR("RoI seeded BS conversion into RDOs failed"); }
58  // clear vector of ROB IDs ready for next RoI
59  rpcrobs.clear();
60  }
61 
62  } else {
63  // ask RpcRawDataProviderTool to decode the event and to fill the IDC
64  if (m_rawDataTool->convert(ctx).isFailure()) ATH_MSG_ERROR("BS conversion into RDOs failed");
65  }
66 
67  return StatusCode::SUCCESS;
68 }
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Muon::RpcRawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const
Execute.
Definition: RpcRawDataProvider.cxx:38
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::RpcRawDataProvider::initialize
virtual StatusCode initialize()
Initialize.
Definition: RpcRawDataProvider.cxx:14
RpcRawDataProvider.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Muon::RpcRawDataProvider::RpcRawDataProvider
RpcRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: RpcRawDataProvider.cxx:11
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32