12#ifndef FRAMEWORK_GROUP_SLICER_H_
13#define FRAMEWORK_GROUP_SLICER_H_
19#include <arrow/util/config.h>
20#include <arrow/util/key_value_metadata.h>
28 auto matcher = o2::soa::getMatcherFromTypeForKey<std::decay_t<T>>(columnName);
38template <
typename G,
typename...
A>
43 mBegin{GroupSlicerIterator(gt, at, slices, newOrigin)}
65 template <soa::is_table T>
69 if (table.size() == 0) {
75 template <soa::is_smallgroups T>
76 requires(o2::soa::relatedByIndex<std::decay_t<G>, std::decay_t<T>>())
79 if (table.tableSize() == 0) {
90 template <soa::is_filtered_table T>
115 [
this]<
size_t... Is>(std::tuple<
A...>& at, std::index_sequence<Is...>) {
118 }(*
mAt, std::make_index_sequence<
sizeof...(A)>());
165 return std::make_tuple(prepareArgument<A>()...);
168 template <soa::is_smallgroups A1>
173 auto& originalTable = std::get<A1>(*
mAt);
185 if (!selection.empty()) {
186 std::copy(selection.begin(), selection.end(), std::back_inserter(
s));
189 if (!selection.empty()) {
190 if constexpr (std::decay_t<A1>::applyFilters) {
193 std::copy(selection.begin(), selection.end(), std::back_inserter(
s));
197 std::decay_t<A1> typedTable{{originalTable.asArrowTableRef()}, std::move(
s)};
198 typedTable.bindInternalIndicesTo(&originalTable);
202 template <soa::is_filtered_table A1>
207 auto& originalTable = std::get<A1>(*
mAt);
208 if (originalTable.size() == 0) {
209 return originalTable;
220 auto count = oc.second;
221 auto groupedElementsTable = originalTable.asArrowTableRef().slice({
offset,
count});
228 std::transform(slicedSelection.begin(), slicedSelection.end(), slicedSelection.begin(),
230 return idx - static_cast<int64_t>(offset);
233 std::decay_t<A1> typedTable{{groupedElementsTable}, std::move(slicedSelection)};
234 typedTable.bindInternalIndicesTo(&originalTable);
238 template <soa::is_table A1>
243 auto& originalTable = std::get<A1>(*
mAt);
244 if (originalTable.size() == 0) {
245 return originalTable;
256 groupedElementsTable.bindInternalIndicesTo(&originalTable);
257 return groupedElementsTable;
260 template <soa::is_table A1>
264 return std::get<A1>(*
mAt);
273 std::array<std::span<int64_t const>
const*,
sizeof...(A)>
selections;
274 std::array<std::span<int64_t const>::iterator,
sizeof...(A)>
starts;
#define O2_BUILTIN_LIKELY(x)
#define O2_BUILTIN_UNLIKELY(x)
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
GLsizei const GLchar *const * string
constexpr framework::ConcreteDataMatcher matcher()
Defining ITS Vertex explicitly as messageable.
ConfigParamSpec replaceOrigin(ConfigParamSpec &source, std::string const &originStr)
std::string cutString(std::string &&str)
std::vector< int64_t > SelectionVector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
SliceInfoUnsortedPtr getCacheUnsortedFor(Entry const &bindingKey) const
SliceInfoPtr getCacheFor(Entry const &bindingKey) const
header::DataOrigin origin
std::span< int64_t const > groupSelection
auto splittingFunction(T &&table)
std::array< SliceInfoUnsortedPtr, sizeof...(A)> sliceInfosUnsorted
auto extractingFunction(T &&table)
GroupSlicerIterator operator+(int64_t inc) const
auto splittingFunction(T &&table)
std::array< std::span< int64_t const >::iterator, sizeof...(A)> starts
std::array< SliceInfoPtr, sizeof...(A)> sliceInfos
GroupSlicerIterator & operator=(GroupSlicerIterator const &)=default
GroupSlicerIterator(GroupSlicerIterator &&)=default
bool operator!=(GroupSlicerSentinel const &other)
GroupSlicerIterator & operator=(GroupSlicerIterator &&)=default
GroupSlicerIterator operator+=(int64_t inc)
GroupSlicerIterator(GroupSlicerIterator const &)=default
GroupSlicerIterator & operator*()
std::array< std::span< int64_t const > const *, sizeof...(A)> selections
GroupSlicerIterator(G >, std::tuple< A... > &at, ArrowTableSlicingCache &slices, header::DataOrigin newOrigin=header::DataOrigin{"AOD"})
GroupSlicerIterator & operator++()
GroupSlicerIterator()=default
std::string mIndexColumnName
auto splittingFunction(T &&)
bool operator==(GroupSlicerSentinel const &other)
auto extractingFunction(T &&)
grouping_t::iterator mGroupingElement
ArrowTableSlicingCache * mSlices
header::DataOrigin replacementOrigin
GroupSlicerSentinel end()
GroupSlicer(G >, std::tuple< A... > &at, ArrowTableSlicingCache &slices, header::DataOrigin newOrigin=header::DataOrigin{"AOD"})
GroupSlicerIterator mBegin
std::decay_t< G > grouping_t
GroupSlicerIterator & begin()
VectorOfTObjectPtrs other