o remove obsolete lines
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2012 00:46:21 +0000 (00:46 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2012 00:46:21 +0000 (00:46 +0000)
o add macro to create a pdf report from the PIDqa output
o add loggin of splines and TPC Response setting

ANALYSIS/AliAnalysisTaskPIDqa.cxx
ANALYSIS/AliAnalysisTaskPIDqa.h
ANALYSIS/TenderSupplies/AddTaskTender.C
ANALYSIS/macros/MakePIDqaReport.C [new file with mode: 0644]

index 5e1d623..bb6aeb1 100644 (file)
@@ -69,7 +69,8 @@ fListQAemcal(0x0),
 fListQAhmpid(0x0),\r
 fListQAtofhmpid(0x0),\r
 fListQAtpctof(0x0),\r
-fListQAV0(0x0)\r
+fListQAV0(0x0),\r
+fListQAinfo(0x0)\r
 {\r
   //\r
   // Dummy constructor\r
@@ -96,7 +97,8 @@ fListQAemcal(0x0),
 fListQAhmpid(0x0),\r
 fListQAtofhmpid(0x0),\r
 fListQAtpctof(0x0),\r
-fListQAV0(0x0)\r
+fListQAV0(0x0),\r
+fListQAinfo(0x0)\r
 {\r
   //\r
   // Default constructor\r
@@ -195,6 +197,10 @@ void AliAnalysisTaskPIDqa::UserCreateOutputObjects()
   fListQAV0=new TList;\r
   fListQAV0->SetOwner();\r
   fListQAV0->SetName("V0decay");\r
+\r
+  fListQAinfo=new TList;\r
+  fListQAinfo->SetOwner();\r
+  fListQAinfo->SetName("QAinfo");\r
   \r
   fListQA->Add(fListQAits);\r
   fListQA->Add(fListQAitsSA);\r
@@ -207,6 +213,7 @@ void AliAnalysisTaskPIDqa::UserCreateOutputObjects()
   fListQA->Add(fListQAtpctof);\r
   fListQA->Add(fListQAtofhmpid);\r
   fListQA->Add(fListQAV0);\r
+  fListQA->Add(fListQAinfo);\r
 \r
   SetupITSqa();\r
   SetupTPCqa();\r
@@ -217,6 +224,7 @@ void AliAnalysisTaskPIDqa::UserCreateOutputObjects()
   SetupTPCTOFqa();\r
   SetupTOFHMPIDqa();\r
   SetupV0qa();\r
+  SetupQAinfo();\r
   \r
   PostData(1,fListQA);\r
 }\r
@@ -249,7 +257,8 @@ void AliAnalysisTaskPIDqa::UserExec(Option_t */*option*/)
   // Clear the V0 PID arrays\r
   ClearV0PIDlist();\r
 \r
-\r
+  //QA info\r
+  FillQAinfo();\r
   \r
   PostData(1,fListQA);\r
 }\r
@@ -939,6 +948,65 @@ void AliAnalysisTaskPIDqa::FillTPCTOFqa()
   }\r
 }\r
 \r
+//_____________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillQAinfo()\r
+{\r
+  //\r
+  // Fill the QA information\r
+  //\r
+\r
+\r
+  //TPC QA info\r
+  TObjArray *arrTPC=static_cast<TObjArray*>(fListQAinfo->At(0));\r
+  if (fPIDResponse && arrTPC){\r
+    AliTPCPIDResponse &tpcResp=fPIDResponse->GetTPCResponse();\r
+    // fill spline names\r
+    if (!arrTPC->UncheckedAt(0)){\r
+      \r
+      TObjArray *arrTPCsplineNames=new TObjArray(AliPID::kSPECIESC);\r
+      arrTPCsplineNames->SetOwner();\r
+      arrTPCsplineNames->SetName("TPC_spline_names");\r
+      arrTPC->AddAt(arrTPCsplineNames,0);\r
+      \r
+      for (Int_t iresp=0; iresp<AliPID::kSPECIESC; ++iresp){\r
+        const TObject *o=tpcResp.GetResponseFunction((AliPID::EParticleType)iresp);\r
+        if (!o) continue;\r
+        arrTPCsplineNames->Add(new TObjString(Form("%02d: %s",iresp, o->GetName())));\r
+      }\r
+    }\r
+\r
+    // tpc response config\r
+    if (!arrTPC->UncheckedAt(1)){\r
+      \r
+      TObjArray *arrTPCconfigInfo=new TObjArray;\r
+      arrTPCconfigInfo->SetOwner();\r
+      arrTPCconfigInfo->SetName("TPC_config_info");\r
+      arrTPC->AddAt(arrTPCconfigInfo,1);\r
+\r
+      TObjString *ostr=0x0;\r
+      ostr=new TObjString;\r
+      ostr->String().Form("Eta Corr map: %s", tpcResp.GetEtaCorrMap()?tpcResp.GetEtaCorrMap()->GetName():"none");\r
+      arrTPCconfigInfo->Add(ostr);\r
+\r
+      ostr=new TObjString;\r
+      ostr->String().Form("Sigma Par map: %s", tpcResp.GetSigmaPar1Map()?tpcResp.GetSigmaPar1Map()->GetName():"none");\r
+      arrTPCconfigInfo->Add(ostr);\r
+\r
+      ostr=new TObjString;\r
+      ostr->String().Form("MIP: %.2f", tpcResp.GetMIP());\r
+      arrTPCconfigInfo->Add(ostr);\r
+      \r
+      ostr=new TObjString;\r
+      ostr->String().Form("Res: Def %.3g (%.3g) : AllHigh %.3g (%.3g) : OROC high %.3g (%.3g)",\r
+                          tpcResp.GetRes0(AliTPCPIDResponse::kDefault), tpcResp.GetResN2(AliTPCPIDResponse::kDefault),\r
+                          tpcResp.GetRes0(AliTPCPIDResponse::kALLhigh), tpcResp.GetResN2(AliTPCPIDResponse::kALLhigh),\r
+                          tpcResp.GetRes0(AliTPCPIDResponse::kOROChigh), tpcResp.GetResN2(AliTPCPIDResponse::kOROChigh)\r
+                         );\r
+      arrTPCconfigInfo->Add(ostr);\r
+    }\r
+  }\r
+}\r
+\r
 //______________________________________________________________________________\r
 void AliAnalysisTaskPIDqa::SetupITSqa()\r
 {\r
@@ -1237,6 +1305,17 @@ void AliAnalysisTaskPIDqa::SetupV0qa()
  \r
 }\r
 \r
+//_____________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupQAinfo(){\r
+  //\r
+  // Setup the info of QA objects\r
+  //\r
+\r
+  TObjArray *arr=new TObjArray;\r
+  arr->SetName("TPC_info");\r
+  fListQAinfo->Add(arr);\r
+}\r
+\r
 //______________________________________________________________________________\r
 TVectorD* AliAnalysisTaskPIDqa::MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)\r
 {\r
index 821fbbd..12e0271 100644 (file)
@@ -1,45 +1,45 @@
-#ifndef ALIANALYSISTASKPIDQA_H
-#define ALIANALYSISTASKPIDQA_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id: AliAnalysisTaskPIDqa.h 43642 2010-09-17 15:50:04Z wiechula $ */
-// Author: Jens Wiechula, 24/02/2011
-
-//==============================================================================
-//
-//
-//
-//
-//==============================================================================
-
-#include <TVectorDfwd.h>
-
-#ifndef ALIANALYSISTASKSE_H
-#include "AliAnalysisTaskSE.h"
-#endif
-
-class AliPIDResponse;
-class TList;
-class AliVEvent;
+#ifndef ALIANALYSISTASKPIDQA_H\r
+#define ALIANALYSISTASKPIDQA_H\r
+\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice                               */\r
+\r
+/* $Id: AliAnalysisTaskPIDqa.h 43642 2010-09-17 15:50:04Z wiechula $ */\r
+// Author: Jens Wiechula, 24/02/2011\r
+\r
+//==============================================================================\r
+//\r
+//\r
+//\r
+//\r
+//==============================================================================\r
+\r
+#include <TVectorDfwd.h>\r
+\r
+#ifndef ALIANALYSISTASKSE_H\r
+#include "AliAnalysisTaskSE.h"\r
+#endif\r
+\r
+class AliPIDResponse;\r
+class TList;\r
+class AliVEvent;\r
 class AliESDv0KineCuts;\r
-
-class AliAnalysisTaskPIDqa : public AliAnalysisTaskSE {
-  
-  
-public:
-  AliAnalysisTaskPIDqa();
-  AliAnalysisTaskPIDqa(const char *name);
-  virtual ~AliAnalysisTaskPIDqa();
-
-  virtual void UserCreateOutputObjects();
-  
-  virtual void UserExec(Option_t */*option*/);
-
-  
-private: 
-  AliPIDResponse *fPIDResponse;             //! PID response Handler
+\r
+class AliAnalysisTaskPIDqa : public AliAnalysisTaskSE {\r
+  \r
+  \r
+public:\r
+  AliAnalysisTaskPIDqa();\r
+  AliAnalysisTaskPIDqa(const char *name);\r
+  virtual ~AliAnalysisTaskPIDqa();\r
+\r
+  virtual void UserCreateOutputObjects();\r
+  \r
+  virtual void UserExec(Option_t */*option*/);\r
+\r
+  \r
+private: \r
+  AliPIDResponse *fPIDResponse;             //! PID response Handler\r
   AliESDv0KineCuts *fV0cuts;                //! ESD V0 cuts\r
 \r
   TObjArray *fV0electrons;                  //! array with pointer to identified particles from V0 decays (electrons)\r
@@ -47,58 +47,61 @@ private:
   TObjArray *fV0kaons;                      //! array with pointer to identified particles from V0 decays (kaons)\r
   TObjArray *fV0protons;                    //! array with pointer to identified particles from V0 decays (ptotons)\r
 \r
-  TList                 *fListQA;           //! list with all QA histograms
-  TList                 *fListQAits;        //! List with ITS QA histograms
-  TList                 *fListQAitsSA;      //! List with ITS SA QA histograms
-  TList                 *fListQAitsPureSA;  //! List with ITS pure SA QA histograms
-  TList                 *fListQAtpc;        //! List with TPC QA histograms
-  TList                 *fListQAtrd;        //! List with TRD QA histograms
-  TList                 *fListQAtof;        //! List with TOF QA histograms
-  TList                 *fListQAemcal;      //! List with EMCAL QA histograms
-  TList                 *fListQAhmpid;      //! List with EMCAL QA histograms
-  TList                 *fListQAtofhmpid;   //! List with EMCAL QA histograms
-  TList                 *fListQAtpctof;     //! List with combined PID from TPC + TOF
+  TList                 *fListQA;           //! list with all QA histograms\r
+  TList                 *fListQAits;        //! List with ITS QA histograms\r
+  TList                 *fListQAitsSA;      //! List with ITS SA QA histograms\r
+  TList                 *fListQAitsPureSA;  //! List with ITS pure SA QA histograms\r
+  TList                 *fListQAtpc;        //! List with TPC QA histograms\r
+  TList                 *fListQAtrd;        //! List with TRD QA histograms\r
+  TList                 *fListQAtof;        //! List with TOF QA histograms\r
+  TList                 *fListQAemcal;      //! List with EMCAL QA histograms\r
+  TList                 *fListQAhmpid;      //! List with EMCAL QA histograms\r
+  TList                 *fListQAtofhmpid;   //! List with EMCAL QA histograms\r
+  TList                 *fListQAtpctof;     //! List with combined PID from TPC + TOF\r
   TList                 *fListQAV0;         //! List with V0 kine cuts QA histograms\r
-
-  
-  void ExecNewRun();
-
-  //qa object initialisation
-  void SetupITSqa();
-  void SetupTPCqa();
-  void SetupTRDqa();
-  void SetupTOFqa();
-  void SetupEMCALqa();
-  void SetupHMPIDqa();
-  void SetupTOFHMPIDqa();
-  void SetupTPCTOFqa();
+  TList                 *fListQAinfo;       //! List with information about loaded splines etc.\r
+\r
+  \r
+  void ExecNewRun();\r
+\r
+  //qa object initialisation\r
+  void SetupITSqa();\r
+  void SetupTPCqa();\r
+  void SetupTRDqa();\r
+  void SetupTOFqa();\r
+  void SetupEMCALqa();\r
+  void SetupHMPIDqa();\r
+  void SetupTOFHMPIDqa();\r
+  void SetupTPCTOFqa();\r
   void SetupV0qa();\r
-
-  //
+  void SetupQAinfo();\r
+\r
+  //\r
   void FillV0PIDlist();\r
   void ClearV0PIDlist();\r
   //\r
-  void FillITSqa();
-  void FillTPCqa();
-  void FillTRDqa();
-  void FillTOFqa();
-  void FillEMCALqa();
-  void FillHMPIDqa();
-  void FillTOFHMPIDqa();
-  void FillTPCTOFqa();
-  
-  //
-  void SetRecoInfo();
-  
-  //helper functions
-  TVectorD* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);
-  TVectorD* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);
-  TVectorD* MakeArbitraryBinning(const char* bins);
-  
-  
-  AliAnalysisTaskPIDqa(const AliAnalysisTaskPIDqa &other);
-  AliAnalysisTaskPIDqa& operator=(const AliAnalysisTaskPIDqa &other);
-  
-  ClassDef(AliAnalysisTaskPIDqa,1)  // Task to properly set the PID response functions of all detectors
-};
-#endif
+  void FillITSqa();\r
+  void FillTPCqa();\r
+  void FillTRDqa();\r
+  void FillTOFqa();\r
+  void FillEMCALqa();\r
+  void FillHMPIDqa();\r
+  void FillTOFHMPIDqa();\r
+  void FillTPCTOFqa();\r
+  void FillQAinfo();\r
+  \r
+  //\r
+  void SetRecoInfo();\r
+  \r
+  //helper functions\r
+  TVectorD* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);\r
+  TVectorD* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);\r
+  TVectorD* MakeArbitraryBinning(const char* bins);\r
+  \r
+  \r
+  AliAnalysisTaskPIDqa(const AliAnalysisTaskPIDqa &other);\r
+  AliAnalysisTaskPIDqa& operator=(const AliAnalysisTaskPIDqa &other);\r
+  \r
+  ClassDef(AliAnalysisTaskPIDqa,1)  // Task to properly set the PID response functions of all detectors\r
+};\r
+#endif\r
index 2831f2b..b4c4262 100644 (file)
@@ -31,8 +31,6 @@ AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE,
   tender->SetDefaultCDBStorage("raw://");
   mgr->AddTask(tender);
   
-  Bool_t cachePID=kFALSE;
-
   //check that that tender is the first task after the pid response
   TString firstName(mgr->GetTasks()->First()->GetName());
   Bool_t isSecond=(mgr->GetTasks()->At(1) == (TObject*)tender);
@@ -42,15 +40,7 @@ AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE,
     return NULL;
   }
   
-  AliAnalysisTaskPIDResponse *pidResp=(AliAnalysisTaskPIDResponse*)mgr->GetTasks()->First();
-  if (pidResp->GetCachePID()){
-    usePID=kTRUE;
-    pidResp->SetCachePID(kFALSE);
-    cachePID=kTRUE;
-  }
-  
   //========= Attach VZERO supply ======
-
   if (useV0) {
      AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
      vzeroSupply->SetDebug(kFALSE);
@@ -128,7 +118,6 @@ AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE,
   //========= Attach PID supply ======
   if (usePID) {
     AliPIDTenderSupply *pidSupply=new AliPIDTenderSupply("PIDtender");
-    pidSupply->SetCachePID(cachePID);
     tender->AddSupply(pidSupply);
   }
 
diff --git a/ANALYSIS/macros/MakePIDqaReport.C b/ANALYSIS/macros/MakePIDqaReport.C
new file mode 100644 (file)
index 0000000..21e06bf
--- /dev/null
@@ -0,0 +1,336 @@
+void SetupStyle();
+TH2* Get2DHistogramfromList(TList *pidqalist, const char* listname, const char* histoname);
+void AddFit(TH2* h2d);
+void PublishCanvas(TList *qaList, const char* det, const char* name, TString nadd="");
+void SetupPadStyle();
+
+void LoadLibs();
+Int_t CheckLoadLibrary(const char* library);
+
+TCanvas *fCanvas=0x0;
+
+/*
+
+Example (require aliroot environment)
+
+root.exe -l -b -q $ALICE_ROOT/ANALYSIS/macros/MakePIDqaReport.C'("PIDqa.root")'
+
+*/
+
+void MakePIDqaReport(const char* inputFile, const char* outputFile="PIDqaReport.pdf")
+{
+  //
+  // Make a pdf file with the efficiency report
+  //
+
+  LoadLibs();
+  SetupStyle();
+
+  TFile f(inputFile);
+  if (!f.IsOpen()){
+    printf("Could not open file '%s'\n",f.GetName())
+    return;
+  }
+
+  TList *qaList = (TList*) f.Get("PIDqa");
+  if (!qaList){
+    printf("Could not fine list 'PIDqa' in file '%s'\n",f.GetName())
+    return;
+  }
+
+  fCanvas=new TCanvas;
+
+  TPDF p(outputFile);
+
+  //
+  // Invariant mass plots
+  //
+
+
+  //
+  // Make QA info
+  //
+
+  // ITS PID
+  PublishCanvas(qaList,"ITS","hNsigmaP_ITS_%s");
+
+  // TPC PID
+  PublishCanvas(qaList,"TPC","hNsigmaP_TPC_%s");
+  //   if (man->GetCurrentPeriod()=="11h"){
+    //     PublishCanvas(qaList,"TPC","hNsigmaP_TPC_%s_Hybrid","Hybrid");
+  //     PublishCanvas(qaList,"TPC","hNsigmaP_TPC_%s_OROChigh","OROChigh");
+  //   }
+
+  // TPC PID after 3 sigma TOF cut
+  PublishCanvas(qaList,"TPC_TOF","hNsigmaP_TPC_TOF_%s");
+
+  // TOF PID
+  PublishCanvas(qaList,"TOF","hNsigmaP_TOF_%s");
+
+  // TRD PID
+  fCanvas->Divide(2,3);
+  TH2 *hLikeP_TRD_3tls_electron=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_3tls_electron");
+  TH2 *hLikeP_TRD_3tls_pion=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_3tls_pion");
+  TH2 *hLikeP_TRD_4tls_electron=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_4tls_electron");
+  TH2 *hLikeP_TRD_4tls_pion=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_4tls_pion");
+  TH2 *hLikeP_TRD_5tls_electron=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_5tls_electron");
+  TH2 *hLikeP_TRD_5tls_pion=Get2DHistogramfromList(qaList,"TRD","hLikeP_TRD_5tls_pion");
+
+  /*
+   *  cTRDnsigma[countcanvas]->cd(1);
+   *  TPaveText pt3TRD(.02,.02,.49,.52);
+   *  pt3TRD.SetTextAlign(11);
+   *  pt3TRD.SetTextSizePixels(16);
+   *  pt3TRD.AddText(Form(" TRD PID QA %s.%s.%d", first.Data(), man->GetCurrentPeriod().Data(), pass));
+   *  pt3TRD.Draw();
+   */
+  fCanvas->cd(1);
+  SetupPadStyle();
+  hLikeP_TRD_3tls_electron->Draw("colz");
+  fCanvas->cd(2);
+  SetupPadStyle();
+  hLikeP_TRD_3tls_pion->Draw("colz");
+  fCanvas->cd(3);
+  SetupPadStyle();
+  hLikeP_TRD_4tls_electron->Draw("colz");
+  fCanvas->cd(4);
+  SetupPadStyle();
+  hLikeP_TRD_4tls_pion->Draw("colz");
+  fCanvas->cd(5);
+  SetupPadStyle();
+  hLikeP_TRD_5tls_electron->Draw("colz");
+  fCanvas->cd(6);
+  SetupPadStyle();
+  hLikeP_TRD_5tls_pion->Draw("colz");
+
+  fCanvas->Update();
+  fCanvas->Clear();
+
+  // TPC Response info
+  TObjArray *qaInfo=(TObjArray*)PIDqa->FindObject("QAinfo");
+  TObjArray *tpcInfo=0x0;
+  if (qaInfo && (tpcInfo=(TObjArray*)qaInfo->FindObject("TPC_info"))){
+    TObjArray *tpcSplineInfo=(TObjArray*)tpcInfo->FindObject("TPC_spline_names");
+    TObjArray *tpcConfigInfo=(TObjArray*)tpcInfo->FindObject("TPC_config_info");
+    fCanvas->Divide(1,2);
+  
+    TPaveText pt(.1,.1,.9,.9,"NDC");
+    pt.SetBorderSize(1);
+    pt.SetFillColor(0);
+    pt.SetTextSizePixels(16);
+
+    if (tpcSplineInfo){
+      for (Int_t i=0; i<tpcSplineInfo->GetEntriesFast();++i) pt.AddText(tpcSplineInfo->At(i)->GetName());
+    }
+    
+    TPaveText pt2(.1,.1,.9,.9,"NDC");
+    pt2.SetBorderSize(1);
+    pt2.SetFillColor(0);
+    pt2.SetTextSizePixels(16);
+    if (tpcConfigInfo){
+      for (Int_t i=0; i<tpcConfigInfo->GetEntriesFast();++i) pt2.AddText(tpcConfigInfo->At(i)->GetName());
+    }
+
+    fCanvas->cd(1);
+    pt.Draw();
+    fCanvas->cd(2);
+    pt2.Draw();
+    
+    fCanvas->Update();
+    fCanvas->Clear();
+  }
+  
+  delete qaList;
+
+  p.Close();
+  delete fCanvas;
+}
+
+void SetupStyle()
+{
+  const Int_t NCont=255;
+
+  TStyle *st = new TStyle("mystyle","mystyle");
+  gROOT->GetStyle("Plain")->Copy((*st));
+  st->SetTitleX(0.1);
+  st->SetTitleW(0.8);
+  st->SetTitleH(0.08);
+  st->SetStatX(.9);
+  st->SetStatY(.9);
+  st->SetNumberContours(NCont);
+  st->SetPalette(1,0);
+  st->SetOptStat("erm");
+  st->SetOptFit(0);
+  st->SetGridColor(kGray+1);
+  st->SetPadGridX(kTRUE);
+  st->SetPadGridY(kTRUE);
+  st->SetPadTickX(kTRUE);
+  st->SetPadTickY(kTRUE);
+  st->cd();
+
+  const Int_t NRGBs = 5;
+  Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
+  Double_t red[NRGBs]   = { 0.00, 0.00, 0.87, 1.00, 0.51 };
+  Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
+  Double_t blue[NRGBs]  = { 0.51, 1.00, 0.12, 0.00, 0.00 };
+
+  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
+
+}
+
+TH2* Get2DHistogramfromList(TList *pidqalist, const char* listname, const char* histoname)
+{
+  TList *histolist = (TList *)pidqalist->FindObject(listname);
+  if (!histolist) {printf(" list not found \n");  return 0x0; }
+  TH2* histo = (TH2*)histolist->FindObject(histoname);
+  //   if (!histo) {printf(" histogram not found \n");  return 0x0; }
+  return histo;
+}
+
+void AddFit(TH2* h2d)
+{
+  //
+  // Fit in slices and draw mean and sigma
+  //
+  TF1 *f1 = new TF1("f1", "gaus");
+  f1->SetRange(-1.5,1.5);
+  TObjArray aSlices;
+  h2d->FitSlicesY(f1, 0,-1, 0, "QNR",&aSlices);
+  aSlices.SetOwner(1);
+  TH1* hMean=(TH1*)aSlices.At(1);
+  TH1* hSigma=(TH1*)aSlices.At(2);
+  TH1* hChi2=(TH1*)aSlices.At(3);
+  hChi2->Scale(1./10.);
+  aSlices.AddAt(0x0,1);
+  aSlices.AddAt(0x0,2);
+  aSlices.AddAt(0x0,3);
+  hMean->SetMarkerStyle(20);
+  hMean->SetMarkerSize(0.3);
+  hMean->SetOption("same");
+  h2d->GetListOfFunctions()->Add(hMean);
+  hSigma->SetMarkerStyle(20);
+  hSigma->SetMarkerSize(0.3);
+  hSigma->SetOption("same");
+  hSigma->SetMarkerColor(kMagenta);
+  h2d->GetListOfFunctions()->Add(hSigma);
+  hChi2->SetOption("same");
+  hChi2->SetMarkerColor(kMagenta + 2);
+  hChi2->SetLineColor(kMagenta + 2);
+  h2d->GetListOfFunctions()->Add(hChi2);
+
+  TLine *l=0x0;
+  l=new TLine(h2d->GetXaxis()->GetXmin(),0,h2d->GetXaxis()->GetXmax(),0);
+  l->SetLineStyle(2);
+  h2d->GetListOfFunctions()->Add(l);
+  l=new TLine(h2d->GetXaxis()->GetXmin(),1,h2d->GetXaxis()->GetXmax(),1);
+  l->SetLineStyle(2);
+  h2d->GetListOfFunctions()->Add(l);
+}
+
+void PublishCanvas(TList *qaList, const char* det, const char* name, TString nadd)
+{
+  //
+  // draw all nSigma + signal histo
+  //
+
+
+  TObjArray arrHistos;
+
+  TPaveText pt(.1,.1,.9,.9,"NDC");
+  pt.SetBorderSize(1);
+  pt.SetFillColor(0);
+  pt.SetTextSizePixels(16);
+  pt.AddText(Form("%s PID QA",det));
+  if (!nadd.IsNull()){
+    pt.AddText(nadd.Data());
+    nadd.Prepend("_");
+  }
+  arrHistos.Add(&pt);
+
+  TH2 *hSig=Get2DHistogramfromList(qaList,det,Form("hSigP_%s",det));
+  if (hSig){
+    hSig->SetOption("colz");
+    arrHistos.Add(hSig);
+  }
+
+  for (Int_t i=0;i<AliPID::kSPECIESC;++i){
+    //     for (Int_t i=0;i<AliPID::kSPECIES;++i){
+    if (i==(Int_t)AliPID::kMuon) continue;
+    TH2 *h=Get2DHistogramfromList(qaList,det,Form(name,AliPID::ParticleName(i)));
+    if (!h) continue;
+    h->SetOption("colz");
+    AddFit(h);
+    arrHistos.Add(h);
+  }
+
+  Int_t nPads=arrHistos.GetEntriesFast();
+  Int_t nCols = (Int_t)TMath::Ceil( TMath::Sqrt(nPads) );
+  Int_t nRows = (Int_t)TMath::Ceil( (Double_t)nPads/(Double_t)nCols );
+
+  
+  fCanvas->Divide(nCols,nRows);
+
+
+  for (Int_t i=0; i<nPads;++i) {
+    fCanvas->cd(i+1);
+    arrHistos.At(i)->Draw();
+  }
+
+  fCanvas->Update();
+  fCanvas->Clear();
+
+}
+
+void SetupPadStyle()
+{
+  gPad->SetLogx();
+  gPad->SetLogz();
+  gPad->SetGridx();
+  gPad->SetGridy();
+  gPad->SetTickx();
+  gPad->SetTicky();
+}
+
+void LoadLibs()
+{
+  CheckLoadLibrary("libCore");
+  CheckLoadLibrary("libPhysics");
+  CheckLoadLibrary("libMinuit");
+  CheckLoadLibrary("libGui");
+  CheckLoadLibrary("libXMLParser");
+  
+  CheckLoadLibrary("libGeom");
+  CheckLoadLibrary("libVMC");
+  
+  CheckLoadLibrary("libNet");
+  CheckLoadLibrary("libTree");
+  CheckLoadLibrary("libProof");
+  
+  CheckLoadLibrary("libSTEERBase");
+  CheckLoadLibrary("libESD");
+  CheckLoadLibrary("libCDB");
+  CheckLoadLibrary("libRAWDatabase");
+  CheckLoadLibrary("libRAWDatarec");
+  CheckLoadLibrary("libANALYSIS");
+  CheckLoadLibrary("libSTEER");
+  
+  CheckLoadLibrary("libSTAT");
+  
+  CheckLoadLibrary("libAOD");
+  CheckLoadLibrary("libOADB");
+  CheckLoadLibrary("libANALYSISalice");
+  CheckLoadLibrary("libCORRFW");
+  
+  
+  CheckLoadLibrary("libTPCbase");
+}
+
+Int_t CheckLoadLibrary(const char* library)
+{
+  // checks if a library is already loaded, if not loads the library
+  
+  if (strlen(gSystem->GetLibraries(Form("%s.so", library), "", kFALSE)) > 0)
+    return 1;
+  
+  return gSystem->Load(library);
+}