ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "HLTSrcIdMap.h"
8#include "eformat/SourceIdentifier.h"
10#include <stdlib.h>
11
13 const std::string& name,
14 const IInterface* parent )
15 : AthAlgTool(type,name,parent)
16{
17 declareInterface<HLT::HLTResultByteStreamTool>( this );
18}
19
20
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
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
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
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}
const std::regex re(r_e)
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition RawEvent.h:39
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
HLTResultByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
std Gaudi tool constructor
Gaudi::Property< std::map< std::string, uint32_t > > m_robIDMap
StatusCode convert(IROBDataProviderSvc &dataProvider, HLTResult *&result, const std::string &objName)
convert ROBData to HLTResult this function should be called from createObj
FullEventAssembler< HLTSrcIdMap > m_fea
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
Definition HLTResult.h:49
Interface class for managing ROB for both online and offline.
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
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.
std::vector< const ROBF * > VROBFRAG
const DataType * PointerType
Definition RawEvent.h:25
MsgStream & msg
Definition testRead.cxx:32