ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonRdoToPrepData
src
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
5
#include "
MuonRdoToPrepData/MuonRdoToPrepDataAlg.h
"
6
#include "
TrigSteeringEvent/TrigRoiDescriptor.h
"
7
8
#include "
Identifier/IdentifierHash.h
"
9
#include <cstdint>
10
#include <vector>
11
12
MuonRdoToPrepDataAlg::MuonRdoToPrepDataAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
13
AthReentrantAlgorithm
(name, pSvcLocator) {}
14
15
StatusCode
MuonRdoToPrepDataAlg::initialize
() {
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());
20
ATH_CHECK
(
m_roiCollectionKey
.initialize(
m_seededDecoding
));
21
ATH_CHECK
(
m_regsel
.retrieve(EnableTool{m_seededDecoding}));
22
return
StatusCode::SUCCESS;
23
}
24
25
StatusCode
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
34
SG::ReadHandle<TrigRoiDescriptorCollection>
muonRoI(
m_roiCollectionKey
, ctx);
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IdentifierHash.h
MuonRdoToPrepDataAlg.h
TrigRoiDescriptor.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
MuonRdoToPrepDataAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition
MuonRdoToPrepDataAlg.cxx:25
MuonRdoToPrepDataAlg::m_seededDecoding
Gaudi::Property< bool > m_seededDecoding
Definition
MuonRdoToPrepDataAlg.h:39
MuonRdoToPrepDataAlg::m_tool
ToolHandle< Muon::IMuonRdoToPrepDataTool > m_tool
Definition
MuonRdoToPrepDataAlg.h:36
MuonRdoToPrepDataAlg::m_regsel
ToolHandle< IRegSelTool > m_regsel
Definition
MuonRdoToPrepDataAlg.h:37
MuonRdoToPrepDataAlg::m_robDecoding
Gaudi::Property< bool > m_robDecoding
Definition
MuonRdoToPrepDataAlg.h:40
MuonRdoToPrepDataAlg::MuonRdoToPrepDataAlg
MuonRdoToPrepDataAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
MuonRdoToPrepDataAlg.cxx:12
MuonRdoToPrepDataAlg::initialize
StatusCode initialize() override final
Definition
MuonRdoToPrepDataAlg.cxx:15
MuonRdoToPrepDataAlg::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition
MuonRdoToPrepDataAlg.h:41
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition
StoreGate/src/VarHandleBase.cxx:400
Generated on
for ATLAS Offline Software by
1.17.0