12 #include "FairLogger.h"
15 #include "TDecompSVD.h"
17 #include "TMatrixFSymfwd.h"
31 TGraph2DErrors*
gr =
new TGraph2DErrors();
33 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
40 gr->SetPointError(NHit,
47 Double_t pStart[4] = {0., 0., 0., 0.};
52 LOG(debug) <<
"Line3DFit init: X0 " << pStart[0] <<
", TX " << pStart[1]
53 <<
", Y0 " << pStart[2] <<
", TY " << pStart[3];
59 LOG(debug) <<
"Line3Dfit result: " << gMinuit->fCstatu <<
" : X0 " << dRes[0]
60 <<
", TX " << dRes[1] <<
", Y0 " << dRes[2] <<
", TY " << dRes[3]
68 Double_t dDist1 = 100.;
73 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
75 if (nValidHits == 0) {
80 * TMath::Sqrt(1. + dPar[1] * dPar[1] + dPar[3] * dPar[3]);
87 aR[nValidHits] = dDist1
96 if (nValidHits < 2)
return 0.;
97 if (nValidHits == 2)
return (at[0] - at[1]) / (aR[0] - aR[1]);
106 Double_t sig_weight = 0;
109 for (Int_t
i = 0;
i < nValidHits;
i++) {
111 sig_weight = (ae[
i] * ae[
i]);
112 Rsum += (aR[
i] / sig_weight);
113 tsum += (at[
i] / sig_weight);
114 RRsum += (aR[
i] * aR[
i] / sig_weight);
115 Rtsum += (aR[
i] * at[
i] / sig_weight);
116 esum += (1 / sig_weight);
118 Double_t det_cov_mat =
123 return (-Rsum * tsum + esum * Rtsum)
140 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
143 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
161 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
171 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes "
178 return pHit->
GetX() - dXref;
189 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
192 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
209 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
219 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes "
226 return pHit->
GetY() - dYref;
238 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
241 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
260 LOG(error) <<
"No valid hit pair ";
263 dTt /= (Double_t) iNt;
265 dTt =
FitTt(pTrk, iDetId);
268 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
279 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes "
283 dTref /= (Double_t) Nref;
284 Double_t dTdif = pHit->
GetTime() - dTref;
297 dTt =
FitTt(pTrk, iDetId);
299 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
309 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes "
313 dTref /= (Double_t) Nref;