X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=TPC%2FAliTPCCorrection.cxx;h=a1262bfed1694059d4a4c355819c67ef183b7930;hp=a88eb2a158e1ac97f6f741229f70ba4062ac1883;hb=b1f0a2a55d72ef9a5834950f7793efb30a41cc1e;hpb=534fd34a78064d8c2ef7b76af402185b9bd59304 diff --git a/TPC/AliTPCCorrection.cxx b/TPC/AliTPCCorrection.cxx index a88eb2a158e..a1262bfed16 100644 --- a/TPC/AliTPCCorrection.cxx +++ b/TPC/AliTPCCorrection.cxx @@ -51,11 +51,13 @@ #include #include +#include "TRandom.h" #include "AliExternalTrackParam.h" #include "AliTrackPointArray.h" #include "TDatabasePDG.h" #include "AliTrackerBase.h" #include "AliTPCROC.h" +#include "THnSparse.h" #include "AliTPCCorrection.h" @@ -63,7 +65,7 @@ ClassImp(AliTPCCorrection) // FIXME: the following values should come from the database -const Double_t AliTPCCorrection::fgkTPC_Z0 =249.7; // nominal gating grid position +const Double_t AliTPCCorrection::fgkTPCZ0 =249.7; // nominal gating grid position const Double_t AliTPCCorrection::fgkIFCRadius= 83.06; // Mean Radius of the Inner Field Cage ( 82.43 min, 83.70 max) (cm) const Double_t AliTPCCorrection::fgkOFCRadius=254.5; // Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm) const Double_t AliTPCCorrection::fgkZOffSet = 0.2; // Offset from CE: calculate all distortions closer to CE as if at this point @@ -389,12 +391,11 @@ TH2F* AliTPCCorrection::CreateTH2F(const char *name,const char *title, // Simple Interpolation functions: e.g. with bi(tri)cubic interpolations (not yet in TH2 and TH3) void AliTPCCorrection::Interpolate2DEdistortion( const Int_t order, const Double_t r, const Double_t z, - const Double_t er[kNZ][kNR], Double_t &er_value ) -{ + const Double_t er[kNZ][kNR], Double_t &erValue ) { // // Interpolate table - 2D interpolation // - Double_t save_er[10] ; + Double_t saveEr[10] ; Search( kNZ, fgkZList, z, fJLow ) ; Search( kNR, fgkRList, r, fKLow ) ; @@ -404,16 +405,15 @@ void AliTPCCorrection::Interpolate2DEdistortion( const Int_t order, const Double if ( fKLow + order >= kNR - 1 ) fKLow = kNR - 1 - order ; for ( Int_t j = fJLow ; j < fJLow + order + 1 ; j++ ) { - save_er[j-fJLow] = Interpolate( &fgkRList[fKLow], &er[j][fKLow], order, r ) ; + saveEr[j-fJLow] = Interpolate( &fgkRList[fKLow], &er[j][fKLow], order, r ) ; } - er_value = Interpolate( &fgkZList[fJLow], save_er, order, z ) ; + erValue = Interpolate( &fgkZList[fJLow], saveEr, order, z ) ; } Double_t AliTPCCorrection::Interpolate( const Double_t xArray[], const Double_t yArray[], - const Int_t order, const Double_t x ) -{ + const Int_t order, const Double_t x ) { // // Interpolate function Y(x) using linear (order=1) or quadratic (order=2) interpolation. // @@ -432,8 +432,7 @@ Double_t AliTPCCorrection::Interpolate( const Double_t xArray[], const Double_t } -void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low ) -{ +void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low ) { // // Search an ordered table by starting at the most recently used point // @@ -481,7 +480,7 @@ void AliTPCCorrection::Search( const Int_t n, const Double_t xArray[], const Dou } -AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackParam & trackIn, Double_t refX, Int_t dir,TTreeSRedirector *pcstream){ +AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackParam & trackIn, Double_t refX, Int_t dir, TTreeSRedirector * const pcstream){ // // Fit the track parameters - without and with distortion // 1. Space points in the TPC are simulated along the trajectory @@ -515,14 +514,16 @@ AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackPara AliTrackPointArray pointArray0(npoints0); AliTrackPointArray pointArray1(npoints0); Double_t xyz[3]; - AliTrackerBase::PropagateTrackTo(&track,kRTPC0,kMass,3,kTRUE,kMaxSnp); + AliTrackerBase::PropagateTrackToBxByBz(&track,kRTPC0,kMass,3,kTRUE,kMaxSnp); // // simulate the track Int_t npoints=0; Float_t covPoint[6]={0,0,0, kSigmaY*kSigmaY,0,kSigmaZ*kSigmaZ}; //covariance at the local frame for (Double_t radius=kRTPC0; radiusGaus(0,0.001); + xyz[1]+=gRandom->Gaus(0,0.001); AliTrackPoint pIn0; // space point AliTrackPoint pIn1; Int_t sector= (xyz[2]>0)? 0:18; @@ -554,12 +555,12 @@ AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackPara AliTrackPoint point1,point2,point3; if (dir==1) { //make seed inner pointArray0.GetPoint(point1,1); - pointArray0.GetPoint(point2,10); - pointArray0.GetPoint(point3,20); + pointArray0.GetPoint(point2,30); + pointArray0.GetPoint(point3,60); } if (dir==-1){ //make seed outer - pointArray0.GetPoint(point1,npoints-20); - pointArray0.GetPoint(point2,npoints-10); + pointArray0.GetPoint(point1,npoints-60); + pointArray0.GetPoint(point2,npoints-30); pointArray0.GetPoint(point3,npoints-1); } track0 = AliTrackerBase::MakeSeed(point1, point2, point3); @@ -567,7 +568,7 @@ AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackPara for (Int_t jpoint=0; jpoint0) ? ipoint: npoints-1-jpoint; + Int_t ipoint= (dir>0) ? jpoint: npoints-1-jpoint; // AliTrackPoint pIn0; AliTrackPoint pIn1; @@ -576,9 +577,9 @@ AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackPara AliTrackPoint prot0 = pIn0.Rotate(track0->GetAlpha()); // rotate to the local frame - non distoted point AliTrackPoint prot1 = pIn1.Rotate(track1->GetAlpha()); // rotate to the local frame - distorted point // - AliTrackerBase::PropagateTrackTo(track0,prot0.GetX(),kMass,1,kFALSE,kMaxSnp); - AliTrackerBase::PropagateTrackTo(track1,prot1.GetX(),kMass,1,kFALSE,kMaxSnp); - track.GetXYZ(xyz); + AliTrackerBase::PropagateTrackToBxByBz(track0,prot0.GetX(),kMass,3,kFALSE,kMaxSnp); + AliTrackerBase::PropagateTrackToBxByBz(track1,prot0.GetX(),kMass,3,kFALSE,kMaxSnp); + track.GetXYZ(xyz); // distorted track also propagated to the same reference radius // Double_t pointPos[2]={0,0}; Double_t pointCov[3]={0,0,0}; @@ -589,15 +590,19 @@ AliExternalTrackParam * AliTPCCorrection::FitDistortedTrack(AliExternalTrackPara pointCov[2]=prot0.GetCov()[5];//sigmaz^2 track0->Update(pointPos,pointCov); // - pointPos[0]=prot1.GetY();//local y - pointPos[1]=prot1.GetZ();//local z + Double_t deltaX=prot1.GetX()-prot0.GetX(); // delta X + Double_t deltaYX=deltaX*TMath::Tan(TMath::ASin(track1->GetSnp())); // deltaY due delta X + Double_t deltaZX=deltaX*track1->GetTgl(); // deltaZ due delta X + + pointPos[0]=prot1.GetY()-deltaYX;//local y + pointPos[1]=prot1.GetZ()-deltaZX;//local z pointCov[0]=prot1.GetCov()[3];//simay^2 pointCov[1]=prot1.GetCov()[4];//sigmayz pointCov[2]=prot1.GetCov()[5];//sigmaz^2 track1->Update(pointPos,pointCov); } - AliTrackerBase::PropagateTrackTo(track0,refX,kMass,2.,kTRUE,kMaxSnp); + AliTrackerBase::PropagateTrackToBxByBz(track0,refX,kMass,2.,kTRUE,kMaxSnp); track1->Rotate(track0->GetAlpha()); track1->PropagateTo(track0->GetX(),AliTrackerBase::GetBz()); @@ -680,7 +685,7 @@ TTree* AliTPCCorrection::CreateDistortionTree(Double_t step){ -void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, TObjArray * corrArray, Int_t step, Bool_t debug ){ +void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, const TObjArray * corrArray, Int_t step, Bool_t debug ){ // // Make a fit tree: // For each partial correction (specified in array) and given track topology (phi, theta, snp, refX) @@ -697,6 +702,9 @@ void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t // corrArray - array with partial corrections // step - skipe entries - if 1 all entries processed - it is slow // debug 0 if debug on also space points dumped - it is slow + const Double_t kMaxSnp = 0.85; + const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass(); + // const Double_t kB2C=-0.299792458e-3; const Int_t kMinEntries=50; Double_t phi,theta, snp, mean,rms, entries; tinput->SetBranchAddress("theta",&theta); @@ -715,8 +723,8 @@ void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t Double_t refX=0; Int_t dir=0; if (dtype==0) {refX=85; dir=-1;} - if (dtype==1) {refX=245; dir=1;} - if (dtype==2) {refX=0; dir=-1;} + if (dtype==1) {refX=275; dir=1;} + if (dtype==2) {refX=85; dir=-1;} // for (Int_t ientry=0; ientryGetEntry(ientry); @@ -724,20 +732,13 @@ void AliTPCCorrection::MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t tPar[1]=theta*refX; tPar[2]=snp; tPar[3]=theta; - tPar[4]=0.00001; // should be calculated - non equal to 0 - cout<