ATLAS Offline Software
Loading...
Searching...
No Matches
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//=====================================================================
8Muon::sTgcRawDataProvider::sTgcRawDataProvider(const std::string& name, ISvcLocator* pSvcLocator) :
9 AthReentrantAlgorithm(name, pSvcLocator) {}
10
11//=====================================================================
13 ATH_MSG_INFO("sTgcRawDataProvider::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
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//=====================================================================
32StatusCode 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
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}
#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.
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
ReadHandle for the input RoIs.
sTgcRawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
ToolHandle< IRegSelTool > m_regsel_stgc
Handle for region selector service.
ToolHandle< Muon::IMuonRawDataProviderTool > m_rawDataTool
Handle for the RawDataProviderTool.
virtual StatusCode initialize() override
Initialize.
Gaudi::Property< bool > m_seededDecoding
Property to decide whether or not to do RoI based decoding.
virtual bool isValid() override final
Can the handle be successfully dereferenced?