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
7
9#include <cstdint>
10#include <vector>
11
12MuonRdoToPrepDataAlg::MuonRdoToPrepDataAlg(const std::string& name, ISvcLocator* pSvcLocator) :
13 AthReentrantAlgorithm(name, pSvcLocator) {}
14
16 ATH_MSG_DEBUG(" in initialize()");
17
18 // verify that our tool handle is pointing to an accessible tool
19 ATH_CHECK(m_tool.retrieve());
21 ATH_CHECK(m_regsel.retrieve(EnableTool{m_seededDecoding}));
22 return StatusCode::SUCCESS;
23}
24
25StatusCode MuonRdoToPrepDataAlg::execute(const EventContext& ctx) const {
26 ATH_MSG_DEBUG("**************** in MuonRdoToPrepDataAlg::execute() ***********************************************");
27 ATH_MSG_DEBUG("in execute()");
28
29 std::vector<IdentifierHash> toDecode{};
30 std::vector<uint32_t> robs{};
31
32
33 if (m_seededDecoding) { // decoding from trigger roi
35 ATH_CHECK(muonRoI.isPresent());
36 for (const auto *roi : *muonRoI) {
37 if (m_robDecoding) {
38 m_regsel->lookup(ctx)->ROBIDList(*roi, robs);
39 } else {
40 m_regsel->lookup(ctx)->HashIDList(*roi, toDecode);
41 }
42 if (!robs.empty()) {
43 ATH_CHECK(m_tool->decode(ctx, robs));
44 robs.clear();
45 } else if (!toDecode.empty()) {
46 ATH_CHECK(m_tool->decode(ctx, toDecode));
47 } else {
48 ATH_CHECK(m_tool->provideEmptyContainer(ctx));
49 }
50 }
51
52 } else {
53 ATH_CHECK(m_tool->decode(ctx, toDecode));
54 }
55 return StatusCode::SUCCESS;
56}
#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?