3 #include "data/CbmLitTrackParam.h"
4 #include "data/CbmLitHit.h"
5 #include "data/CbmLitStripHit.h"
6 #include "data/CbmLitPixelHit.h"
7 #include "data/CbmLitTrack.h"
16 const CbmLitTrackParam* par,
20 if (hit->GetType() == kLITSTRIPHIT) {
21 chisq =
ChiSq(par, static_cast<const CbmLitStripHit*>(hit));
22 }
else if (hit->GetType() == kLITPIXELHIT) {
23 chisq =
ChiSq(par, static_cast<const CbmLitPixelHit*>(hit));
29 const CbmLitTrackParam* par,
30 const CbmLitStripHit* hit)
32 litfloat duu = hit->GetDu() * hit->GetDu();
33 litfloat phiCos = hit->GetCosPhi();
34 litfloat phiSin = hit->GetSinPhi();
35 litfloat phiCosSq = phiCos * phiCos;
36 litfloat phiSinSq = phiSin * phiSin;
37 litfloat phi2SinCos = 2 * phiCos * phiSin;
38 litfloat C0 = par->GetCovariance(0);
39 litfloat C1 = par->GetCovariance(1);
40 litfloat C5 = par->GetCovariance(5);
42 litfloat ru = hit->GetU() - par->GetX() * phiCos - par->GetY() * phiSin;
44 return (ru * ru) / (duu - phiCosSq*C0 - phi2SinCos*C1 - phiSinSq*C5);
48 const CbmLitTrackParam* par,
49 const CbmLitPixelHit* hit)
51 litfloat dxx = hit->GetDx() * hit->GetDx();
52 litfloat dxy = hit->GetDxy();
53 litfloat dyy = hit->GetDy() * hit->GetDy();
54 litfloat xmx = hit->GetX() - par->GetX();
55 litfloat ymy = hit->GetY() - par->GetY();
56 litfloat C0 = par->GetCovariance(0);
57 litfloat C1 = par->GetCovariance(1);
58 litfloat C5 = par->GetCovariance(5);
60 litfloat norm = dxx * dyy - dxx * C5 - dyy * C0 + C0 * C5
61 - dxy * dxy + 2 * dxy * C1 - C1 * C1;
62 if (norm == 0.) { norm = 1
e-10; }
63 return ((xmx * (dyy - C5) - ymy * (dxy - C1)) * xmx
64 +(-xmx * (dxy - C1) + ymy * (dxx - C0)) * ymy) / norm;
68 const CbmLitTrack* track)
71 for (Int_t i = 0; i < track->GetNofHits(); i++) {
72 if (track->GetHit(i)->GetType() == kLITPIXELHIT) { ndf += 2; }
73 else if (track->GetHit(i)->GetType() == kLITSTRIPHIT) { ndf++; }
76 if (ndf > 0) {
return ndf; }