Project
Loading...
Searching...
No Matches
TrackTPC.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.
11
12#ifndef ALICEO2_TPC_TRACKTPC
13#define ALICEO2_TPC_TRACKTPC
14
15#include "GPUCommonDef.h"
20
21namespace o2
22{
23namespace tpc
24{
27
28using TPCClRefElem = uint32_t;
29
31{
33
34 public:
35 enum Flags : unsigned short {
36 HasASideClusters = 0x1 << 0,
37 HasCSideClusters = 0x1 << 1,
38 HasBothSidesClusters = HasASideClusters | HasCSideClusters, // track has clusters on both sides
39 FullMask = 0xffff
40 };
41
42 using o2::track::TrackParCov::TrackParCov; // inherit
43
45 GPUdDefault() TrackTPC() = default;
46
48 GPUdDefault() ~TrackTPC() = default;
49
50 GPUd() unsigned short getFlags() const { return mFlags; }
51 GPUd() unsigned short getClustersSideInfo() const { return mFlags & HasBothSidesClusters; }
52 GPUd() bool hasASideClusters() const { return mFlags & HasASideClusters; }
53 GPUd() bool hasCSideClusters() const { return mFlags & HasCSideClusters; }
54 GPUd() bool hasBothSidesClusters() const { return (mFlags & (HasASideClusters | HasCSideClusters)) == (HasASideClusters | HasCSideClusters); }
55 GPUd() bool hasASideClustersOnly() const { return (mFlags & HasBothSidesClusters) == HasASideClusters; }
56 GPUd() bool hasCSideClustersOnly() const { return (mFlags & HasBothSidesClusters) == HasCSideClusters; }
57
58 GPUd() void setHasASideClusters() { mFlags |= HasASideClusters; }
59 GPUd() void setHasCSideClusters() { mFlags |= HasCSideClusters; }
60
61 GPUd() float getTime0() const { return mTime0; }
62 GPUd() float getDeltaTBwd() const { return mDeltaTBwd; }
63 GPUd() float getDeltaTFwd() const { return mDeltaTFwd; }
64 GPUd() void setDeltaTBwd(float t) { mDeltaTBwd = t; }
65 GPUd() void setDeltaTFwd(float t) { mDeltaTFwd = t; }
66
67 GPUd() float getChi2() const { return mChi2; }
68 GPUd() const o2::track::TrackParCov& getOuterParam() const { return mOuterParam; }
69 GPUd() const o2::track::TrackParCov& getParamOut() const { return mOuterParam; } // to have method with same name as other tracks
70 GPUd() o2::track::TrackParCov& getParamOut() { return mOuterParam; } // to have method with same name as other tracks
71 GPUd() void setTime0(float v) { mTime0 = v; }
72 GPUd() void setChi2(float v) { mChi2 = v; }
73 GPUd() void setOuterParam(o2::track::TrackParCov&& v) { mOuterParam = v; }
74 GPUd() void setParamOut(o2::track::TrackParCov&& v) { mOuterParam = v; } // to have method with same name as other tracks
75 GPUd() const ClusRef& getClusterRef() const { return mClustersReference; }
76 GPUd() void shiftFirstClusterRef(int dif) { mClustersReference.setFirstEntry(dif + mClustersReference.getFirstEntry()); }
77 GPUd() int getNClusters() const { return mClustersReference.getEntries(); }
78 GPUd() int getNClusterReferences() const { return getNClusters(); }
79 GPUd() void setClusterRef(uint32_t entry, uint16_t ncl) { mClustersReference.set(entry, ncl); }
80
81 template <class T>
82 GPUdi() static void getClusterReference(T& clinfo, int nCluster,
83 uint8_t& sectorIndex, uint8_t& rowIndex, uint32_t& clusterIndex, const ClusRef& ref)
84 {
85 // data for given tracks starts at clinfo[ ref.getFirstEntry() ],
86 // 1st ref.getEntries() cluster indices are stored as uint32_t
87 // then sector indices as uint8_t, then row indices ar uin8_t
88
89 // const uint32_t* clIndArr = &clinfo[ ref.getFirstEntry() ];
90 const uint32_t* clIndArr = reinterpret_cast<const uint32_t*>(&clinfo[ref.getFirstEntry()]); // TODO remove this trick
92 const uint8_t* srIndexArr = reinterpret_cast<const uint8_t*>(clIndArr + ref.getEntries());
94 rowIndex = srIndexArr[nCluster + ref.getEntries()];
95 }
96
97 template <class T>
98 GPUdi() void getClusterReference(T& clinfo, int nCluster,
99 uint8_t& sectorIndex, uint8_t& rowIndex, uint32_t& clusterIndex) const
100 {
101 getClusterReference<T>(clinfo, nCluster, sectorIndex, rowIndex, clusterIndex, mClustersReference);
102 }
103
104 template <class T>
105 GPUdi() static const o2::tpc::ClusterNative& getCluster(T& clinfo, int nCluster,
107 {
108 uint32_t clusterIndex;
109 getClusterReference<T>(clinfo, nCluster, sectorIndex, rowIndex, clusterIndex, ref);
110 return (clusters.clusters[sectorIndex][rowIndex][clusterIndex]);
111 }
112
113 template <class T>
114 GPUdi() const o2::tpc::ClusterNative& getCluster(T& clinfo, int nCluster,
115 const o2::tpc::ClusterNativeAccess& clusters, uint8_t& sectorIndex, uint8_t& rowIndex) const
116 {
117 return getCluster<T>(clinfo, nCluster, clusters, sectorIndex, rowIndex, mClustersReference);
118 }
119
120 template <class T>
121 GPUdi() const o2::tpc::ClusterNative& getCluster(T& clinfo, int nCluster,
123 {
124 uint8_t sectorIndex, rowIndex;
125 return (getCluster<T>(clinfo, nCluster, clusters, sectorIndex, rowIndex));
126 }
127
128 GPUd() const dEdxInfo& getdEdx() const { return mdEdx; }
129 GPUd() void setdEdx(const dEdxInfo& v) { mdEdx = v; }
130
131 private:
132 float mTime0 = 0.f;
133 float mDeltaTFwd = 0;
134 float mDeltaTBwd = 0;
135 short mFlags = 0;
136 float mChi2 = 0.f; // Chi2 of the track
137 o2::track::TrackParCov mOuterParam; // Track parameters at outer end of TPC.
138 dEdxInfo mdEdx; // dEdx Information
139 ClusRef mClustersReference; // reference to externale cluster indices
140
141 ClassDefNV(TrackTPC, 4);
142};
143
144} // namespace tpc
145} // namespace o2
146
147#endif
Class of a TPC cluster in TPC-native coordinates (row, time)
Base track model for the Barrel, params only, w/o covariance.
Class to refer to the 1st entry and N elements of some group in the continuous container.
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
GPUd() void setClusterRef(uint32_t entry
GPUd() bool hasBothSidesClusters() const
Definition TrackTPC.h:54
GPUd() int getNClusters() const
Definition TrackTPC.h:77
GPUd() const o2
Definition TrackTPC.h:68
GPUd() void setDeltaTFwd(float t)
set max possible increment to getTimeVertex
Definition TrackTPC.h:65
GPUd() void setHasASideClusters()
Definition TrackTPC.h:58
GPUd() unsigned short getClustersSideInfo() const
Definition TrackTPC.h:51
GPUdi() const o2
Definition TrackTPC.h:114
GPUdi() void getClusterReference(T &clinfo
GPUd() void setChi2(float v)
Definition TrackTPC.h:72
GPUd() bool hasCSideClustersOnly() const
Definition TrackTPC.h:56
GPUd() unsigned short getFlags() const
Definition TrackTPC.h:50
int uint8_t & sectorIndex
Definition TrackTPC.h:83
GPUd() void setOuterParam(o2
Definition TrackTPC.h:73
GPUd() bool hasASideClusters() const
Definition TrackTPC.h:52
GPUd() void shiftFirstClusterRef(int dif)
Definition TrackTPC.h:76
GPUd() const ClusRef &getClusterRef() const
Definition TrackTPC.h:75
GPUd() void setParamOut(o2
Definition TrackTPC.h:74
GPUd() float getTime0() const
Reference time of the track, i.e. t-bins of a primary track with eta=0.
Definition TrackTPC.h:61
const uint8_t * srIndexArr
Definition TrackTPC.h:92
GPUd() bool hasCSideClusters() const
Definition TrackTPC.h:53
@ HasCSideClusters
track has clusters on C side
Definition TrackTPC.h:37
@ HasASideClusters
track has clusters on A side
Definition TrackTPC.h:36
GPUd() float getDeltaTBwd() const
max possible decrement to getTimeVertex
Definition TrackTPC.h:62
GPUd() float getDeltaTFwd() const
max possible increment to getTimeVertex
Definition TrackTPC.h:63
GPUd() void setDeltaTBwd(float t)
set max possible decrement to getTimeVertex
Definition TrackTPC.h:64
GPUd() int getNClusterReferences() const
Definition TrackTPC.h:78
GPUd() void setTime0(float v)
Definition TrackTPC.h:71
GPUdDefault() TrackTPC()=default
Default constructor.
int uint8_t uint8_t uint32_t & clusterIndex
Definition TrackTPC.h:83
GPUdi() static const o2
Definition TrackTPC.h:105
int uint8_t uint8_t & rowIndex
Definition TrackTPC.h:83
int uint8_t uint8_t uint32_t &clusterIndex const
Definition TrackTPC.h:100
GPUd() float getChi2() const
Definition TrackTPC.h:67
GPUd() bool hasASideClustersOnly() const
Definition TrackTPC.h:55
GPUd() void setHasCSideClusters()
Definition TrackTPC.h:59
GPUdi() static void getClusterReference(T &clinfo
GLuint entry
Definition glcorearb.h:5735
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
uint32_t TPCClRefElem
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Cluster > clusters