16#ifndef ALICEO2_DATAFORMATSTPC_COMPRESSEDCLUSTERSHELPERS_H
17#define ALICEO2_DATAFORMATSTPC_COMPRESSEDCLUSTERSHELPERS_H
38 template <
typename Op,
typename BufferType>
42 size +=
op(
ptr,
c.nAttachedClusters,
c.qTotA,
c.qMaxA,
c.flagsA,
c.sigmaPadA,
c.sigmaTimeA);
43 size +=
op(
ptr,
c.nUnattachedClusters,
c.qTotU,
c.qMaxU,
c.flagsU,
c.padDiffU,
c.timeDiffU,
c.sigmaPadU,
c.sigmaTimeU);
44 size +=
op(
ptr,
c.nAttachedClustersReduced,
c.rowDiffA,
c.sliceLegDiffA,
c.padResA,
c.timeResA);
45 size +=
op(
ptr,
c.nTracks,
c.qPtA,
c.rowA,
c.sliceA,
c.timeA,
c.padA,
c.nTrackClusters);
52 template <
typename ContainerType>
55 static_assert(
sizeof(
typename ContainerType::value_type) == 1);
56 char* dummyptr =
nullptr;
57 auto calc_size = [](
auto&... args) {
return flatten::calc_size(args...); };
58 auto copy_to = [](
auto&... args) {
return flatten::copy_to(args...); };
60 container.resize(
size);
61 auto wrtptr = container.data();
63 assert(copySize ==
size);
68 template <
typename ContainerType>
71 static_assert(
sizeof(
typename ContainerType::value_type) == 1);
72 char* dummyptr =
nullptr;
73 auto calc_size = [](
auto&... args) {
return flatten::calc_size(args...); };
74 auto set_from = [](
auto&... args) {
return flatten::set_from(args...); };
76 if (container.size() !=
size) {
79 throw std::runtime_error(
"mismatch between raw buffer size and counters, schema evolution is not yet supported");
81 auto readptr = container.data();
83 assert(checkSize ==
size);
Container to store compressed TPC cluster data.
Utilities to copy complex objects to flat buffer and restore.
Global TPC definitions and constants.
static size_t apply(Op op, BufferType &ptr, CompressedClustersROOT &c)
static size_t flattenTo(ContainerType &container, CompressedClustersROOT &clusters)
static size_t restoreFrom(ContainerType &container, CompressedClustersROOT &clusters)
Restore the array pointers from the data in the container.
std::vector< Cluster > clusters