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"
37 virtual StatusCode
convertFromBS(
const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf,
38 const EventContext& eventContext)
const = 0;
54 virtual StatusCode
convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf,
56 const EventContext& eventContext) = 0;
65 virtual const std::vector<uint32_t>&
robIds()
const = 0;
71 template<
typename RHK,
typename WHK>
73 if (readHandleKeys.empty() and not writeHandleKeys.empty()) {
76 if (writeHandleKeys.empty() and not readHandleKeys.empty()) {
79 if constexpr (std::is_base_of_v<SG::VarHandleKeyArray, RHK>) {
80 msg << MSG::ERROR <<
"Exactly one of the read / write handle key arrays has to be set and the other has to"
81 <<
" be empty, but they have " << readHandleKeys.size() <<
" / " << writeHandleKeys.size() <<
" elements"
83 }
else if constexpr (std::is_base_of_v<SG::VarHandleKey, RHK>) {
84 msg << MSG::ERROR <<
"Exactly one of the read / write handle keys has to be set and the other has to"
85 <<
" be empty, but they are \"" << readHandleKeys.key() <<
"\" / \"" << writeHandleKeys.key() <<
"\""
91 inline void clearCache(
const EventContext& eventContext) {
92 m_cache.get(eventContext)->clear();
95 inline uint32_t*
newRodData(
const EventContext& eventContext,
const size_t size) {
97 cache->rodData.push_back(std::make_unique<uint32_t[]>(
size));
98 return cache->rodData.back().get();
102 const EventContext& eventContext,
105 const uint32_t*
data,
106 uint32_t detev_type = 0,
107 uint32_t status_position = eformat::STATUS_BACK) {
110 const EventIDBase& eid = eventContext.eventID();
111 cache->robFragments.push_back(std::make_unique<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment>(
115 eid.bunch_crossing_id(),
122 return cache->robFragments.back().get();
134 std::vector<std::unique_ptr<uint32_t[]>>
rodData;
135 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.
size_t size() const
Number of registered mappings.
Maintain a set of objects, one per slot.
eformat::write::ROBFragment ROBFragment
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.