From: marian Date: Fri, 16 Oct 2009 03:24:40 +0000 (+0000) Subject: Warnig removal X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=43a74775d21df10427b96c24cda683c576d2131e;p=u%2Fmrichter%2FAliRoot.git Warnig removal Update implementation of drift and Time 0 correction AliTPCTransform.cxx .h - forgotten commit --- diff --git a/TPC/AliTPCTransform.cxx b/TPC/AliTPCTransform.cxx index 702735485f7..8877982cdfc 100755 --- a/TPC/AliTPCTransform.cxx +++ b/TPC/AliTPCTransform.cxx @@ -136,7 +136,6 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/, // line approximation // - Int_t row=TMath::Nint(x[0]); Int_t pad=TMath::Nint(x[1]); Int_t sector=i[0]; @@ -246,6 +245,35 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { } } + // + // + Double_t vdcorrectionTime=1; + Double_t time0corrTime=0; + // + if(fCurrentRecoParam&&fCurrentRecoParam->GetUseDriftCorrectionTime()>0) { + vdcorrectionTime = (1+AliTPCcalibDB::Instance()-> + GetVDriftCorrectionTime(fCurrentTimeStamp, + AliTPCcalibDB::Instance()->GetRun(), + sector%36>=18, + fCurrentRecoParam->GetUseDriftCorrectionTime())); + time0corrTime= AliTPCcalibDB::Instance()-> + GetTime0CorrectionTime(fCurrentTimeStamp, + AliTPCcalibDB::Instance()->GetRun(), + sector%36>=18, + fCurrentRecoParam->GetUseDriftCorrectionTime()); + } + // + if(fCurrentRecoParam&&fCurrentRecoParam->GetUseDriftCorrectionGY()>0) { + Float_t xyzPad[3]; + AliTPCROC::Instance()->GetPositionGlobal(sector, TMath::Nint(x[0]) ,TMath::Nint(x[1]), xyzPad); + + Double_t corrGy= (1+(xyzPad[1])*AliTPCcalibDB::Instance()-> + GetVDriftCorrectionGy(fCurrentTimeStamp, + AliTPCcalibDB::Instance()->GetRun(), + sector%36>=18, + fCurrentRecoParam->GetUseDriftCorrectionGY())); + vdcorrectionTime *=corrGy; + } @@ -257,7 +285,7 @@ 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; + Double_t zwidth = param->GetZWidth()*driftCorr*vdcorrectionTime; Double_t padWidth = 0; Double_t padLength = 0; Double_t maxPad = 0; @@ -291,7 +319,7 @@ void AliTPCTransform::Local2RotatedGlobal(Int_t sector, Double_t *x) const { // Z coordinate // x[2]*= zwidth; // tranform time bin to the distance to the ROC - x[2]-= 3.*param->GetZSigma() + param->GetNTBinsL1()*zwidth; + x[2]-= 3.*param->GetZSigma() + param->GetNTBinsL1()*zwidth+ time0corrTime; // subtract the time offsets x[2] = sign*( param->GetZLength(sector) - x[2]); } @@ -325,3 +353,12 @@ void AliTPCTransform::GetCosAndSin(Int_t sector,Double_t &cos, } +void AliTPCTransform::ApplyTransformations(Double_t */*xyz*/, Int_t /*volID*/){ + // + // Modify global position + // xyz - global xyz position + // volID - volID of detector (sector number) + // + // + +} diff --git a/TPC/AliTPCTransform.h b/TPC/AliTPCTransform.h index 5a675a5e430..e1f7d589654 100755 --- a/TPC/AliTPCTransform.h +++ b/TPC/AliTPCTransform.h @@ -39,6 +39,7 @@ public: void SetCurrentRecoParam(AliTPCRecoParam* param){fCurrentRecoParam=param;} void SetCurrentRun(Int_t run){fCurrentRun=run;} void SetCurrentTimeStamp(Int_t timeStamp){fCurrentTimeStamp=timeStamp;} + void ApplyTransformations(Double_t *xyz, Int_t volID); private: AliTPCTransform& operator=(const AliTPCTransform&); // not implemented Double_t fCoss[18]; // cache the transformation diff --git a/TPC/AliTPCcalibDB.cxx b/TPC/AliTPCcalibDB.cxx index 2382ac4ba3e..3b585a1cbf4 100644 --- a/TPC/AliTPCcalibDB.cxx +++ b/TPC/AliTPCcalibDB.cxx @@ -103,6 +103,7 @@ class AliTPCCalDet; #include "TFile.h" #include "TKey.h" +#include "TGraphErrors.h" #include "TObjArray.h" #include "TObjString.h" @@ -116,6 +117,7 @@ class AliTPCCalDet; #include "AliTPCTempMap.h" #include "AliTPCCalibVdrift.h" #include "AliTPCCalibRaw.h" +#include "AliTPCParam.h" #include "AliTPCPreprocessorOnline.h" @@ -1556,7 +1558,7 @@ Bool_t AliTPCcalibDB::CreateRefFile(Int_t run, const char* filename) -Double_t AliTPCcalibDB::GetVDriftCorrectionTime(Int_t timeStamp, Int_t run, Int_t side, Int_t mode){ +Double_t AliTPCcalibDB::GetVDriftCorrectionTime(Int_t timeStamp, Int_t run, Int_t side, Int_t /*mode*/){ // // Get time dependent drift velocity correction // multiplication factor vd = vdnom *(1+vdriftcorr) @@ -1568,12 +1570,26 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionTime(Int_t timeStamp, Int_t run, Int_ // // Notice - Extrapolation outside of calibration range - using constant function // - return 0; + TObjArray *array =AliTPCcalibDB::Instance()->GetTimeVdriftSplineRun(run); + TGraphErrors *laserA= (TGraphErrors*)array->FindObject("GRAPH_MEAN_DRIFT_LASER_ALL_A"); + TGraphErrors *laserC= (TGraphErrors*)array->FindObject("GRAPH_MEAN_DRIFT_LASER_ALL_C"); + + Double_t result=0; + if (laserA && laserC){ + result= (laserA->Eval(timeStamp)+laserC->Eval(timeStamp))*0.5; + } + if (laserA && side==0){ + result = (laserA->Eval(timeStamp)); + } + if (laserC &&side==1){ + result = (laserC->Eval(timeStamp)); + } + return result; } -Double_t AliTPCcalibDB::GetTime0CorrectionTime(Int_t timeStamp, Int_t run, Int_t side, Int_t mode){ +Double_t AliTPCcalibDB::GetTime0CorrectionTime(Int_t timeStamp, Int_t run, Int_t side, Int_t /*mode*/){ // - // Get time dependent time 0 (trigger delay) correction + // Get time dependent time 0 (trigger delay in cm) correction // additive correction time0 = time0+ GetTime0CorrectionTime // Value etracted combining the vdrift correction using laser tracks and CE and the physics track matchin // Arguments: @@ -1584,13 +1600,34 @@ Double_t AliTPCcalibDB::GetTime0CorrectionTime(Int_t timeStamp, Int_t run, Int_t // // Notice - Extrapolation outside of calibration range - using constant function // + TObjArray *array =AliTPCcalibDB::Instance()->GetTimeVdriftSplineRun(run); + TGraphErrors *laserA= (TGraphErrors*)array->FindObject("GRAPH_MEAN_DRIFT_LASER_ALL_A"); + TGraphErrors *laserC= (TGraphErrors*)array->FindObject("GRAPH_MEAN_DRIFT_LASER_ALL_C"); + + Double_t lresult=0; + if (laserA && laserC){ + lresult= (laserA->Eval(timeStamp)+laserC->Eval(timeStamp))*0.5; + } + if (laserA && side==0){ + lresult = (laserA->Eval(timeStamp)); + } + if (laserC &&side==1){ + lresult = (laserC->Eval(timeStamp)); + } + TGraphErrors *cosmic =(TGraphErrors*)array->FindObject("TGRAPHERRORS_MEAN_VDRIFT_COSMICS_ALL"); + if (cosmic){ + Double_t cresult =cosmic->Eval(timeStamp); + Double_t result =(cresult-result)*fParam->GetZLength(); + return result; + } return 0; + } -Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t side, Int_t mode){ +Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t side, Int_t /*mode*/){ // // Get global y correction drift velocity correction factor // additive factor vd = vdnom*(1+GetVDriftCorrectionGy *gy) @@ -1603,5 +1640,19 @@ Double_t AliTPCcalibDB::GetVDriftCorrectionGy(Int_t timeStamp, Int_t run, Int_t // // Notice - Extrapolation outside of calibration range - using constant function // - return 0; + TObjArray *array =AliTPCcalibDB::Instance()->GetTimeVdriftSplineRun(run); + TGraphErrors *laserA= (TGraphErrors*)array->FindObject("GRAPH_MEAN_GLOBALYGRADIENT_LASER_ALL_A"); + TGraphErrors *laserC= (TGraphErrors*)array->FindObject("GRAPH_MEAN_GLOBALYGRADIENT_LASER_ALL_C"); + + Double_t result=0; + if (laserA && laserC){ + result= (laserA->Eval(timeStamp)+laserC->Eval(timeStamp))*0.5; + } + if (laserA && side==0){ + result = (laserA->Eval(timeStamp)); + } + if (laserC &&side==1){ + result = (laserC->Eval(timeStamp)); + } + return -result/250.; //normalized before } diff --git a/TPC/AliTPCcalibDB.h b/TPC/AliTPCcalibDB.h index 7c6aa9ecf2c..dda2a4367ed 100644 --- a/TPC/AliTPCcalibDB.h +++ b/TPC/AliTPCcalibDB.h @@ -123,7 +123,7 @@ class AliTPCcalibDB : public TObject AliDCSSensorArray * GetGoofieSensors(Int_t run); AliDCSSensorArray * GetVoltageSensors(Int_t run); AliTPCCalibVdrift * GetVdrift(Int_t run); - TObjArray * GetTimeGainSplinesRun(Int_t run); + TObjArray * GetTimeGainSplinesRun(Int_t run); TObjArray* GetTimeVdriftSplineRun(Int_t run); static Float_t GetGain(Int_t sector, Int_t row, Int_t pad); //