ATLAS Offline Software
Loading...
Searching...
No Matches
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
11Muon::RpcRawDataProvider::RpcRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
12 AthReentrantAlgorithm(name, pSvcLocator) {}
13
15 ATH_MSG_INFO("RpcRawDataProvider::initialize");
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
38StatusCode 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
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->lookup(ctx)->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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode initialize()
Initialize.
ToolHandle< Muon::IMuonRawDataProviderTool > m_rawDataTool
Tool handle for raw data provider tool.
RpcRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
ReadHandle for the input RoIs.
Gaudi::Property< bool > m_seededDecoding
Property to decide whether or not to do RoI based decoding.
virtual StatusCode execute(const EventContext &ctx) const
Execute.
ToolHandle< IRegSelTool > m_regsel_rpc
Handle for region selector service.
virtual bool isValid() override final
Can the handle be successfully dereferenced?