- fZfit[1] = (fZfit[0]+zoff)/dx;
- if(!IsRowCross()) fZfit[1] *= 1.09;
- // compute local z @ anode wire
- //fZfit[0]+= fZfit[1]*fS2Y;
-// printf("EstimatedCrossPoint : zoff[%f]\n", zoff);
-// fS2Z = 0.05+0.4*TMath::Abs(fZfit[1]);
- Float_t s2dzdx(0.0245-0.0014*fZfit[1]+0.0557*fZfit[1]*fZfit[1]); s2dzdx*=s2dzdx;
- fS2Z = fZfit[1]*fZfit[1]*sx*sx+fS2Y*fS2Y*s2dzdx;
-
- return fS2Y;
+ fZfit[1] = (fZfit[0]+zoff)/dx;
+
+ // correct dzdx for the bias
+ UnbiasDZDX(IsRowCross());
+ if(IsRowCross()){
+ // correct x_cross/sigma(x_cross) for the bias in dzdx
+ const AliTRDrecoParam* const recoParam = fkReconstructor->GetRecoParam();
+ if(recoParam){
+ fS2Y += recoParam->GetCorrDZDXxcross()*TMath::Abs(fZfit[1]);
+ sx += recoParam->GetCorrDZDXxcross()*recoParam->GetCorrDZDXxcross()*GetS2DZDX(fZfit[1]);
+ }
+ // correct sigma(x_cross) for the width of the crossing area
+ sx += GetS2XcrossDZDX(TMath::Abs(fZfit[1]));
+
+ // estimate z and error @ anode wire
+ fZfit[0] += fZfit[1]*fS2Y;
+ fS2Z = fZfit[1]*fZfit[1]*sx+fS2Y*fS2Y*GetS2DZDX(fZfit[1]);
+ }
+ return sx;
+}
+
+//____________________________________________________________________
+void AliTRDseedV1::UnbiasDZDX(Bool_t rc)
+{
+ // correct dzdx for the bias in z according to MC
+ const AliTRDrecoParam* const recoParam = fkReconstructor->GetRecoParam();
+ if(!recoParam) return;
+ fZfit[1] *= recoParam->GetCorrDZDX(rc);
+ if(rc) fZfit[1] += recoParam->GetCorrDZDXbiasRC(fZfit[1]<0);
+}
+
+//____________________________________________________________________
+Double_t AliTRDseedV1::UnbiasY(Bool_t rc, Bool_t sgn, Int_t chg)
+{
+// correct y coordinate for tail cancellation. This should be fixed by considering TC as a function of q/pt.
+// rc : TRUE if tracklet crosses rows
+// sgn : TRUE if track has same sign with magnetic field
+// chg : -1 for negative particles, +1 for the rest
+
+ const AliTRDrecoParam* const recoParam = fkReconstructor->GetRecoParam();
+ if(!recoParam) return 0.;
+ Double_t par[2]={0.};
+ if(rc) recoParam->GetYcorrTailCancel(2, par);
+ else{
+ if(sgn && 1./fPt > 1.5) recoParam->GetYcorrTailCancel(1, par);
+ else if(!sgn) recoParam->GetYcorrTailCancel(0, par);
+ }
+ return par[0]+par[1]*chg/fPt;