Project
Loading...
Searching...
No Matches
GPUTPCGMMergedTrack.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUTPCGMMERGEDTRACK_H
16#define GPUTPCGMMERGEDTRACK_H
17
18#include "GPUTPCGMTrackParam.h"
20
21namespace o2::gpu
22{
29{
30 public:
31 GPUd() uint32_t NClusters() const { return mNClusters; }
32 GPUd() uint32_t NClustersFitted() const { return mNClustersFitted; }
33 GPUd() uint32_t FirstClusterRef() const { return mFirstClusterRef; }
34 GPUd() const GPUTPCGMTrackParam& GetParam() const { return mParam; }
35 GPUd() float GetAlpha() const { return mAlpha; }
37 {
38 return mParam;
39 }
40 GPUd() float& Alpha()
41 {
42 return mAlpha;
43 }
44 GPUd() bool OK() const { return mFlags & 0x01; }
45 GPUd() bool Looper() const { return mFlags & 0x02; } // TODO: Get rid of the looper flag, or rename it if still needed.
46 GPUd() bool CSide() const { return mFlags & 0x04; }
47 GPUd() bool CCE() const { return mFlags & 0x08; }
48 GPUd() bool MergedLooperUnconnected() const { return mFlags & 0x10; }
49 GPUd() bool MergedLooperConnected() const { return mFlags & 0x20; }
50 GPUd() bool MergedLooper() const { return mFlags & 0x30; }
51 GPUd() int32_t PrevSegment() const { return mPrevSegment; }
52 template <class T>
53 GPUd() static T* GetFirstSegment_helper(T* me, T* base, bool workaround)
54 {
55 if (me->mPrevSegment < 0) {
56 return me;
57 }
58 T* cur = &base[me->mPrevSegment];
59 while (cur->mPrevSegment >= 0) {
60 T* next = &base[cur->mPrevSegment];
61 if (workaround && next == me) {
62 return cur;
63 }
64 cur = next;
65 }
66 return cur;
67 }
68 GPUd() GPUTPCGMMergedTrack* GetFirstSegment(GPUTPCGMMergedTrack* base, bool workaround) { return GetFirstSegment_helper<GPUTPCGMMergedTrack>(this, base, workaround); }
69 GPUd() const GPUTPCGMMergedTrack* GetFirstSegment(const GPUTPCGMMergedTrack* base, bool workaround) const { return GetFirstSegment_helper<const GPUTPCGMMergedTrack>(this, base, workaround); }
70 GPUd() uint8_t Leg() const { return mLeg; }
71 GPUd() uint8_t Flags() const { return mFlags; }
72
73 GPUd() void SetNClusters(int32_t v) { mNClusters = v; }
74 GPUd() void SetNClustersFitted(int32_t v) { mNClustersFitted = v; }
75 GPUd() void SetFirstClusterRef(int32_t v) { mFirstClusterRef = v; }
76 GPUd() void SetParam(const GPUTPCGMTrackParam& v) { mParam = v; }
77 GPUd() void SetAlpha(float v) { mAlpha = v; }
78 GPUd() void SetPrevSegment(int32_t v) { mPrevSegment = v; }
79 GPUd() void SetLeg(uint8_t v) { mLeg = v; }
80 GPUd() void SetOK(bool v)
81 {
82 if (v) {
83 mFlags |= 0x01;
84 } else {
85 mFlags &= 0xFE;
86 }
87 }
88 GPUd() void SetLooper(bool v)
89 {
90 if (v) {
91 mFlags |= 0x02;
92 } else {
93 mFlags &= 0xFD;
94 }
95 }
96 GPUd() void SetCSide(bool v)
97 {
98 if (v) {
99 mFlags |= 0x04;
100 } else {
101 mFlags &= 0xFB;
102 }
103 }
104 GPUd() void SetCCE(bool v)
105 {
106 if (v) {
107 mFlags |= 0x08;
108 } else {
109 mFlags &= 0xF7;
110 }
111 }
112 GPUd() void SetMergedLooperUnconnected(bool v)
113 {
114 if (v) {
115 mFlags |= 0x10;
116 } else {
117 mFlags &= 0xEF;
118 }
119 }
120 GPUd() void SetMergedLooperConnected(bool v)
121 {
122 if (v) {
123 mFlags |= 0x20;
124 } else {
125 mFlags &= 0xDF;
126 }
127 }
128 GPUd() void SetFlags(uint8_t v) { mFlags = v; }
129
130 GPUd() const gputpcgmmergertypes::GPUTPCOuterParam& OuterParam() const { return mOuterParam; }
131 GPUd() gputpcgmmergertypes::GPUTPCOuterParam& OuterParam() { return mOuterParam; }
132
133 private:
134 GPUTPCGMTrackParam mParam; //* fitted track parameters
135 gputpcgmmergertypes::GPUTPCOuterParam mOuterParam; //* outer param
136
137 float mAlpha; //* alpha angle
138 uint32_t mFirstClusterRef; //* index of the first track cluster in corresponding cluster arrays
139 int32_t mPrevSegment; //* next segment in case of looping track
140 uint16_t mNClusters; //* number of track clusters
141 uint16_t mNClustersFitted; //* number of clusters used in fit
142 uint8_t mFlags;
143 uint8_t mLeg;
144
145#if !defined(GPUCA_STANDALONE)
146 ClassDefNV(GPUTPCGMMergedTrack, 0);
147#endif
148};
149} // namespace o2::gpu
150
151#endif
GPUd() void SetNClustersFitted(int32_t v)
GPUd() float GetAlpha() const
GPUd() bool MergedLooperUnconnected() const
GPUd() void SetFlags(uint8_t v)
GPUd() void SetParam(const GPUTPCGMTrackParam &v)
GPUd() uint32_t NClustersFitted() const
GPUd() const GPUTPCGMTrackParam &GetParam() const
GPUd() void SetNClusters(int32_t v)
GPUd() uint8_t Flags() const
GPUd() int32_t PrevSegment() const
GPUd() void SetLeg(uint8_t v)
GPUd() void SetCSide(bool v)
GPUd() GPUTPCGMMergedTrack *GetFirstSegment(GPUTPCGMMergedTrack *base
GPUd() void SetMergedLooperUnconnected(bool v)
GPUd() void SetMergedLooperConnected(bool v)
GPUd() void SetAlpha(float v)
GPUd() uint32_t NClusters() const
GPUd() void SetPrevSegment(int32_t v)
GPUd() uint32_t FirstClusterRef() const
GPUd() bool MergedLooper() const
GPUd() GPUTPCGMTrackParam &Param()
GPUd() void SetFirstClusterRef(int32_t v)
GPUd() void SetLooper(bool v)
GPUd() bool MergedLooperConnected() const
GPUd() const gputpcgmmergertypes
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)