ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigSteer
TrigHLTResultByteStream
src
HLTResultMTByteStreamDecoderAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
HLTResultMTByteStreamDecoderAlg.h
"
6
7
// =============================================================================
8
// Standard constructor
9
// =============================================================================
10
HLTResultMTByteStreamDecoderAlg::HLTResultMTByteStreamDecoderAlg
(
const
std::string& name, ISvcLocator* svcLoc)
11
:
AthReentrantAlgorithm
(name, svcLoc),
12
m_robDataProviderSvc
(
"ROBDataProviderSvc"
, name) {}
13
14
// =============================================================================
15
// Implementation of AthReentrantAlgorithm::initialize
16
// =============================================================================
17
StatusCode
HLTResultMTByteStreamDecoderAlg::initialize
() {
18
ATH_MSG_DEBUG
(
"Initialising "
<< name());
19
ATH_CHECK
(
m_hltResultWHKey
.initialize());
20
ATH_CHECK
(
m_robDataProviderSvc
.retrieve());
21
22
// Convert module IDs to HLT result ROB IDs
23
for
(
const
uint16_t moduleId :
m_moduleIdsToDecode
) {
24
eformat::helper::SourceIdentifier sid(eformat::TDAQ_HLT, moduleId);
25
m_robIdsToDecode
.push_back(sid.code());
26
}
27
28
return
StatusCode::SUCCESS;
29
}
30
31
// =============================================================================
32
// Implementation of AthReentrantAlgorithm::finalize
33
// =============================================================================
34
StatusCode
HLTResultMTByteStreamDecoderAlg::finalize
() {
35
ATH_MSG_DEBUG
(
"Finalising "
<< name());
36
ATH_CHECK
(
m_robDataProviderSvc
.release());
37
return
StatusCode::SUCCESS;
38
}
39
40
// =============================================================================
41
// Implementation of AthReentrantAlgorithm::execute
42
// =============================================================================
43
StatusCode
HLTResultMTByteStreamDecoderAlg::execute
(
const
EventContext& eventContext)
const
{
44
ATH_MSG_DEBUG
(
"Executing "
<< name());
45
46
// Create and record the HLTResultMT object
47
auto
hltResult =
SG::makeHandle
(
m_hltResultWHKey
,eventContext);
48
ATH_CHECK
( hltResult.record(std::make_unique<HLT::HLTResultMT>()) );
49
ATH_MSG_DEBUG
(
"Recorded HLTResultMT with key "
<<
m_hltResultWHKey
.key());
50
51
// Retrieve the RawEvent pointer
52
const
RawEvent
*
re
=
m_robDataProviderSvc
->getEvent(eventContext);
// Owned by ROBDataProvider or InputSvc
53
if
(!
re
) {
54
ATH_MSG_ERROR
(
"Failed to retrieve the RawEvent pointer from ROBDataProvider"
);
55
return
StatusCode::FAILURE;
56
}
57
58
// Retrieve the HLT result payload
59
IROBDataProviderSvc::VROBFRAG
vrobf;
// vector of ROBFragments to be filled
60
m_robDataProviderSvc
->getROBData(eventContext,
m_robIdsToDecode
, vrobf, name());
61
if
(vrobf.empty()) {
62
ATH_MSG_ERROR
(
"Failed to retrieve HLT ROBFragments from ROBDataProvider"
);
63
return
StatusCode::FAILURE;
64
}
65
66
// Get the format version
67
hltResult->setVersion(
m_decoderTool
->getHltRodMinorVersion(vrobf));
68
69
// Fill the result object from ByteStream event header
70
ATH_CHECK
(
m_decoderTool
->decodeHeader(
re
, *hltResult));
71
72
// Read the HLT result payload
73
ATH_CHECK
(
m_decoderTool
->decodePayload(vrobf, *hltResult));
74
75
// Print the result
76
ATH_MSG_DEBUG
(*hltResult);
77
78
return
StatusCode::SUCCESS;
79
}
re
const std::regex re(r_e)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
HLTResultMTByteStreamDecoderAlg.h
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition
RawEvent.h:37
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
HLTResultMTByteStreamDecoderAlg::m_decoderTool
ToolHandle< HLTResultMTByteStreamDecoderTool > m_decoderTool
Tool performing the decoding work.
Definition
HLTResultMTByteStreamDecoderAlg.h:43
HLTResultMTByteStreamDecoderAlg::finalize
virtual StatusCode finalize() override
Definition
HLTResultMTByteStreamDecoderAlg.cxx:34
HLTResultMTByteStreamDecoderAlg::m_moduleIdsToDecode
Gaudi::Property< std::vector< uint16_t > > m_moduleIdsToDecode
Module IDs to decode.
Definition
HLTResultMTByteStreamDecoderAlg.h:33
HLTResultMTByteStreamDecoderAlg::HLTResultMTByteStreamDecoderAlg
HLTResultMTByteStreamDecoderAlg(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition
HLTResultMTByteStreamDecoderAlg.cxx:10
HLTResultMTByteStreamDecoderAlg::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
ROBDataProvider service handle.
Definition
HLTResultMTByteStreamDecoderAlg.h:46
HLTResultMTByteStreamDecoderAlg::execute
virtual StatusCode execute(const EventContext &eventContext) const override
Definition
HLTResultMTByteStreamDecoderAlg.cxx:43
HLTResultMTByteStreamDecoderAlg::m_robIdsToDecode
std::vector< uint32_t > m_robIdsToDecode
Full ROB IDs constructed from the ModuleIdsToDecode property.
Definition
HLTResultMTByteStreamDecoderAlg.h:50
HLTResultMTByteStreamDecoderAlg::initialize
virtual StatusCode initialize() override
Definition
HLTResultMTByteStreamDecoderAlg.cxx:17
HLTResultMTByteStreamDecoderAlg::m_hltResultWHKey
SG::WriteHandleKey< HLT::HLTResultMT > m_hltResultWHKey
StoreGate key for the output HLTResultMT.
Definition
HLTResultMTByteStreamDecoderAlg.h:38
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition
IROBDataProviderSvc.h:27
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0