]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/Rec/AliTPCseed.cxx
added changes from Alex Kalweit - dip angle correction in dedx
[u/mrichter/AliRoot.git] / TPC / Rec / AliTPCseed.cxx
index e9a7e01f67c6add18379a0cc2979bb2f4493ed25..c26561b9bd55e4b829fe6f89503252555341abb8 100644 (file)
@@ -1210,6 +1210,7 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
   TObjArray * timeGainSplines = 0x0;
   TGraphErrors * grPadEqual = 0x0;
   TGraphErrors*  grChamberGain[3]={0x0,0x0,0x0};
+  TGraphErrors*  grDipAngle[3]={0x0,0x0,0x0};
   //
   //
   if (recoParam->GetNeighborRowsDedx() == 0) rowThres = 0;     
@@ -1232,8 +1233,11 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
        if (type==1) grPadEqual = (TGraphErrors * ) timeGainSplines->FindObject("TGRAPHERRORS_MEANQMAX_PADREGIONGAIN_BEAM_ALL");
        if (type==0) grPadEqual = (TGraphErrors * ) timeGainSplines->FindObject("TGRAPHERRORS_MEANQTOT_PADREGIONGAIN_BEAM_ALL");
         const char* names[3]={"SHORT","MEDIUM","LONG"};
-        for (Int_t iPadRegion=0; iPadRegion<3; ++iPadRegion)
+        for (Int_t iPadRegion=0; iPadRegion<3; ++iPadRegion) {
           grChamberGain[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TGRAPHERRORS_MEAN_CHAMBERGAIN_%s_BEAM_ALL",names[iPadRegion]));
+         if (type==1) grDipAngle[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TGRAPHERRORS_QMAX_DIPANGLE_%s_BEAM_ALL",names[iPadRegion]));
+         if (type==0) grDipAngle[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TGRAPHERRORS_QTOT_DIPANGLE_%s_BEAM_ALL",names[iPadRegion]));
+       }
       }
   }
   
@@ -1338,7 +1342,12 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
       if (gainChamber==0) gainChamber=1; // in case old calibation was used before use no correction
     }
     //
+    // dip angle correction
+    //
+    Float_t corrDipAngle = 1;
+    if (grDipAngle[ipad]) corrDipAngle = grDipAngle[ipad]->Eval(GetTgl());
     //
+    // pressure temperature and high voltage correction
     //
     Double_t correctionHVandPT = AliTPCcalibDB::Instance()->GetGainCorrectionHVandPT(time, runNumber,cluster->GetDetector(), 5 , recoParam->GetGainCorrectionHVandPTMode());
     //
@@ -1349,6 +1358,7 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
     amp[ncl]/=corrPos;
     amp[ncl]/=gainEqualPadRegion;
     amp[ncl]/=gainChamber;
+    amp[ncl]/=corrDipAngle;
     //
     ncl++;
   }