Skip to content

Commit 9e7d3c0

Browse files
committed
ITS: drof class mods
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 3ba68ef commit 9e7d3c0

2 files changed

Lines changed: 17 additions & 31 deletions

File tree

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

Lines changed: 10 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
@@ -36,15 +32,14 @@ class Cell final
3632
GPUhd() int getSecondTrackletIndex() const { return mSecondTrackletIndex; };
3733
GPUhd() int getLevel() const { return mLevel; };
3834
GPUhd() void setLevel(const int level) { mLevel = level; };
39-
GPUhd() int* getLevelPtr() { return &mLevel; }
4035

4136
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};
37+
int mFirstClusterIndex{constants::UnusedIndex};
38+
int mSecondClusterIndex{constants::UnusedIndex};
39+
int mThirdClusterIndex{constants::UnusedIndex};
40+
int mFirstTrackletIndex{constants::UnusedIndex};
41+
int mSecondTrackletIndex{constants::UnusedIndex};
42+
int mLevel{constants::UnusedIndex};
4843
};
4944

5045
class CellSeed final : public o2::track::TrackParCovF
@@ -77,19 +72,18 @@ class CellSeed final : public o2::track::TrackParCovF
7772
GPUhd() void setChi2(float chi2) { mChi2 = chi2; };
7873
GPUhd() int getLevel() const { return mLevel; };
7974
GPUhd() void setLevel(int level) { mLevel = level; };
80-
GPUhd() int* getLevelPtr() { return &mLevel; }
8175
GPUhd() int* getClusters() { return mClusters; }
8276
GPUhd() int getCluster(int i) const { return mClusters[i]; }
8377
GPUhd() void printCell() const
8478
{
85-
printf("trkl: %d, %d\t lvl: %d\t chi2: %f\n", mTracklets[0], mTracklets[1], mLevel, mChi2);
79+
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]);
8680
}
8781

8882
private:
8983
float mChi2 = 0.f;
9084
int mLevel = 0;
91-
int mTracklets[2] = {-1, -1};
92-
int mClusters[7] = {-1, -1, -1, -1, -1, -1, -1};
85+
int mTracklets[2] = {constants::UnusedIndex, constants::UnusedIndex};
86+
int mClusters[7] = {constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex, constants::UnusedIndex};
9387
};
9488

9589
} // 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)