ATLAS Offline Software
sTgcRawDataProvider.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 //=====================================================================
8 Muon::sTgcRawDataProvider::sTgcRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
9  AthReentrantAlgorithm(name, pSvcLocator) {}
10 
11 //=====================================================================
13  ATH_MSG_INFO("sTgcRawDataProvider::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 
19  if (m_seededDecoding) {
20  if (m_regsel_stgc.retrieve().isFailure()) { // in RoI - seeded mode, retrieve the region selector
21  ATH_MSG_FATAL("Unable to retrieve RegionSelector Tool");
22  return StatusCode::FAILURE;
23  }
24  } else {
25  m_regsel_stgc.disable();
26  }
27 
28  return StatusCode::SUCCESS;
29 }
30 
31 //=====================================================================
32 StatusCode Muon::sTgcRawDataProvider::execute(const EventContext& ctx) const {
33  // This method is substantially different than the one for TGCs because the hash IDs
34  // corresponding to each ROI (in seeded mode) have quadruplet-level granularity (module=quadruplet).
35  // Thus, ROB-level selection is not enough; we need quadruplet-level selection. Therefore,
36  // we pass the list of hash IDs to the decoder to make the selection based on decoded elink info.
37 
38  ATH_MSG_VERBOSE("sTgcRawDataProvider::execute");
39 
40  if (m_seededDecoding) { // RoI - seeded mode
41 
42  ATH_MSG_DEBUG("converting sTGC BS into RDOs in ROI-seeded mode");
43 
44  // get the RoIs to process
45  SG::ReadHandle<TrigRoiDescriptorCollection> muonRoI(m_roiCollectionKey, ctx);
46  if (!muonRoI.isValid()) {
47  ATH_MSG_WARNING("Cannot retrieve muonRoI " << m_roiCollectionKey.key());
48  return StatusCode::FAILURE;
49  }
50 
51  std::vector<uint32_t> robs;
52  // loop on RoIs
53  for (auto roi : *muonRoI) {
54  ATH_MSG_DEBUG("Getting ROBs for RoI " << *roi);
55  // Get ROB IDs from region selector
56  m_regsel_stgc->lookup(ctx)->ROBIDList(*roi, robs);
57  }
58 
59  if (!m_rawDataTool->convert(robs, ctx).isSuccess()) {
60  ATH_MSG_ERROR("STGC BS conversion into RDOs failed");
61  return StatusCode::FAILURE;
62  }
63  } else {
64  ATH_MSG_DEBUG("converting sTGC BS into RDOs in unseeded mode");
65  if (!m_rawDataTool->convert(ctx).isSuccess()) {
66  ATH_MSG_ERROR("STGC BS conversion into RDOs failed");
67  return StatusCode::FAILURE;
68  }
69  }
70 
71  return StatusCode::SUCCESS;
72 }
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
Muon::sTgcRawDataProvider::sTgcRawDataProvider
sTgcRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: sTgcRawDataProvider.cxx:8
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
sTgcRawDataProvider.h
Muon::sTgcRawDataProvider::initialize
virtual StatusCode initialize() override
Initialize.
Definition: sTgcRawDataProvider.cxx:12
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?
Muon::sTgcRawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition: sTgcRawDataProvider.cxx:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32