Project
Loading...
Searching...
No Matches
Cell.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.
15
16#ifndef TRACKINGITSU_INCLUDE_CACELL_H_
17#define TRACKINGITSU_INCLUDE_CACELL_H_
18
20#include "GPUCommonDef.h"
21
22namespace o2::its
23{
24
25class Cell final
26{
27 public:
28 GPUhd() int getFirstClusterIndex() const { return mFirstClusterIndex; };
29 GPUhd() int getSecondClusterIndex() const { return mSecondClusterIndex; };
30 GPUhd() int getThirdClusterIndex() const { return mThirdClusterIndex; };
31 GPUhd() int getFirstTrackletIndex() const { return mFirstTrackletIndex; };
32 GPUhd() int getSecondTrackletIndex() const { return mSecondTrackletIndex; };
33 GPUhd() int getLevel() const { return mLevel; };
34 GPUhd() void setLevel(const int level) { mLevel = level; };
35 GPUhd() int* getLevelPtr() { return &mLevel; }
36
37 private:
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};
44};
45
46template <int nLayers>
48{
49 public:
50 GPUhdDefault() CellSeed() = default;
51 GPUhd() CellSeed(int innerL, int cl0, int cl1, int cl2, int trkl0, int trkl1, o2::track::TrackParCovF& tpc, float chi2) : o2::track::TrackParCovF(tpc), mChi2(chi2), mLevel(1)
52 {
53 mClusters.fill(constants::UnusedIndex);
54 setUserField(innerL);
55 mClusters[innerL + 0] = cl0;
56 mClusters[innerL + 1] = cl1;
57 mClusters[innerL + 2] = cl2;
58 mTracklets[0] = trkl0;
59 mTracklets[1] = trkl1;
60 }
61 GPUhdDefault() CellSeed(const CellSeed&) = default;
62 GPUhdDefault() ~CellSeed() = default;
63 // GPUhdDefault() CellSeed(CellSeed&&) = default; TODO cannot use this yet since TrackPar only has device
64 GPUhdDefault() CellSeed& operator=(const CellSeed&) = default;
65 GPUhdDefault() CellSeed& operator=(CellSeed&&) = default;
66
67 GPUhd() int getFirstClusterIndex() const { return mClusters[getUserField()]; };
68 GPUhd() int getSecondClusterIndex() const { return mClusters[getUserField() + 1]; };
69 GPUhd() int getThirdClusterIndex() const { return mClusters[getUserField() + 2]; };
70 GPUhd() int getFirstTrackletIndex() const { return mTracklets[0]; };
71 GPUhd() void setFirstTrackletIndex(int trkl) { mTracklets[0] = trkl; };
72 GPUhd() int getSecondTrackletIndex() const { return mTracklets[1]; };
73 GPUhd() void setSecondTrackletIndex(int trkl) { mTracklets[1] = trkl; };
74 GPUhd() float getChi2() const { return mChi2; };
75 GPUhd() void setChi2(float chi2) { mChi2 = chi2; };
76 GPUhd() int getLevel() const { return mLevel; };
77 GPUhd() void setLevel(int level) { mLevel = level; };
78 GPUhd() int* getLevelPtr() { return &mLevel; }
79 GPUhd() auto& getClusters() { return mClusters; }
80 GPUhd() int getCluster(int i) const { return mClusters[i]; }
81 GPUhd() void printCell() const
82 {
83 printf("cell: %d, %d\t lvl: %d\t chi2: %f\tcls: [", mTracklets[0], mTracklets[1], mLevel, mChi2);
84 for (int i = 0; i < nLayers; ++i) {
85 printf("%d", mClusters[i]);
86 if (i < nLayers - 1) {
87 printf(" | ");
88 }
89 }
90 printf("]\n");
91 }
92
93 private:
94 float mChi2 = -999.f;
95 int mLevel = constants::UnusedIndex;
96 std::array<int, 2> mTracklets = constants::helpers::initArray<int, 2, constants::UnusedIndex>();
97 std::array<int, nLayers> mClusters = constants::helpers::initArray<int, nLayers, constants::UnusedIndex>();
98};
99
100} // namespace o2::its
101
102#endif /* TRACKINGITSU_INCLUDE_CACELL_H_ */
int32_t i
GPUhd() int getSecondClusterIndex() const
Definition Cell.h:68
int int int cl2
Definition Cell.h:51
GPUhd() CellSeed(int innerL
GPUhdDefault() CellSeed()=default
int int int int trkl0
Definition Cell.h:51
int int cl1
Definition Cell.h:51
GPUhd() auto &getClusters()
Definition Cell.h:79
GPUhd() void setSecondTrackletIndex(int trkl)
Definition Cell.h:73
GPUhd() int *getLevelPtr()
Definition Cell.h:78
GPUhd() int getThirdClusterIndex() const
Definition Cell.h:69
GPUhd() void setLevel(int level)
Definition Cell.h:77
GPUhd() int getFirstTrackletIndex() const
Definition Cell.h:70
GPUhd() int getSecondTrackletIndex() const
Definition Cell.h:72
GPUhd() float getChi2() const
Definition Cell.h:74
int int int int int o2::track::TrackParCovF float chi2
Definition Cell.h:51
GPUhd() int getLevel() const
Definition Cell.h:76
int int int int int trkl1
Definition Cell.h:51
GPUhd() void setChi2(float chi2)
Definition Cell.h:75
GPUhdDefault() CellSeed(const CellSeed &)=default
int int int int int o2::track::TrackParCovF & tpc
Definition Cell.h:51
GPUhd() int getCluster(int i) const
Definition Cell.h:80
GPUhd() void printCell() const
Definition Cell.h:81
GPUhd() void setFirstTrackletIndex(int trkl)
Definition Cell.h:71
GPUhd() int *getLevelPtr()
Definition Cell.h:35
GPUhd() int getFirstClusterIndex() const
Definition Cell.h:28
GPUhd() void setLevel(const int level)
Definition Cell.h:34
GPUhd() int getFirstTrackletIndex() const
Definition Cell.h:31
GPUhd() int getThirdClusterIndex() const
Definition Cell.h:30
GPUhd() int getSecondClusterIndex() const
Definition Cell.h:29
GPUhd() int getLevel() const
Definition Cell.h:33
GPUhd() int getSecondTrackletIndex() const
Definition Cell.h:32
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLint level
Definition glcorearb.h:275
TrackParametrizationWithError< float > TrackParCovF
Definition Track.h:31
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...