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
22#include "GPUCommonDef.h"
23
24namespace o2::its
25{
26
27template <int NClusters>
29{
30 public:
31 GPUhd() int getInnerLayer() const { return getUserField(); }
32 GPUhd() int getFirstTrackletIndex() const { return mTracklets[0]; };
33 GPUhd() void setFirstTrackletIndex(int trkl) { mTracklets[0] = trkl; };
34 GPUhd() int getSecondTrackletIndex() const { return mTracklets[1]; };
35 GPUhd() void setSecondTrackletIndex(int trkl) { mTracklets[1] = trkl; };
36 GPUhd() float getChi2() const { return mChi2; };
37 GPUhd() void setChi2(float chi2) { mChi2 = chi2; };
38 GPUhd() int getLevel() const { return mLevel; };
39 GPUhd() void setLevel(int level) { mLevel = level; };
40 GPUhd() int* getLevelPtr() { return &mLevel; }
41 GPUhd() auto& getTimeStamp() noexcept { return mTime; }
42 GPUhd() const auto& getTimeStamp() const noexcept { return mTime; }
43
44 protected:
45 GPUhdDefault() SeedBase() = default;
46 GPUhdDefault() SeedBase(const SeedBase&) = default;
47 GPUhdDefault() ~SeedBase() = default;
49 GPUhdDefault() SeedBase& operator=(const SeedBase&) = default;
50 GPUhdDefault() SeedBase& operator=(SeedBase&&) = default;
51 GPUhd() SeedBase(const o2::track::TrackParCovF& tpc, float chi2, int level, const TimeEstBC& time)
52 : o2::track::TrackParCovF(tpc), mChi2(chi2), mLevel(level), mTime(time)
53 {
54 }
55 GPUhd() auto& clustersRaw() { return mClusters; }
56 GPUhd() const auto& clustersRaw() const { return mClusters; }
57
58 private:
59 float mChi2 = -999.f;
60 int mLevel = constants::UnusedIndex;
61 std::array<int, 2> mTracklets = constants::helpers::initArray<int, 2, constants::UnusedIndex>();
62 std::array<int, NClusters> mClusters = constants::helpers::initArray<int, NClusters, constants::UnusedIndex>();
63 TimeEstBC mTime;
64};
65
67class CellSeed final : public SeedBase<3>
68{
69 static constexpr int NStoredClusters = 3;
71
72 public:
73 GPUhdDefault() CellSeed() = default;
74 GPUhd() CellSeed(int innerL, int cl0, int cl1, int cl2, int trkl0, int trkl1, const o2::track::TrackParCovF& tpc, float chi2, const TimeEstBC& time)
75 : Base(tpc, chi2, 1, time)
76 {
77 setUserField(innerL);
78 auto& clusters = this->clustersRaw();
80 clusters[1] = cl1;
81 clusters[2] = cl2;
84 }
85 GPUhdDefault() CellSeed(const CellSeed&) = default;
86 GPUhdDefault() ~CellSeed() = default;
88 GPUhdDefault() CellSeed& operator=(const CellSeed&) = default;
89 GPUhdDefault() CellSeed& operator=(CellSeed&&) = default;
90
91 GPUhd() int getFirstClusterIndex() const { return this->clustersRaw()[0]; };
92 GPUhd() int getSecondClusterIndex() const { return this->clustersRaw()[1]; };
93 GPUhd() int getThirdClusterIndex() const { return this->clustersRaw()[2]; };
94 GPUhd() auto& getClusters() { return this->clustersRaw(); }
95 GPUhd() const auto& getClusters() const { return this->clustersRaw(); }
98 GPUhd() int getCluster(int layer) const
99 {
100 const int rel = layer - getInnerLayer();
101 return (rel >= 0 && rel < NStoredClusters) ? this->clustersRaw()[rel] : constants::UnusedIndex;
102 }
103};
104
108template <int NLayers>
109class TrackSeed final : public SeedBase<NLayers>
110{
111 using Base = SeedBase<NLayers>;
112
113 public:
114 GPUhdDefault() TrackSeed() = default;
116 : Base(static_cast<const o2::track::TrackParCovF&>(cs), cs.getChi2(), cs.getLevel(), cs.getTimeStamp())
117 {
118 this->setUserField(cs.getInnerLayer());
119 this->setFirstTrackletIndex(cs.getFirstTrackletIndex());
120 this->setSecondTrackletIndex(cs.getSecondTrackletIndex());
121 const int innerL = cs.getInnerLayer();
122 auto& clusters = this->clustersRaw();
123 clusters[innerL + 0] = cs.getFirstClusterIndex();
124 clusters[innerL + 1] = cs.getSecondClusterIndex();
125 clusters[innerL + 2] = cs.getThirdClusterIndex();
126 }
127 GPUhdDefault() TrackSeed(const TrackSeed&) = default;
128 GPUhdDefault() ~TrackSeed() = default;
130 GPUhdDefault() TrackSeed& operator=(const TrackSeed&) = default;
131 GPUhdDefault() TrackSeed& operator=(TrackSeed&&) = default;
132
135 GPUhd() int getFirstClusterIndex() const { return this->clustersRaw()[this->getUserField()]; }
136 GPUhd() int getSecondClusterIndex() const { return this->clustersRaw()[this->getUserField() + 1]; }
137 GPUhd() int getThirdClusterIndex() const { return this->clustersRaw()[this->getUserField() + 2]; }
138 GPUhd() auto& getClusters() { return this->clustersRaw(); }
139 GPUhd() const auto& getClusters() const { return this->clustersRaw(); }
140 GPUhd() int getCluster(int layer) const { return this->clustersRaw()[layer]; }
141};
142
143} // namespace o2::its
144
145#endif /* TRACKINGITSU_INCLUDE_CACELL_H_ */
Base track model for the Barrel, params only, w/o covariance.
int16_t time
Definition RawEventData.h:4
CellSeed: connections of three clusters.
Definition Cell.h:68
int int int int int trkl1
Definition Cell.h:74
GPUhd() int getCluster(int layer) const
Definition Cell.h:98
int int int int int const o2::track::TrackParCovF float chi2
Definition Cell.h:74
GPUhdDefault() CellSeed()=default
setFirstTrackletIndex(trkl0)
setSecondTrackletIndex(trkl1)
GPUhdDefault() CellSeed(const CellSeed &)=default
int int int int int const o2::track::TrackParCovF float const TimeEstBC & time
Definition Cell.h:75
GPUhd() auto &getClusters()
Definition Cell.h:94
GPUhd() CellSeed(int innerL
int int int cl2
Definition Cell.h:74
GPUhd() int getSecondClusterIndex() const
Definition Cell.h:92
GPUhd() int getThirdClusterIndex() const
Definition Cell.h:93
int int int int trkl0
Definition Cell.h:74
int int cl1
Definition Cell.h:74
auto & clusters
Definition Cell.h:78
GPUhd() const auto &getClusters() const
Definition Cell.h:95
int int int int int const o2::track::TrackParCovF & tpc
Definition Cell.h:74
GPUhd() void setLevel(int level)
Definition Cell.h:39
GPUhd() void setChi2(float chi2)
Definition Cell.h:37
GPUhd() int getLevel() const
Definition Cell.h:38
GPUhd() const auto &getTimeStamp() const noexcept
Definition Cell.h:42
GPUhd() void setSecondTrackletIndex(int trkl)
Definition Cell.h:35
GPUhdDefault() SeedBase()=default
GPUhd() int *getLevelPtr()
Definition Cell.h:40
GPUhd() float getChi2() const
Definition Cell.h:36
GPUhd() auto &clustersRaw()
Definition Cell.h:55
GPUhd() auto &getTimeStamp() noexcept
Definition Cell.h:41
GPUhd() void setFirstTrackletIndex(int trkl)
Definition Cell.h:33
GPUhd() int getFirstTrackletIndex() const
Definition Cell.h:32
GPUhd() int getSecondTrackletIndex() const
Definition Cell.h:34
GPUhd() const auto &clustersRaw() const
Definition Cell.h:56
GPUhd() int getInnerLayer() const
Definition Cell.h:31
GPUhdDefault() TrackSeed()=default
GPUhd() auto &getClusters()
Definition Cell.h:138
GPUhd() int getThirdClusterIndex() const
Definition Cell.h:137
GPUhd() const auto &getClusters() const
Definition Cell.h:139
GPUhd() int getSecondClusterIndex() const
Definition Cell.h:136
GPUhd() int getFirstClusterIndex() const
Definition Cell.h:135
GPUhdDefault() TrackSeed(const TrackSeed &)=default
GPUhd() int getCluster(int layer) const
Definition Cell.h:140
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLint level
Definition glcorearb.h:275
constexpr int UnusedIndex
Definition Constants.h:35
TrackParametrizationWithError< float > TrackParCovF
Definition Track.h:31
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Cluster > clusters