Calib/AliTPCPreprocessorOffline.cxx - Normalize graphs to mean + export robust...
authormivanov <marian.ivanov@cern.ch>
Tue, 10 Dec 2013 21:37:32 +0000 (22:37 +0100)
committermivanov <marian.ivanov@cern.ch>
Tue, 10 Dec 2013 21:37:32 +0000 (22:37 +0100)
Rec/AliTPCseed.cxx                    - Use robust pol2 fits

TPC/Calib/AliTPCPreprocessorOffline.cxx
TPC/Rec/AliTPCseed.cxx

index bab7e45..4c953d2 100644 (file)
@@ -41,7 +41,7 @@
   AliTPCPreprocessorOffline proces;
   proces.CalibTimeGain("TPCMultObjects.root",114000,140040,0);
   TFile oo("OCDB/TPC/Calib/TimeGain/Run114000_121040_v0_s0.root")
-  TObjArray * arr = AliCDBEntry->GetObject()
+ TObjArray * arr = AliCDBEntry->GetObject()
   arr->At(4)->Draw("alp")
 
 */
@@ -1183,6 +1183,8 @@ Bool_t AliTPCPreprocessorOffline::AnalyzeGainDipAngle(Int_t padRegion)  {
   histQtot->FitSlicesY(0,0,-1,0,"QNR",&arrTot);
   TH1D * corrMax = (TH1D*)arrMax.At(1);
   TH1D * corrTot = (TH1D*)arrTot.At(1);
+  corrMax->Scale(1./histQmax->GetMean(2));
+  corrTot->Scale(1./histQtot->GetMean(2));
   //
   const char* names[3]={"SHORT","MEDIUM","LONG"};
   //
@@ -1197,6 +1199,19 @@ Bool_t AliTPCPreprocessorOffline::AnalyzeGainDipAngle(Int_t padRegion)  {
   fGainArray->AddLast(graphMax);
   fGainArray->AddLast(graphTot);
   //
+  TF1 * funMax= new TF1("","1++abs(x)++abs(x*x)");
+  TF1 * funTot= new TF1("","1++abs(x)++abs(x*x)");
+  graphMax->Fit(funMax,"w","rob=0.9",-0.8,0.8);
+  graphTot->Fit(funTot,"w","rob=0.9",-0.8,0.8);
+  funMax->SetNameTitle(Form("TF1_QMAX_DIPANGLE_%s_BEAM_ALL",names[padRegion]),
+                       Form("TF1_QMAX_DIPANGLE_%s_BEAM_ALL",names[padRegion]));
+  funTot->SetNameTitle(Form("TF1_QTOT_DIPANGLE_%s_BEAM_ALL",names[padRegion]),
+                       Form("TF1_QTOT_DIPANGLE_%s_BEAM_ALL",names[padRegion]));
+
+  //
+  fGainArray->AddLast(funMax);
+  fGainArray->AddLast(funTot);
+  //
   return kTRUE;
 }
 
index c26561b..3984364 100644 (file)
@@ -1211,6 +1211,7 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
   TGraphErrors * grPadEqual = 0x0;
   TGraphErrors*  grChamberGain[3]={0x0,0x0,0x0};
   TGraphErrors*  grDipAngle[3]={0x0,0x0,0x0};
+  TGraphErrors*  funDipAngle[3]={0x0,0x0,0x0};
   //
   //
   if (recoParam->GetNeighborRowsDedx() == 0) rowThres = 0;     
@@ -1237,6 +1238,8 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
           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]));
+         if (type==1) funDipAngle[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TF1_QMAX_DIPANGLE_%s_BEAM_ALL",names[iPadRegion]));
+         if (type==0) funDipAngle[iPadRegion]=(TGraphErrors*)timeGainSplines->FindObject(Form("TF1_QTOT_DIPANGLE_%s_BEAM_ALL",names[iPadRegion]));
        }
       }
   }
@@ -1345,7 +1348,8 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
     // dip angle correction
     //
     Float_t corrDipAngle = 1;
-    if (grDipAngle[ipad]) corrDipAngle = grDipAngle[ipad]->Eval(GetTgl());
+    //    if (grDipAngle[ipad]) corrDipAngle = grDipAngle[ipad]->Eval(GetTgl());
+    if (funDipAngle[ipad]) corrDipAngle = funDipAngle[ipad]->Eval(GetTgl());
     //
     // pressure temperature and high voltage correction
     //