ATLAS Offline Software
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 //===============================================================================================
8 Muon::MM_RawDataProvider::MM_RawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
9  AthReentrantAlgorithm(name, pSvcLocator) {}
10 
11 //===============================================================================================
13  ATH_MSG_INFO("MM_RawDataProvider::initialize");
14  ATH_MSG_INFO(m_seededDecoding);
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 //===============================================================================================
24 StatusCode 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
34  SG::ReadHandle<TrigRoiDescriptorCollection> muonRoI(m_roiCollectionKey, ctx);
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->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 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Muon::MM_RawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition: MM_RawDataProvider.cxx:24
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::MM_RawDataProvider::initialize
virtual StatusCode initialize() override
Initialize.
Definition: MM_RawDataProvider.cxx:12
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
Muon::MM_RawDataProvider::MM_RawDataProvider
MM_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: MM_RawDataProvider.cxx:8
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
python.HLT.CommonSequences.EventBuildingSequences.robs
robs
Definition: EventBuildingSequences.py:401
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:221
MM_RawDataProvider.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32