////////////////////////////////////////////////////////////////////////////
#include "TMath.h"
-#include "TLinearFitter.h"
-#include "TClonesArray.h" // tmp
#include <TTreeStream.h>
#include "AliLog.h"
ClassImp(AliTRDseedV1)
-TLinearFitter *AliTRDseedV1::fgFitterY = NULL;
-TLinearFitter *AliTRDseedV1::fgFitterZ = NULL;
-
//____________________________________________________________________
AliTRDseedV1::AliTRDseedV1(Int_t det)
:AliTRDtrackletBase()
Double_t fSnp = trk->GetSnp();
Double_t fTgl = trk->GetTgl();
fPt = trk->Pt();
- Double_t norm =1./TMath::Sqrt(1. - fSnp*fSnp);
+ Double_t norm =1./TMath::Sqrt((1.-fSnp)*(1.+fSnp));
fYref[1] = fSnp*norm;
fZref[1] = fTgl*norm;
SetCovRef(trk->GetCovariance());
}
dx *= TMath::Sqrt(1. + fYfit[1]*fYfit[1] + fZref[1]*fZref[1]);
if(dl) (*dl) = dx;
- return dq/dx;
+ if(dx>1.e-9) return dq/dx;
+ else return 0.;
}
//____________________________________________________________
return fClusters[ic] ? fClusters[ic]->GetVolumeId() : 0;
}
-//____________________________________________________________________
-TLinearFitter* AliTRDseedV1::GetFitterY()
-{
- if(!fgFitterY) fgFitterY = new TLinearFitter(1, "pol1");
- fgFitterY->ClearPoints();
- return fgFitterY;
-}
-
-//____________________________________________________________________
-TLinearFitter* AliTRDseedV1::GetFitterZ()
-{
- if(!fgFitterZ) fgFitterZ = new TLinearFitter(1, "pol1");
- fgFitterZ->ClearPoints();
- return fgFitterZ;
-}
//____________________________________________________________________
void AliTRDseedV1::Calibrate()
fExB = AliTRDCommonParam::Instance()->GetOmegaTau(fVD);
AliTRDCommonParam::Instance()->GetDiffCoeff(fDiffL,
fDiffT, fVD);
+ AliDebug(4, Form("Calibration params for Det[%3d] Col[%3d] Row[%2d]\n t0[%f] vd[%f] s2PRF[%f] ExB[%f] Dl[%f] Dt[%f]", fDet, col, row, fT0, fVD, fS2PRF, fExB, fDiffL, fDiffT));
+
+
SetBit(kCalib, kTRUE);
}
AliTRDpadPlane *pp = g.GetPadPlane(fDet);
fPad[0] = pp->GetLengthIPad();
fPad[1] = pp->GetWidthIPad();
- fPad[3] = TMath::Tan(TMath::DegToRad()*pp->GetTiltingAngle());
+ fPad[2] = TMath::Tan(TMath::DegToRad()*pp->GetTiltingAngle());
//fSnp = fYref[1]/TMath::Sqrt(1+fYref[1]*fYref[1]);
//fTgl = fZref[1];
Int_t n = 0, nshare = 0, nused = 0;
//optional tilt correction
if(tilt) yc[n] -= (GetTilt()*(zc[n] - zt));
- fitterY.AddPoint(&xc[n], yc[n], TMath::Sqrt(sy[n]));
+ fitterY.AddPoint(&xc[n], yc[n], sy[n]);
if(IsRowCross()) fitterZ.AddPoint(&xc[n], qc[n], 1.);
n++;
}
if (n < kClmin) return kFALSE;
// fit XY
- fitterY.Eval();
+ if(!fitterY.Eval()){
+ SetErrorMsg(kFitFailed);
+ return kFALSE;
+ }
fYfit[0] = fitterY.GetFunctionParameter(0);
fYfit[1] = -fitterY.GetFunctionParameter(1);
// store covariance
Double_t p[3];
fitterY.GetCovarianceMatrix(p);
- fCov[0] = p[0]; // variance of y0
+ fCov[0] = p[1]; // variance of y0
fCov[1] = p[2]; // covariance of y0, dydx
- fCov[2] = p[1]; // variance of dydx
+ fCov[2] = p[0]; // variance of dydx
// the ref radial position is set at the minimum of
// the y variance of the tracklet
fX = -fCov[1]/fCov[2];
+ Float_t xs=fX+.5*AliTRDgeometry::CamHght();
+ if(xs < 0. || xs > AliTRDgeometry::CamHght()+AliTRDgeometry::CdrHght()){
+ AliDebug(1, Form("Ref radial position ouside chamber x[%5.2f].", fX));
+ SetErrorMsg(kFitOutside);
+ return kFALSE;
+ }
// collect second row clusters
Int_t m(0);
AliInfo(Form("Det[%3d] X0[%7.2f] Pad{L[%5.2f] W[%5.2f] Tilt[%+6.2f]}", fDet, fX0, GetPadLength(), GetPadWidth(), GetTilt()));
AliInfo(Form("N[%2d] Nused[%2d] Nshared[%2d] [%d]", GetN(), GetNUsed(), GetNShared(), fN));
AliInfo(Form("FLAGS : RC[%c] Kink[%c] SA[%c]", IsRowCross()?'y':'n', IsKink()?'y':'n', IsStandAlone()?'y':'n'));
+ AliInfo(Form("CALIB PARAMS : T0[%5.2f] Vd[%5.2f] s2PRF[%5.2f] ExB[%5.2f] Dl[%5.2f] Dt[%5.2f]", fT0, fVD, fS2PRF, fExB, fDiffL, fDiffT));
Double_t cov[3], x=GetX();
GetCovAt(x, cov);