ATLAS Offline Software
Loading...
Searching...
No Matches
MM_RawDataProvider.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//===============================================================================================
8Muon::MM_RawDataProvider::MM_RawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
9 AthReentrantAlgorithm(name, pSvcLocator) {}
10
11//===============================================================================================
13 ATH_MSG_INFO("MM_RawDataProvider::initialize");
15
16 ATH_CHECK(m_rawDataTool.retrieve());
17 ATH_CHECK(m_roiCollectionKey.initialize(m_seededDecoding)); // mark the RoI-collection flag as used or not used
18 ATH_CHECK(m_regsel_mm.retrieve(DisableTool{!m_seededDecoding}));
19
20 return StatusCode::SUCCESS;
21}
22
23//===============================================================================================
24StatusCode Muon::MM_RawDataProvider::execute(const EventContext& ctx) const {
25 // The hash IDs corresponding to each ROI (in seeded mode) have module-level granularity, not sector level.
26 // Therefore, we pass the list of hash IDs to the decoder to make the selection based on decoded elink info.
27
28 ATH_MSG_VERBOSE("MM_RawDataProvider::execute");
29
30 if (m_seededDecoding) {
31 ATH_MSG_DEBUG("converting MM BS into RDOs in ROI-seeded mode");
32
33 // read the RoIs to process
35 if (!muonRoI.isValid()) {
36 ATH_MSG_WARNING("Cannot retrieve muonRoI " << m_roiCollectionKey.key());
37 return StatusCode::FAILURE;
38 }
39
40 std::vector<uint32_t> robs;
41 // loop on RoIs
42 for (auto roi : *muonRoI) {
43 ATH_MSG_DEBUG("Getting ROBs for RoI " << *roi);
44 // Get ROB IDs from region selector
45 m_regsel_mm->lookup(ctx)->ROBIDList(*roi, robs);
46 }
47
48 // Call decoding tool, passing the ROB IDs
49 if (!m_rawDataTool->convert(robs, ctx).isSuccess()) {
50 ATH_MSG_ERROR("MM BS conversion into RDOs failed");
51 return StatusCode::FAILURE;
52 }
53
54 } else {
55 ATH_MSG_DEBUG("converting MM BS into RDOs in unseeded mode");
56 if (!m_rawDataTool->convert(ctx).isSuccess()) {
57 ATH_MSG_ERROR("MM BS conversion into RDOs failed");
58 return StatusCode::FAILURE;
59 }
60 }
61
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(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.
MM_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode initialize() override
Initialize.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
ToolHandle< Muon::IMuonRawDataProviderTool > m_rawDataTool
Tool handle for raw data provider tool.
Gaudi::Property< bool > m_seededDecoding
Property to decide whether or not to do RoI based decoding.
ToolHandle< IRegSelTool > m_regsel_mm
Handle for region selector service.
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
ReadHandle for the input RoIs.
virtual bool isValid() override final
Can the handle be successfully dereferenced?