Project
Loading...
Searching...
No Matches
ResidualsController.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
16
17#ifndef RESIDUALSCONTROLLER_H
18#define RESIDUALSCONTROLLER_H
19
21#include <TMath.h>
22#include <Rtypes.h>
23
24namespace o2
25{
26namespace align
27{
28
29class AlignmentTrack;
30
32{
33 public:
34 enum {
35 CosmicBit = 0x1,
36 VertexBit = 0x1 << 1,
37 KalmanBit = 0x1 << 2
38 };
39 //
42 //
43 int getRun() const { return mRunNumber; }
44 void setRun(int r) { mRunNumber = r; }
45 uint32_t getFirstTFOrbit() const { return mFirstTFOrbit; }
46 void setFirstTFOrbit(uint32_t v) { mFirstTFOrbit = v; }
49 void setBz(float v) { mBz = v; }
50 float getBz() const { return mBz; }
51
52 void setNPoints(int n)
53 {
54 mNPoints = n;
55 resize(n);
56 }
57 //
58 bool isCosmic() const { return testBit(CosmicBit); }
59 void setCosmic(bool v = true) { setBit(CosmicBit, v); }
60
61 bool hasVertex() const { return testBit(VertexBit); }
62 void setHasVertex(bool v = true) { setBit(VertexBit, v); }
63 //
64 bool getKalmanDone() const { return testBit(KalmanBit); }
65 void setKalmanDone(bool v = true) { setBit(KalmanBit, v); }
66 //
67 int getNPoints() const { return mNPoints; }
68 int getNBook() const { return mNBook; }
69 float getChi2() const { return mChi2; }
70 float getChi2Ini() const { return mChi2Ini; }
71 float getChi2K() const { return mChi2K; }
72 float getQ2Pt() const { return mQ2Pt; }
73 float getX(int i) const { return mX[i]; }
74 float getY(int i) const { return mY[i]; }
75 float getZ(int i) const { return mZ[i]; }
76 float getSnp(int i) const { return mSnp[i]; }
77 float getTgl(int i) const { return mTgl[i]; }
78 float getAlpha(int i) const { return mAlpha[i]; }
79 float getDY(int i) const { return mDY[i]; }
80 float getDZ(int i) const { return mDZ[i]; }
81 float getDYK(int i) const { return mDYK[i]; }
82 float getDZK(int i) const { return mDZK[i]; }
83 //
84 float getSigY2K(int i) const { return mSigY2K[i]; }
85 float getSigYZK(int i) const { return mSigYZK[i]; }
86 float getSigZ2K(int i) const { return mSigZ2K[i]; }
87 float getSigmaYK(int i) const { return TMath::Sqrt(mSigY2K[i]); }
88 float getSigmaZK(int i) const { return TMath::Sqrt(mSigZ2K[i]); }
89 //
90 float getSigY2(int i) const { return mSigY2[i]; }
91 float getSigYZ(int i) const { return mSigYZ[i]; }
92 float getSigZ2(int i) const { return mSigZ2[i]; }
93 float getSigmaY(int i) const { return TMath::Sqrt(mSigY2[i]); }
94 float getSigmaZ(int i) const { return TMath::Sqrt(mSigZ2[i]); }
95 //
96 float getSigY2Tot(int i) const { return mSigY2K[i] + mSigY2[i]; }
97 float getSigYZTot(int i) const { return mSigYZK[i] + mSigYZ[i]; }
98 float getSigZ2Tot(int i) const { return mSigZ2K[i] + mSigZ2[i]; }
99 float getSigmaYTot(int i) const { return TMath::Sqrt(getSigY2Tot(i)); }
100 float getSigmaZTot(int i) const { return TMath::Sqrt(getSigZ2Tot(i)); }
101 //
102 int getVolID(int i) const { return mVolID[i]; }
103 //
104 float getXLab(int i) const;
105 float getYLab(int i) const;
106 float getZLab(int i) const;
107 //
108 bool fillTrack(AlignmentTrack& trc, bool doKalman = kTRUE);
109 void resize(int n);
110 void clear();
111 void print(const Option_t* opt = "re") const;
112 //
113 protected:
114 //
115 uint16_t mBits = 0;
116 int mRunNumber = 0; // run
117 float mBz = 0; // field
118 uint32_t mFirstTFOrbit = 0; // event time stamp
120 int mNPoints = 0; // n meas points
121 int mNBook = 0;
122 float mChi2 = 0; // chi2 after solution
123 float mChi2Ini = 0; // chi2 before solution
124 float mChi2K = 0; // chi2 from kalman
125 float mQ2Pt = 0; // Q/Pt at reference point
126 float* mX = nullptr; //[mNPoints] tracking X of cluster
127 float* mY = nullptr; //[mNPoints] tracking Y of cluster
128 float* mZ = nullptr; //[mNPoints] tracking Z of cluster
129 float* mSnp = nullptr; //[mNPoints] track Snp
130 float* mTgl = nullptr; //[mNPoints] track Tgl
131 float* mAlpha = nullptr; //[mNPoints] track alpha
132 float* mDY = nullptr; //[mNPoints] Y residual (track - meas)
133 float* mDZ = nullptr; //[mNPoints] Z residual (track - meas)
134 float* mDYK = nullptr; //[mNPoints] Y residual (track - meas) Kalman
135 float* mDZK = nullptr; //[mNPoints] Z residual (track - meas) Kalman
136 float* mSigY2 = nullptr; //[mNPoints] Y err^2
137 float* mSigYZ = nullptr; //[mNPoints] YZ err
138 float* mSigZ2 = nullptr; //[mNPoints] Z err^2
139 float* mSigY2K = nullptr; //[mNPoints] Y err^2 of Kalman track smoothing
140 float* mSigYZK = nullptr; //[mNPoints] YZ err of Kalman track smoothing
141 float* mSigZ2K = nullptr; //[mNPoints] Z err^2 of Kalman track smoothing
142 int* mVolID = nullptr; //[mNPoints] volume id (0 for vertex constraint)
143 int* mLabel = nullptr; //[mNPoints] label of the volume
144 //
145 void setBit(uint16_t b, bool v)
146 {
147 if (v) {
148 mBits |= b;
149 } else {
150 mBits &= ~(b & 0xffff);
151 }
152 }
153 bool testBit(uint16_t b) const
154 {
155 return mBits & b;
156 }
157
159};
160} // namespace align
161} // namespace o2
162#endif
void print() const
int32_t i
Global index for barrel track: provides provenance (detectors combination), index in respective array...
o2::dataformats::GlobalTrackID getTrackID() const
void setBit(uint16_t b, bool v)
o2::dataformats::GlobalTrackID mTrackID
void setTrackID(o2::dataformats::GlobalTrackID t)
ClassDefNV(ResidualsController, 1)
bool fillTrack(AlignmentTrack &trc, bool doKalman=kTRUE)
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean r
Definition glcorearb.h:1233
void align(gsl::span< ElinkEncoder< BareFormat, CHARGESUM > > elinks)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...