16#ifndef ALICEO2_ITS_TRACKITS_H
17#define ALICEO2_ITS_TRACKITS_H
44 kSharedClusters = 1 << 28
51 using o2::track::TrackParCov::TrackParCov;
58 :
o2::track::
TrackParCov{parCov}, mParamOut{outer}, mChi2{chi2} {}
68 GPUhdi()
float getChi2()
const {
return mChi2; }
69 GPUhdi()
int getNClusters()
const {
return mClusRef.getEntries(); }
70 GPUhdi()
int getNumberOfClusters()
const {
return getNClusters(); }
75 mClusRef.setFirstEntry(mClusRef.getFirstEntry() + bias);
79 mClusRef.setFirstEntry(offs);
83 mClusRef.setEntries(
n);
91 mClusRef.set(firstEntry,
n);
101 GPUhdi() auto& getTimeStamp() {
return mTime; }
102 GPUhdi() const auto& getTimeStamp()
const {
return mTime; }
110 GPUhdi()
void setPattern(uint32_t p) { mPattern = p; }
111 GPUhdi() uint32_t getPattern()
const {
return mPattern; }
115 template <
int NLayers>
116 GPUhdi() static constexpr uint32_t getLayerPatternMask()
118 return (NLayers >= 32) ? 0xffffffffu : ((1u << NLayers) - 1u);
120 template <
int NLayers>
123 pattern &= getLayerPatternMask<NLayers>();
124 setUserField(
static_cast<uint16_t
>(
pattern));
129 template <
int NLayers>
130 GPUhdi() uint32_t getExtendedLayerPattern()
const
132 const auto mask = getLayerPatternMask<NLayers>();
139 return getUserField() &
mask;
144 getParamOut().setUserField(0);
146 GPUhdi() uint32_t getLastClusterLayer()
const
148 uint32_t
r{0},
v{mPattern & ((1 << 16) - 1)};
154 GPUhdi() uint32_t getFirstClusterLayer()
const
157 while (!(mPattern & (1 << s))) {
164 void setSharedClusters(
bool toggle =
true) { mClusterSizes = toggle ? (mClusterSizes | kSharedClusters) : (mClusterSizes & ~kSharedClusters); }
175 mClusterSizes &= ~(0xf << (l * 4));
176 mClusterSizes |= (
size << (l * 4));
184 return (mClusterSizes >> (l * 4)) & 0xf;
189 return mClusterSizes;
196 uint32_t mPattern = 0;
197 uint32_t mClusterSizes = 0u;
208 using TrackITS::TrackITS;
211 :
TrackITS(parCov, chi2, outer), mIndex{cls}
217 :
TrackITS(parCov, chi2, outer), mIndex{cls}
226 int ncl = getNumberOfClusters();
227 mIndex[ncl++] = (l << 28) +
i;
231 GPUhdi()
int getClusterIndex(
int lr)
const {
return mIndex[lr]; }
235 return getClusterIndex(getFirstClusterLayer());
242 uint32_t
pattern = getPattern();
257 size_t hash(uint16_t layerMask = 0xFFFF,
bool inward =
true) const noexcept
259 size_t h1 = 0, h2 = 0;
260 int from = (
int)getLastClusterLayer(), to = -1,
step = -1;
262 from = (
int)getFirstClusterLayer();
269 int idx = mIndex[slot++];
270 if (layerMask & (uint16_t(1) <<
layer)) {
271 size_t v = std::hash<int>{}(
idx);
273 h2 +=
v * 0x9e3779b97f4a7c15ULL;
277 return h1 ^ (h2 << 1);
282 std::array<int, MaxClusters> mIndex = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
283 ClassDefNV(TrackITSExt, 3);
Class to refer to the 1st entry and N elements of some group in the continuous container.
o2::track::TrackParCov TrackParCov
HMPID cluster implementation.
void setClusterIndex(int l, int i)
GPUhdDefault() TrackITSExt(const TrackITSExt &t)=default
size_t hash(uint16_t layerMask=0xFFFF, bool inward=true) const noexcept
GPUh() int getFirstLayerClusterIndex() const
GPUhdi() void setExternalClusterIndex(int layer
int bool MaxClusters & getClusterIndexes()
static constexpr int MaxClusters
< heavy version of TrackITS, with clusters embedded
GPUhdi() int getClusterIndex(int lr) const
GPUhdi() void setExtendedLayerPattern(uint32_t pattern)
GPUhdi() auto &getTimeStamp()
bool operator<(const TrackITS &o) const
bool hasHitOnLayer(uint32_t i) const
GPUhdi() const auto &getTimeStamp() const
const ClusRefs & getClusterRefs() const
void setClusterRefs(int firstEntry, int n)
GPUhdi() int getNClusters() const
int getNFakeClusters() const
static constexpr int MaxClusters
GPUhdi() ClusRefs &getClusterRefs()
GPUhdi() uint32_t getLastClusterLayer() const
void getImpactParams(float x, float y, float z, float bz, float ip[2]) const
GPUhdDefault() TrackITS &operator
int getClusterEntry(int i) const
void shiftFirstClusterEntry(int bias)
void setNumberOfClusters(int n)
GPUhdi() uint32_t getPattern() const
int getClusterSize(int l)
GPUhdi() uint32_t getFirstClusterLayer() const
bool isFakeOnLayer(uint32_t i) const
GPUhdi() uint32_t getExtendedLayerPattern() const
void setClusterSize(int l, int size)
GPUhdi() int getNumberOfClusters() const
int getFirstClusterEntry() const
int getClusterSizes() const
GPUhdi() float getChi2() const
void setFirstClusterEntry(int offs)
bool propagate(float alpha, float x, float bz)
bool hasSharedClusters() const
GPUhd() TrackITS(const o2
static constexpr unsigned int ExtendedPatternShift
void setSharedClusters(bool toggle=true)
static constexpr int MaxLayersInTrackPattern
GPUhdDefault() TrackITS()=default
GPUhdi() void clearExtendedLayerPattern()
bool isBetter(const TrackITS &best, float maxChi2) const
bool isExtendedOnLayer(uint32_t i) const
bool update(const Cluster &c, float chi2)
GPUhdi() void setChi2(float chi2)
GPUhdi() static const expr uint32_t getLayerPatternMask()
Cluster class for the ITSMFT.
GLfloat GLfloat GLfloat alpha
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLuint GLint GLint layer
GLdouble GLdouble GLdouble z
const bool const bool const int FollowDirection BestTrial TrackITSInternal< NLayers > & best
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::array< uint16_t, 5 > pattern