17#include "TDecompSVD.h"
19#include "TMatrixFSymfwd.h"
37 TGraph2DErrors*
gr =
new TGraph2DErrors();
39 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
48 Double_t pStart[4] = {0., 0., 0., 0.};
53 LOG(debug1) <<
"Line3DFit init: X0 " << pStart[0] <<
", TX " << pStart[1] <<
", Y0 " << pStart[2] <<
", TY "
60 LOG(debug1) <<
"Line3Dfit result: " << gMinuit->fCstatu <<
" : X0 " << dRes[0] <<
", TX " << dRes[1] <<
", Y0 "
75 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
77 if (nValidHits == 0) {
81 dDist1 = pTrk->
GetTofHitPointer(iHit1)->
GetZ() * TMath::Sqrt(1. + dPar[1] * dPar[1] + dPar[3] * dPar[3]);
92 if (nValidHits < 2)
return 0.;
93 if (nValidHits == 2)
return (at[0] - at[1]) / (aR[0] - aR[1]);
100 Double_t sig_weight = 0;
101 Double_t yoffset = at[0] - 10;
102 for (Int_t i = 0; i < nValidHits; i++) {
104 sig_weight = (ae[i] * ae[i]);
105 Rsum += (aR[i] / sig_weight);
106 tsum += (at[i] / sig_weight);
107 RRsum += (aR[i] * aR[i] / sig_weight);
108 Rtsum += (aR[i] * at[i] / sig_weight);
109 esum += (1 / sig_weight);
111 Double_t det_cov_mat =
114 Double_t dT0 = (RRsum * tsum - Rsum * Rtsum) / det_cov_mat;
115 Double_t dTt = (-Rsum * tsum + esum * Rtsum) / det_cov_mat;
116 Double_t dT0Err = TMath::Sqrt(RRsum / det_cov_mat);
118 Double_t dTtErr = TMath::Sqrt(esum / det_cov_mat);
119 Double_t dT0TtCov = -Rsum / det_cov_mat;
137 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
139 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
154 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
163 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes " << pTrk->
GetNofHits() <<
", "
170 return pHit->
GetX() - dXref;
180 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
182 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
196 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
205 LOG(error) <<
"DetId " << iDetId <<
", Nref " << iNref <<
" sizes " << pTrk->
GetNofHits() <<
", "
212 return pHit->
GetY() - dYref;
223 for (Int_t iHL = 0; iHL < pTrk->
GetNofHits() - 1; iHL++) {
225 for (Int_t iHH = iHL + 1; iHH < pTrk->
GetNofHits(); iHH++) {
237 LOG(error) <<
"No valid hit pair ";
240 dTt /= (Double_t) iNt;
243 dTt =
FitTt(pTrk, iDetId);
246 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
255 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes " << pTrk->
GetNofHits();
258 dTref /= (Double_t) Nref;
259 Double_t dTdif = pHit->
GetTime() - dTref;
271 dTt =
FitTt(pTrk, iDetId);
275 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
283 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes " << pTrk->
GetNofHits();
286 dTref /= (Double_t) Nref;
294 Double_t dTrms2 = 0.;
301 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
308 dTrms2 += dTref * dTref;
312 LOG(error) <<
"DetId " << iDetId <<
", Nref " << Nref <<
" sizes " << pTrk->
GetNofHits();
315 dTrms2 /= (Double_t) Nref;
316 dTrms = TMath::Sqrt(dTrms2);
328 for (Int_t iHit = 0; iHit < pTrk->
GetNofHits(); iHit++) {
334 return pHit->
GetTime() - dTmean;
ClassImp(CbmConverterManager)
Provides information on attaching a TofHit to a TofTrack.
int32_t GetNofHits() const
void SetT0TtCov(double val)
CbmTofHit * GetTofHitPointer(int32_t ind)
void SetT0Err(double val)
int32_t GetTofDetIndex(int32_t ind) const
void SetTtErr(double val)
CbmTofTrackletParam * GetTrackParameter()
virtual double Dist3D(CbmTofHit *pHit0, CbmTofHit *pHit1)
static LKFMinuit * Instance()
int DoFit(TGraph2DErrors *gr, double pStart[])