From: marian Date: Thu, 11 Jun 2009 21:33:58 +0000 (+0000) Subject: 1. Adding sorting of the Points in point array X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=ddf81107d976e80272f6bc62db037af80b60d7e7;p=u%2Fmrichter%2FAliRoot.git 1. Adding sorting of the Points in point array 2. Adding drift velocity global y scaling --- diff --git a/TPC/AliTPCTransformation.cxx b/TPC/AliTPCTransformation.cxx index 20d3b2eb308..9536c3a4a26 100644 --- a/TPC/AliTPCTransformation.cxx +++ b/TPC/AliTPCTransformation.cxx @@ -71,6 +71,7 @@ Int_t AliTPCTransformation::BuildBasicFormulas(){ 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 @@ -329,6 +330,21 @@ Double_t AliTPCTransformation::TPCscalingZDr(Double_t *xyz, Double_t * param){ 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){ // // @@ -532,51 +548,71 @@ Double_t AliTPCTransformation::TPClocaldRzdGY(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 = (lx0) 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]; } diff --git a/TPC/AliTPCTransformation.h b/TPC/AliTPCTransformation.h index f9f85609cc5..13b208d00d0 100644 --- a/TPC/AliTPCTransformation.h +++ b/TPC/AliTPCTransformation.h @@ -51,6 +51,7 @@ public: static Int_t BuildBasicFormulas(); //build list of basic formulas static Double_t TPCscalingRPol(Double_t *xyz, Double_t * param); static Double_t TPCscalingZDr(Double_t *xyz, Double_t * param); + static Double_t TPCscalingZDrGy(Double_t *xyz, Double_t * param); static Double_t TPCscalingPhiLocal(Double_t *xyz, Double_t * param); // // TPC Field cage + ROC misalingment induced distortion diff --git a/TPC/AliTPCkalmanFit.cxx b/TPC/AliTPCkalmanFit.cxx index c3c7bf5f038..783223e8e4f 100644 --- a/TPC/AliTPCkalmanFit.cxx +++ b/TPC/AliTPCkalmanFit.cxx @@ -713,6 +713,40 @@ void AliTPCkalmanFit::UpdateLinear(AliTrackPoint &point, TTreeSRedirector *debu } +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; ipointAddPoint(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){ // // diff --git a/TPC/AliTPCkalmanFit.h b/TPC/AliTPCkalmanFit.h index 1317830768a..59a38d9161f 100644 --- a/TPC/AliTPCkalmanFit.h +++ b/TPC/AliTPCkalmanFit.h @@ -35,6 +35,7 @@ public: void PropagateTime(Int_t time); void Update(const AliTPCkalmanFit * kalman); + static AliTrackPointArray * SortPoints(AliTrackPointArray &points); static AliTrackPointArray * MakePointArrayLinear(Double_t alpha, Double_t y0, Double_t z0, Double_t ky, Double_t kz, Double_t err=0.02); void ApplyCalibration(AliTrackPointArray *array, Double_t csign); Bool_t CheckCovariance(TMatrixD &covar, Float_t maxEl);