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