Skip to content

Commit e76eb64

Browse files
committed
ITS: drof class mods
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 1529e71 commit e76eb64

File tree

3 files changed

+23
-35
lines changed

3 files changed

+23
-35
lines changed

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Cell.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515

1616
#ifndef TRACKINGITSU_INCLUDE_CACELL_H_
1717
#define TRACKINGITSU_INCLUDE_CACELL_H_
18-
#ifndef GPUCA_GPUCODE_DEVICE
19-
#include <array>
20-
#include <vector>
21-
#include <iostream>
22-
#endif
2318

19+
#include "ITStracking/Constants.h"
2420
#include "GPUCommonDef.h"
2521

2622
namespace o2::its
@@ -39,12 +35,12 @@ class Cell final
3935
GPUhd() int* getLevelPtr() { return &mLevel; }
4036

4137
private:
42-
int mFirstClusterIndex{0};
43-
int mSecondClusterIndex{0};
44-
int mThirdClusterIndex{0};
45-
int mFirstTrackletIndex{0};
46-
int mSecondTrackletIndex{0};
47-
int mLevel{0};
38+
int mFirstClusterIndex{constants::UnusedIndex};
39+
int mSecondClusterIndex{constants::UnusedIndex};
40+
int mThirdClusterIndex{constants::UnusedIndex};
41+
int mFirstTrackletIndex{constants::UnusedIndex};
42+
int mSecondTrackletIndex{constants::UnusedIndex};
43+
int mLevel{constants::UnusedIndex};
4844
};
4945

5046
class CellSeed final : public o2::track::TrackParCovF
@@ -82,14 +78,14 @@ class CellSeed final : public o2::track::TrackParCovF
8278
GPUhd() int getCluster(int i) const { return mClusters[i]; }
8379
GPUhd() void printCell() const
8480
{
85-
printf("trkl: %d, %d\t lvl: %d\t chi2: %f\n", mTracklets[0], mTracklets[1], mLevel, mChi2);
81+
printf("trkl: %d, %d\t lvl: %d\t chi2: %f\tcls: [%d | %d | %d | %d | %d | %d | %d]\n", mTracklets[0], mTracklets[1], mLevel, mChi2, mClusters[0], mClusters[1], mClusters[2], mClusters[3], mClusters[4], mClusters[5], mClusters[6]);
8682
}
8783

8884
private:
89-
float mChi2 = 0.f;
90-
int mLevel = 0;
91-
int mTracklets[2] = {-1, -1};
92-
int mClusters[7] = {-1, -1, -1, -1, -1, -1, -1};
85+
float mChi2 = -999.f;
86+
int mLevel = constants::UnusedIndex;
87+
int mTracklets[2] = {constants::UnusedIndex, constants::UnusedIndex};
88+
int mClusters[7] = {constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex};
9389
};
9490

9591
} // namespace o2::its

Detectors/ITSMFT/ITS/tracking/include/ITStracking/ClusterLines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct Line final {
4242
bool operator!=(const Line&) const;
4343
short getMinROF() const { return rof[0] < rof[1] ? rof[0] : rof[1]; }
4444

45-
float originPoint[3] = {0};
46-
float cosinesDirector[3] = {0};
45+
float originPoint[3] = {0, 0, 0};
46+
float cosinesDirector[3] = {0, 0, 0};
4747
// float weightMatrix[6] = {1., 0., 0., 1., 0., 1.};
4848
// weightMatrix is a symmetric matrix internally stored as
4949
// 0 --> row = 0, col = 0
@@ -52,7 +52,7 @@ struct Line final {
5252
// 3 --> 1,1
5353
// 4 --> 1,2
5454
// 5 --> 2,2
55-
short rof[2] = {-1, -1};
55+
short rof[2] = {constants::UnusedIndex, constants::UnusedIndex};
5656

5757
ClassDefNV(Line, 1);
5858
};
@@ -207,7 +207,7 @@ class ClusterLines final
207207
std::array<float, 6> mRMS2 = {0.f}; // symmetric matrix: diagonal is RMS2
208208
float mAvgDistance2 = 0.f; // substitute for chi2
209209
int mROFWeight = 0; // rof weight for voting
210-
short mROF = -1; // rof
210+
short mROF = constants::UnusedIndex; // rof
211211
};
212212

213213
} // namespace o2::its

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracklet.h

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#ifndef TRACKINGITS_INCLUDE_TRACKLET_H_
1717
#define TRACKINGITS_INCLUDE_TRACKLET_H_
1818

19+
#include "ITStracking/Constants.h"
1920
#include "ITStracking/Cluster.h"
2021
#include "GPUCommonRtypes.h"
2122
#include "GPUCommonMath.h"
@@ -41,9 +42,10 @@ struct Tracklet final {
4142
{
4243
return firstClusterIndex < 0 || secondClusterIndex < 0;
4344
}
45+
GPUhdi() auto getMinRof() const noexcept { return o2::gpu::CAMath::Min(rof[0], rof[1]); }
46+
GPUhdi() auto getMaxRof() const noexcept { return o2::gpu::CAMath::Max(rof[0], rof[1]); }
4447
GPUhdi() auto getDeltaRof() const { return rof[1] - rof[0]; }
45-
GPUhdi() void dump() const;
46-
GPUhdi() void dump(const int, const int) const;
48+
GPUhdi() auto getSpanRof(const Tracklet& o) const noexcept { return o2::gpu::CAMath::Max(getMaxRof(), o.getMaxRof()) - o2::gpu::CAMath::Min(getMinRof(), o.getMinRof()); }
4749
GPUhdi() unsigned char operator<(const Tracklet&) const;
4850
#if !defined(GPUCA_NO_FMT) && !defined(GPUCA_GPUCODE_DEVICE)
4951
std::string asString() const
@@ -53,11 +55,11 @@ struct Tracklet final {
5355
void print() const { LOG(info) << asString(); }
5456
#endif
5557

56-
int firstClusterIndex{-1};
57-
int secondClusterIndex{-1};
58+
int firstClusterIndex{constants::UnusedIndex};
59+
int secondClusterIndex{constants::UnusedIndex};
5860
float tanLambda{-999};
5961
float phi{-999};
60-
short rof[2] = {-1, -1};
62+
short rof[2] = {constants::UnusedIndex, constants::UnusedIndex};
6163

6264
ClassDefNV(Tracklet, 1);
6365
};
@@ -93,16 +95,6 @@ GPUhdi() unsigned char Tracklet::operator<(const Tracklet& t) const
9395
return true;
9496
}
9597

96-
GPUhdi() void Tracklet::dump(const int offsetFirst, const int offsetSecond) const
97-
{
98-
printf("fClIdx: %d sClIdx: %d rof1: %hu rof2: %hu\n", firstClusterIndex + offsetFirst, secondClusterIndex + offsetSecond, rof[0], rof[1]);
99-
}
100-
101-
GPUhdi() void Tracklet::dump() const
102-
{
103-
printf("fClIdx: %d sClIdx: %d rof1: %hu rof2: %hu\n", firstClusterIndex, secondClusterIndex, rof[0], rof[1]);
104-
}
105-
10698
} // namespace o2::its
10799

108100
#endif /* TRACKINGITS_INCLUDE_TRACKLET_H_ */

0 commit comments

Comments
 (0)