CbmRoot
Loading...
Searching...
No Matches
CbmCaHitQaData.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#ifndef CbmCaHitQaData_h
11#define CbmCaHitQaData_h 1
12
13#include <cmath>
14#include <limits>
15#include <tuple>
16
17namespace cbm::ca
18{
21 class HitQaData {
22 public:
24 HitQaData() = default;
25
27 ~HitQaData() = default;
28
30 HitQaData(const HitQaData&) = default;
31
33 HitQaData(HitQaData&&) = default;
34
36 HitQaData& operator=(const HitQaData&) = default;
37
40
43 double GetHitDu() const
44 {
45 auto cU = cos(fPhiU);
46 auto sU = sin(fPhiU);
47 return sqrt(cU * cU * GetHitDx() * GetHitDx() + 2. * sU * cU * GetHitDxy() + sU * sU * GetHitDy() * GetHitDy());
48 }
49
52 double GetHitDv() const
53 {
54 auto cV = cos(fPhiV);
55 auto sV = sin(fPhiV);
56 return sqrt(cV * cV * GetHitDx() * GetHitDx() + 2. * sV * cV * GetHitDxy() + sV * sV * GetHitDy() * GetHitDy());
57 }
58
61 double GetHitDuv() const
62 {
63 auto cU = cos(fPhiU);
64 auto sU = sin(fPhiU);
65 auto cV = cos(fPhiV);
66 auto sV = sin(fPhiV);
67 return GetHitDx() * GetHitDx() * cU * cV + GetHitDxy() * (sU * cV + cU * sV) + GetHitDy() * GetHitDy() * sU * sV;
68 }
69
72 double GetHitDx() const { return fHitDx; }
73
76 double GetHitDxy() const { return fHitDxy; }
77
80 double GetHitDy() const { return fHitDy; }
81
84 int GetHitIndex() const { return fHitID; }
85
88 double GetHitRuv() const { return GetHitDuv() / GetHitDu() / GetHitDv(); }
89
92 double GetHitTime() const { return fHitTime; }
93
96 double GetHitTimeError() const { return fHitTimeError; }
97
100 double GetHitU() const { return GetHitX() * cos(fPhiU) + GetHitY() * sin(fPhiU); }
101
104 double GetHitV() const { return GetHitX() * cos(fPhiV) + GetHitY() * sin(fPhiV); }
105
108 double GetHitX() const { return fHitX; }
109
112 double GetHitY() const { return fHitY; }
113
116 double GetHitZ() const { return fHitZ; }
117
120 bool GetIfTrackHasHits() const { return fbTrackHasHits; }
121
124 bool GetIfTrackSelected() const { return fbTrackSelected; }
125
128 double GetResidualTime() const { return GetHitTime() - GetPointTime(); }
129
132 double GetResidualU() const { return GetHitU() - GetPointU(); }
133
136 double GetResidualV() const { return GetHitV() - GetPointV(); }
137
140 double GetResidualX() const { return GetHitX() - GetPointX(); }
141
144 double GetResidualY() const { return GetHitY() - GetPointY(); }
145
148 double GetPhiU() const { return fPhiU; }
149
152 double GetPhiV() const { return fPhiV; }
153
156 std::tuple<int, int, int> GetPointID() const { return std::make_tuple(fPointID, fMCEventID, fMCFileID); }
157
160 double GetPointTime() const { return fPointTime; }
161
164 double GetPointU() const { return GetPointX() * cos(fPhiU) + GetPointY() * sin(fPhiU); }
165
168 double GetPointV() const { return GetPointX() * cos(fPhiV) + GetPointY() * sin(fPhiV); }
169
172 double GetPointX() const { return fPointX; }
173
176 double GetPointY() const { return fPointY; }
177
180 double GetPointZ() const { return fPointZ; }
181
184 double GetPullTime() const { return GetResidualTime() / GetHitTimeError(); }
185
188 double GetPullU() const { return GetResidualU() / GetHitDu(); }
189
192 double GetPullV() const { return GetResidualV() / GetHitDv(); }
193
196 double GetPullX() const { return GetResidualX() / GetHitDx(); }
197
200 double GetPullY() const { return GetResidualY() / GetHitDy(); }
201
204 int GetStationID() const { return fStationID; }
205
207 void Reset() { this->operator=(HitQaData()); }
208
211 void SetHitDx(double hitDx) { fHitDx = hitDx; }
212
215 void SetHitDxy(double hitDxy) { fHitDxy = hitDxy; }
216
219 void SetHitDy(double hitDy) { fHitDy = hitDy; }
220
223 void SetHitIndex(int hitID) { fHitID = hitID; }
224
227 void SetHitTime(double hitTime) { fHitTime = hitTime; }
228
231 void SetHitTimeError(double hitTimeError) { fHitTimeError = hitTimeError; }
232
235 void SetHitX(double hitX) { fHitX = hitX; }
236
239 void SetHitY(double hitY) { fHitY = hitY; }
240
243 void SetHitZ(double hitZ) { fHitZ = hitZ; }
244
247 void SetIfTrackHasHits(bool ifTrackHasHits) { fbTrackHasHits = ifTrackHasHits; }
248
251 void SetIfTrackSelected(bool ifTrackSelected) { fbTrackSelected = ifTrackSelected; }
252
255 void SetPhiU(double phiU) { fPhiU = phiU; }
256
259 void SetPhiV(double phiV) { fPhiV = phiV; }
260
265 void SetPointID(int pointID, int eventID, int fileID)
266 {
267 fPointID = pointID;
268 fMCEventID = eventID;
269 fMCFileID = fileID;
270 }
271
274 void SetPointTime(double pointTime) { fPointTime = pointTime; }
275
278 void SetPointX(double pointX) { fPointX = pointX; }
279
282 void SetPointY(double pointY) { fPointY = pointY; }
283
286 void SetPointZ(double pointZ) { fPointZ = pointZ; }
287
290 void SetStationID(int iStLoc) { fStationID = iStLoc; }
291
292 private:
293 static constexpr double kNAN = std::numeric_limits<double>::signaling_NaN();
294
295 double fPhiU = kNAN;
296 double fPhiV = kNAN;
297 double fHitX = kNAN;
298 double fHitY = kNAN;
299 double fHitZ = kNAN;
300 double fHitTime = kNAN;
301 double fHitDx = kNAN;
302 double fHitDy = kNAN;
303 double fHitDxy = kNAN;
305 double fPointX = kNAN;
306 double fPointY = kNAN;
307 double fPointZ = kNAN;
308 double fPointTime = kNAN;
309 int fStationID = -1;
310 int fHitID = -1;
311 int fPointID = -1;
312 int fMCEventID = -1;
313 int fMCFileID = -1;
314 bool fbTrackSelected = false;
315 bool fbTrackHasHits = false;
316 };
317
318} // namespace cbm::ca
319
320#endif // CbmCaHitQaData_h
friend fvec sqrt(const fvec &a)
friend fvec cos(const fvec &a)
friend fvec sin(const fvec &a)
Contains necessary data to calculate hit residuals and pulls.
double GetHitDx() const
Gets hit x-coordinate error.
double GetHitV() const
Gets hit v-coordinate.
void SetPhiU(double phiU)
Sets front strips stereo angle.
bool fbTrackSelected
Flag: if track selected.
void SetHitDxy(double hitDxy)
Sets hit x- and y-coordinate covariance.
void SetHitX(double hitX)
Sets hit x-coordinate.
double GetHitX() const
Gets hit x-coordinate.
int fPointID
Index of MC point.
double GetHitRuv() const
Gets Pearson correlation coefficient for u- and v-coordinates.
void SetHitIndex(int hitID)
Sets hit index.
static constexpr double kNAN
int fMCFileID
Index of MC file id.
double GetHitDy() const
Gets hit y-coordinate error.
double fHitDy
Hit y-coordinate error [cm].
double GetPullX() const
Gets pull of x-coordinate.
double GetPointU() const
Gets point u-coordinate.
double fHitDxy
Hit x- and y-coordinate covariance [cm2].
bool GetIfTrackSelected() const
Gets Flag: if track selected.
double GetHitDu() const
Gets hit u-coordinate error.
double GetResidualV() const
Gets residual of v-coordinate.
double GetPhiU() const
Gets front strips stereo angle.
void SetPointTime(double pointTime)
Sets point time.
double fPointZ
Point z-coordinate [cm].
int fMCEventID
Index of MC event.
double fPointX
Point x-coordinate [cm].
void SetStationID(int iStLoc)
Sets station local index.
HitQaData(HitQaData &&)=default
Move constructor.
void SetPhiV(double phiV)
Sets back strips stereo angle.
double GetResidualY() const
Gets residual of y-coordinate.
void SetIfTrackSelected(bool ifTrackSelected)
Sets Flag: if track selected.
double fHitZ
Hit z-coordinate [cm].
double GetResidualU() const
Gets residual of u-coordinate.
double fHitTime
Hit time [ns].
double GetPullTime() const
Gets pull of time.
double GetPullU() const
Gets pull of u-coordinate.
double GetPointY() const
Gets point y-coordinate.
double fHitTimeError
Hit time error [ns].
bool fbTrackHasHits
Flag: if track has hits.
void SetHitZ(double hitZ)
Sets hit z-coordinate.
void SetPointY(double pointY)
Sets point y-coordinate.
double GetHitDuv() const
Gets hit u- and v-coordinate covariance.
void SetPointZ(double pointZ)
Sets point z-coordinate.
HitQaData()=default
Default constructor.
HitQaData & operator=(HitQaData &&)=default
Move assignment operator.
double fHitDx
Hit x-coordinate error [cm].
double GetHitTimeError() const
Gets hit time error.
double GetHitTime() const
Gets hit time.
double GetPhiV() const
Gets back strips stereo angle.
~HitQaData()=default
Destructor.
double fHitY
Hit y-coordinate [cm].
double GetPointTime() const
Gets point time.
void SetHitDx(double hitDx)
Sets hit x-coordinate error.
HitQaData & operator=(const HitQaData &)=default
Copy assignment operator.
double GetPullY() const
Gets pull of y-coordinate.
double GetPullV() const
Gets pull of v-coordinate.
bool GetIfTrackHasHits() const
Gets Flag: if track has hits.
double GetResidualTime() const
Gets residual of time.
double fPointTime
Point time [ns].
double GetHitDxy() const
Gets hit x- and y-coordinate covariance.
double GetPointV() const
Gets point v-coordinate.
int fStationID
Local index of tracking station.
double fHitX
Hit x-coordinate [cm].
void SetPointID(int pointID, int eventID, int fileID)
Sets point index.
double GetHitDv() const
Gets hit v-coordinate error.
void SetHitTime(double hitTime)
Sets hit time.
double fPhiU
Stereo angle for front strips [rad].
double GetPointX() const
Gets point x-coordinate.
void SetHitY(double hitY)
Sets hit y-coordinate.
double GetHitY() const
Gets hit y-coordinate.
int GetStationID() const
Gets station local index.
void SetHitTimeError(double hitTimeError)
Sets hit time error.
double GetResidualX() const
Gets residual of x-coordinate.
HitQaData(const HitQaData &)=default
Copy constructor.
double GetPointZ() const
Gets point z-coordinate.
void SetHitDy(double hitDy)
Sets hit y-coordinate error.
double GetHitZ() const
Gets hit z-coordinate.
double fPhiV
Stereo anele for back strips [rad].
int GetHitIndex() const
Gets hit index.
void SetPointX(double pointX)
Sets point x-coordinate.
std::tuple< int, int, int > GetPointID() const
Gets point index.
void Reset()
Resets data fields.
void SetIfTrackHasHits(bool ifTrackHasHits)
Sets Flag: if track has hits.
double fPointY
Point y-coordinate [cm].
int fHitID
Index of hit.
double GetHitU() const
Gets hit u-coordinate.