15#ifndef ALICEO2_DATAFORMATSTPC_CLUSTERNATIVE_H
16#define ALICEO2_DATAFORMATSTPC_CLUSTERNATIVE_H
17#ifndef GPUCA_GPUCODE_DEVICE
32class ConstMCTruthContainer;
34class ConstMCTruthContainerView;
84 GPUd()
ClusterNative(uint32_t
time, uint8_t
flags, uint16_t
pad, uint8_t
sigmaTime, uint8_t
sigmaPad, uint16_t
qmax, uint16_t
qtotPacked) :
padPacked(
pad),
sigmaTimePacked(
sigmaTime),
sigmaPadPacked(
sigmaPad),
qMax(
qmax),
qTotPacked(
qtotPacked)
89 GPUd() uint16_t getQmax()
const {
return qMax; }
90 GPUd() uint32_t getQtot()
const {
return isSaturated() ? getSaturatedQtot() : (uint32_t)
qTotPacked; }
126 GPUd() float getSigmaTime()
const
128 if (isSaturated()) [[unlikely]] {
155 this->qTotPacked = USHRT_MAX;
161 GPUd() uint32_t getSaturatedQtot()
const
171 GPUd() uint32_t getSaturatedTailLength()
const
178 if (this->getTimePacked() != rhs.getTimePacked()) {
179 return (this->getTimePacked() < rhs.getTimePacked());
180 }
else if (this->padPacked != rhs.padPacked) {
181 return (this->padPacked < rhs.padPacked);
182 }
else if (this->sigmaTimePacked != rhs.sigmaTimePacked) {
183 return (this->sigmaTimePacked < rhs.sigmaTimePacked);
184 }
else if (this->sigmaPadPacked != rhs.sigmaPadPacked) {
185 return (this->sigmaPadPacked < rhs.sigmaPadPacked);
186 }
else if (this->qMax != rhs.qMax) {
187 return (this->qMax < rhs.qMax);
188 }
else if (this->qTotPacked != rhs.qTotPacked) {
189 return (this->getQtot() < rhs.getQtot());
191 return (this->getFlags() < rhs.getFlags());
197 return this->getTimePacked() == rhs.getTimePacked() &&
198 this->padPacked == rhs.padPacked &&
199 this->sigmaTimePacked == rhs.sigmaTimePacked &&
200 this->sigmaPadPacked == rhs.sigmaPadPacked &&
201 this->qMax == rhs.qMax &&
202 this->qTotPacked == rhs.qTotPacked &&
203 this->getFlags() == rhs.getFlags();
207 static constexpr GPUd() uint32_t decodeTailLength(uint8_t code)
231 uint32_t q = (uint32_t)code - 64u;
232 uint32_t exponent = (q >> 5) + 1u;
233 uint32_t mantissa = q & 31u;
235 return (32u + mantissa) << exponent;
239 return 512u + 16u * ((uint32_t)code - 160u);
243 return 1552u + 32u * ((uint32_t)code - 224u);
246 return 2048u + 400u * ((uint32_t)code - 240u);
249 static constexpr GPUd() uint8_t encodeTailLength(uint32_t
value)
252 if (
value >= decodeTailLength(255)) [[unlikely]] {
261 uint8_t mid = lo + ((hi - lo) >> 1);
262 uint32_t decoded = decodeTailLength(mid);
264 if (decoded <
value) {
272 if (lo == 0) [[unlikely]] {
279 uint32_t above_value = decodeTailLength(above_code);
280 uint32_t below_value = decodeTailLength(below_code);
282 uint32_t above_error = above_value -
value;
283 uint32_t below_error =
value - below_value;
286 if (below_error <= above_error) {
GLsizei const GLfloat * value
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
uint8_t itsSharedClusterMap uint8_t
constexpr int MAXGLOBALPADROW
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string getTime(uint64_t ts)
unsigned int nClusters[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
unsigned int nClustersSector[constants::MAXSECTOR]
const o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > * clustersMCTruth
std::pair< ConstMCLabelContainer, ConstMCLabelContainerView > ConstMCLabelContainerViewWithBuffer
unsigned int nClustersTotal
const ClusterNative * clusters[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
unsigned int clusterOffset[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
const ClusterNative * clustersLinear
uint8_t uint16_t uint8_t uint8_t uint16_t uint16_t qtotPacked
GPUd() bool operator<(const ClusterNative &rhs) const
GPUd() static float unpackTime(uint32_t time)
static constexpr int scaleSigmaTimePacked
uint8_t uint16_t uint8_t sigmaTime
uint8_t uint16_t uint8_t uint8_t uint16_t qmax
GPUd() uint32_t getTimePacked() const
GPUd() void setFlags(uint8_t flags)
static constexpr int maxSaturatedQtot
GPUd() uint16_t getQmax() const
GPUd() uint8_t getFlags() const
GPUd() float getSigmaTime() const
static constexpr int scaleTimePacked
GPUdDefault() ClusterNative()=default
GPUd() float getTime() const
static constexpr int scaleSaturatedQtot
GPUd() uint32_t getSaturatedTailLength() const
GPUd() static float unpackPad(uint16_t pad)
GPUd() void setTime(float time)
GPUd() void setTimeFlags(float time
static constexpr int scaleSigmaPadPacked
GPUd() static uint16_t packPad(float pad)
GPUd() uint32_t getQtot() const
uint8_t uint16_t uint8_t uint8_t sigmaPad
GPUd() void setSigmaPad(float sigmaPad)
static constexpr int maxRegularQtot
GPUd() void setSaturatedTailLength(uint32_t tail)
GPUd() uint32_t getSaturatedQtot() const
GPUd() float getPad() const
static constexpr int scalePadPacked
GPUd() void setPad(float pad)
GPUd() void setTimePacked(uint32_t timePacked)
GPUd() void setSaturatedQtot(uint32_t qtot)
GPUd() static uint32_t packTime(float time)
GPUd() void setTimePackedFlags(uint32_t timePacked
GPUd() bool isSaturated() const
GPUd() float getSigmaPad() const
GPUd() void setSigmaTime(float sigmaTime)