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
qtot) :
padPacked(
pad),
sigmaTimePacked(
sigmaTime),
sigmaPadPacked(
sigmaPad),
qMax(
qmax),
qTot(
qtot)
89 GPUd() uint16_t getQmax()
const {
return qMax; }
90 GPUd() uint16_t getQtot()
const
92 if (isSaturated()) [[unlikely]] {
93 auto sQtot = getSaturatedQtot();
94 return sQtot < USHRT_MAX ? sQtot : USHRT_MAX;
133 GPUd() float getSigmaTime()
const
135 if (isSaturated()) [[unlikely]] {
162 this->qTot = USHRT_MAX;
168 GPUd() uint32_t getSaturatedQtot()
const
178 GPUd() uint32_t getSaturatedTailLength()
const
185 if (this->getTimePacked() != rhs.getTimePacked()) {
186 return (this->getTimePacked() < rhs.getTimePacked());
187 }
else if (this->padPacked != rhs.padPacked) {
188 return (this->padPacked < rhs.padPacked);
189 }
else if (this->sigmaTimePacked != rhs.sigmaTimePacked) {
190 return (this->sigmaTimePacked < rhs.sigmaTimePacked);
191 }
else if (this->sigmaPadPacked != rhs.sigmaPadPacked) {
192 return (this->sigmaPadPacked < rhs.sigmaPadPacked);
193 }
else if (this->qMax != rhs.qMax) {
194 return (this->qMax < rhs.qMax);
195 }
else if (this->qTot != rhs.qTot) {
196 return (this->qTot < rhs.qTot);
198 return (this->getFlags() < rhs.getFlags());
204 return this->getTimePacked() == rhs.getTimePacked() &&
205 this->padPacked == rhs.padPacked &&
206 this->sigmaTimePacked == rhs.sigmaTimePacked &&
207 this->sigmaPadPacked == rhs.sigmaPadPacked &&
208 this->qMax == rhs.qMax &&
209 this->qTot == rhs.qTot &&
210 this->getFlags() == rhs.getFlags();
214 static constexpr GPUd() uint32_t decodeTailLength(uint8_t code)
238 uint32_t q = (uint32_t)code - 64u;
239 uint32_t exponent = (q >> 5) + 1u;
240 uint32_t mantissa = q & 31u;
242 return (32u + mantissa) << exponent;
246 return 512u + 16u * ((uint32_t)code - 160u);
250 return 1552u + 32u * ((uint32_t)code - 224u);
253 return 2048u + 400u * ((uint32_t)code - 240u);
256 static constexpr GPUd() uint8_t encodeTailLength(uint32_t
value)
259 if (
value >= decodeTailLength(255)) [[unlikely]] {
268 uint8_t mid = lo + ((hi - lo) >> 1);
269 uint32_t decoded = decodeTailLength(mid);
271 if (decoded <
value) {
279 if (lo == 0) [[unlikely]] {
286 uint32_t above_value = decodeTailLength(above_code);
287 uint32_t below_value = decodeTailLength(below_code);
289 uint32_t above_error = above_value -
value;
290 uint32_t below_error =
value - below_value;
293 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
GPUd() bool operator<(const ClusterNative &rhs) const
GPUd() static float unpackTime(uint32_t time)
static constexpr int scaleSigmaTimePacked
uint8_t uint16_t uint8_t uint8_t uint16_t uint16_t qtot
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)
uint8_t uint16_t uint8_t uint8_t sigmaPad
GPUd() uint16_t getQtot() const
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)