ATLAS Offline Software
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 
9 MuonRdoToPrepDataAlg::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 
22 StatusCode 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->ROBIDList(*roi, robs);
36  } else {
37  m_regsel->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 }
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonRdoToPrepDataAlg::m_tool
ToolHandle< Muon::IMuonRdoToPrepDataTool > m_tool
Definition: MuonRdoToPrepDataAlg.h:36
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
MuonRdoToPrepDataAlg::m_robDecoding
Gaudi::Property< bool > m_robDecoding
Definition: MuonRdoToPrepDataAlg.h:40
python.HLT.CommonSequences.EventBuildingSequences.robs
robs
Definition: EventBuildingSequences.py:400
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonRdoToPrepDataAlg::m_regsel
ToolHandle< IRegSelTool > m_regsel
Definition: MuonRdoToPrepDataAlg.h:37
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IdentifierHash.h
MuonRdoToPrepDataAlg::MuonRdoToPrepDataAlg
MuonRdoToPrepDataAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonRdoToPrepDataAlg.cxx:9
MuonRdoToPrepDataAlg::initialize
StatusCode initialize() override final
Definition: MuonRdoToPrepDataAlg.cxx:12
MuonRdoToPrepDataAlg::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: MuonRdoToPrepDataAlg.h:41
MuonRdoToPrepDataAlg.h
MuonRdoToPrepDataAlg::m_seededDecoding
Gaudi::Property< bool > m_seededDecoding
Definition: MuonRdoToPrepDataAlg.h:39
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition: StoreGate/src/VarHandleBase.cxx:397
MuonRdoToPrepDataAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition: MuonRdoToPrepDataAlg.cxx:22