4#ifndef TRIGT1RESULTBYTESTREAM_IL1TRIGGERBYTESTREAMTOOL_H
5#define TRIGT1RESULTBYTESTREAM_IL1TRIGGERBYTESTREAMTOOL_H
11#include "GaudiKernel/IAlgTool.h"
12#include "GaudiKernel/EventContext.h"
13#include "eformat/Status.h"
35 virtual StatusCode
convertFromBS(
const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf,
36 const EventContext& eventContext)
const = 0;
50 virtual StatusCode
convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf,
51 const EventContext& eventContext) = 0;
60 virtual const std::vector<uint32_t>&
robIds()
const = 0;
66 template<
typename RHK,
typename WHK>
68 if (readHandleKeys.empty() and not writeHandleKeys.empty()) {
71 if (writeHandleKeys.empty() and not readHandleKeys.empty()) {
74 if constexpr (std::is_base_of_v<SG::VarHandleKeyArray, RHK>) {
75 msg << MSG::ERROR <<
"Exactly one of the read / write handle key arrays has to be set and the other has to"
76 <<
" be empty, but they have " << readHandleKeys.size() <<
" / " << writeHandleKeys.size() <<
" elements"
78 }
else if constexpr (std::is_base_of_v<SG::VarHandleKey, RHK>) {
79 msg << MSG::ERROR <<
"Exactly one of the read / write handle keys has to be set and the other has to"
80 <<
" be empty, but they are \"" << readHandleKeys.key() <<
"\" / \"" << writeHandleKeys.key() <<
"\""
86 inline void clearCache(
const EventContext& eventContext) {
87 m_cache.get(eventContext)->clear();
90 inline uint32_t*
newRodData(
const EventContext& eventContext,
const size_t size) {
92 cache->
rodData.push_back(std::make_unique<uint32_t[]>(size));
93 return cache->
rodData.back().get();
97 const EventContext& eventContext,
100 const uint32_t*
data,
101 uint32_t detev_type = 0,
102 uint32_t status_position = eformat::STATUS_BACK) {
105 const EventIDBase& eid = eventContext.eventID();
106 cache->
robFragments.push_back(std::make_unique<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment>(
110 eid.bunch_crossing_id(),
129 std::vector<std::unique_ptr<uint32_t[]>>
rodData;
130 std::vector<std::unique_ptr<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment>>
robFragments;
Maintain a set of objects, one per slot.
char data[hepevt_bytes_allocation_ATLAS]
Base class for VarHandleKeyArray for reading from StoreGate.
A property holding a SG store/key/clid from which a VarHandle is made.
Maintain a set of objects, one per slot.
eformat::write::ROBFragment ROBFragment