ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigSteer
TrigHLTResultByteStream
src
HLTResultByteStreamTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
HLTResultByteStreamTool.h
"
7
#include "
HLTSrcIdMap.h
"
8
#include "eformat/SourceIdentifier.h"
9
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
10
#include <stdlib.h>
11
12
HLT::HLTResultByteStreamTool::HLTResultByteStreamTool
(
const
std::string&
type
,
13
const
std::string& name,
14
const
IInterface* parent )
15
:
AthAlgTool
(
type
,name,parent)
16
{
17
declareInterface<HLT::HLTResultByteStreamTool>(
this
);
18
}
19
20
25
StatusCode
HLT::HLTResultByteStreamTool::convert
(
HLTResult
* result,
RawEventWrite
*
re
,
26
const
std::string & objName)
27
{
28
// find the ROB ID for the given HLTResult name
29
const
auto
itr =
m_robIDMap
.find(objName);
30
if
( itr==
m_robIDMap
.end() ) {
31
ATH_MSG_ERROR
(
"No ROB ID configured for "
<< objName);
32
return
StatusCode::FAILURE;
33
}
34
eformat::helper::SourceIdentifier rob(itr->second);
35
36
// configure the EventAssembler and serialize into bytestream
37
m_fea
.clear();
38
m_fea
.idMap().setDetId(rob.subdetector_id());
39
40
std::vector<uint32_t>* rod =
m_fea
.getRodData( rob.code() );
41
if
(!rod)
return
StatusCode::FAILURE;
42
43
result->serialize( *rod );
44
m_fea
.fill(
re
,
msg
());
45
46
ATH_MSG_DEBUG
(
"Serialized HLT Result "
<< objName <<
" ("
<< rod->size()
47
<<
" words) to location "
<< rob.human());
48
49
return
StatusCode::SUCCESS;
50
}
51
52
57
StatusCode
HLT::HLTResultByteStreamTool::convert
(
IROBDataProviderSvc
& dataProvider,
58
HLT::HLTResult
*& result,
const
std::string & objName)
59
{
60
// find the ROB ID for the given HLTResult name
61
const
auto
itr =
m_robIDMap
.find(objName);
62
if
( itr==
m_robIDMap
.end() ) {
63
ATH_MSG_ERROR
(
"No ROB ID configured for "
<< objName);
64
return
StatusCode::FAILURE;
65
}
66
eformat::helper::SourceIdentifier rob(itr->second);
67
68
// request the ROB and deserialize into HLTResult
69
IROBDataProviderSvc::VROBFRAG
robFrags;
70
dataProvider.
getROBData
(Gaudi::Hive::currentContext(), {rob.code()}, robFrags);
71
72
// unsigned int vector where to store HLT payload
73
std::vector<uint32_t> hltContent;
74
for
(
const
IROBDataProviderSvc::ROBF
* rob : robFrags ) {
75
76
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
rodData =
nullptr
;
77
rob->rod_data(rodData);
78
79
const
uint32_t nData = rob->rod_ndata();
80
hltContent.reserve(nData);
81
for
(
size_t
i = 0; i < nData; i++) hltContent.push_back(rodData[i]);
82
}
83
84
result->deserialize(hltContent);
85
ATH_MSG_DEBUG
(
"Deserialized HLT Result "
<< objName <<
" ("
<< hltContent.size() <<
" words)"
);
86
87
return
StatusCode::SUCCESS;
88
}
re
const std::regex re(r_e)
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
HLTResultByteStreamTool.h
HLTSrcIdMap.h
IROBDataProviderSvc.h
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition
RawEvent.h:39
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
HLT::HLTResultByteStreamTool::HLTResultByteStreamTool
HLTResultByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
std Gaudi tool constructor
Definition
HLTResultByteStreamTool.cxx:12
HLT::HLTResultByteStreamTool::m_robIDMap
Gaudi::Property< std::map< std::string, uint32_t > > m_robIDMap
Definition
HLTResultByteStreamTool.h:65
HLT::HLTResultByteStreamTool::convert
StatusCode convert(IROBDataProviderSvc &dataProvider, HLTResult *&result, const std::string &objName)
convert ROBData to HLTResult this function should be called from createObj
Definition
HLTResultByteStreamTool.cxx:57
HLT::HLTResultByteStreamTool::m_fea
FullEventAssembler< HLTSrcIdMap > m_fea
Definition
HLTResultByteStreamTool.h:72
HLT::HLTResult
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
Definition
HLTResult.h:49
IROBDataProviderSvc
Interface class for managing ROB for both online and offline.
Definition
IROBDataProviderSvc.h:21
IROBDataProviderSvc::ROBF
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
Definition
IROBDataProviderSvc.h:24
IROBDataProviderSvc::getROBData
virtual void getROBData(const EventContext &context, const std::vector< uint32_t > &robIds, VROBFRAG &robFragments, const std::string_view callerName="UNKNOWN")=0
Retrieve ROBFragments for given ROB ids from cache.
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition
IROBDataProviderSvc.h:25
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition
RawEvent.h:25
type
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0