CbmRoot
L1TrackParFit.h
Go to the documentation of this file.
1 #ifndef L1TrackParFit_h
2 #define L1TrackParFit_h
3 
4 #include "L1AddMaterial.h"
5 #include "L1Field.h"
6 #include "L1UMeasurementInfo.h"
7 
8 #include "L1TrackPar.h"
9 
10 #include "../CbmL1Def.h"
11 
13 
14 public:
15  fvec fx, fy, ftx, fty, fqp, fz, ft, C00, C10, C11, C20, C21, C22, C30, C31,
17  // fvec n;
18 
19 
21  : fx(0)
22  , fy(0)
23  , ftx(0)
24  , fty(0)
25  , fqp(0)
26  , fz(0)
27  , ft(0)
28  , C00(0)
29  , C10(0)
30  , C11(0)
31  , C20(0)
32  , C21(0)
33  , C22(0)
34  , C30(0)
35  , C31(0)
36  , C32(0)
37  , C33(0)
38  , C40(0)
39  , C41(0)
40  , C42(0)
41  , C43(0)
42  , C44(0)
43  , C50(0)
44  , C51(0)
45  , C52(0)
46  , C53(0)
47  , C54(0)
48  , C55(0)
49  , chi2(0)
50  , NDF(0) {};
51  L1TrackParFit(double* T, double* C)
52  : fx(T[0])
53  , fy(T[1])
54  , ftx(T[3])
55  , fty(T[4])
56  , fqp(T[5])
57  , fz(T[6])
58  , ft(T[7])
59  ,
60 
61  C00(C[0])
62  , C10(C[1])
63  , C11(C[2])
64  , C20(C[3])
65  , C21(C[4])
66  , C22(C[5])
67  , C30(C[6])
68  , C31(C[7])
69  , C32(C[8])
70  , C33(C[9])
71  , C40(C[10])
72  , C41(C[11])
73  , C42(C[12])
74  , C43(C[13])
75  , C44(C[14])
76  , C50(C[15])
77  , C51(C[16])
78  , C52(C[17])
79  , C53(C[18])
80  , C54(C[19])
81  , C55(C[20])
82  , chi2(0)
83  , NDF(0) {};
84 
85  void SetOneEntry(const int i0, const L1TrackParFit& T1, const int i1);
86 
87  void Print(int i = -1);
88 
89  //Fit functionality
90  void Filter(L1UMeasurementInfo& info, fvec u, fvec w = 1.);
91  void Filter(fvec t0, fvec dt0, fvec w = 1.);
92  void FilterNoP(L1UMeasurementInfo& info, fvec u, fvec w = 1.);
93  void Extrapolate(fvec z_out, fvec qp0, const L1FieldRegion& F, fvec* w = 0);
94  void ExtrapolateLine(fvec z_out, fvec* w = 0);
95  void ExtrapolateLine1(fvec z_out, fvec* w = 0, fvec v = 0);
96  void Compare(L1TrackPar& T);
97  void EnergyLossCorrection(const fvec& mass2,
98  const fvec& radThick,
99  fvec& qp0,
100  fvec direction,
101  fvec w = 1);
102  void L1AddMaterial(L1MaterialInfo& info,
103  fvec qp0,
104  fvec w = 1,
105  fvec mass2 = 0.1395679f * 0.1395679f);
106  void L1AddMaterial(fvec radThick,
107  fvec qp0,
108  fvec w = 1,
109  fvec mass2 = 0.1395679f * 0.1395679f);
110  void L1AddThickMaterial(fvec radThick,
111  fvec qp0,
112  fvec w = 1,
113  fvec mass2 = 0.1395679f * 0.1395679f,
114  fvec thickness = 0,
115  bool fDownstream = 1);
116  void
117  L1AddPipeMaterial(fvec qp0, fvec w = 1, fvec mass2 = 0.1395679f * 0.1395679f);
118  void EnergyLossCorrectionIron(const fvec& mass2,
119  const fvec& radThick,
120  fvec& qp0,
121  fvec direction,
122  fvec w = 1);
123  void EnergyLossCorrectionCarbon(const fvec& mass2,
124  const fvec& radThick,
125  fvec& qp0,
126  fvec direction,
127  fvec w = 1);
128  void EnergyLossCorrectionAl(const fvec& mass2,
129  const fvec& radThick,
130  fvec& qp0,
131  fvec direction,
132  fvec w = 1);
133  // void L1Extrapolate
134  // (
135  // // L1TrackParFit &T, // input track parameters (x,y,tx,ty,Q/p) and cov.matrix
136  // fvec z_out , // extrapolate to this z position
137  // fvec qp0 , // use Q/p linearisation at this value
138  // L1FieldRegion &F
139  // );
140 
141 
143 
144 // =============================================================================================
145 
146 inline void L1TrackParFit::Print(int i) {
147  std::cout.setf(std::ios::scientific, std::ios::floatfield);
148  if (i == -1) {
149  std::cout << "T = " << std::endl;
150  std::cout << fx << std::endl;
151  std::cout << fy << std::endl;
152  std::cout << ftx << std::endl;
153  std::cout << fty << std::endl;
154  std::cout << fqp << std::endl;
155  std::cout << fz << std::endl;
156  std::cout << ft << std::endl;
157  } else {
158  std::cout << "T = ";
159  std::cout << fx[i] << " ";
160  std::cout << fy[i] << " ";
161  std::cout << ftx[i] << " ";
162  std::cout << fty[i] << " ";
163  std::cout << fqp[i] << " ";
164  std::cout << fz[i] << std::endl;
165  std::cout << "C = ";
166  std::cout << C00[i] << " ";
167  std::cout << C11[i] << " ";
168  std::cout << C22[i] << " ";
169  std::cout << C33[i] << " ";
170  std::cout << C44[i] << " ";
171  std::cout << C55[i] << std::endl;
172  }
173 }
174 
175 
177  std::cout.precision(8);
178 
179  // if (fabs(T.x[0]-fx[0])/T.x[0] > 1.e-7) std::cout << fx <<" x "<< T.x << std::endl;
180  //
181  // if (fabs(T.y[0]-fy[0])/T.y[0] > 1.e-7) std::cout << fy <<" y "<< T.y << std::endl;
182  //
183  // if (fabs(T.tx[0]-ftx[0])/T.tx[0] > 1.e-7) std::cout << ftx <<" tx "<< T.tx << std::endl;
184  //
185  // if (fabs(T.ty[0]-fty[0])/T.ty[0] > 1.e-7) std::cout << fty <<" ty "<< T.ty << std::endl;
186  //
187  // if (fabs(T.qp[0]-fqp[0])/T.qp[0] > 1.e-7) std::cout << fqp <<" qp "<< T.qp << std::endl;
188  //
189  // if (fabs(T.z[0]-fz[0])/T.z[0] > 1.e-7) std::cout << fz <<" z "<< T.z << std::endl;
190  //
191  // if (fabs(T.C00[0]-C00[0])/T.C00[0] > 1.e-7) std::cout << C00 <<" C00 "<< T.C00 << std::endl;
192  // if (fabs(T.C11[0]-C11[0])/T.C11[0] > 1.e-7) std::cout << C11 <<" C11 "<< T.C11 << std::endl;
193  // if (fabs(T.C22[0]-C22[0])/T.C22[0] > 1.e-7) std::cout << C22 <<" C22 "<< T.C22 << std::endl;
194  // if (fabs(T.C33[0]-C33[0])/T.C33[0] > 1.e-7) std::cout << C33 <<" C33 "<< T.C33 << std::endl;
195  // if (fabs(T.C44[0]-C44[0])/T.C44[0] > 1.e-7) std::cout << C44 <<" C44 "<< T.C44 << std::endl;
196 
197 
198  // if (!(T.x==fx)[0]) std::cout << fx <<" x "<< T.x << std::endl;
199  // if (!(T.y==fy)[0]) std::cout << fy << " y "<< T.y << std::endl;
200  // if (!(T.tx==ftx)[0]) std::cout << ftx << " ty "<< T.tx << std::endl;
201  // if (!(T.ty==fty)[0]) std::cout << fty << " ty "<< T.ty << std::endl;
202  // if (!(T.qp==fqp)[0]) std::cout << fqp << " qp "<< T.qp << std::endl;
203  // if (!(T.z==fz)[0]) std::cout << fz << " z "<< T.z << std::endl;
204  // // if (T.t!=ft) std::cout << ft << " fx "<< T.x << std::endl;
205 
206 
207  // if (!(T.C00==C00)[0]) std::cout << C00 << " C00 "<< T.C00 << std::endl;
208  // if (!(T.C11==C11)[0]) std::cout << C11 << " C11 "<< T.C11 << std::endl;
209  // if (!(T.C22==C22)[0]) std::cout << C22 << " C22 "<< T.C22 << std::endl;
210  // if (!(T.C33==C33)[0]) std::cout << C33 << " C33 "<< T.C33 << std::endl;
211  // if (!(T.C44==C44)[0]) std::cout << C44 << " C44 "<< T.C44 << std::endl;
212  // if (T.C55!=C55) std::cout << C55 << " fx "<< T.C55 << std::endl;
213 
214 
215  std::cout << "parameters:" << std::endl;
216  std::cout << T.x[0] << " " << T.y[0] << " " << T.z[0] << " " << T.tx[0] << " "
217  << T.ty[0] << " " << T.qp[0] << std::endl;
218  std::cout << fx[0] << " " << fy[0] << " " << fz[0] << " " << ftx[0] << " "
219  << fty[0] << " " << fqp[0] << " " << ft[0] << std::endl;
220 
221  std::cout << "Covariance matrix:" << std::endl;
222  std::cout << T.C00[0] << " " << T.C10[0] << " " << T.C11[0] << " " << T.C20[0]
223  << " " << T.C21[0] << " " << T.C22[0] << " " << T.C30[0] << " "
224  << T.C31[0] << " " << T.C32[0] << " " << T.C33[0] << " " << T.C40[0]
225  << " " << T.C41[0] << " " << T.C42[0] << " " << T.C43[0] << " "
226  << T.C44[0] << std::endl;
227 
228  std::cout << C00[0] << " " << C10[0] << " " << C11[0] << " " << C20[0] << " "
229  << C21[0] << " " << C22[0] << " " << C30[0] << " " << C31[0] << " "
230  << C32[0] << " " << C33[0] << " " << C40[0] << " " << C41[0] << " "
231  << C42[0] << " " << C43[0] << " " << C44[0] << std::endl;
232  std::cout << " Time covariance:" << std::endl;
233  std::cout << " " << C50[0] << " " << C51[0] << " " << C52[0] << " "
234  << C53[0] << " " << C54[0] << " " << C55[0] << " " << std::endl;
235 
236  std::cout << std::endl;
237 }
238 
239 inline void L1TrackParFit::SetOneEntry(const int i0,
240  const L1TrackParFit& T1,
241  const int i1) {
242  fx[i0] = T1.fx[i1];
243  fy[i0] = T1.fy[i1];
244  ftx[i0] = T1.ftx[i1];
245  fty[i0] = T1.fty[i1];
246  fqp[i0] = T1.fqp[i1];
247  fz[i0] = T1.fz[i1];
248  ft[i0] = T1.ft[i1];
249  C00[i0] = T1.C00[i1];
250  C10[i0] = T1.C10[i1];
251  C11[i0] = T1.C11[i1];
252  C20[i0] = T1.C20[i1];
253  C21[i0] = T1.C21[i1];
254  C22[i0] = T1.C22[i1];
255  C30[i0] = T1.C30[i1];
256  C31[i0] = T1.C31[i1];
257  C32[i0] = T1.C32[i1];
258  C33[i0] = T1.C33[i1];
259  C40[i0] = T1.C40[i1];
260  C41[i0] = T1.C41[i1];
261  C42[i0] = T1.C42[i1];
262  C43[i0] = T1.C43[i1];
263  C44[i0] = T1.C44[i1];
264  C50[i0] = T1.C50[i1];
265  C51[i0] = T1.C51[i1];
266  C52[i0] = T1.C52[i1];
267  C53[i0] = T1.C53[i1];
268  C54[i0] = T1.C54[i1];
269  C55[i0] = T1.C55[i1];
270 
271  chi2[i0] = T1.chi2[i1];
272  NDF[i0] = T1.NDF[i1];
273  // time[i0] = T1.time[i1];
274  // n[i0] = T1.n[i1];
275 } // SetOneEntry
276 
277 #endif
L1TrackPar::C10
fvec C10
Definition: L1TrackPar.h:9
L1TrackPar::qp
fvec qp
Definition: L1TrackPar.h:9
L1TrackParFit::Extrapolate
void Extrapolate(fvec z_out, fvec qp0, const L1FieldRegion &F, fvec *w=0)
Definition: L1TrackParFit.cxx:326
L1TrackParFit::Print
void Print(int i=-1)
Definition: L1TrackParFit.h:146
L1TrackParFit::L1AddPipeMaterial
void L1AddPipeMaterial(fvec qp0, fvec w=1, fvec mass2=0.1395679f *0.1395679f)
Definition: L1TrackParFit.cxx:764
L1TrackParFit::C31
fvec C31
Definition: L1TrackParFit.h:15
f
float f
Definition: L1/vectors/P4_F32vec4.h:24
L1TrackPar::C20
fvec C20
Definition: L1TrackPar.h:9
L1TrackParFit::C43
fvec C43
Definition: L1TrackParFit.h:16
L1TrackParFit::C41
fvec C41
Definition: L1TrackParFit.h:16
F32vec4
Definition: L1/vectors/P4_F32vec4.h:47
L1TrackParFit::ft
fvec ft
Definition: L1TrackParFit.h:15
L1TrackParFit::C50
fvec C50
Definition: L1TrackParFit.h:16
L1TrackPar::C41
fvec C41
Definition: L1TrackPar.h:10
L1Field.h
L1TrackPar::C30
fvec C30
Definition: L1TrackPar.h:9
L1TrackParFit::chi2
fvec chi2
Definition: L1TrackParFit.h:16
L1TrackPar::C31
fvec C31
Definition: L1TrackPar.h:9
L1TrackParFit::fy
fvec fy
Definition: L1TrackParFit.h:15
L1TrackParFit::Compare
void Compare(L1TrackPar &T)
Definition: L1TrackParFit.h:176
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
L1TrackParFit::L1AddThickMaterial
void L1AddThickMaterial(fvec radThick, fvec qp0, fvec w=1, fvec mass2=0.1395679f *0.1395679f, fvec thickness=0, bool fDownstream=1)
Definition: L1TrackParFit.cxx:822
L1MaterialInfo
Definition: L1MaterialInfo.h:7
L1TrackPar::C42
fvec C42
Definition: L1TrackPar.h:10
L1TrackParFit::C30
fvec C30
Definition: L1TrackParFit.h:15
L1TrackParFit::EnergyLossCorrectionAl
void EnergyLossCorrectionAl(const fvec &mass2, const fvec &radThick, fvec &qp0, fvec direction, fvec w=1)
Definition: L1TrackParFit.cxx:1070
L1TrackPar::z
fvec z
Definition: L1TrackPar.h:9
L1TrackParFit::C10
fvec C10
Definition: L1TrackParFit.h:15
L1TrackParFit::L1AddMaterial
void L1AddMaterial(L1MaterialInfo &info, fvec qp0, fvec w=1, fvec mass2=0.1395679f *0.1395679f)
Definition: L1TrackParFit.cxx:867
L1TrackParFit::C33
fvec C33
Definition: L1TrackParFit.h:16
L1TrackParFit::SetOneEntry
void SetOneEntry(const int i0, const L1TrackParFit &T1, const int i1)
Definition: L1TrackParFit.h:239
L1TrackParFit::C42
fvec C42
Definition: L1TrackParFit.h:16
L1TrackPar::ty
fvec ty
Definition: L1TrackPar.h:9
L1TrackPar::C32
fvec C32
Definition: L1TrackPar.h:9
L1TrackParFit::C54
fvec C54
Definition: L1TrackParFit.h:16
L1TrackPar::y
fvec y
Definition: L1TrackPar.h:9
L1TrackParFit::C00
fvec C00
Definition: L1TrackParFit.h:15
L1TrackParFit::C40
fvec C40
Definition: L1TrackParFit.h:16
L1UMeasurementInfo.h
L1TrackPar::C44
fvec C44
Definition: L1TrackPar.h:10
L1FieldRegion
Definition: L1Field.h:85
L1TrackParFit::C20
fvec C20
Definition: L1TrackParFit.h:15
L1TrackParFit::fx
fvec fx
Definition: L1TrackParFit.h:15
L1TrackPar::tx
fvec tx
Definition: L1TrackPar.h:9
L1TrackParFit::C52
fvec C52
Definition: L1TrackParFit.h:16
L1TrackPar.h
L1TrackParFit::Filter
void Filter(L1UMeasurementInfo &info, fvec u, fvec w=1.)
Definition: L1TrackParFit.cxx:6
L1TrackParFit::C51
fvec C51
Definition: L1TrackParFit.h:16
L1TrackParFit::C11
fvec C11
Definition: L1TrackParFit.h:15
L1TrackParFit::ftx
fvec ftx
Definition: L1TrackParFit.h:15
L1TrackPar::C21
fvec C21
Definition: L1TrackPar.h:9
L1TrackParFit::ExtrapolateLine
void ExtrapolateLine(fvec z_out, fvec *w=0)
Definition: L1TrackParFit.cxx:204
L1TrackPar::x
fvec x
Definition: L1TrackPar.h:9
L1TrackPar::C00
fvec C00
Definition: L1TrackPar.h:9
L1TrackParFit::FilterNoP
void FilterNoP(L1UMeasurementInfo &info, fvec u, fvec w=1.)
Definition: L1TrackParFit.cxx:72
L1UMeasurementInfo
Definition: L1UMeasurementInfo.h:7
_fvecalignment
class L1TrackParFit _fvecalignment
L1TrackParFit::C21
fvec C21
Definition: L1TrackParFit.h:15
L1TrackPar::C33
fvec C33
Definition: L1TrackPar.h:9
L1TrackParFit::NDF
fvec NDF
Definition: L1TrackParFit.h:16
L1TrackParFit::C32
fvec C32
Definition: L1TrackParFit.h:16
L1TrackParFit::L1TrackParFit
L1TrackParFit()
Definition: L1TrackParFit.h:20
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
L1AddMaterial.h
L1TrackParFit::C53
fvec C53
Definition: L1TrackParFit.h:16
L1TrackParFit::L1TrackParFit
L1TrackParFit(double *T, double *C)
Definition: L1TrackParFit.h:51
L1TrackPar
Definition: L1TrackPar.h:6
L1TrackPar::C40
fvec C40
Definition: L1TrackPar.h:10
L1TrackPar::C11
fvec C11
Definition: L1TrackPar.h:9
L1TrackParFit::fqp
fvec fqp
Definition: L1TrackParFit.h:15
L1TrackParFit
Definition: L1TrackParFit.h:12
L1TrackParFit::C55
fvec C55
Definition: L1TrackParFit.h:16
L1TrackParFit::C44
fvec C44
Definition: L1TrackParFit.h:16
L1TrackParFit::EnergyLossCorrectionIron
void EnergyLossCorrectionIron(const fvec &mass2, const fvec &radThick, fvec &qp0, fvec direction, fvec w=1)
Definition: L1TrackParFit.cxx:928
L1TrackPar::C43
fvec C43
Definition: L1TrackPar.h:10
L1TrackParFit::ExtrapolateLine1
void ExtrapolateLine1(fvec z_out, fvec *w=0, fvec v=0)
Definition: L1TrackParFit.cxx:260
L1TrackParFit::fz
fvec fz
Definition: L1TrackParFit.h:15
L1TrackParFit::EnergyLossCorrectionCarbon
void EnergyLossCorrectionCarbon(const fvec &mass2, const fvec &radThick, fvec &qp0, fvec direction, fvec w=1)
Definition: L1TrackParFit.cxx:999
L1TrackParFit::EnergyLossCorrection
void EnergyLossCorrection(const fvec &mass2, const fvec &radThick, fvec &qp0, fvec direction, fvec w=1)
Definition: L1TrackParFit.cxx:898
L1TrackParFit::fty
fvec fty
Definition: L1TrackParFit.h:15
L1TrackPar::C22
fvec C22
Definition: L1TrackPar.h:9
L1TrackParFit::C22
fvec C22
Definition: L1TrackParFit.h:15