// line approximation
//
-
Int_t row=TMath::Nint(x[0]);
Int_t pad=TMath::Nint(x[1]);
Int_t sector=i[0];
}
}
+ //
+ //
+ 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;
+ }
//
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;
// 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]);
}
}
+void AliTPCTransform::ApplyTransformations(Double_t */*xyz*/, Int_t /*volID*/){
+ //
+ // Modify global position
+ // xyz - global xyz position
+ // volID - volID of detector (sector number)
+ //
+ //
+
+}
#include "TFile.h"
#include "TKey.h"
+#include "TGraphErrors.h"
#include "TObjArray.h"
#include "TObjString.h"
#include "AliTPCTempMap.h"
#include "AliTPCCalibVdrift.h"
#include "AliTPCCalibRaw.h"
+#include "AliTPCParam.h"
#include "AliTPCPreprocessorOnline.h"
-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)
//
// 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:
//
// 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)
//
// 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
}