16#ifndef ALICEO2_DATAFORMATS_LABELCONTAINER_H_
17#define ALICEO2_DATAFORMATS_LABELCONTAINER_H_
34template <
typename LabelType,
bool isContiguousStorage = true>
55 using HeaderElement =
typename std::conditional<isContiguousStorage, HeaderElementContinuous, HeaderElementLinked>::type;
56 using StoredLabelType =
typename std::conditional<isContiguousStorage, LabelType, std::pair<LabelType, int>>
::type;
77 return h.index +
h.size;
89 using iterator_category = std::input_iterator_tag;
90 using value_type = LabelType;
91 using difference_type = std::ptrdiff_t;
92 using pointer = LabelType*;
93 using reference = LabelType&;
94 std::vector<StoredLabelType>& mLabelsRef;
101 mLabelsRef = it.mLabelsRef;
124 std::vector<HeaderElement>& mHeaderArrayRef;
125 std::vector<StoredLabelType>& mLabelArrayRef;
128 constexpr LabelView(
int i, std::vector<HeaderElement>&
v1, std::vector<StoredLabelType>&
v2) : dataindex(
i), mHeaderArrayRef(
v1), mLabelArrayRef(
v2) {}
133 return dataindex < mHeaderArrayRef.size() ?
Iterator(mLabelArrayRef, mHeaderArrayRef[dataindex].
index) :
Iterator(mLabelArrayRef, 0);
138 return dataindex < mHeaderArrayRef.size() ?
Iterator(mLabelArrayRef,
lastIndex(mHeaderArrayRef[dataindex])) :
Iterator(mLabelArrayRef, 0);
142 size_t size()
const {
return dataindex < mHeaderArrayRef.size() ? mHeaderArrayRef[dataindex].size : 0; }
145 static void addLabelImpl(
int dataindex, std::vector<HeaderElementContinuous>& headerv, std::vector<LabelType>& labelv, LabelType
const&
label)
147 if (dataindex < headerv.size()) {
150 if (dataindex != (headerv.size() - 1)) {
151 throw std::runtime_error(
"LabelContainer: unsupported code path");
154 assert(dataindex == headerv.size());
156 headerv.emplace_back(0, labelv.size());
158 auto&
header = headerv[dataindex];
160 labelv.emplace_back(
label);
163 static void addLabelImpl(
int dataindex, std::vector<HeaderElementLinked>& headerv, std::vector<std::pair<LabelType, int>>& labelv, LabelType
const&
label)
165 labelv.emplace_back(std::make_pair(
label, -1));
167 if (dataindex < headerv.size()) {
168 auto&
header = headerv[dataindex];
171 const auto lastindex = labelv.size() - 1;
173 labelv[
header.lastindex].second = lastindex;
175 header.lastindex = lastindex;
178 assert(dataindex == headerv.size());
180 const auto lastpos = labelv.size() - 1;
181 headerv.emplace_back(lastpos, lastpos, 1);
std::vector< std::string > header
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 e
std::vector< o2::MCCompLabel > labels
Class for time synchronization of RawReader instances.
GLint GLint GLsizei GLint GLenum GLenum type
GLuint GLsizei const GLchar * label
GLfloat GLfloat GLfloat v2