RegisterFormula("TPCscalingROFC",(GenFuncG)(AliTPCTransformation::TPCscalingROFC));
//
RegisterFormula("TPCscalingZDr",(GenFuncG)(AliTPCTransformation::TPCscalingZDr));
+ RegisterFormula("TPCscalingZDrGy",(GenFuncG)(AliTPCTransformation::TPCscalingZDrGy));
RegisterFormula("TPCscalingPhiLocal",(GenFuncG)(AliTPCTransformation::TPCscalingPhiLocal));
//
// TPC Local X and Y misalignment + rotation
return deltaZ*xyz[3];
}
+
+Double_t AliTPCTransformation::TPCscalingZDrGy(Double_t *xyz, Double_t * param){
+ //
+ //
+ // Scaling and shift of TPC radius
+ // xyz[0..2] - global xyz of point
+ // xyz[3] - scale parameter
+ Double_t driftP = TMath::Power(1. - TMath::Abs(xyz[2]/250.), param[0]);
+ Double_t gy = xyz[1]/250.;
+ Double_t deltaZ = (xyz[2]>0) ? -driftP : driftP;
+ return deltaZ*xyz[3]*gy;
+}
+
+
+
Double_t AliTPCTransformation::TPCscalingPhiLocal(Double_t *xyz, Double_t * param){
//
//
}
-Double_t AliTPCTransformation::TPCDeltaZ(Double_t *xyz, Double_t * param){
+
+Double_t AliTPCTransformation::TPCDeltaZMediumLong(Double_t *xyz, Double_t * /*param*/){
//
// xyz - [0..2] - position
// [3] - scale parameter
// [4] - volID
- // return delta in global coordiante system
+ // return delta in global coordinate system
//
Int_t sector = TMath::Nint(xyz[4]);
Double_t signZ = (sector%36<18) ? 1: -1; // drift direction
- return signZ*xyz[3]; // IROC shift
+ if (sector<36) return 0;
+ //
+ const Double_t radiusLong = 198.1;
+ //
+ Double_t alpha = TMath::Pi()*(sector+0.5)/9;
+ Double_t ca = TMath::Cos(alpha);
+ Double_t sa = TMath::Sin(alpha);
+ Double_t lx = xyz[0]*ca + xyz[1]*sa;
+ Double_t sign = (lx<radiusLong) ? 1:-1;
+ return xyz[3]*sign*signZ;
}
-Double_t AliTPCTransformation::TPCDeltaZMediumLong(Double_t *xyz, Double_t * /*param*/){
+Double_t AliTPCTransformation::TPCDeltaZ(Double_t *xyz, Double_t * param){
//
// xyz - [0..2] - position
// [3] - scale parameter
// [4] - volID
- // return delta in global coordinate system
+ // return delta in global coordiante system
//
Int_t sector = TMath::Nint(xyz[4]);
- Double_t signZ = (sector%36<18) ? 1: -1; // drift direction
- if (sector<36) return 0;
+ Double_t delta = (sector%36<18) ? 1: -1; // drift direction
+ Double_t alpha = TMath::Pi()*(sector+0.5)/9;
+ Double_t ca = TMath::Cos(alpha);
+ Double_t sa = TMath::Sin(alpha);
+ Double_t lx = xyz[0]*ca + xyz[1]*sa;
//
- Double_t radius = (TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]));
- const Double_t radiusLong = 198.1;
- Double_t sign = (radius<radiusLong) ? 1:-1;
- return xyz[3]*sign*signZ;
+ const Double_t xIROCOROC = 133.4;
+ if (param[0]>0) delta *= TMath::Cos(param[0]*alpha);
+ if (param[1]>0) delta *= TMath::Sin(param[1]*alpha);
+ if (param[2]>0.5 && lx >xIROCOROC) delta *=-1;
+ return delta*xyz[3]; // IROC shift
}
+
Double_t AliTPCTransformation::TPCTiltingZ(Double_t *xyz, Double_t * param){
// xyz - [0..2] - position
// [3] - scale parameter
// [4] - volID
// param[0] - n for cos
// param[1] - n for sin
+ // param[2] - IROC-ORC relative (if >0.5 )
// return delta in global coordinate system
- Double_t radius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
const Double_t rFirst=85.2;
const Double_t rLast =245.8;
- Double_t radiusC = (rFirst+rLast)*0.5;
- Double_t deltaR = 2.0*(radius-radiusC)/(rLast-rFirst);
- Double_t alpha = TMath::ATan2(xyz[1],xyz[0]);
-
+ const Double_t xIROCOROC = 133.4;
+ //
+ Int_t sector = TMath::Nint(xyz[4]);
+ Double_t alpha = TMath::Pi()*(sector+0.5)/9;
+ Double_t ca = TMath::Cos(alpha);
+ Double_t sa = TMath::Sin(alpha);
+ Double_t lx = xyz[0]*ca + xyz[1]*sa;
+ Double_t deltaR = 2.0*(lx-xIROCOROC)/(rLast-rFirst);
if (param[0]>0) deltaR *= TMath::Cos(param[0]*alpha);
if (param[1]>0) deltaR *= TMath::Sin(param[1]*alpha);
+ if (param[2]>0.5 && lx >xIROCOROC) deltaR *=-1;
return deltaR*xyz[3];
}
}
+AliTrackPointArray * AliTPCkalmanFit::SortPoints(AliTrackPointArray &points){
+ //
+ //Creates the array - points sorted according radius - neccessay for kalman fit
+ //
+ //
+ // 0. choose the frame - rotation angle
+ //
+ Int_t npoints = points.GetNPoints();
+ if (npoints<1) return 0;
+ Double_t currentAlpha = TMath::ATan2(points.GetY()[npoints-1]-points.GetY()[0], points.GetX()[npoints-1]-points.GetX()[0]);
+ Double_t ca = TMath::Cos(currentAlpha);
+ Double_t sa = TMath::Sin(currentAlpha);
+ //
+ // 1. sort the points
+ //
+ Double_t *rxvector = new Double_t[npoints];
+ Int_t *indexes = new Int_t[npoints];
+ for (Int_t ipoint=0; ipoint<npoints-1; ipoint++){
+ rxvector[ipoint]=ca*points.GetX()[ipoint]+sa*points.GetY()[ipoint];
+ }
+ TMath::Sort(npoints, rxvector,indexes,kFALSE);
+ AliTrackPoint point;
+ AliTrackPointArray *pointsSorted= new AliTrackPointArray(npoints);
+ for (Int_t ipoint=0; ipoint<npoints; ipoint++){
+ if (!points.GetPoint(point,indexes[ipoint])) continue;
+ pointsSorted->AddPoint(ipoint,&point);
+ }
+ delete [] rxvector;
+ delete [] indexes;
+ return pointsSorted;
+}
+
+
+
AliTrackPointArray * AliTPCkalmanFit::MakePointArrayLinear(Double_t alpha, Double_t y0, Double_t z0, Double_t ky, Double_t kz, Double_t err){
//
//