ATLAS Offline Software
Loading...
Searching...
No Matches
MuonRdoToPrepDataAlg.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
8
9MuonRdoToPrepDataAlg::MuonRdoToPrepDataAlg(const std::string& name, ISvcLocator* pSvcLocator) :
10 AthReentrantAlgorithm(name, pSvcLocator) {}
11
13 ATH_MSG_DEBUG(" in initialize()");
14
15 // verify that our tool handle is pointing to an accessible tool
16 ATH_CHECK(m_tool.retrieve());
18 ATH_CHECK(m_regsel.retrieve(EnableTool{m_seededDecoding}));
19 return StatusCode::SUCCESS;
20}
21
22StatusCode MuonRdoToPrepDataAlg::execute(const EventContext& ctx) const {
23 ATH_MSG_DEBUG("**************** in MuonRdoToPrepDataAlg::execute() ***********************************************");
24 ATH_MSG_DEBUG("in execute()");
25
26 std::vector<IdentifierHash> toDecode{};
27 std::vector<uint32_t> robs{};
28
29
30 if (m_seededDecoding) { // decoding from trigger roi
32 ATH_CHECK(muonRoI.isPresent());
33 for (const auto *roi : *muonRoI) {
34 if (m_robDecoding) {
35 m_regsel->lookup(ctx)->ROBIDList(*roi, robs);
36 } else {
37 m_regsel->lookup(ctx)->HashIDList(*roi, toDecode);
38 }
39 if (!robs.empty()) {
40 ATH_CHECK(m_tool->decode(ctx, robs));
41 robs.clear();
42 } else if (!toDecode.empty()) {
43 ATH_CHECK(m_tool->decode(ctx, toDecode));
44 } else {
45 ATH_CHECK(m_tool->provideEmptyContainer(ctx));
46 }
47 }
48
49 } else {
50 ATH_CHECK(m_tool->decode(ctx, toDecode));
51 }
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
An algorithm that can be simultaneously executed in multiple threads.
StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< bool > m_seededDecoding
ToolHandle< Muon::IMuonRdoToPrepDataTool > m_tool
ToolHandle< IRegSelTool > m_regsel
Gaudi::Property< bool > m_robDecoding
MuonRdoToPrepDataAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize() override final
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
bool isPresent() const
Is the referenced object present in SG?