X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCTransform.cxx;h=69618adf81eedda5774e8d63bc1deea711ec273d;hb=1fc8d3c0b7ed03fa096cea25940e7383e08bd469;hp=1c5f129ae3bcad2ea46a61c9ee8d16af52e32dbf;hpb=4486a91f6634f217e8127afee8c7c68eb3bb80f5;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCTransform.cxx b/TPC/AliTPCTransform.cxx index 1c5f129ae3b..69618adf81e 100755 --- a/TPC/AliTPCTransform.cxx +++ b/TPC/AliTPCTransform.cxx @@ -64,6 +64,9 @@ #include "AliTPCRecoParam.h" #include "AliTPCCalibVdrift.h" #include "AliTPCTransform.h" +#include "AliMagF.h" +#include "TGeoGlobalMagField.h" +#include "AliTracker.h" #include ClassImp(AliTPCTransform) @@ -137,7 +140,9 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, // TOF of particle calculated assuming the speed-of-light and // line approximation // - + if (!fCurrentRecoParam) { + return; + } Int_t row=TMath::Nint(x[0]); Int_t pad=TMath::Nint(x[1]); Int_t sector=i[0]; @@ -148,19 +153,23 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, AliTPCCalPad * distortionMapZ = calib->GetDistortionMap(1); AliTPCCalPad * distortionMapR = calib->GetDistortionMap(2); AliTPCParam * param = calib->GetParameters(); - AliTPCCorrection * correction = calib->GetTPCComposedCorrection(); + AliTPCCorrection * correction = calib->GetTPCComposedCorrection(); // first user defined correction // if does not exist try to get it from calibDB array + if (!correction) correction = calib->GetTPCComposedCorrection(AliTracker::GetBz()); if (!time0TPC){ AliFatal("Time unisochronity missing"); + return ; // make coverity happy } + AliTPCCorrection * correctionDelta = calib->GetTPCComposedCorrectionDelta(); if (!param){ AliFatal("Parameters missing"); + return; // make coverity happy } Double_t xx[3]; // Apply Time0 correction - Pad by pad fluctuation - // - x[2]-=time0TPC->GetCalROC(sector)->GetValue(row,pad); + // + if (!calib->HasAlignmentOCDB()) x[2]-=time0TPC->GetCalROC(sector)->GetValue(row,pad); // // Tranform from pad - time coordinate system to the rotated global (tracking) system // @@ -175,7 +184,7 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, // // old ExB correction // - if(fCurrentRecoParam&&fCurrentRecoParam->GetUseExBCorrection()) { + if(fCurrentRecoParam->GetUseExBCorrection()) { calib->GetExB()->Correct(x,xx); @@ -189,19 +198,26 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, // // new composed correction - will replace soon ExB correction // - if(fCurrentRecoParam&&fCurrentRecoParam->GetUseComposedCorrection()&&correction) { + if(fCurrentRecoParam->GetUseComposedCorrection()&&correction) { Float_t distPoint[3]={xx[0],xx[1],xx[2]}; correction->CorrectPoint(distPoint, sector); xx[0]=distPoint[0]; xx[1]=distPoint[1]; xx[2]=distPoint[2]; + if (correctionDelta&&fCurrentRecoParam->GetUseAlignmentTime()){ // appply time dependent correction if available and enabled + Float_t distPointDelta[3]={xx[0],xx[1],xx[2]}; + correctionDelta->CorrectPoint(distPointDelta, sector); + xx[0]=distPointDelta[0]; + xx[1]=distPointDelta[1]; + xx[2]=distPointDelta[2]; + } } // // Time of flight correction // - if (fCurrentRecoParam&&fCurrentRecoParam->GetUseTOFCorrection()){ + if (fCurrentRecoParam->GetUseTOFCorrection()){ const Int_t kNIS=param->GetNInnerSector(), kNOS=param->GetNOuterSector(); Float_t sign=1; if (sector < kNIS) { @@ -231,16 +247,32 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, // Apply non linear distortion correction // if (distortionMapY ){ + // wt - to get it form the OCDB + // ignore T1 and T2 + AliMagF* magF= (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); + Double_t bzField = magF->SolenoidField()/10.; //field in T + Double_t vdrift = param->GetDriftV()/1000000.; // [cm/us] // From dataBase: to be updated: per second (ideally) + Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) + if (sector%36<18) ezField*=-1; + Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; + Double_t c0=1./(1.+wt*wt); + Double_t c1=wt/c0; + //can be switch on for each dimension separatelly if (fCurrentRecoParam->GetUseFieldCorrection()&0x2) - if (distortionMapY) - xx[1]-=distortionMapY->GetCalROC(sector)->GetValue(row,pad); + if (distortionMapY){ + xx[1]-= c0*distortionMapY->GetCalROC(sector)->GetValue(row,pad); + xx[0]-= c1*distortionMapY->GetCalROC(sector)->GetValue(row,pad); + } if (fCurrentRecoParam->GetUseFieldCorrection()&0x4) if (distortionMapZ) xx[2]-=distortionMapZ->GetCalROC(sector)->GetValue(row,pad); if (fCurrentRecoParam->GetUseFieldCorrection()&0x8) - if (distortionMapR) - xx[0]-=distortionMapR->GetCalROC(sector)->GetValue(row,pad); + if (distortionMapR){ + xx[0]-= c0*distortionMapR->GetCalROC(sector)->GetValue(row,pad); + xx[1]-=-c1*distortionMapR->GetCalROC(sector)->GetValue(row,pad)*wt; + } + } // @@ -260,6 +292,7 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { // // // + if (!fCurrentRecoParam) return; const Int_t kMax =60; // cache for 60 seconds static Int_t lastStamp=-1; //cached values static Double_t lastCorr = 1; @@ -284,12 +317,13 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { // // simple caching non thread save static Double_t vdcorrectionTime=1; + static Double_t vdcorrectionTimeGY=0; static Double_t time0corrTime=0; static Int_t lastStampT=-1; // if (lastStampT!=(Int_t)fCurrentTimeStamp){ lastStampT=fCurrentTimeStamp; - if(fCurrentRecoParam&&fCurrentRecoParam->GetUseDriftCorrectionTime()>0) { + if(fCurrentRecoParam->GetUseDriftCorrectionTime()>0) { vdcorrectionTime = (1+AliTPCcalibDB::Instance()-> GetVDriftCorrectionTime(fCurrentTimeStamp, fCurrentRun, @@ -302,22 +336,21 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { fCurrentRecoParam->GetUseDriftCorrectionTime()); } // - if(fCurrentRecoParam&&fCurrentRecoParam->GetUseDriftCorrectionGY()>0) { - Float_t xyzPad[3]; - AliTPCROC::Instance()->GetPositionGlobal(sector, TMath::Nint(x[0]) ,TMath::Nint(x[1]), xyzPad); + if(fCurrentRecoParam->GetUseDriftCorrectionGY()>0) { - Double_t corrGy= (1+(xyzPad[1])*AliTPCcalibDB::Instance()-> + Double_t corrGy= AliTPCcalibDB::Instance()-> GetVDriftCorrectionGy(fCurrentTimeStamp, AliTPCcalibDB::Instance()->GetRun(), sector%36>=18, - fCurrentRecoParam->GetUseDriftCorrectionGY())); - vdcorrectionTime *=corrGy; + fCurrentRecoParam->GetUseDriftCorrectionGY()); + vdcorrectionTimeGY = corrGy; } } if (!param){ AliFatal("Parameters missing"); + return; // make coverity happy } Int_t row=TMath::Nint(x[0]); // Int_t pad=TMath::Nint(x[1]); @@ -325,7 +358,9 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { const Int_t kNIS=param->GetNInnerSector(), kNOS=param->GetNOuterSector(); Double_t sign = 1.; Double_t zwidth = param->GetZWidth()*driftCorr; - if (AliTPCRecoParam:: GetUseTimeCalibration()) zwidth*=vdcorrectionTime; + Float_t xyzPad[3]; + AliTPCROC::Instance()->GetPositionGlobal(sector, TMath::Nint(x[0]) ,TMath::Nint(x[1]), xyzPad); + if (AliTPCRecoParam:: GetUseTimeCalibration()) zwidth*=vdcorrectionTime*(1+xyzPad[1]*vdcorrectionTimeGY); Double_t padWidth = 0; Double_t padLength = 0; Double_t maxPad = 0;