ATLAS Offline Software
MdtRawDataProvider.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 Muon::MdtRawDataProvider::MdtRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
10  AthReentrantAlgorithm(name, pSvcLocator) {}
11 
13  ATH_MSG_INFO("MdtRawDataProvider::initialize");
14  ATH_MSG_INFO(m_seededDecoding);
15 
16  ATH_CHECK(m_rawDataTool.retrieve());
17 
18  ATH_CHECK(m_roiCollectionKey.initialize(m_seededDecoding)); // pass the seeded decoding flag - this marks the RoI collection flag as
19  // not used for the case when we decode the full detector
20 
21  if (m_seededDecoding) {
22  // We only need the region selector in RoI seeded mode
23  if (m_regsel_mdt.retrieve().isFailure()) {
24  ATH_MSG_FATAL("Unable to retrieve RegionSelector Tool");
25  return StatusCode::FAILURE;
26  }
27  } // seededDecoding
28  else
29  m_regsel_mdt.disable();
30 
31  return StatusCode::SUCCESS;
32 }
33 
34 // --------------------------------------------------------------------
35 // Execute
36 
37 StatusCode Muon::MdtRawDataProvider::execute(const EventContext& ctx) const {
38  ATH_MSG_VERBOSE("MdtRawDataProvider::execute");
39 
40  if (m_seededDecoding) {
41  // read in the RoIs to process
42  SG::ReadHandle<TrigRoiDescriptorCollection> muonRoI(m_roiCollectionKey, ctx);
43  if (!muonRoI.isValid()) {
44  ATH_MSG_WARNING("Cannot retrieve muonRoI " << m_roiCollectionKey.key());
45  return StatusCode::FAILURE;
46  }
47 
48  // loop on RoIs
49  std::vector<uint32_t> robs;
50  for (auto roi : *muonRoI) {
51  ATH_MSG_DEBUG("Get ROBs for RoI " << *roi);
52  // get list of ROBs from region selector
53  m_regsel_mdt->lookup(ctx)->ROBIDList(*roi, robs);
54 
55  // decode the ROBs
56  if (m_rawDataTool->convert(robs, ctx).isFailure()) { ATH_MSG_ERROR("RoI seeded BS conversion into RDOs failed"); }
57  // clear vector of ROB IDs ready for next RoI
58  robs.clear();
59  }
60  } else {
61  // ask MdtRawDataProviderTool to decode the event and to fill the IDC
62  if (m_rawDataTool->convert(ctx).isFailure()) ATH_MSG_ERROR("BS conversion into RDOs failed");
63  }
64 
65  return StatusCode::SUCCESS;
66 }
MdtRawDataProvider.h
Muon::MdtRawDataProvider::MdtRawDataProvider
MdtRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: MdtRawDataProvider.cxx:9
Muon::MdtRawDataProvider::initialize
virtual StatusCode initialize()
Initialize.
Definition: MdtRawDataProvider.cxx:12
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
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
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:228
Muon::MdtRawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const
Execute.
Definition: MdtRawDataProvider.cxx:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32