]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small modifications on the PID checker task in order to be able to
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 16:49:54 +0000 (16:49 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Jan 2009 16:49:54 +0000 (16:49 +0000)
run the pion efficiency for several electron efficiencies. The standard
post process will still run on 90% electron efficiency, but a function
called from outside may change the electron efficiency threshold for the
calculation. (Markus)

TRD/qaRec/AliTRDpidChecker.cxx
TRD/qaRec/AliTRDpidChecker.h

index a0de83959eab6019e5e6c9680f794769f14a1256..0531685f95823f81de4e4dddd9d8131b55c7c496 100644 (file)
@@ -1049,49 +1049,56 @@ Bool_t AliTRDpidChecker::PostProcess()
     AliError("Efficiency container missing.");
     return 0x0;
   }
-
-  TGraphErrors *g = 0x0;
   if(!fGraph){ 
     fGraph = new TObjArray(6);
     fGraph->SetOwner();
-
-    // efficiency graphs
-    TObjArray *arr = new TObjArray(3); arr->SetOwner();
-    fGraph->AddAt(arr, 0);
-    arr->AddAt(g = new TGraphErrors(), kLQ);
-    g->SetLineColor(kBlue);
-    g->SetMarkerColor(kBlue);
-    g->SetMarkerStyle(7);
-    arr->AddAt(g = new TGraphErrors(), kNN);
-    g->SetLineColor(kGreen);
-    g->SetMarkerColor(kGreen);
-    g->SetMarkerStyle(7);
-    arr -> AddAt(g = new TGraphErrors(), kESD);
-    g->SetLineColor(kRed);
-    g->SetMarkerColor(kRed);
-    g->SetMarkerStyle(24);
-
-    arr = new TObjArray(3); arr->SetOwner();
-    fGraph->AddAt(arr, 1);
-    arr->AddAt(g = new TGraphErrors(), kLQ);
-    g->SetLineColor(kBlue);
-    g->SetMarkerColor(kBlue);
-    g->SetMarkerStyle(7);
-    arr->AddAt(g = new TGraphErrors(), kNN);
-    g->SetLineColor(kGreen);
-    g->SetMarkerColor(kGreen);
-    g->SetMarkerStyle(7);
-    arr -> AddAt(g = new TGraphErrors(), kESD);
-    g->SetLineColor(kRed);
-    g->SetMarkerColor(kRed);
-    g->SetMarkerStyle(24);
+    EvaluatePionEfficiency(fEfficiency, fGraph, 0.9);
   }
+  fNRefFigures = 8;
+  return kTRUE;
+}
 
+//________________________________________________________________________
+void AliTRDpidChecker::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency){
+  TGraphErrors *g = 0x0;
+  fUtil->SetElectronEfficiency(electron_efficiency);
+
+  // efficiency graphs
+  TObjArray *arr = new TObjArray(3); arr->SetOwner();
+  results->AddAt(arr, 0);
+  arr->AddAt(g = new TGraphErrors(), kLQ);
+  g->SetLineColor(kBlue);
+  g->SetMarkerColor(kBlue);
+  g->SetMarkerStyle(7);
+  arr->AddAt(g = new TGraphErrors(), kNN);
+  g->SetLineColor(kGreen);
+  g->SetMarkerColor(kGreen);
+  g->SetMarkerStyle(7);
+  arr -> AddAt(g = new TGraphErrors(), kESD);
+  g->SetLineColor(kRed);
+  g->SetMarkerColor(kRed);
+  g->SetMarkerStyle(24);
+
+  arr = new TObjArray(3); arr->SetOwner();
+  results->AddAt(arr, 1);
+  arr->AddAt(g = new TGraphErrors(), kLQ);
+  g->SetLineColor(kBlue);
+  g->SetMarkerColor(kBlue);
+  g->SetMarkerStyle(7);
+  arr->AddAt(g = new TGraphErrors(), kNN);
+  g->SetLineColor(kGreen);
+  g->SetMarkerColor(kGreen);
+  g->SetMarkerStyle(7);
+  arr -> AddAt(g = new TGraphErrors(), kESD);
+  g->SetLineColor(kRed);
+  g->SetMarkerColor(kRed);
+  g->SetMarkerStyle(24);
+  
   Float_t mom = 0.;
   TH1D *Histo1=0x0, *Histo2=0x0;
 
   // calculate the pion efficiencies and the errors for 90% electron efficiency (2-dim LQ)
-  TH2F *hPIDLQ = (TH2F*)fEfficiency->At(kLQ);
+  TH2F *hPIDLQ = (TH2F*)histoContainer->At(kLQ);
   for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){
     mom = AliTRDCalPID::GetMomentum(iMom);
 
@@ -1112,7 +1119,7 @@ Bool_t AliTRDpidChecker::PostProcess()
   
 
   // calculate the pion efficiencies and the errors for 90% electron efficiency (NN)
-  TH2F *hPIDNN = (TH2F*)fEfficiency->At(kNN);
+  TH2F *hPIDNN = (TH2F*)histoContainer->At(kNN);
   for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){
     mom = AliTRDCalPID::GetMomentum(iMom);
 
@@ -1133,7 +1140,7 @@ Bool_t AliTRDpidChecker::PostProcess()
 
 
   // calculate the pion efficiencies and the errors for 90% electron efficiency (ESD)
-  TH2F *hPIDESD = (TH2F*)fEfficiency->At(kESD);
+  TH2F *hPIDESD = (TH2F*)histoContainer->At(kESD);
   for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){
     mom = AliTRDCalPID::GetMomentum(iMom);
 
@@ -1152,12 +1159,8 @@ Bool_t AliTRDpidChecker::PostProcess()
     if(fDebugLevel>=2) Printf("Pion Efficiency for ESD is : %f +/- %f\n\n", fUtil->GetPionEfficiency(), fUtil->GetError());
   }
 
-  fNRefFigures = 8;
-
-  return kTRUE;
 }
 
-
 //________________________________________________________________________
 void AliTRDpidChecker::Terminate(Option_t *) 
 {
index 57f3e3758d9e0aa3718cfde80356a92b14e800c8..c14a65aeeaf2cead230aac541afdf884bcec8617 100644 (file)
@@ -55,6 +55,7 @@ public:
 
   TObjArray *GetGraphs() { return fGraph; };
   virtual TObjArray *Histos();
+  void EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency);
 
 private:
   AliTRDpidChecker(const AliTRDpidChecker&);               // not implemented