Warnig removal
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Oct 2009 03:24:40 +0000 (03:24 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Oct 2009 03:24:40 +0000 (03:24 +0000)
Update implementation of drift and Time 0 correction
AliTPCTransform.cxx .h - forgotten commit

TPC/AliTPCTransform.cxx
TPC/AliTPCTransform.h
TPC/AliTPCcalibDB.cxx
TPC/AliTPCcalibDB.h

index 7027354..8877982 100755 (executable)
@@ -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)
+  //
+  //
+  
+}
index 5a675a5..e1f7d58 100755 (executable)
@@ -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
index 2382ac4..3b585a1 100644 (file)
@@ -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
 }
index 7c6aa9e..dda2a43 100644 (file)
@@ -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);
   //