Skip to content

Commit cb8ed2b

Browse files
committed
ITS: allow cluster classes to be trivially moveable
1 parent 080e252 commit cb8ed2b

File tree

1 file changed

+25
-47
lines changed
  • Detectors/ITSMFT/ITS/tracking/include/ITStracking

1 file changed

+25
-47
lines changed

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

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@
2323

2424
#include "GPUCommonDef.h"
2525

26-
namespace o2
27-
{
28-
namespace its
26+
namespace o2::its
2927
{
3028

3129
class Cell final
3230
{
3331
public:
34-
GPUhd() Cell();
35-
GPUd() Cell(const int, const int, const int, const int, const int);
32+
GPUhd() Cell() = default;
33+
GPUdi() Cell(const int firstClusterIndex, const int secondClusterIndex, const int thirdClusterIndex,
34+
const int firstTrackletIndex, const int secondTrackletIndex)
35+
: mFirstClusterIndex(firstClusterIndex),
36+
mSecondClusterIndex(secondClusterIndex),
37+
mThirdClusterIndex(thirdClusterIndex),
38+
mFirstTrackletIndex(firstTrackletIndex),
39+
mSecondTrackletIndex(secondTrackletIndex),
40+
mLevel(1) {}
3641

3742
GPUhd() int getFirstClusterIndex() const { return mFirstClusterIndex; };
3843
GPUhd() int getSecondClusterIndex() const { return mSecondClusterIndex; };
@@ -44,43 +49,18 @@ class Cell final
4449
GPUhd() int* getLevelPtr() { return &mLevel; }
4550

4651
private:
47-
const int mFirstClusterIndex;
48-
const int mSecondClusterIndex;
49-
const int mThirdClusterIndex;
50-
const int mFirstTrackletIndex;
51-
const int mSecondTrackletIndex;
52-
int mLevel;
52+
int mFirstClusterIndex{0};
53+
int mSecondClusterIndex{0};
54+
int mThirdClusterIndex{0};
55+
int mFirstTrackletIndex{0};
56+
int mSecondTrackletIndex{0};
57+
int mLevel{0};
5358
};
5459

55-
GPUhdi() Cell::Cell()
56-
: mFirstClusterIndex{0},
57-
mSecondClusterIndex{0},
58-
mThirdClusterIndex{0},
59-
mFirstTrackletIndex{0},
60-
mSecondTrackletIndex{0},
61-
mLevel{0}
62-
{
63-
// Nothing to do
64-
}
65-
66-
GPUdi() Cell::Cell(const int firstClusterIndex, const int secondClusterIndex, const int thirdClusterIndex,
67-
const int firstTrackletIndex, const int secondTrackletIndex)
68-
: mFirstClusterIndex{firstClusterIndex},
69-
mSecondClusterIndex{secondClusterIndex},
70-
mThirdClusterIndex{thirdClusterIndex},
71-
mFirstTrackletIndex{firstTrackletIndex},
72-
mSecondTrackletIndex{secondTrackletIndex},
73-
mLevel{1}
74-
{
75-
// Nothing to do
76-
}
77-
7860
class CellSeed final : public o2::track::TrackParCovF
7961
{
8062
public:
81-
GPUhdDefault() CellSeed() = default;
82-
GPUhdDefault() CellSeed(const CellSeed&) = default;
83-
GPUhdDefault() ~CellSeed() = default;
63+
GPUd() CellSeed() = default;
8464
GPUd() CellSeed(int innerL, int cl0, int cl1, int cl2, int trkl0, int trkl1, o2::track::TrackParCovF& tpc, float chi2) : o2::track::TrackParCovF{tpc}, mLevel{1}, mChi2{chi2}
8565
{
8666
setUserField(innerL);
@@ -104,20 +84,18 @@ class CellSeed final : public o2::track::TrackParCovF
10484
GPUhd() int* getLevelPtr() { return &mLevel; }
10585
GPUhd() int* getClusters() { return mClusters; }
10686
GPUhd() int getCluster(int i) const { return mClusters[i]; }
107-
GPUhdi() void printCell() const;
87+
GPUhdi() void printCell() const
88+
{
89+
printf("trkl: %d, %d\t lvl: %d\t chi2: %f\n", mTracklets[0], mTracklets[1], mLevel, mChi2);
90+
}
10891

10992
private:
110-
int mClusters[7] = {-1, -1, -1, -1, -1, -1, -1};
111-
int mTracklets[2] = {-1, -1};
112-
int mLevel = 0;
11393
float mChi2 = 0.f;
94+
int mLevel = 0;
95+
int mTracklets[2] = {-1, -1};
96+
int mClusters[7] = {-1, -1, -1, -1, -1, -1, -1};
11497
};
11598

116-
GPUhdi() void CellSeed::printCell() const
117-
{
118-
printf("trkl: %d, %d\t lvl: %d\t chi2: %f\n", mTracklets[0], mTracklets[1], mLevel, mChi2);
119-
}
99+
} // namespace o2::its
120100

121-
} // namespace its
122-
} // namespace o2
123101
#endif /* TRACKINGITSU_INCLUDE_CACELL_H_ */

0 commit comments

Comments
 (0)