CbmRoot
CbmKFUMeasurement.cxx
Go to the documentation of this file.
1 #include "CbmKFUMeasurement.h"
2 
3 #include <cmath>
4 
6 
7  void CbmKFUMeasurement::Set(Double_t z_,
8  Double_t u_,
9  Double_t phi_,
10  Double_t sigma2_) {
11  this->z = z_;
12  this->u = u_;
13  this->phi = phi_;
14  this->sigma2 = sigma2_;
15  phi_s = sin(phi_);
16  phi_c = cos(phi_);
17  phi_ss = phi_s * phi_s;
18  phi_cc = phi_c * phi_c;
19  phi_2sc = 2. * phi_s * phi_c;
20 }
21 
23 
24  Double_t* T = track.GetTrack();
25  Double_t* C = track.GetCovMatrix();
26 
27  Double_t W = sigma2 + phi_cc * C[0] + phi_2sc * C[1] + phi_ss * C[2];
28  if (!finite(W) || W < 1.e-10) return 1;
29  W = 1. / W;
30  if (!finite(W)) return 1;
31 
32  Double_t zeta = phi_c * T[0] + phi_s * T[1] - u;
33 
34  track.GetRefChi2() += zeta * zeta * W;
35  track.GetRefNDF() += 1;
36  Double_t K[5] = {phi_c * C[0] + phi_s * C[1],
37  phi_c * C[1] + phi_s * C[2],
38  phi_c * C[3] + phi_s * C[4],
39  phi_c * C[6] + phi_s * C[7],
40  phi_c * C[10] + phi_s * C[11]};
41 
42  Double_t KW[5] = {K[0] * W, K[1] * W, K[2] * W, K[3] * W, K[4] * W};
43 
44  T[0] -= KW[0] * zeta;
45  T[1] -= KW[1] * zeta;
46  T[2] -= KW[2] * zeta;
47  T[3] -= KW[3] * zeta;
48  T[4] -= KW[4] * zeta;
49 
50  C[0] -= K[0] * KW[0];
51  C[1] -= K[1] * KW[0];
52  C[2] -= K[1] * KW[1];
53  C[3] -= K[2] * KW[0];
54  C[4] -= K[2] * KW[1];
55  C[5] -= K[2] * KW[2];
56  C[6] -= K[3] * KW[0];
57  C[7] -= K[3] * KW[1];
58  C[8] -= K[3] * KW[2];
59  C[9] -= K[3] * KW[3];
60  C[10] -= K[4] * KW[0];
61  C[11] -= K[4] * KW[1];
62  C[12] -= K[4] * KW[2];
63  C[13] -= K[4] * KW[3];
64  C[14] -= K[4] * KW[4];
65  return 0;
66 }
CbmKFUMeasurement::phi_s
Double_t phi_s
Definition: CbmKFUMeasurement.h:38
sin
friend F32vec4 sin(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:136
CbmKFTrackInterface::GetTrack
virtual Double_t * GetTrack()
Is it electron.
Definition: CbmKFTrackInterface.cxx:33
CbmKFUMeasurement::phi_c
Double_t phi_c
Definition: CbmKFUMeasurement.h:39
CbmKFUMeasurement::u
Double_t u
Definition: CbmKFUMeasurement.h:31
CbmKFUMeasurement.h
CbmKFUMeasurement::Set
void Set(Double_t z, Double_t u, Double_t phi, Double_t sigma2)
finite
T finite(T x)
Definition: CbmL1Def.h:21
CbmKFUMeasurement::Filter
Int_t Filter(CbmKFTrackInterface &track)
Definition: CbmKFUMeasurement.cxx:22
ClassImp
ClassImp(CbmKFUMeasurement) void CbmKFUMeasurement
Definition: CbmKFUMeasurement.cxx:5
CbmKFUMeasurement::phi
Double_t phi
Definition: CbmKFUMeasurement.h:33
CbmKFUMeasurement::z
Double_t z
Definition: CbmKFUMeasurement.h:30
CbmKFUMeasurement::phi_ss
Double_t phi_ss
Definition: CbmKFUMeasurement.h:40
CbmKFTrackInterface::GetRefNDF
virtual Int_t & GetRefNDF()
Chi^2 after fit.
Definition: CbmKFTrackInterface.cxx:36
CbmKFTrackInterface
Definition: CbmKFTrackInterface.h:26
CbmKFUMeasurement::phi_2sc
Double_t phi_2sc
Definition: CbmKFUMeasurement.h:42
CbmKFTrackInterface::GetCovMatrix
virtual Double_t * GetCovMatrix()
array[6] of track parameters(x,y,tx,ty,qp,z)
Definition: CbmKFTrackInterface.cxx:34
CbmKFUMeasurement::sigma2
Double_t sigma2
Definition: CbmKFUMeasurement.h:32
cos
friend F32vec4 cos(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:137
CbmKFUMeasurement::phi_cc
Double_t phi_cc
Definition: CbmKFUMeasurement.h:41
CbmKFUMeasurement
Definition: CbmKFUMeasurement.h:16
CbmKFTrackInterface::GetRefChi2
virtual Double_t & GetRefChi2()
array[15] of covariance matrix
Definition: CbmKFTrackInterface.cxx:35