Physics selection QA
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Jun 2011 12:13:30 +0000 (12:13 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Jun 2011 12:13:30 +0000 (12:13 +0000)
A. Ortiz

PWG1/macros/PhysSel/DefinePlots.h [new file with mode: 0644]
PWG1/macros/PhysSel/PlotQAPhysicsSelection.C [new file with mode: 0644]
PWG1/macros/PhysSel/QALHC11c_QA69.h [new file with mode: 0644]
PWG1/macros/PhysSel/rct.dat [new file with mode: 0644]
PWG1/macros/PhysSel/read.C [new file with mode: 0644]

diff --git a/PWG1/macros/PhysSel/DefinePlots.h b/PWG1/macros/PhysSel/DefinePlots.h
new file mode 100644 (file)
index 0000000..97331be
--- /dev/null
@@ -0,0 +1,280 @@
+enum {
+  kGraphACCOverAllAC,
+  kGraphACCOverAllACS2,
+  kGraphACCOverAllSMH,
+
+  kGraphACCOverAllACRej,
+  kGraphACCOverAllACS2Rej,
+  kGraphACCOverAllSMHRej,
+
+  kGraphV0BGOverAllAC,
+  kGraphV0BGOverAllAC2,
+  kGraphV0BGOverAllSMH,
+
+  kGraphV0BGOverAllACRej,
+  kGraphV0BGOverAllAC2Rej,
+  kGraphV0BGOverAllSMHRej,
+
+
+  kGraphNevAC,
+  kGraphNevAC2, 
+  kGraphNevSMH,
+
+  kGraphNevACBefore, 
+  kGraphNevAC2Before,
+  kGraphNevSMHBefore,
+
+  kGraphNevACAfter, 
+  kGraphNevAC2After,
+  kGraphNevSMHAfter,
+
+  kGraphNevACratioAfter, 
+  kGraphNevAC2ratioAfter,
+  kGraphNevSMHratioAfter,
+
+  kGraphNevACratioAfterRej, 
+  kGraphNevAC2ratioAfterRej,
+  kGraphNevSMHratioAfterRej,
+
+
+  kGraphBGOverAllAC,
+  kGraphBGOverAllAC2,
+  kGraphBGOverAllSMH,
+
+  kGraphBGOverAllACRej,
+  kGraphBGOverAllAC2Rej,
+  kGraphBGOverAllSMHRej,
+
+  kGraphV0AOverV0CAC,
+  kGraphV0AOverV0CAC2,
+  kGraphV0AOverV0CSMH,
+
+  kGraphV0AOverV0CACRej,
+  kGraphV0AOverV0CAC2Rej,
+  kGraphV0AOverV0CSMHRej,
+
+
+  kGraphV0ABGOverAllAC,
+  kGraphV0ABGOverAllAC2,
+  kGraphV0ABGOverAllSMH,
+
+  kGraphV0ABGOverAllACRej,
+  kGraphV0ABGOverAllAC2Rej,
+  kGraphV0ABGOverAllSMHRej,
+
+  kGraphV0CBGOverAllAC,
+  kGraphV0CBGOverAllAC2,
+  kGraphV0CBGOverAllSMH,
+
+  kGraphV0CBGOverAllACRej,
+  kGraphV0CBGOverAllAC2Rej,
+  kGraphV0CBGOverAllSMHRej,
+
+  kGraphFO1OverAllAC,
+  kGraphFO1OverAllAC2,
+  kGraphFO1OverAllSMH,
+
+  kGraphFO1OverAllACRej,
+  kGraphFO1OverAllAC2Rej,
+  kGraphFO1OverAllSMHRej,
+
+  kGraphFO2OverAllAC,
+  kGraphFO2OverAllAC2,
+  kGraphFO2OverAllSMH,
+
+  kGraphFO2OverAllACRej,
+  kGraphFO2OverAllAC2Rej,
+  kGraphFO2OverAllSMHRej,
+
+
+
+
+
+  kGraphNev90, 
+  kGraphTemp,
+  kNGraphs
+};
+const char * ylabels[] = {
+  "Accepted / All [CEMC7-B]",
+  "Accepted / All [CMUSH7-B]",
+  "Accepted / All [CINT7-B]",
+
+  "Accepted / All Rej [CEMC7-B]",
+  "Accepted / All Rej [CMUSH7-B]",
+  "Accepted / All Rej [CINT7-B]",
+
+  "V0BG / All [CEMC7-B]", 
+  "V0BG / All [CMUSH7-B]", 
+  "V0BG / All [CINT7-B]", 
+
+  "V0BG / All Rej [CEMC7-B]", 
+  "V0BG / All Rej [CMUSH7-B]", 
+  "V0BG / All Rej [CINT7-B]", 
+
+
+  "Nev [Accepted, CEMC7-B]" ,
+  "Nev [Accepted, CMUSH7-B]" ,
+  "Nev [Accepted, CINT7-B]" ,
+
+  "Nev [All Before, CEMC7-B]" ,
+  "Nev [All Before, CMUSH7-B]" ,
+  "Nev [All Before, CINT7-B]" ,
+  
+  "Nev [All After, CEMC7-B]" ,
+  "Nev [All After, CMUSH7-B]" ,
+  "Nev [All After, CINT7-B]" ,
+
+  "Nev_AFS / Nev_BPS [CEMC7-B]" ,
+  "Nev_AFS / Nev_BPS [CMUSH7-B]" ,
+  "Nev_AFS / Nev_BPS [CINT7-B]" ,
+
+  "Nev_AFS / Nev_BPS  [CEMC7-B] Rej" ,
+  "Nev_AFS / Nev_BPS  [CMUSH7-B] Rej" ,
+  "Nev_AFS / Nev_BPS  [CINT7-B] Rej" ,
+
+  "BG / All [CEMC7-B]", 
+  "BG / All [CMUSH7-B]", 
+  "BG / All [CINT7-B]", 
+
+  "BG / All Rej [CEMC7-B]", 
+  "BG / All Rej [CMUSH7-B]", 
+  "BG / All Rej [CINT7-B]", 
+
+  "Nev_V0A / Nev_V0C [CEMC7-B]",
+  "Nev_V0A / Nev_V0C [CMUSH7-B]",
+  "Nev_V0A / Nev_V0C [CINT7-B]",
+
+  "Nev_V0A / Nev_V0C  [CEMC7-B] Rej",
+  "Nev_V0A / Nev_V0C  [CMUSH7-B] Rej",
+  "Nev_V0A / Nev_V0C  [CINT7-B] Rej",
+
+  "BGV0A / All [CEMC7-B]",
+  "BGV0A / All [CMUSH7-B]",
+  "BGV0A / All [CINT7-B]",
+
+  "BGV0A / All  [CEMC7-B] Rej",
+  "BGV0A / All  [CMUSH7-B] Rej",
+  "BGV0A / All  [CINT7-B] Rej",
+
+  "BGV0C / All [CEMC7-B]",
+  "BGV0C / All [CMUSH7-B]",
+  "BGV0C / All [CINT7-B]",
+
+  "BGV0C / All  [CEMC7-B] Rej",
+  "BGV0C / All  [CMUSH7-B] Rej",
+  "BGV0C / All  [CINT7-B] Rej",
+
+  "FO1 / All [CEMC7-B]",
+  "FO1 / All [CMUSH7-B]",
+  "FO1 / All [CINT7-B]",
+
+  "FO1 / All  [CEMC7-B] Rej",
+  "FO1 / All  [CMUSH7-B] Rej",
+  "FO1 / All  [CINT7-B] Rej",
+
+
+  "FO2 / All [CEMC7-B]",
+  "FO2 / All [CMUSH7-B]",
+  "FO2 / All [CINT7-B]",
+
+  "FO2 / All  [CEMC7-B] Rej",
+  "FO2 / All  [CMUSH7-B] Rej",
+  "FO2 / All  [CINT7-B] Rej",
+
+
+  "Events above 90% (centrality fit V0)",
+  "Temp"
+};
+const char * gnames[] = {
+  "grGraphACCOverAllAC",
+  "grGraphACCOverAllACS2",
+  "grGraphACCOverAllSMH", 
+
+  "grGraphACCOverAllACRej", 
+  "grGraphACCOverAllACS2Rej", 
+  "grGraphACCOverAllSMHRej",
+
+  "grGraphV0BGOverAllAC",
+  "grGraphV0BGOverAllAC2",
+  "grGraphV0BGOverAllSMH",
+
+  "grGraphV0BGOverAllACRej",
+  "grGraphV0BGOverAllAC2Rej",
+  "grGraphV0BGOverAllSMHRej",
+
+  "grGraphNevAC",
+  "grGraphNevAC2",
+  "grGraphNevSMH",
+
+
+  "grGraphNevACAll",
+  "grGraphNevAC2All",
+  "grGraphNevSMHAll",
+
+  "grGraphNevACAfter",
+  "grGraphNevAC2After",
+  "grGraphNevSMHAfter",
+
+  "grGraphNevACratioAfter",
+  "grGraphNevAC2ratioAfter",
+  "grGraphNevSMHratioAfter",
+
+  "grGraphNevACratioAfterRej",
+  "grGraphNevAC2ratioAfterRej",
+  "grGraphNevSMHratioAfterRej",
+
+  "grGraphBGOverAllAC",
+  "grGraphBGOverAllAC2",
+  "grGraphBGOverAllSMH",
+
+  "grGraphBGOverAllACRej",
+  "grGraphBGOverAllAC2Rej",
+  "grGraphBGOverAllSMHRej",
+
+  "grGraphV0AOverV0CAC",
+  "grGraphV0AOverV0CAC2",
+  "grGraphV0AOverV0CSMH",
+
+  "grGraphV0AOverV0CACRej",
+  "grGraphV0AOverV0CAC2Rej",
+  "grGraphV0AOverV0CSMHRej",
+
+
+  "grGraphV0ABGOverAllAC",
+  "grGraphV0ABGOverAllAC2",
+  "grGraphV0ABGOverAllSMH",
+
+  "grGraphV0ABGOverAllACRej",
+  "grGraphV0ABGOverAllAC2Rej",
+  "grGraphV0ABGOverAllSMHRej",
+
+
+  "grGraphV0CBGOverAllAC",
+  "grGraphV0CBGOverAllAC2",
+  "grGraphV0CBGOverAllSMH",
+
+  "grGraphV0CBGOverAllACRej",
+  "grGraphV0CBGOverAllAC2Rej",
+  "grGraphV0CBGOverAllSMHRej",
+
+  "grGraphFO1OverAllAC",
+  "grGraphFO1OverAllAC2",
+  "grGraphFO1OverAllSMH",
+
+  "grGraphFO1OverAllACRej",
+  "grGraphFO1OverAllAC2Rej",
+  "grGraphFO1OverAllSMHRej",
+
+
+  "grGraphFO2OverAllAC",
+  "grGraphFO2OverAllAC2",
+  "grGraphFO2OverAllSMH",
+
+  "grGraphFO2OverAllACRej",
+  "grGraphFO2OverAllAC2Rej",
+  "grGraphFO2OverAllSMHRej",
+
+
+  "grNev90",
+  "grTemp"
+};
diff --git a/PWG1/macros/PhysSel/PlotQAPhysicsSelection.C b/PWG1/macros/PhysSel/PlotQAPhysicsSelection.C
new file mode 100644 (file)
index 0000000..19d0e7b
--- /dev/null
@@ -0,0 +1,1678 @@
+//using namespace std;
+
+#include <iostream>
+
+#include "QALHC11c_QA69.h"
+#include "DefinePlots.h"
+#include "TGraphErrors.h"
+
+
+const char * GetLocalFileName(Int_t run, const char * suffix, const char * path);
+TH1F * GetEmpty(const char * name, Int_t nfile);
+TGraphErrors * GetGraphRej(TGraphErrors * gr, TList * rejRunList, const char * reason, Float_t &mean, Bool_t doDraw) ;
+double GetMedian(double* arr, int n);
+double meanMed(double* vec, int np, double nsigmaCut, int &nrej, int *rejList);
+TGraphErrors * graph[kNGraphs];
+
+//---------------------------------------------------------
+TH1F *fAccOverAll[3];
+TH1F *fBGOverAll[3];
+TH1F *fV0BGOverAll[3];
+TH1F *fV0ABGOverAll[3];
+TH1F *fV0CBGOverAll[3];
+TH1F *fAfterOverBefore[3];
+TH1F *fV0AOverV0C[3];
+TH1F *fF02OverAll[3];
+TH1F *fF01OverAll[3];
+
+void PlotQAPhysicsSelection() {
+
+
+  for(Int_t i=0;i<3;++i){
+    fAccOverAll[i]=new TH1F(Form("fAccOverAll_%d",i),Form("fAccOverAll_%d",i),100,0,1);
+    fBGOverAll[i]=new TH1F(Form("fBGOverAll_%d",i),Form("fBGOverAll_%d",i),50,0,0.5);
+    fV0BGOverAll[i]=new TH1F(Form("fV0BGOverAll_%d",i),Form("fV0BGOverAll_%d",i),50,0,0.1);
+    fV0ABGOverAll[i]=new TH1F(Form("fV0ABGOverAll_%d",i),Form("fV0ABGOverAll_%d",i),50,0,0.1);
+    fV0CBGOverAll[i]=new TH1F(Form("fV0CBGOverAll_%d",i),Form("fV0CBGOverAll_%d",i),50,0,0.1);
+    fAfterOverBefore[i]=new TH1F(Form("fAfterOverBefore_%d",i),Form("fAfterOverBefore_%d",i),100,0.5,1);
+    fV0AOverV0C[i]=new TH1F(Form("fV0AOverV0C_%d",i),Form("fV0AOverV0C_%d",i),100,0.7,1.2);
+    fF01OverAll[i]=new TH1F(Form("fF01OverAll_%d",i),Form("fF01OverAll_%d",i),200,0.6,1.1);
+    fF02OverAll[i]=new TH1F(Form("fF02OverAll_%d",i),Form("fF02OverAll_%d",i),200,0.6,1.1);
+  }
+
+
+  gStyle->SetOptStat(0);
+  gStyle->SetPalette(1);
+  gStyle->SetCanvasColor(10);
+  gStyle->SetFrameFillColor(10);
+  gStyle->SetOptStat(0);
+  gStyle->SetOptTitle(0);
+
+  // Book graphs
+  TGraphErrors * graph[kNGraphs] = {0};
+  for(Int_t igraph = 0; igraph < kNGraphs; igraph++){
+    graph[igraph] = new TGraphErrors;
+    graph[igraph]->SetName(gnames[igraph]);
+    graph[igraph]->GetXaxis()->SetTitle("run");
+    graph[igraph]->GetYaxis()->SetTitle(ylabels[igraph]);
+    graph[igraph]->SetMarkerStyle(20);
+  }
+
+  //loading libraries
+  loadlibs();
+
+  TList * listEmptyRuns    = new TList(); // keep track of empty runs
+  TList * listRejectedRuns = new TList(); // keep track of rejected runes
+
+  // Count ncycles
+  Int_t cycle=0;
+  while(QAcycle[++cycle]>0) {
+    
+    cout << "." ;
+  }  
+  cout << "  Ncycles " << cycle <<endl;
+  cout << QAcycle[0] ;
+
+  // connect to grid
+  if(!localMode) TGrid::Connect("alien://");  
+
+  // do not use scientific notation for run number
+  TGaxis::SetMaxDigits(7)  ;
+
+
+
+
+  
+  // loop over all files
+  Int_t ifile =-1;
+  Int_t ifileGood = 0;
+  Int_t ifileNotEmpty  = 0;
+  while (runs[++ifile] > 0) {
+    
+    Long_t *id,*size,*flags,*mt;
+    
+
+
+
+    // check if QA file is available and open it
+    // try different QA train outputs
+    TString file ;
+    TFile *fr=0;
+    TFile *fc=0; // centrality, only in local mode for the time being
+    for(Int_t c=0;c<cycle;c++){ 
+      if(fr)break; 
+      if(output.Contains("AOD"))
+       file.Form("alien://%s/%09d/%s%3.3d/event_stat.root",location.Data(),runs[ifile],
+                 output.Data(),QAcycle[c] );
+      else
+       file.Form("alien://%s/%09d/%s%d/event_stat.root",location.Data(),runs[ifile],
+                 output.Data(),QAcycle[c] );
+      if(localMode){ 
+       if(!GetLocalFileName(runs[ifile], localSuffix, localPath))continue;
+       file = GetLocalFileName(runs[ifile], localSuffix, localPath);
+       if(gSystem->GetPathInfo(file,id,size,flags,mt)){Printf("not found");continue;}
+      }
+  
+      Printf("\nBegin of reading: %s", file.Data());
+      fr=TFile::Open(file);     
+
+    }
+
+
+    // set value to -1 by default:
+    for(Int_t igraph = 0; igraph < kNGraphs; igraph++){
+      graph[igraph]->SetPoint(ifile, runs[ifile], -1);
+    }
+
+    // If the file is not available, continue
+    if(!fr){
+      Printf("File %d is not available.\n",runs[ifile]);
+      listEmptyRuns->Add(new TObjString(Form("File not Existing [%d]",runs[ifile])));
+      continue;
+    }
+
+
+    // get stats and fill graphs
+    TH2F * hStats = (TH2F*) fr->Get("fHistStatistics"); 
+    if(!localMode) {
+      gSystem->Exec(Form("alien_cp %s %s",file.Data(), GetLocalFileName(runs[ifile], localSuffix, localPath)));
+      cout << Form("alien_cp %s %s",file.Data(), GetLocalFileName(runs[ifile], localSuffix, localPath)) <<endl;
+    }
+
+
+    Int_t rowC0SMH   = -1;
+    Int_t rowCMBAC   = -1;
+    Int_t rowCMBACS2 = -1;
+    Int_t nbiny = hStats->GetNbinsY();
+    for(Int_t ibiny = 1; ibiny <= nbiny; ibiny++){
+      TString label = hStats->GetYaxis()->GetBinLabel(ibiny);
+      if(label.Contains(trigger3))   rowC0SMH   = ibiny; 
+      if(label.Contains(trigger1))   rowCMBAC   = ibiny; 
+      if(label.Contains(trigger2)) rowCMBACS2 = ibiny; 
+    }
+
+    //Number of events in the selected trigger class
+    Float_t C0SMH   = hStats->GetBinContent(AliPhysicsSelection::kStatTriggerClass,rowC0SMH);    
+    Float_t CMBAC   = hStats->GetBinContent(AliPhysicsSelection::kStatTriggerClass,rowCMBAC);
+    Float_t CMBACS2 = hStats->GetBinContent(AliPhysicsSelection::kStatTriggerClass,rowCMBACS2);
+
+
+    //Number of events after physics selection
+    Float_t C0SMH_APS   = hStats->GetBinContent(AliPhysicsSelection::kStatOffline,rowC0SMH);    
+    Float_t CMBAC_APS   = hStats->GetBinContent(AliPhysicsSelection::kStatOffline,rowCMBAC);
+    Float_t CMBACS2_APS = hStats->GetBinContent(AliPhysicsSelection::kStatOffline,rowCMBACS2);
+
+
+    //Fraction of Events rejected as background because out of the correlation tracklets vs clusters
+    Float_t C0SMHBG   = hStats->GetBinContent(AliPhysicsSelection::kStatBG,rowC0SMH);    
+    Float_t CMBACBG   = hStats->GetBinContent(AliPhysicsSelection::kStatBG,rowCMBAC);
+    Float_t CMBACS2BG = hStats->GetBinContent(AliPhysicsSelection::kStatBG,rowCMBACS2);
+
+
+
+    //Events with a signal from V0A in the collision time window
+    Float_t C0SMHV0A   = hStats->GetBinContent(AliPhysicsSelection::kStatV0A,rowC0SMH);    
+    Float_t CMBACV0A   = hStats->GetBinContent(AliPhysicsSelection::kStatV0A,rowCMBAC);
+    Float_t CMBACS2V0A = hStats->GetBinContent(AliPhysicsSelection::kStatV0A,rowCMBACS2);
+    
+    //Events with a signal from V0C in the collision time window
+    Float_t C0SMHV0C   = hStats->GetBinContent(AliPhysicsSelection::kStatV0C,rowC0SMH);    
+    Float_t CMBACV0C   = hStats->GetBinContent(AliPhysicsSelection::kStatV0C,rowCMBAC);
+    Float_t CMBACS2V0C = hStats->GetBinContent(AliPhysicsSelection::kStatV0C,rowCMBACS2);
+
+    if(C0SMHV0C>0)graph[kGraphV0AOverV0CSMH]->SetPoint(ifile,runs[ifile], C0SMHV0A/C0SMHV0C);
+    if(CMBACV0C>0)graph[kGraphV0AOverV0CAC]->SetPoint(ifile,runs[ifile], CMBACV0A/CMBACV0C);
+    if(CMBACS2V0C>0)graph[kGraphV0AOverV0CAC2]->SetPoint(ifile,runs[ifile], CMBACS2V0A/CMBACS2V0C);
+
+    //Events flagged as BG from V0 side A
+    Float_t C0SMHV0ABG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowC0SMH);    
+    Float_t CMBACV0ABG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowCMBAC);
+    Float_t CMBACS2V0ABG = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowCMBACS2);
+    
+    //Events flagged as BG from V0 side C
+    Float_t C0SMHV0CBG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowC0SMH);    
+    Float_t CMBACV0CBG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowCMBAC);
+    Float_t CMBACS2V0CBG = hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowCMBACS2);
+
+
+    //Number of events with more than 1 chip hit in the pixels, computed offline
+    Float_t C0SMHF01   = hStats->GetBinContent(AliPhysicsSelection::kStatFO1,rowC0SMH);    
+    Float_t CMBACF01   = hStats->GetBinContent(AliPhysicsSelection::kStatFO1,rowCMBAC);
+    Float_t CMBACS2F01 = hStats->GetBinContent(AliPhysicsSelection::kStatFO1,rowCMBACS2);
+
+
+    //Number of events with more than 2 chip hit in the pixels, computed offline
+    Float_t C0SMHF02   = hStats->GetBinContent(AliPhysicsSelection::kStatFO2,rowC0SMH);    
+    Float_t CMBACF02   = hStats->GetBinContent(AliPhysicsSelection::kStatFO2,rowCMBAC);
+    Float_t CMBACS2F02 = hStats->GetBinContent(AliPhysicsSelection::kStatFO2,rowCMBACS2);
+
+
+    //Accepted by V0
+    Float_t C0SMHV0   = hStats->GetBinContent(AliPhysicsSelection::kStatV0,rowC0SMH);    
+    Float_t CMBACV0   = hStats->GetBinContent(AliPhysicsSelection::kStatV0,rowCMBAC);
+    Float_t CMBACS2V0 = hStats->GetBinContent(AliPhysicsSelection::kStatV0,rowCMBACS2);
+
+
+
+    //Events flagged as BG from V0 and the A or C side
+    Float_t C0SMHV0BG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowC0SMH)  +hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowC0SMH)  ;
+    Float_t CMBACV0BG   = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowCMBAC)  +hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowCMBAC)  ;
+    Float_t CMBACS2V0BG = hStats->GetBinContent(AliPhysicsSelection::kStatV0ABG,rowCMBACS2)+hStats->GetBinContent(AliPhysicsSelection::kStatV0CBG,rowCMBACS2);
+
+
+   //Events passing the ZDC time cut on the correlation between the sum and the difference of the timing (rejects the "debunched" events)
+    
+    Float_t C0SMHZDC   = hStats->GetBinContent(AliPhysicsSelection::kStatZDCTime,rowC0SMH);
+    Float_t CMBACZDC   = hStats->GetBinContent(AliPhysicsSelection::kStatZDCTime,rowCMBAC);
+    Float_t CMBACS2ZDC = hStats->GetBinContent(AliPhysicsSelection::kStatZDCTime,rowCMBACS2);
+                                                                    
+
+    //Accepted events                                               kStatAccepted
+    Float_t C0SMHACC   = hStats->GetBinContent(AliPhysicsSelection::kStatAccepted,rowC0SMH);
+    Float_t CMBACACC   = hStats->GetBinContent(AliPhysicsSelection::kStatAccepted,rowCMBAC);
+    Float_t CMBACS2ACC = hStats->GetBinContent(AliPhysicsSelection::kStatAccepted,rowCMBACS2);
+
+
+    cout<<"C0SMHBG="<<C0SMHBG<<"   C0SMHACC="<<C0SMHACC<<endl;
+
+
+
+
+
+    cout << runs[ifile] << " " << CMBACS2 << " " << CMBACS2V0BG << " " << " " << CMBACS2ACC << endl;
+    
+  
+   
+
+   
+    
+
+    if(CMBAC>0) {
+      graph[kGraphBGOverAllAC]->SetPoint(ifile,runs[ifile], CMBACBG / CMBAC);
+      graph[kGraphV0BGOverAllAC]->SetPoint(ifile,runs[ifile], CMBACV0BG / CMBAC);
+      graph[kGraphV0ABGOverAllAC]->SetPoint(ifile,runs[ifile], CMBACV0ABG / CMBAC);//
+      graph[kGraphV0CBGOverAllAC]->SetPoint(ifile,runs[ifile], CMBACV0CBG / CMBAC);//
+      graph[kGraphACCOverAllAC]    ->SetPoint(ifile,runs[ifile],CMBACACC/CMBAC);
+      graph[kGraphNevACratioAfter]    ->SetPoint(ifile,runs[ifile],CMBAC_APS/CMBAC);
+      //F0
+      graph[kGraphFO1OverAllAC]    ->SetPoint(ifile,runs[ifile],CMBACF01/CMBAC);
+      graph[kGraphFO2OverAllAC]    ->SetPoint(ifile,runs[ifile],CMBACF02/CMBAC);
+
+
+
+    }
+    if(CMBACS2>0){
+      graph[kGraphBGOverAllAC2]->SetPoint(ifile,runs[ifile], CMBACS2BG / CMBACS2);
+      graph[kGraphV0BGOverAllAC2]->SetPoint(ifile,runs[ifile], CMBACS2V0BG / CMBACS2);
+      graph[kGraphV0ABGOverAllAC2]->SetPoint(ifile,runs[ifile], CMBACS2V0ABG / CMBACS2);//
+      graph[kGraphV0CBGOverAllAC2]->SetPoint(ifile,runs[ifile], CMBACS2V0CBG / CMBACS2);//
+      graph[kGraphACCOverAllACS2]->SetPoint(ifile,runs[ifile],CMBACS2ACC/CMBACS2);
+      graph[kGraphNevAC2ratioAfter]->SetPoint(ifile,runs[ifile],CMBACS2_APS/CMBACS2);
+
+      //FO
+      graph[kGraphFO1OverAllAC2]    ->SetPoint(ifile,runs[ifile],CMBACS2F01/CMBACS2);
+      graph[kGraphFO2OverAllAC2]    ->SetPoint(ifile,runs[ifile],CMBACS2F02/CMBACS2);
+
+
+
+    }
+    if(C0SMH>0){
+      graph[kGraphBGOverAllSMH]->SetPoint(ifile,runs[ifile], C0SMHBG / C0SMH);
+      graph[kGraphV0BGOverAllSMH]->SetPoint(ifile,runs[ifile], C0SMHV0BG / C0SMH);
+      graph[kGraphV0ABGOverAllSMH]->SetPoint(ifile,runs[ifile],  C0SMHV0ABG/ C0SMH);
+      graph[kGraphV0CBGOverAllSMH]->SetPoint(ifile,runs[ifile],  C0SMHV0CBG/ C0SMH);
+      graph[kGraphACCOverAllSMH]   ->SetPoint(ifile,runs[ifile],C0SMHACC/C0SMH);
+      graph[kGraphNevSMHratioAfter]   ->SetPoint(ifile,runs[ifile],C0SMH_APS/C0SMH);
+
+      graph[kGraphFO1OverAllSMH]    ->SetPoint(ifile,runs[ifile], C0SMHF01/C0SMH);
+      graph[kGraphFO2OverAllSMH]    ->SetPoint(ifile,runs[ifile], C0SMHF02/C0SMH);
+
+
+    } 
+    
+    
+    
+    
+
+    graph[kGraphNevSMH]->SetPoint(ifile,runs[ifile],C0SMHACC);
+    graph[kGraphNevAC ]->SetPoint(ifile,runs[ifile],CMBACACC);
+    graph[kGraphNevAC2]->SetPoint(ifile,runs[ifile],CMBACS2ACC);
+    graph[kGraphNevSMHBefore]->SetPoint(ifile,runs[ifile],C0SMH);
+    graph[kGraphNevACBefore ]->SetPoint(ifile,runs[ifile],CMBAC);
+    graph[kGraphNevAC2Before]->SetPoint(ifile,runs[ifile],CMBACS2);
+    graph[kGraphNevSMHAfter]->SetPoint(ifile,runs[ifile],C0SMH_APS);
+    graph[kGraphNevACAfter ]->SetPoint(ifile,runs[ifile],CMBAC_APS);
+    graph[kGraphNevAC2After]->SetPoint(ifile,runs[ifile],CMBACS2_APS);
+
+
+    ifileGood++;
+    if(C0SMH>0 || CMBACS2>0 || CMBAC>0) ifileNotEmpty++;
+    else  listEmptyRuns->Add(new TObjString(Form("No events [%d]",runs[ifile])));
+
+  }
+
+
+
+
+  // Set bin labels with run number and save graphs
+  // also prepare a table with number of events
+  AliLatexTable tableEvts (7,"c|ccc|ccc");
+  //tableEvts.InsertCustomRow("& \\multicolumn{3}{c}{Before Phys. Sel.} & \\multicolumn{3}{c}{After Phys. Sel.}\\\\");
+  tableEvts.InsertCustomRow("Run & CINT1B & CEMC1B & CSH1B &  CINT1B & CEMC1B & CSH1B \\\\"); 
+
+
+
+  fou = new TFile("qaLHC10apass2.root","recreate");
+  fou->cd();
+
+  for(Int_t igraph = 0; igraph < kNGraphs; igraph++){
+    //    TAxis * ax = graph[igraph]->GetHistogram()->GetXaxis();
+    graph[igraph]->GetXaxis()->SetTitle("run");
+    graph[igraph]->GetYaxis()->SetTitle(ylabels[igraph]);
+
+    graph[igraph]->GetXaxis()->SetLabelSize(0.06);
+    graph[igraph]->GetXaxis()->SetTitleSize(0.07);
+    graph[igraph]->GetXaxis()->SetTitleOffset(0.5);
+    graph[igraph]->GetYaxis()->SetLabelSize(0.08);
+    graph[igraph]->GetYaxis()->SetTitleSize(0.06);
+    graph[igraph]->GetYaxis()->SetTitleOffset(0.7);
+    
+    
+    graph[igraph]->GetYaxis()->CenterTitle(0);
+    graph[igraph]->GetYaxis()->SetLabelFont(42);
+    graph[igraph]->GetYaxis()->SetTitleFont(42);
+    graph[igraph]->GetYaxis()->SetNoExponent(kTRUE);
+    graph[igraph]->GetXaxis()->SetLabelFont(42);
+    graph[igraph]->GetXaxis()->SetTitleFont(52);
+
+    graph[igraph]->SetMarkerStyle(30);
+    graph[igraph]->SetMarkerColor(4);
+
+
+    graph[igraph]->SetMinimum(0);
+    graph[igraph]->SetName(gnames[igraph]);
+    graph[igraph]->SetTitle(ylabels[igraph]);
+    //    graph[igraph]->SetMaximum(1);
+    graph[igraph]->Write();
+  }
+
+  fou->Close();
+
+
+  
+  Int_t npoint = graph[kGraphNevAC2] -> GetN();
+  for(Int_t ipoint = 0; ipoint < npoint; ipoint++){      
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevAC2]->GetX()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevACBefore]->GetY()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevAC2Before]->GetY()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevSMHBefore]->GetY()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevAC]->GetY()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevAC2]->GetY()[ipoint]));
+    tableEvts.SetNextCol(TMath::Nint(graph[kGraphNevSMH]->GetY()[ipoint]));
+    //tableEvts.SetNextCol(TMath::Nint(graph[kGraphNev90]->GetY()[ipoint]));
+    tableEvts.InsertRow();
+    //   ax->SetBinLabel(ax->FindBin(ipoint), Form("%d", runs[ipoint-1]));
+  }    
+
+
+
+
+  Float_t meanDummy;
+  
+
+  /*
+    THREE TRIGGERS IN THE SAME CANVAS
+    
+  */
+  c4a = new TCanvas("GraphACCOverAll","GraphACCOverAll",1000,700);
+  
+
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c4a->cd();
+  pad1->Draw();
+
+
+  pad1->cd();
+
+
+  graph[kGraphACCOverAllAC]->Draw("PA");
+  graph[kGraphACCOverAllACRej] = GetGraphRej(graph[kGraphACCOverAllAC] , listRejectedRuns, "Acc/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fAccOverAll[0]->Draw();
+
+
+  pad2->cd();
+
+
+  graph[kGraphACCOverAllACS2]->Draw("PA");
+  graph[kGraphACCOverAllACS2Rej] = GetGraphRej(graph[kGraphACCOverAllACS2] , listRejectedRuns, "Acc/All [ACS2]" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  //  GetHisto(graph[kGraphACCOverAllACS2],fAccOverAll[1]);
+  fAccOverAll[1]->Draw();
+
+
+
+  pad3->cd();
+
+
+  graph[kGraphACCOverAllSMH]->Draw("PA");
+  graph[kGraphACCOverAllSMHRej] = GetGraphRej(graph[kGraphACCOverAllSMH] , listRejectedRuns, "Acc/All SMH" ,  meanDummy, 1);
+
+  //fAccOverAll[i]
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  //  GetHisto(graph[kGraphACCOverAllSMH],fAccOverAll[2]);
+  fAccOverAll[2]->Draw();
+  fAccOverAll[2]->GetXaxis()->SetTitle("Accepted / All");
+
+  /*
+  for(Int_t ipoint = 0; ipoint < graph[kGraphACCOverAllAC]->GetN(); ipoint++){
+    fhistTest->Fill(graph[kGraphACCOverAllAC]->GetY()[ipoint]);
+  }
+
+  pad1->cd(4);
+  fhistTest->Sumw2();
+  fhistTest->SetMarkerStyle(25);
+  fhistTest->GetXaxis()->SetTitle(ylabels[kGraphACCOverAllAC]);
+  fhistTest->GetYaxis()->SetTitle("Entries");
+  fhistTest->Draw();
+  */
+  //pad1->cd(2);
+
+
+
+
+
+  c4a->Update();
+  gSystem->ProcessEvents();
+  c4a->SaveAs(Form("picturesLHC11hAOD50/c4a_%s.png",c4a->GetName()));
+
+
+
+  c5a = new TCanvas("GraphNev","GraphNev",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+  pad1->cd(1);
+  graph[kGraphNevAC]->Draw("PA");
+
+  pad1->cd(2);
+  graph[kGraphNevAC2]->Draw("PA");
+
+
+  pad1->cd(3);
+  graph[kGraphNevSMH]->Draw("PA");
+
+
+  c5a->Update();
+  gSystem->ProcessEvents();
+  c5a->SaveAs(Form("picturesLHC11hAOD50/c5a_%s.png",c5a->GetName()));
+
+
+
+
+
+  c7a = new TCanvas("GraphBGOverAll","GraphACCOverAll",1000,700);
+  
+
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7a->cd();
+  pad1->Draw();
+
+
+  pad1->cd();
+
+  graph[kGraphBGOverAllAC]->Draw("PA");
+  graph[kGraphBGOverAllAC] = GetGraphRej(graph[kGraphBGOverAllAC] , listRejectedRuns, "BG/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fBGOverAll[0]->Draw();
+
+
+
+
+
+
+  pad2->cd();
+
+  graph[kGraphBGOverAllAC2]->Draw("PA");
+  graph[kGraphBGOverAllAC2] = GetGraphRej(graph[kGraphBGOverAllAC2] , listRejectedRuns, "BG/All AC2" ,  meanDummy, 1);
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fBGOverAll[1]->Draw();
+
+
+
+  pad3->cd();
+
+  graph[kGraphBGOverAllSMH]->Draw("PA");
+  graph[kGraphBGOverAllSMHRej] = GetGraphRej(graph[kGraphBGOverAllSMH] , listRejectedRuns, "BG/All SMH" ,  meanDummy, 1);
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+
+  fBGOverAll[2]->GetXaxis()->SetTitle("BG / All");
+  fBGOverAll[2]->Draw();
+
+
+
+
+  c7a->Update();
+  gSystem->ProcessEvents();
+  c7a->SaveAs(Form("picturesLHC11hAOD50/c7a_%s.png",c7a->GetName()));
+
+
+
+  c7b = new TCanvas("GraphV0BGOverAll","GraphV0BGOverAll",1000,700);
+    TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7b->cd();
+
+
+
+  pad1->cd();
+
+  graph[kGraphV0BGOverAllAC]->Draw("PA");
+  graph[kGraphV0BGOverAllAC] = GetGraphRej(graph[kGraphV0BGOverAllAC] , listRejectedRuns, "V0BG/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0BGOverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0BGOverAllAC2]->Draw("PA");
+  graph[kGraphV0BGOverAllAC2] = GetGraphRej(graph[kGraphV0BGOverAllAC2] , listRejectedRuns, "V0BG/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0BGOverAll[1]->Draw();
+
+  pad3->cd();
+  graph[kGraphV0BGOverAllSMH]->Draw("PA");
+  graph[kGraphV0BGOverAllSMHRej] = GetGraphRej(graph[kGraphV0BGOverAllSMH] , listRejectedRuns, "V0BG/All SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0BGOverAll[2]->GetXaxis()->SetTitle("V0BG / All");
+  fV0BGOverAll[2]->Draw();
+
+
+
+  c7b->Update();
+  gSystem->ProcessEvents();
+  c7b->SaveAs(Form("picturesLHC11hAOD50/c7b_%s.png",c7b->GetName()));
+
+
+
+
+
+
+
+
+
+
+  c7c = new TCanvas("GraphV0A_BGOverAll","GraphV0A_BGOverAll",1000,700);
+   TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7c->cd();
+
+  pad1->cd(); 
+
+
+  graph[kGraphV0ABGOverAllAC]->Draw("PA");
+  graph[kGraphV0ABGOverAllAC] = GetGraphRej(graph[kGraphV0ABGOverAllAC] , listRejectedRuns, "V0A_BG/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0ABGOverAll[0]->Draw();
+
+
+
+  pad2->cd(); 
+  graph[kGraphV0ABGOverAllAC2]->Draw("PA");
+  graph[kGraphV0ABGOverAllAC2] = GetGraphRej(graph[kGraphV0ABGOverAllAC2] , listRejectedRuns, "V0A_BG/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0ABGOverAll[1]->Draw();
+
+  pad3->cd(); 
+  graph[kGraphV0ABGOverAllSMH]->Draw("PA");
+  graph[kGraphV0ABGOverAllSMHRej] = GetGraphRej(graph[kGraphV0ABGOverAllSMH] , listRejectedRuns, "V0A_BG/All SMH" ,  meanDummy, 1);
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0ABGOverAll[2]->Draw();
+  fV0ABGOverAll[2]->GetXaxis()->SetTitle("V0ABG / All");
+
+
+  c7c->Update();
+  gSystem->ProcessEvents();
+  c7c->SaveAs(Form("picturesLHC11hAOD50/c7c_%s.png",c7c->GetName()));
+
+
+
+
+
+  c7d = new TCanvas("GraphV0C_BGOverAll","GraphV0C_BGOverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7d->cd();
+
+  pad1->cd();
+  graph[kGraphV0CBGOverAllAC]->Draw("PA");
+  graph[kGraphV0CBGOverAllAC] = GetGraphRej(graph[kGraphV0CBGOverAllAC] , listRejectedRuns, "V0C_BG/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0CBGOverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0CBGOverAllAC2]->Draw("PA");
+  graph[kGraphV0CBGOverAllAC2] = GetGraphRej(graph[kGraphV0CBGOverAllAC2] , listRejectedRuns, "V0C_BG/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0CBGOverAll[1]->Draw();
+
+
+          pad3->cd();
+  graph[kGraphV0CBGOverAllSMH]->Draw("PA");
+  graph[kGraphV0CBGOverAllSMHRej] = GetGraphRej(graph[kGraphV0CBGOverAllSMH] , listRejectedRuns, "V0A_BG/All SMH" ,  meanDummy, 1);
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0CBGOverAll[2]->Draw();
+  fV0CBGOverAll[2]->GetXaxis()->SetTitle("V0CBG / All");
+
+
+
+  c7d->Update();
+  gSystem->ProcessEvents();
+  c7d->SaveAs(Form("picturesLHC11hAOD50/c7d_%s.png",c7d->GetName()));
+
+
+
+
+
+  c8a = new TCanvas("GraphAfterOverBefore","GraphAfterOverBefore",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+  
+  pad1->cd();
+  
+  graph[kGraphNevACratioAfter]->Draw("PA");
+  graph[kGraphNevACratioAfterRej] = GetGraphRej(graph[kGraphNevACratioAfter] , listRejectedRuns, "V0BG/All AC" ,  meanDummy, 1);
+  
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fAfterOverBefore[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphNevAC2ratioAfter]->Draw("PA");
+  graph[kGraphNevAC2ratioAfterRej] = GetGraphRej(graph[kGraphNevAC2ratioAfter] , listRejectedRuns, "V0BG/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fAfterOverBefore[1]->Draw();
+
+  pad3->cd();
+  graph[kGraphNevSMHratioAfter]->Draw("PA");
+  graph[kGraphNevSMHratioAfterRej] = GetGraphRej(graph[kGraphNevSMHratioAfter] , listRejectedRuns, "V0BG/All SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fAfterOverBefore[2]->Draw();
+  fAfterOverBefore[2]->GetXaxis()->SetTitle("After_PS / Before_PS");
+
+
+  c8a->Update();
+  gSystem->ProcessEvents();
+  c8a->SaveAs(Form("picturesLHC11hAOD50/c8a_%s.png",c8a->GetName()));
+
+
+
+
+
+  c8b = new TCanvas("GraphNevBefore","GraphNevBefore",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+
+  pad1->cd(1);
+  graph[kGraphNevACBefore]->Draw("PA");
+
+  pad1->cd(2);
+  graph[kGraphNevAC2Before]->Draw("PA");
+
+  pad1->cd(3);
+  graph[kGraphNevSMHBefore]->Draw("PA");
+
+
+
+  c8b->Update();
+  gSystem->ProcessEvents();
+  c8b->SaveAs(Form("picturesLHC11hAOD50/c8b_%s.png",c8b->GetName()));
+
+
+
+
+
+  c8c = new TCanvas("GraphNevAfter","GraphNevAfter",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+
+  pad1->cd(1);
+  graph[kGraphNevACAfter]->Draw("PA");
+
+
+  pad1->cd(2);
+  graph[kGraphNevAC2After]->Draw("PA");
+
+
+  pad1->cd(3);
+
+  graph[kGraphNevSMHAfter]->Draw("PA");
+
+
+
+  c8c->Update();
+  gSystem->ProcessEvents();
+  c8c->SaveAs(Form("picturesLHC11hAOD50/c8c_%s.png",c8c->GetName()));
+
+
+
+
+
+
+
+
+  c9a = new TCanvas("GraphV0AOverV0C","GraphV0AOverV0C",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+  pad1->cd();
+  graph[kGraphV0AOverV0CAC]->Draw("PA");
+  graph[kGraphV0AOverV0CACRej] = GetGraphRej(graph[kGraphV0AOverV0CAC] , listRejectedRuns, "Nev_V0A/Nev_V0C AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0AOverV0C[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0AOverV0CAC2]->Draw("PA");
+  graph[kGraphV0AOverV0CAC2Rej] = GetGraphRej(graph[kGraphV0AOverV0CAC2] , listRejectedRuns, "Nev_V0A/Nev_V0C AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0AOverV0C[1]->Draw();
+
+
+  pad3->cd();
+  graph[kGraphV0AOverV0CSMH]->Draw("PA");
+  graph[kGraphV0AOverV0CSMHRej] = GetGraphRej(graph[kGraphV0AOverV0CSMH] , listRejectedRuns, "Nev_V0A/Nev_V0C SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0AOverV0C[2]->Draw();
+  fV0AOverV0C[2]->GetXaxis()->SetTitle("V0A / VOC");
+
+
+
+  c9a->Update();
+  gSystem->ProcessEvents();
+  c9a->SaveAs(Form("picturesLHC11hAOD50/c9a_%s.png",c9a->GetName()));
+
+
+
+  c10a = new TCanvas("GraphFO1OverAll","GraphFO1OverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();  
+
+
+  pad1->cd();
+  graph[kGraphFO1OverAllAC]->Draw("PA");
+  graph[kGraphFO1OverAllACRej] = GetGraphRej(graph[kGraphFO1OverAllAC] , listRejectedRuns, "Nev_FO1/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fF01OverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphFO1OverAllAC2]->Draw("PA");
+  graph[kGraphFO1OverAllAC2Rej] = GetGraphRej(graph[kGraphFO1OverAllAC2] , listRejectedRuns, "Nev_FO1/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fF01OverAll[1]->Draw();
+
+
+  pad3->cd();
+  graph[kGraphFO1OverAllSMH]->Draw("PA");
+  graph[kGraphFO1OverAllSMHRej] = GetGraphRej(graph[kGraphFO1OverAllSMH] , listRejectedRuns, "Nev_FO1/All SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fF01OverAll[2]->Draw();
+  fF01OverAll[2]->GetXaxis()->SetTitle("F01 / All");
+
+
+
+
+  c10a->Update();
+  gSystem->ProcessEvents();
+  c10a->SaveAs(Form("picturesLHC11hAOD50/c10a_%s.png",c10a->GetName()));
+
+
+
+
+  c10b = new TCanvas("GraphFO2OverAll","GraphFO2OverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();  
+
+
+  pad1->cd();
+  graph[kGraphFO2OverAllAC]->Draw("PA");
+  graph[kGraphFO2OverAllACRej] = GetGraphRej(graph[kGraphFO2OverAllAC] , listRejectedRuns, "Nev_FO2/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fF02OverAll[0]->Draw();
+  fF02OverAll[0]->GetXaxis()->SetTitle("F02 / All");
+
+
+  pad2->cd();
+  graph[kGraphFO2OverAllAC2]->Draw("PA");
+  graph[kGraphFO2OverAllAC2Rej] = GetGraphRej(graph[kGraphFO2OverAllAC2] , listRejectedRuns, "Nev_FO2/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fF02OverAll[1]->Draw();
+  fF02OverAll[1]->GetXaxis()->SetTitle("F02 / All");
+
+  pad3->cd();
+  graph[kGraphFO2OverAllSMH]->Draw("PA");
+  graph[kGraphFO2OverAllSMHRej] = GetGraphRej(graph[kGraphFO2OverAllSMH] , listRejectedRuns, "Nev_FO2/All SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fF02OverAll[2]->Draw();
+  fF02OverAll[2]->GetXaxis()->SetTitle("F02 / All");
+
+
+
+
+
+  c10b->Update();
+  gSystem->ProcessEvents();
+  c10b->SaveAs(Form("picturesLHC11hAOD50/c10b_%s.png",c10b->GetName()));
+
+
+
+  cout << "Files Statistics" << endl;
+  cout << " Total     [" << ifile         << "]" << endl;
+  cout << " Available [" << ifileGood     << "]" << endl;  
+  cout << " Not Empty [" << ifileNotEmpty << "]" <<  endl;
+
+  cout << "" << endl;
+  cout << "All Events" << endl <<  endl;
+  tableEvts.PrintTable("CSV");
+
+  cout << "Empty or missing files" << endl<< endl;  
+  listEmptyRuns->Sort();
+  listEmptyRuns->Print();
+
+  cout << "Suspicious Runs" << endl << endl;
+  listRejectedRuns->Sort();
+  listRejectedRuns->Print();
+
+
+
+  
+
+}
+
+TH1F * GetEmpty(const char * name, Int_t nfile) {
+  TH1F * he01 = new TH1F(TString("hempty")+name, "hempty", nfile, -0.5, nfile-0.5);
+  for(Int_t ilab = 0; ilab < nfile; ilab++){
+    he01->GetXaxis()->SetBinLabel(ilab+1, Form("%d", runs[ilab]));
+  }
+  he01->SetMinimum(0);
+  he01->SetMaximum(1);
+  he01->SetXTitle("run");
+  he01->SetYTitle(name);
+  return he01;
+}
+
+
+const char * GetLocalFileName(Int_t run, const char * suffix, const char * path) {
+  // returns the filename of the local copy of the event_stat file
+  static TString name;
+  //  name.Form("%s/event_stat_%s_%d.root", path, suffix, run);
+  name.Form("%s/event_stat_%d.root", path, run);
+  return name.Data();
+
+}
+
+double meanMed(double* vec, int np, double nsigmaCut, int &nrej, int *rejList)
+{
+  // compute the mean of the array "vec" rejecting the outliers
+  // if rejlist array is provided, fill indices of rejected values
+  // This method works assuming that the "good" points are nearly normally 
+  // distrubted around the mean (i.e. there is no significant trend)
+  //
+  // create copy of the vector
+  double *vec1 = new Double_t[np];
+  memcpy(vec1, vec, np*sizeof(double));
+  //
+  // get median of the vector as a robust initial estimate of the mean
+  cout << "Points " << np << endl;
+  double md = GetMedian(vec1,np);
+  //
+  // compute squared differences to median, 
+  for (int i=0;i<np;i++) {
+    vec1[i] = TMath::Abs(vec1[i] - md);
+  }
+  //
+  // compute median squared difference for robust estimate of the sigma
+  double sigmd = GetMedian(vec1,np);
+  //
+  printf("Median Value: %+e | Median abs residual: %e\n",md,sigmd);
+  //
+  sigmd /= 0.6745; // go to sigma assuming normal distribution
+  printf("Estimate of sigma: %+e\n",sigmd);
+  // if the estimate of the sigma is null, do not look for outliers
+
+  cout<<"md="<<md<<endl;
+
+  if(!sigmd) return md;
+
+
+
+  // compute mean rejecting more than nsigmaCut deviations
+  double mean = 0;
+  int npok = 0;
+  for (int i=0;i<np;i++) {
+    double dev =  TMath::Abs(vec[i]-md)/sigmd;
+    if ( dev < nsigmaCut ) {
+      mean += vec[i];
+      npok++;
+    }
+    else {
+      printf("Reject#%d (Y=%+e) : deviation: %e\n",i,vec[i],dev);
+      if (rejList) rejList[nrej] = i; 
+      nrej++;
+    }
+  }
+  //
+  delete vec1;
+  return npok ? mean/npok : 0;
+  //
+
+
+  cout<<"ending meanMed"<<endl;
+
+}
+
+double GetMedian(double* arr, int n)
+{
+  // get median by Wirths algroithm
+  int i=0,j=0,l=0,m=0;
+  double x;
+  l=0 ; m=n-1;
+  int k = (n&1) ? n/2 : n/2-1;
+  while (l<m) {
+    x=arr[k] ;
+    i=l ;
+    j=m ;
+    do {
+      //      cout << arr[i] << " " << arr[j] << i<<","<<j << " " << arr[k]  << " " << k << " " << x<< endl;
+      
+      while (arr[i]<x) i++ ;
+      while (x<arr[j]) j-- ;
+      if (i<=j) { // swap elements       
+       //      cout << "Swapping" << endl;       
+       double t = arr[i];
+       arr[i] = arr[j];
+       arr[j] = t;
+       i++ ; j-- ;
+      }      
+    } while (i<=j) ;
+    if (j<k) l=i ;
+    if (k<i) m=j ;
+  }
+  return arr[k] ;
+}
+
+// double GetMedian(double* arr, int n)
+// {
+//   // get median by Wirths algroithm
+//   int i,j,l,m;
+//   double x;
+//   l=0 ; m=n-1;
+//   int k = (n&1) ? n/2 : n/2-1;
+//   while (l<m) {
+//     x=arr[k] ;
+//     i=l ;
+//     j=m ;
+//     do {
+//       //      cout << i << " " << j << endl;
+      
+//       //skip runs which were not set (value is -1)
+//       while (arr[i]<x) i++ ;
+//       while (x<arr[j]) j-- ;
+//       if(i<=j) { // swap elements
+//     // if((TMath::Abs(arr[i]+1)< 0.0001) && ((TMath::Abs(arr[j]+1)<0.0001))){
+//     //   i++ ; j-- ;
+//     // } else {
+//       double t = arr[i];
+//       arr[i] = arr[j];
+//       arr[j] = t;
+//       i++ ; j-- ;
+//       //    }
+//       }      
+//     } while (i<=j) ;
+//     if (j<k) l=i ;
+//     if (k<i) m=j ;
+    
+//   }
+//   return arr[k] ;
+// }
+
+TGraphErrors * GetGraphRej(TGraphErrors * gr, TList * rejRunList, const char * reason, Float_t &mean, Bool_t doDraw) {
+
+  //Returns a new graph containing only rejected points
+
+  const Double_t nsigmaCut = 3;
+
+  int *rejList = new Int_t[gr->GetN()];
+  int nrej = 0;
+
+  Double_t * array = new Double_t[gr->GetN()];
+  Int_t * correspondenceFullArray = new Int_t[gr->GetN()];
+  Int_t npoint = 0; 
+  //exclude from the array all the -1
+  for(Int_t ipoint = 0; ipoint < gr->GetN(); ipoint++){
+    if (TMath::Abs(gr->GetY()[ipoint]+1)>0.001) { // skip points for which there is no file (==-1)
+      array[npoint] = gr->GetY()[ipoint];
+      correspondenceFullArray[npoint] = ipoint;
+      npoint++;
+    } 
+  }
+
+  cout<<"calling meanMed"<<endl;
+  mean = meanMed(array,npoint,nsigmaCut, nrej, rejList);
+
+  cout<<"nrej="<<nrej<<"  mean="<<mean<<endl;
+  
+    
+  TGraphErrors *grrej = new TGraphErrors(nrej);
+  for (int i=0;i<nrej;i++) {
+    grrej->SetPoint(i, gr->GetX()[correspondenceFullArray[rejList[i]]], gr->GetY()[correspondenceFullArray[rejList[i]]]);
+    grrej->SetPointError(i, gr->GetEX()[correspondenceFullArray[rejList[i]]], gr->GetEY()[correspondenceFullArray[rejList[i]]]);
+    if(!knownProblems.Contains(Form("%d",(int)gr->GetX()[correspondenceFullArray[rejList[i]]])))
+      rejRunList->Add(new TObjString(Form("[%d], %s",  (int)gr->GetX()[correspondenceFullArray[rejList[i]]], reason)));
+  }
+  grrej->SetMarkerColor(kRed);
+  grrej->SetMarkerStyle(gr->GetMarkerStyle());
+  
+
+
+  delete rejList;
+
+  if(doDraw) {
+    Float_t minXDraw = gr->GetXaxis()->GetBinLowEdge(1);
+    Float_t maxXDraw = gr->GetXaxis()->GetBinLowEdge(gr->GetXaxis()->GetNbins());
+
+    grrej->Draw("P");
+    TLine * l = new TLine (minXDraw, mean,maxXDraw, mean);
+    l->SetLineStyle(kDashed);
+    l->Draw();
+
+
+  }
+
+  return grrej;
+
+
+
+} 
+
+void loadlibs()
+{
+  gSystem->Load("libVMC");
+  gSystem->Load("libTree");
+  gSystem->Load("libSTEERBase");
+  gSystem->Load("libESD");
+  gSystem->Load("libAOD");
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  gSystem->Load("libCORRFW");
+  gSystem->Load("libMinuit");
+  gSystem->Load("libPWG2spectra");
+  gSystem->Load("libPWG0base"); 
+}
diff --git a/PWG1/macros/PhysSel/QALHC11c_QA69.h b/PWG1/macros/PhysSel/QALHC11c_QA69.h
new file mode 100644 (file)
index 0000000..e31e650
--- /dev/null
@@ -0,0 +1,120 @@
+//---------------------------------------------------------\r
+// PARAMETERS TO BE SET BY HAND\r
+\r
+\r
+// const Int_t runs[]={ 139173, 139172, 139110, 139107, 139042, 139038, 138973, 138796, 138795, 138742, 138740, 138737, 138736, 138732, 138731, 138730, 138666, 138662, 138653, 138652, 138638, 138637, 138624, 138621, 138620, 138583, 138582, 138579, 138578, 138534, 138533, 138469, 138442, 138439, 138438, 138396, 138275, 138225, 138201, 138200, 138197, 138192, 138190, 138154, 138153, 138151, 138150, 138126, 138125, 137848, 137847, 137844, 137843, 137752, 137751, 137748, 137724, 137722, 137718, 137704, 137693, 137692, 137691, 137689, 137686, 137685, 137639, 137638, 137609, 137608, 137595, 137549, 137546, 137544, 137541, 137539, 137531, 137530, 137443, 137441, 137440, 137439, 137434, 137432, 137431, 137430, 137370, 137366, 137365, 137243, 137236, 137235, 137232, 137230, 137165, 137163, 137162, 137161, 137137, 137136, 137135, 137133, 137132, 137125, 137124, 137045, 137042, 136879, 136854, 136851, -1 };\r
+\r
+// const Int_t runs[]={\r
+//   137135, 137161, 137162, 137163, 137165, 137230, 137232, 137235, 137236, 137243, 137365, 137366, 137430, 137431, 137432, 137434, 137439, 137440, 137441, 137443, 137530, 137531, 137539, 137541, 137544, 137546, 137549, 137595, 137638, 137639, 137685, 137691, 137692, 137693, 137704, 137718, 137722, 137724, 137748, 137751, 137752, 137843, 138125, 138126, 138190, 138192, 138200, 138201, 138275, 138359, 138364, 138396, 138438, 138439, 138442, 138469, 138534, 138578, 138579, 138582, 138583, 138621, 138624, 138638, 138653, 138662, 138666, 138730, 138731, 138740, 138830, 138836, 138837, 138870, 138871, 138872, 138924, 138972, 138976, 138977, 138978, 138979, 138980, 138982, 138983, 139024, 139025, 139028, 139029, 139030, 139031, 139034, 139036, 139037, 139038, 139042, 139105, 139107, 139172, 139173, 139309, 139310, 139314, 139328, 139329, 139360, 139437, 139438, 139440, 139441, 139465, 139503, 139505, 139507, 139510, -1};\r
+\r
+const Int_t runs[]={\r
+  154808,\r
+  154796,\r
+  154793,\r
+  154789,\r
+  154787,\r
+  154786,\r
+  154783,\r
+  154780,\r
+  154773,\r
+  154763,\r
+  154570,\r
+  154495,\r
+  154485,\r
+  154483,\r
+  154482,\r
+  154480,\r
+  154478,\r
+  154448,\r
+  154385,\r
+  154383,\r
+  154382,\r
+  154289,\r
+  154286,\r
+  154283,\r
+  154281,\r
+  154273,\r
+  154270,\r
+  154269,\r
+  154266,\r
+  154264,\r
+  154261,\r
+  154257,\r
+  154252,\r
+  154222,\r
+  154221,\r
+  154220,\r
+  154219,\r
+  154211,\r
+  154207,\r
+  154151,\r
+  154143,\r
+  154141,\r
+  154136,\r
+  154132,\r
+  154126,\r
+  154130,\r
+  153738,\r
+  153733,\r
+  153728,\r
+  153727,\r
+  153726,\r
+  153725,\r
+  153718,\r
+  153709,\r
+  153702,\r
+  153594,\r
+  153591,\r
+  153589,\r
+  153571,\r
+  153570,\r
+  153566,\r
+  153560,\r
+  153558,\r
+  153552,\r
+  153548,\r
+  153544,\r
+  153542,\r
+  153541,\r
+  153539,\r
+  153536,\r
+  153533,\r
+  153373,\r
+  153371,\r
+  153369,\r
+  153363,\r
+  153362,\r
+  -1\r
+};\r
+\r
+\r
+\r
+// check number of processed QA trains for this runs. Try all. \r
+\r
+//const Int_t QAcycle[]={41, 40, 36, 34, 33, 32, 31, -1};\r
+const Int_t QAcycle[]={69,-1};\r
+\r
+\r
+TString location="/alice/data/2011/LHC11c";\r
+//  TString output="ESDs/pass1_4plus/QA";\r
+TString output="ESDs/pass1/QA";\r
+Bool_t localMode = 1; // if true, read local copy\r
+  \r
+\r
+// event stat files are saved locally, with the following suffix. If\r
+// localMode above is true, this local copies are processed rather\r
+// than the originals on alien\r
+const char * localSuffix = "pass1";\r
+//const char * localPath   = "./cache_41/";\r
+const char * localPath   = "./files/";\r
+//const char * localPath   = "./QA_LHC10h_43/";\r
+\r
+// See twiki and update this list, if needed\r
+TString knownProblems = "";\r
+  \r
+// "137161, 137162, 137163, 137165, 138190, 138200, 138201, 138396, 138439, 138469, 138579, 137443, 137230, 137232, 137443, 137531, 137546, 138150, 138154, 138197, 138438, 139024, 139031";\r
+const char * trigger1 = "CEMC7-B-NOPF-ALLNOTRD";//rowCMBAC \r
+const char * trigger2 = "CMUSH7-B-NOPF-MUON";//rowCMBACS2\r
+const char * trigger3 = "CINT7-B-NOPF-ALLNOTRD";//rowC0SMH\r
+\r
+const char *period="LHC11c pass1, Cycle QA69";\r
diff --git a/PWG1/macros/PhysSel/rct.dat b/PWG1/macros/PhysSel/rct.dat
new file mode 100644 (file)
index 0000000..2ea4023
--- /dev/null
@@ -0,0 +1,258 @@
+151636 0.0028231498    1782
+151638 0.002517681     1782
+151655 2.1633109311    1783
+151660 1.6133350643    1783
+151661 0.8748519833    1783
+151664 0.3116474856    1783
+151665 0       1783
+151666 0       1783
+151669 0       1783
+151671 0       1783
+151672 0       1783
+151674 0       1783
+151678 0.0137551474    1783
+151680 0.0108762012    1783
+151681 0       1783
+151689 0.2332762702    1783
+151724 0.619482577     1785
+151732 0.8401575573    1785
+151751 0.8988225529    1785
+151752 0.8754100298    1785
+151849 5.4992698192    1787
+151850 5.3717756335    1787
+151851 5.4862814698    1787
+151852 5.4127983693    1787
+152002 12.4186469891   1795
+152003 2.4302063628    1795
+152005 0.1416412064    1795
+152007 0.1580753084    1795
+152008 0.489156055     1795
+152011 0.1103762594    1795
+152015 0.1109115235    1795
+152046 6.702005744     1796
+152078 2.916036775     1798
+152079 2.6821180728    1798
+152081 2.4552424025    1798
+152082 0.7842170474    1798
+152083 1.9964911343    1798
+152086 1.8226799636    1798
+152087 1.760352228     1798
+152089 1.6431650059    1798
+152090 1.7370380585    1798
+152091 1.6954057189    1798
+152136 1.5971151606    1799
+152137 0.3614983356    1799
+152138 0.8770083069    1799
+152146 0.7223614611    1799
+152206 1.5278105687    1800
+152207 1.3730395076    1800
+152208 1.3692674211    1800
+152209 1.4547033672    1800
+152214 4.2697811836    1800
+152256 9.1198859373    1801
+152257 2.5816861109    1801
+152284 3.8462774307    1802
+152285 2.7764895027    1802
+152306 0.8362371943    1803
+152309 0.6021126761    1803
+152310 0.7581445429    1803
+152311 0.7051542591    1803
+152312 0.7191922461    1803
+152313 0.6997330169    1803
+152314 0.6666534311    1803
+152318 0.6390345738    1803
+152319 0.629737767     1803
+152320 0.6119502317    1803
+152321 0.6059225513    1803
+152322 0.5265588915    1803
+152323 0.5746649452    1803
+152332 0.6113586435    1803
+152334 0.7416367939    1803
+152367 0.7967724896    1804
+152368 0.6323516816    1804
+152369 0.6313094134    1804
+152371 0.5817145245    1804
+152377 0       1804
+152455 0       1805
+152488 1.1099153169    1805
+152512 1.8097788015    1806
+152513 1.1608980879    1806
+152658 0       1809
+152695 0       1812
+152696 0       1812
+152697 0       1812
+152698 0       1812
+152701 0       1812
+152702 0       1812
+152708 0       1812
+152715 0       1812
+152716 0       1812
+152717 0.1737765976    1812
+152718 0.1590892913    1812
+152750 0.2525714433    1813
+152751 0.2416463619    1813
+152772 1.4012179499    1815
+152773 7.4668865834    1815
+152780 0.9972461018    1815
+152817 4.280485044     1816
+152819 2.1757607038    1816
+152820 1.5011644212    1816
+152821 1.0779915727    1816
+152822 0.6533154294    1816
+152823 0.5403316883    1816
+152907 2.5985001515    1822
+152934 1.0038137432    1823
+152935 1.0826080178    1823
+153056 0.1080064571    1835
+153059 0.1450029911    1835
+153115 0.1489969902    1836
+153116 0.1306574771    1836
+153117 0.1207284771    1836
+153120 0.1108242249    1836
+153121 0.0968695426    1836
+153127 0.065410876     1836
+153223 0.2056661437    1841
+153227 0.1996151648    1841
+153232 0.1538345027    1841
+153234 0.0897146924    1841
+153296 0.1189265719    1844
+153360 0.2710629067    1845
+153362 0.0858490477    1845
+153363 0.0782742931    1845
+153369 0.0800503577    1845
+153371 0.0776839924    1845
+153373 0.077839036     1845
+153413 0.0715149373    1846
+153415 0.0710056912    1846
+153465 0.0633498146    1848
+153513 0.0889712328    1851
+153533 0.1308850013    1852
+153536 0.1040926682    1852
+153539 0.0959662289    1852
+153541 0.0909361349    1852
+153542 0.0984486874    1852
+153544 0.0892838196    1852
+153548 0.0738864011    1852
+153552 0.0770619434    1852
+153558 0.0708674981    1852
+153560 0.0767376528    1852
+153566 0.0794711751    1852
+153570 0.0743148947    1852
+153571 0.0655876451    1852
+153578 0.066251138     1852
+153583 0.0530814835    1852
+153587 0.0550016667    1852
+153588 0.0716669315    1852
+153589 0.0661758387    1852
+153591 0.0623189059    1852
+153594 0.0631536577    1852
+153702 0.0996371292    1855
+153709 0.089100299     1855
+153718 0.0948172656    1855
+153725 0.0652818991    1855
+153726 0.0637328115    1855
+153727 0.0707358515    1855
+153728 0.075976689     1855
+153733 0.0647871361    1855
+153738 0.0569144349    1855
+153776 0.3855507868    1856
+153777 0.1701579117    1856
+153778 0.2123692287    1856
+153779 0.2031040942    1856
+153781 0.112244898     1856
+153784 0.1760670732    1856
+153794 0.1502769231    1856
+153796 0.1167336171    1856
+153798 0.2393231265    1856
+153805 0.1044634378    1856
+153807 0.1308644988    1856
+153808 0.1137706856    1856
+153812 0.1129032258    1856
+153873 0.0994170351    1859
+153875 0.1123474217    1859
+153876 0.0914900961    1859
+153906 0.1097111248    1862
+153909 0.103950452     1862
+153911 0.0957197391    1862
+153916 0.0869310698    1862
+153924 0.0852008675    1862
+153929 0.1070139652    1862
+153935 0.0825355757    1862
+153938 0.118705036     1862
+153939 0.137517906     1862
+153944 0.1020092736    1862
+153946 0.0658581517    1862
+153954 0.0929768638    1862
+154018 0.1168269683    1863
+154024 0.0999862278    1863
+154026 0.1052784223    1863
+154030 0.0664027002    1863
+154031 0.0884308731    1863
+154039 0.0682411842    1863
+154081 0.1501436782    1864
+154083 0.0896329936    1864
+154091 0.105226526     1864
+154125 0.3444444444    1865
+154126 0.2724733554    1865
+154129 0.2501184273    1865
+154130 0.1955659442    1865
+154131 0.1396116258    1865
+154132 0.1730599258    1865
+154136 0.1632176235    1865
+154138 0.1113707165    1865
+154141 0.1302631579    1865
+154143 0.1241274914    1865
+154145 0.1346328196    1865
+154151 0.1056021943    1865
+154158 0.0994974874    1865
+154163 0.0879603988    1865
+154207 0.2707116991    1867
+154211 0.1550727253    1867
+154219 0.1040862442    1867
+154220 0.1089108911    1867
+154221 0.0665658094    1867
+154222 0.0861124158    1867
+154252 0.2246171299    1868
+154257 0.1425178147    1868
+154261 0.1516878142    1868
+154264 0.1728579828    1868
+154266 0.119626342     1868
+154269 0.101099008     1868
+154270 0.0928705441    1868
+154273 0.0980663546    1868
+154281 0.1018663627    1868
+154283 0.0754207355    1868
+154286 0.0741984857    1868
+154289 0.0963338199    1868
+154293 0.0725251285    1868
+154296 0.0605306256    1868
+154382 0.1393356101    1871
+154383 0.0934513274    1871
+154385 0.0769882685    1871
+154448 0.1307146394    1873
+154478 0.1156054979    1875
+154480 0.1107668474    1875
+154482 0.0832364943    1875
+154483 0.0940448113    1875
+154485 0.0737240076    1875
+154495 0.0923802585    1875
+154570 0.1184008201    1880
+154726 0.1192449069    1883
+154732 0.1088709677    1883
+154733 0.0976331361    1883
+154742 0.0878313638    1883
+154745 0.1035402395    1883
+154748 0.0858646981    1883
+154750 0.1002821793    1883
+154753 0.1356882534    1883
+154755 0.1220596792    1883
+154763 0.036118205     1883
+154773 0.0841376798    1883
+154780 0.0721311475    1883
+154783 0.0608294931    1883
+154786 0.0719084801    1883
+154787 0.0537070524    1883
+154789 0.0912992587    1883
+154793 0.0680819912    1883
+154796 0.0796113973    1883
+154808 0.0858644676    1883
diff --git a/PWG1/macros/PhysSel/read.C b/PWG1/macros/PhysSel/read.C
new file mode 100644 (file)
index 0000000..1712db9
--- /dev/null
@@ -0,0 +1,1666 @@
+#include "QALHC11c_QA69.h"
+#include "DefinePlots.h"
+#include "TGraphErrors.h"
+
+TH1F *fAccOverAll[3];
+TH1F *fBGOverAll[3];
+TH1F *fV0BGOverAll[3];
+TH1F *fV0ABGOverAll[3];
+TH1F *fV0CBGOverAll[3];
+TH1F *fAfterOverBefore[3];
+TH1F *fV0AOverV0C[3];
+TH1F *fF02OverAll[3];
+TH1F *fF01OverAll[3];
+
+TFile fou;
+TLine *l1=new TLine(153776, 0, 153776, 1);
+TH1F * GetEmpty(const char * name, Int_t nfile);
+TGraphErrors * GetGraphRej(TGraphErrors * gr, TList * rejRunList, const char * reason, Float_t &mean, Bool_t doDraw) ;
+double GetMedian(double* arr, int n);
+double meanMed(double* vec, int np, double nsigmaCut, int &nrej, int *rejList);
+TGraphErrors * graph[kNGraphs];
+
+
+void read(){
+  
+  for(Int_t i=0;i<3;++i){
+    fAccOverAll[i]=new TH1F(Form("fAccOverAll_%d",i),Form("fAccOverAll_%d",i),100,0,1);
+    fBGOverAll[i]=new TH1F(Form("fBGOverAll_%d",i),Form("fBGOverAll_%d",i),50,0,0.5);
+    fV0BGOverAll[i]=new TH1F(Form("fV0BGOverAll_%d",i),Form("fV0BGOverAll_%d",i),50,0,0.1);
+    fV0ABGOverAll[i]=new TH1F(Form("fV0ABGOverAll_%d",i),Form("fV0ABGOverAll_%d",i),50,0,0.1);
+    fV0CBGOverAll[i]=new TH1F(Form("fV0CBGOverAll_%d",i),Form("fV0CBGOverAll_%d",i),50,0,0.1);
+    fAfterOverBefore[i]=new TH1F(Form("fAfterOverBefore_%d",i),Form("fAfterOverBefore_%d",i),100,0.5,1);
+    fV0AOverV0C[i]=new TH1F(Form("fV0AOverV0C_%d",i),Form("fV0AOverV0C_%d",i),100,0.7,1.2);
+    fF01OverAll[i]=new TH1F(Form("fF01OverAll_%d",i),Form("fF01OverAll_%d",i),200,0.6,1.1);
+    fF02OverAll[i]=new TH1F(Form("fF02OverAll_%d",i),Form("fF02OverAll_%d",i),200,0.6,1.1);
+  }
+
+
+
+
+  TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
+  dir.ReplaceAll("read.C","");
+  dir.ReplaceAll("/./","/");
+  
+  // read file and add to fit object
+  Double_t *run = new Double_t[1330];
+  Double_t *ratio1 = new Double_t[1330];
+  Double_t *nofill = new Double_t[1330];
+  Double_t vX, vY, vZ;
+  Int_t vNData = 0;
+  ifstream vInput;
+  vInput.open(Form("%srct.dat",dir.Data()));
+  while (1) {
+    vInput >> vX >> vY >> vZ;
+    if (!vInput.good()) break;
+    run[vNData] = vX;
+    ratio1[vNData] = vY;
+    nofill[vNData] = vZ;
+    vNData++;
+  }//while
+  vInput.close();
+
+  grin = new TGraph(vNData,run,ratio1);
+  cout<<"n points="<<grin->GetN()<<endl;
+
+
+  Int_t NoFillings=0;
+  for(Int_t i=1;i<grin->GetN();++i){
+    if(nofill[i]!=nofill[i-1])
+      NoFillings++;
+  }
+  cout<<"No. Dif. de Fill="<<NoFillings<<endl;
+
+  Int_t *boundary_run=new Double_t[NoFillings];
+  Int_t *boundary_fill=new Double_t[NoFillings];
+  Int_t counter=0;
+  for(Int_t i=1;i<grin->GetN();++i){
+    if(nofill[i]!=nofill[i-1]){
+      boundary_run[counter]=run[i-1];
+      boundary_fill[counter]=nofill[i-1];
+      counter++;
+    }
+    
+  }
+
+
+  const Int_t NoOfFill =NoFillings;
+  TLine *l2[NoOfFill];
+
+  for(Int_t i=0;i<NoFillings;++i){
+    cout<<"interfaz run="<<boundary_run[i]<<";  Fill #"<<boundary_fill[i]<<endl;
+    l2[i]=new TLine(boundary_run[i], 0, boundary_run[i], 20);
+  }
+
+
+
+
+  gStyle->SetOptStat(0);
+  gStyle->SetPalette(1);
+  gStyle->SetCanvasColor(10);
+  gStyle->SetFrameFillColor(10);
+  gStyle->SetOptStat(0);
+  gStyle->SetOptTitle(0);
+  
+
+
+
+
+
+  loadlibs();
+  TList * listRejectedRuns = new TList(); // keep track of rejected runes
+
+  
+  
+  
+  
+  
+  for(Int_t i=0;i<3;++i)
+    cout<<gnames[i]<<endl;
+  
+  fou = new TFile("qaLHC10apass2.root");
+  for(Int_t igraph = 0; igraph < kNGraphs; igraph++){
+    graph[igraph]=(TGraphErrors *)  fou.Get(gnames[igraph]);
+  }
+  
+  GetHisto(graph[kGraphBGOverAllAC],fBGOverAll[0]);
+  GetHisto(graph[kGraphBGOverAllAC2],fBGOverAll[1]);
+  GetHisto(graph[kGraphBGOverAllSMH],fBGOverAll[2]);
+  
+  GetHisto(graph[kGraphV0BGOverAllAC],fV0BGOverAll[0]);
+  GetHisto(graph[kGraphV0BGOverAllAC2],fV0BGOverAll[1]);
+  GetHisto(graph[kGraphV0BGOverAllSMH],fV0BGOverAll[2]);
+  
+  
+  GetHisto(graph[kGraphV0ABGOverAllAC],fV0ABGOverAll[0]);
+  GetHisto(graph[kGraphV0ABGOverAllAC2],fV0ABGOverAll[1]);
+  GetHisto(graph[kGraphV0ABGOverAllSMH],fV0ABGOverAll[2]);
+  
+  GetHisto(graph[kGraphV0CBGOverAllAC],fV0CBGOverAll[0]);
+  GetHisto(graph[kGraphV0CBGOverAllAC2],fV0CBGOverAll[1]);
+  GetHisto(graph[kGraphV0CBGOverAllSMH],fV0CBGOverAll[2]);
+  
+  GetHisto(graph[kGraphNevACratioAfter],fAfterOverBefore[0]);
+  GetHisto(graph[kGraphNevAC2ratioAfter],fAfterOverBefore[1]);
+  GetHisto(graph[kGraphNevSMHratioAfter],fAfterOverBefore[2]);
+
+  GetHisto(graph[kGraphV0AOverV0CAC],fV0AOverV0C[0]);
+  GetHisto(graph[kGraphV0AOverV0CAC2],fV0AOverV0C[1]);
+  GetHisto(graph[kGraphV0AOverV0CSMH],fV0AOverV0C[2]);
+
+  GetHisto(graph[kGraphFO1OverAllAC],fF01OverAll[0]);
+  GetHisto(graph[kGraphFO1OverAllAC2],fF01OverAll[1]);
+  GetHisto(graph[kGraphFO1OverAllSMH],fF01OverAll[2]);
+
+  GetHisto(graph[kGraphFO2OverAllAC],fF02OverAll[0]);
+  GetHisto(graph[kGraphFO2OverAllAC2],fF02OverAll[1]);
+  GetHisto(graph[kGraphFO2OverAllSMH],fF02OverAll[2]);
+
+
+
+  Float_t meanDummy;
+  
+
+
+
+  /*
+    THREE TRIGGERS IN THE SAME CANVAS
+    
+  */
+  c4a = new TCanvas("GraphACCOverAll","GraphACCOverAll",1000,700);
+  
+
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c4a->cd();
+  pad1->Draw();
+
+
+  pad1->cd();
+
+
+  graph[kGraphACCOverAllAC]->Draw("PA");
+  graph[kGraphACCOverAllACRej] = GetGraphRej(graph[kGraphACCOverAllAC] , listRejectedRuns, "Acc/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  GetHisto(graph[kGraphACCOverAllAC],fAccOverAll[0]);
+  fAccOverAll[0]->Draw();
+
+
+
+
+
+  pad2->cd();
+
+
+  graph[kGraphACCOverAllACS2]->Draw("PA");
+  graph[kGraphACCOverAllACS2Rej] = GetGraphRej(graph[kGraphACCOverAllACS2] , listRejectedRuns, "Acc/All [ACS2]" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  GetHisto(graph[kGraphACCOverAllACS2],fAccOverAll[1]);
+  fAccOverAll[1]->Draw();
+
+
+
+  pad3->cd();
+
+
+  graph[kGraphACCOverAllSMH]->Draw("PA");
+  graph[kGraphACCOverAllSMHRej] = GetGraphRej(graph[kGraphACCOverAllSMH] , listRejectedRuns, "Acc/All SMH" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  //fAccOverAll[i]
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  GetHisto(graph[kGraphACCOverAllSMH],fAccOverAll[2]);
+  fAccOverAll[2]->Draw();
+  fAccOverAll[2]->GetXaxis()->SetTitle("Accepted / All");
+
+  /*
+  for(Int_t ipoint = 0; ipoint < graph[kGraphACCOverAllAC]->GetN(); ipoint++){
+    fhistTest->Fill(graph[kGraphACCOverAllAC]->GetY()[ipoint]);
+  }
+
+  pad1->cd(4);
+  fhistTest->Sumw2();
+  fhistTest->SetMarkerStyle(25);
+  fhistTest->GetXaxis()->SetTitle(ylabels[kGraphACCOverAllAC]);
+  fhistTest->GetYaxis()->SetTitle("Entries");
+  fhistTest->Draw();
+  */
+  //pad1->cd(2);
+
+
+
+
+
+  c4a->Update();
+  gSystem->ProcessEvents();
+  c4a->SaveAs(Form("picturesLHC11hAOD50/c4a_%s.png",c4a->GetName()));
+
+
+
+  c5a = new TCanvas("GraphNev","GraphNev",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+  pad1->cd(1);
+  //pad1->cd(1)->SetLogy(1);
+  graph[kGraphNevAC]->Draw("PA");
+
+  pad1->cd(2);
+  //pad1->cd(2)->SetLogy(1);
+  graph[kGraphNevAC2]->Draw("PA");
+
+
+  pad1->cd(3);
+  //pad1->cd(3)->SetLogy(1);
+  graph[kGraphNevSMH]->Draw("PA");
+
+
+  c5a->Update();
+  gSystem->ProcessEvents();
+  c5a->SaveAs(Form("picturesLHC11hAOD50/c5a_%s.png",c5a->GetName()));
+
+
+
+
+
+  c7a = new TCanvas("GraphBGOverAll","GraphACCOverAll",1000,700);
+  
+
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7a->cd();
+  pad1->Draw();
+
+
+  pad1->cd();
+
+  graph[kGraphBGOverAllAC]->Draw("PA");
+  graph[kGraphBGOverAllAC] = GetGraphRej(graph[kGraphBGOverAllAC] , listRejectedRuns, "BG/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fBGOverAll[0]->Draw();
+
+
+
+
+
+
+  pad2->cd();
+
+  graph[kGraphBGOverAllAC2]->Draw("PA");
+  graph[kGraphBGOverAllAC2] = GetGraphRej(graph[kGraphBGOverAllAC2] , listRejectedRuns, "BG/All AC2" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fBGOverAll[1]->Draw();
+
+
+
+  pad3->cd();
+
+  graph[kGraphBGOverAllSMH]->Draw("PA");
+  graph[kGraphBGOverAllSMHRej] = GetGraphRej(graph[kGraphBGOverAllSMH] , listRejectedRuns, "BG/All SMH" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+
+  fBGOverAll[2]->GetXaxis()->SetTitle("BG / All");
+  fBGOverAll[2]->Draw();
+
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+  c7a->Update();
+  gSystem->ProcessEvents();
+  c7a->SaveAs(Form("picturesLHC11hAOD50/c7a_%s.png",c7a->GetName()));
+
+
+
+  c7b = new TCanvas("GraphV0BGOverAll","GraphV0BGOverAll",1000,700);
+    TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7b->cd();
+
+
+
+  pad1->cd();
+
+  graph[kGraphV0BGOverAllAC]->Draw("PA");
+  graph[kGraphV0BGOverAllAC] = GetGraphRej(graph[kGraphV0BGOverAllAC] , listRejectedRuns, "V0BG/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0BGOverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0BGOverAllAC2]->Draw("PA");
+  graph[kGraphV0BGOverAllAC2] = GetGraphRej(graph[kGraphV0BGOverAllAC2] , listRejectedRuns, "V0BG/All AC2" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0BGOverAll[1]->Draw();
+
+  pad3->cd();
+  graph[kGraphV0BGOverAllSMH]->Draw("PA");
+  graph[kGraphV0BGOverAllSMHRej] = GetGraphRej(graph[kGraphV0BGOverAllSMH] , listRejectedRuns, "V0BG/All SMH" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0BGOverAll[2]->GetXaxis()->SetTitle("V0BG / All");
+  fV0BGOverAll[2]->Draw();
+
+
+
+  c7b->Update();
+  gSystem->ProcessEvents();
+  c7b->SaveAs(Form("picturesLHC11hAOD50/c7b_%s.png",c7b->GetName()));
+
+
+
+
+
+
+
+
+
+
+  c7c = new TCanvas("GraphV0A_BGOverAll","GraphV0A_BGOverAll",1000,700);
+   TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7c->cd();
+
+  pad1->cd(); 
+
+
+  graph[kGraphV0ABGOverAllAC]->Draw("PA");
+  graph[kGraphV0ABGOverAllAC] = GetGraphRej(graph[kGraphV0ABGOverAllAC] , listRejectedRuns, "V0A_BG/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0ABGOverAll[0]->Draw();
+
+
+
+  pad2->cd(); 
+  graph[kGraphV0ABGOverAllAC2]->Draw("PA");
+  graph[kGraphV0ABGOverAllAC2] = GetGraphRej(graph[kGraphV0ABGOverAllAC2] , listRejectedRuns, "V0A_BG/All AC2" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0ABGOverAll[1]->Draw();
+
+  pad3->cd(); 
+  graph[kGraphV0ABGOverAllSMH]->Draw("PA");
+  graph[kGraphV0ABGOverAllSMHRej] = GetGraphRej(graph[kGraphV0ABGOverAllSMH] , listRejectedRuns, "V0A_BG/All SMH" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0ABGOverAll[2]->Draw();
+  fV0ABGOverAll[2]->GetXaxis()->SetTitle("V0ABG / All");
+
+
+  c7c->Update();
+  gSystem->ProcessEvents();
+  c7c->SaveAs(Form("picturesLHC11hAOD50/c7c_%s.png",c7c->GetName()));
+
+
+
+
+
+  c7d = new TCanvas("GraphV0C_BGOverAll","GraphV0C_BGOverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+  c7d->cd();
+
+  pad1->cd();
+  graph[kGraphV0CBGOverAllAC]->Draw("PA");
+  graph[kGraphV0CBGOverAllAC] = GetGraphRej(graph[kGraphV0CBGOverAllAC] , listRejectedRuns, "V0C_BG/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0CBGOverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0CBGOverAllAC2]->Draw("PA");
+  graph[kGraphV0CBGOverAllAC2] = GetGraphRej(graph[kGraphV0CBGOverAllAC2] , listRejectedRuns, "V0C_BG/All AC2" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0CBGOverAll[1]->Draw();
+
+
+          pad3->cd();
+  graph[kGraphV0CBGOverAllSMH]->Draw("PA");
+  graph[kGraphV0CBGOverAllSMHRej] = GetGraphRej(graph[kGraphV0CBGOverAllSMH] , listRejectedRuns, "V0A_BG/All SMH" ,  meanDummy, 1);
+
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0CBGOverAll[2]->Draw();
+  fV0CBGOverAll[2]->GetXaxis()->SetTitle("V0CBG / All");
+
+
+
+  c7d->Update();
+  gSystem->ProcessEvents();
+  c7d->SaveAs(Form("picturesLHC11hAOD50/c7d_%s.png",c7d->GetName()));
+
+
+
+
+
+  c8a = new TCanvas("GraphAfterOverBefore","GraphAfterOverBefore",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+  
+  pad1->cd();
+  
+  graph[kGraphNevACratioAfter]->Draw("PA");
+  graph[kGraphNevACratioAfterRej] = GetGraphRej(graph[kGraphNevACratioAfter] , listRejectedRuns, "V0BG/All AC" ,  meanDummy, 1);
+
+  l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+
+  
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fAfterOverBefore[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphNevAC2ratioAfter]->Draw("PA");
+  graph[kGraphNevAC2ratioAfterRej] = GetGraphRej(graph[kGraphNevAC2ratioAfter] , listRejectedRuns, "V0BG/All AC2" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fAfterOverBefore[1]->Draw();
+
+  pad3->cd();
+  graph[kGraphNevSMHratioAfter]->Draw("PA");
+  graph[kGraphNevSMHratioAfterRej] = GetGraphRej(graph[kGraphNevSMHratioAfter] , listRejectedRuns, "V0BG/All SMH" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fAfterOverBefore[2]->Draw();
+  fAfterOverBefore[2]->GetXaxis()->SetTitle("After_PS / Before_PS");
+
+
+  c8a->Update();
+  gSystem->ProcessEvents();
+  c8a->SaveAs(Form("picturesLHC11hAOD50/c8a_%s.png",c8a->GetName()));
+
+
+
+
+
+  c8b = new TCanvas("GraphNevBefore","GraphNevBefore",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+
+  pad1->cd(1);
+  graph[kGraphNevACBefore]->Draw("PA");
+
+  pad1->cd(2);
+  graph[kGraphNevAC2Before]->Draw("PA");
+
+  pad1->cd(3);
+  graph[kGraphNevSMHBefore]->Draw("PA");
+
+
+
+  c8b->Update();
+  gSystem->ProcessEvents();
+  c8b->SaveAs(Form("picturesLHC11hAOD50/c8b_%s.png",c8b->GetName()));
+
+
+
+
+
+  c8c = new TCanvas("GraphNevAfter","GraphNevAfter",1000,700);
+  
+  TPad *pad1 = new TPad("pad1",
+                       "The pad with the function",0.01,0.01,0.99,0.94,0);
+  pad1->Draw();
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+
+
+
+  pad1->Divide(1,3);
+
+  pad1->cd(1);
+  graph[kGraphNevACAfter]->Draw("PA");
+
+
+  pad1->cd(2);
+  graph[kGraphNevAC2After]->Draw("PA");
+
+
+  pad1->cd(3);
+
+  graph[kGraphNevSMHAfter]->Draw("PA");
+
+
+
+  c8c->Update();
+  gSystem->ProcessEvents();
+  c8c->SaveAs(Form("picturesLHC11hAOD50/c8c_%s.png",c8c->GetName()));
+
+
+
+
+
+
+
+
+  c9a = new TCanvas("GraphV0AOverV0C","GraphV0AOverV0C",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();
+
+  pad1->cd();
+  graph[kGraphV0AOverV0CAC]->Draw("PA");
+  graph[kGraphV0AOverV0CACRej] = GetGraphRej(graph[kGraphV0AOverV0CAC] , listRejectedRuns, "Nev_V0A/Nev_V0C AC" ,  meanDummy, 1);
+
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fV0AOverV0C[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphV0AOverV0CAC2]->Draw("PA");
+  graph[kGraphV0AOverV0CAC2Rej] = GetGraphRej(graph[kGraphV0AOverV0CAC2] , listRejectedRuns, "Nev_V0A/Nev_V0C AC2" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fV0AOverV0C[1]->Draw();
+
+
+  pad3->cd();
+  graph[kGraphV0AOverV0CSMH]->Draw("PA");
+  graph[kGraphV0AOverV0CSMHRej] = GetGraphRej(graph[kGraphV0AOverV0CSMH] , listRejectedRuns, "Nev_V0A/Nev_V0C SMH" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fV0AOverV0C[2]->Draw();
+  fV0AOverV0C[2]->GetXaxis()->SetTitle("V0A / VOC");
+
+
+
+  c9a->Update();
+  gSystem->ProcessEvents();
+  c9a->SaveAs(Form("picturesLHC11hAOD50/c9a_%s.png",c9a->GetName()));
+
+
+
+  c10a = new TCanvas("GraphFO1OverAll","GraphFO1OverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();  
+
+
+  pad1->cd();
+  graph[kGraphFO1OverAllAC]->Draw("PA");
+  graph[kGraphFO1OverAllACRej] = GetGraphRej(graph[kGraphFO1OverAllAC] , listRejectedRuns, "Nev_FO1/All AC" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fF01OverAll[0]->Draw();
+
+
+  pad2->cd();
+  graph[kGraphFO1OverAllAC2]->Draw("PA");
+  graph[kGraphFO1OverAllAC2Rej] = GetGraphRej(graph[kGraphFO1OverAllAC2] , listRejectedRuns, "Nev_FO1/All AC2" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fF01OverAll[1]->Draw();
+
+
+
+  pad3->cd();
+  graph[kGraphFO1OverAllSMH]->Draw("PA");
+  graph[kGraphFO1OverAllSMHRej] = GetGraphRej(graph[kGraphFO1OverAllSMH] , listRejectedRuns, "Nev_FO1/All SMH" ,  meanDummy, 1);
+
+ l1->SetLineStyle(3);
+  l1->Draw();
+
+  for(Int_t i=25;i<NoFillings;++i){
+    l2[i]->SetLineStyle(3);
+    l2[i]->SetLineColor(4);
+    l2[i]->Draw();
+  }
+
+
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fF01OverAll[2]->Draw();
+  fF01OverAll[2]->GetXaxis()->SetTitle("F01 / All");
+
+
+
+
+  c10a->Update();
+  gSystem->ProcessEvents();
+  c10a->SaveAs(Form("picturesLHC11hAOD50/c10a_%s.png",c10a->GetName()));
+
+
+
+
+  c10b = new TCanvas("GraphFO2OverAll","GraphFO2OverAll",1000,700);
+  TPad * pad1=new TPad("pad1","pad1",0.01,0.635,0.7,0.94,0);
+  TPad * pad2=new TPad("pad2","pad2",0.01,0.33,0.7,0.635,0);
+  TPad * pad3=new TPad("pad3","pad3",0.01,0.01,0.7,0.33,0);
+
+  TPad * pad1a=new TPad("pad1a","pad1a",0.7,0.635,0.99,0.94,0);
+  TPad * pad2a=new TPad("pad2a","pad2a",0.7,0.33,0.99,0.635,0);
+  TPad * pad3a=new TPad("pad3a","pad3a",0.7,0.01,0.99,0.33,0);
+
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  pad1a->Draw();
+  pad2a->Draw();
+  pad3a->Draw();
+
+
+  pad1->SetBottomMargin(0);
+  pad1->SetBorderSize(0);
+  pad1->SetRightMargin(0.01);
+
+  pad2->SetBottomMargin(0.0);
+  pad2->SetTopMargin(0);
+  pad2->SetRightMargin(0.01);
+  pad2->SetBorderSize(0);
+
+  pad3->SetBottomMargin(0.2);
+  pad3->SetTopMargin(0);
+  pad3->SetRightMargin(0.01);
+  pad3->SetBorderSize(0);
+
+  pad1a->SetBottomMargin(0);
+  pad1a->SetBorderSize(0);
+  pad1a->SetRightMargin(0.01);
+
+  pad2a->SetBottomMargin(0.0);
+  pad2a->SetTopMargin(0);
+  pad2a->SetRightMargin(0.01);
+  pad2a->SetBorderSize(0);
+
+  pad3a->SetBottomMargin(0.2);
+  pad3a->SetTopMargin(0);
+  pad3a->SetRightMargin(0.01);
+  pad3a->SetBorderSize(0);
+
+
+  // Draw a global picture title
+  TPaveLabel *title = new TPaveLabel(0.01,0.95,0.99,0.99,
+                                    Form("%s",period));
+
+  title->SetFillColor(0);
+  title->SetTextFont(52);
+  title->SetTextColor(4);
+  title->SetTextSize(0.7);
+  title->Draw();  
+
+
+  pad1->cd();
+  graph[kGraphFO2OverAllAC]->Draw("PA");
+  graph[kGraphFO2OverAllACRej] = GetGraphRej(graph[kGraphFO2OverAllAC] , listRejectedRuns, "Nev_FO2/All AC" ,  meanDummy, 1);
+
+  pad1a->cd();
+  pad1a->cd()->SetGridx(1);
+  fF02OverAll[0]->Draw();
+  fF02OverAll[0]->GetXaxis()->SetTitle("F02 / All");
+
+
+  pad2->cd();
+  graph[kGraphFO2OverAllAC2]->Draw("PA");
+  graph[kGraphFO2OverAllAC2Rej] = GetGraphRej(graph[kGraphFO2OverAllAC2] , listRejectedRuns, "Nev_FO2/All AC2" ,  meanDummy, 1);
+
+  pad2a->cd();
+  pad2a->cd()->SetGridx(1);
+  fF02OverAll[1]->Draw();
+  fF02OverAll[1]->GetXaxis()->SetTitle("F02 / All");
+
+  pad3->cd();
+  graph[kGraphFO2OverAllSMH]->Draw("PA");
+  graph[kGraphFO2OverAllSMHRej] = GetGraphRej(graph[kGraphFO2OverAllSMH] , listRejectedRuns, "Nev_FO2/All SMH" ,  meanDummy, 1);
+
+  pad3a->cd();
+  pad3a->cd()->SetGridx(1);
+  fF02OverAll[2]->Draw();
+  fF02OverAll[2]->GetXaxis()->SetTitle("F02 / All");
+
+
+
+
+
+  c10b->Update();
+  gSystem->ProcessEvents();
+  c10b->SaveAs(Form("picturesLHC11hAOD50/c10b_%s.png",c10b->GetName()));
+
+
+
+
+
+
+
+
+}
+double meanMed(double* vec, int np, double nsigmaCut, int &nrej, int *rejList)
+{
+  // compute the mean of the array "vec" rejecting the outliers
+  // if rejlist array is provided, fill indices of rejected values
+  // This method works assuming that the "good" points are nearly normally 
+  // distrubted around the mean (i.e. there is no significant trend)
+  //
+  // create copy of the vector
+  double *vec1 = new Double_t[np];
+  memcpy(vec1, vec, np*sizeof(double));
+  //
+  // get median of the vector as a robust initial estimate of the mean
+  cout << "Points " << np << endl;
+  double md = GetMedian(vec1,np);
+  //
+  // compute squared differences to median, 
+  for (int i=0;i<np;i++) {
+    vec1[i] = TMath::Abs(vec1[i] - md);
+  }
+  //
+  // compute median squared difference for robust estimate of the sigma
+  double sigmd = GetMedian(vec1,np);
+  //
+  printf("Median Value: %+e | Median abs residual: %e\n",md,sigmd);
+  //
+  sigmd /= 0.6745; // go to sigma assuming normal distribution
+  printf("Estimate of sigma: %+e\n",sigmd);
+  // if the estimate of the sigma is null, do not look for outliers
+
+  cout<<"md="<<md<<endl;
+
+  if(!sigmd) return md;
+
+
+
+  // compute mean rejecting more than nsigmaCut deviations
+  double mean = 0;
+  int npok = 0;
+  for (int i=0;i<np;i++) {
+    double dev =  TMath::Abs(vec[i]-md)/sigmd;
+    if ( dev < nsigmaCut ) {
+      mean += vec[i];
+      npok++;
+    }
+    else {
+      printf("Reject#%d (Y=%+e) : deviation: %e\n",i,vec[i],dev);
+      if (rejList) rejList[nrej] = i; 
+      nrej++;
+    }
+  }
+  //
+  delete vec1;
+  return npok ? mean/npok : 0;
+  //
+
+
+  cout<<"ending meanMed"<<endl;
+
+}
+
+double GetMedian(double* arr, int n)
+{
+  // get median by Wirths algroithm
+  int i=0,j=0,l=0,m=0;
+  double x;
+  l=0 ; m=n-1;
+  int k = (n&1) ? n/2 : n/2-1;
+  while (l<m) {
+    x=arr[k] ;
+    i=l ;
+    j=m ;
+    do {
+      //      cout << arr[i] << " " << arr[j] << i<<","<<j << " " << arr[k]  << " " << k << " " << x<< endl;
+      
+      while (arr[i]<x) i++ ;
+      while (x<arr[j]) j-- ;
+      if (i<=j) { // swap elements       
+       //      cout << "Swapping" << endl;       
+       double t = arr[i];
+       arr[i] = arr[j];
+       arr[j] = t;
+       i++ ; j-- ;
+      }      
+    } while (i<=j) ;
+    if (j<k) l=i ;
+    if (k<i) m=j ;
+  }
+  return arr[k] ;
+}
+
+// double GetMedian(double* arr, int n)
+// {
+//   // get median by Wirths algroithm
+//   int i,j,l,m;
+//   double x;
+//   l=0 ; m=n-1;
+//   int k = (n&1) ? n/2 : n/2-1;
+//   while (l<m) {
+//     x=arr[k] ;
+//     i=l ;
+//     j=m ;
+//     do {
+//       //      cout << i << " " << j << endl;
+      
+//       //skip runs which were not set (value is -1)
+//       while (arr[i]<x) i++ ;
+//       while (x<arr[j]) j-- ;
+//       if(i<=j) { // swap elements
+//     // if((TMath::Abs(arr[i]+1)< 0.0001) && ((TMath::Abs(arr[j]+1)<0.0001))){
+//     //   i++ ; j-- ;
+//     // } else {
+//       double t = arr[i];
+//       arr[i] = arr[j];
+//       arr[j] = t;
+//       i++ ; j-- ;
+//       //    }
+//       }      
+//     } while (i<=j) ;
+//     if (j<k) l=i ;
+//     if (k<i) m=j ;
+    
+//   }
+//   return arr[k] ;
+// }
+
+TGraphErrors * GetGraphRej(TGraphErrors * gr, TList * rejRunList, const char * reason, Float_t &mean, Bool_t doDraw) {
+
+  //Returns a new graph containing only rejected points
+
+  const Double_t nsigmaCut = 3;
+
+  int *rejList = new Int_t[gr->GetN()];
+  int nrej = 0;
+
+  Double_t * array = new Double_t[gr->GetN()];
+  Int_t * correspondenceFullArray = new Int_t[gr->GetN()];
+  Int_t npoint = 0; 
+  //exclude from the array all the -1
+  for(Int_t ipoint = 0; ipoint < gr->GetN(); ipoint++){
+    if (TMath::Abs(gr->GetY()[ipoint]+1)>0.001) { // skip points for which there is no file (==-1)
+      array[npoint] = gr->GetY()[ipoint];
+      correspondenceFullArray[npoint] = ipoint;
+      npoint++;
+    } 
+  }
+
+  cout<<"calling meanMed"<<endl;
+  mean = meanMed(array,npoint,nsigmaCut, nrej, rejList);
+
+  cout<<"nrej="<<nrej<<"  mean="<<mean<<endl;
+  
+    
+  TGraphErrors *grrej = new TGraphErrors(nrej);
+  for (int i=0;i<nrej;i++) {
+    grrej->SetPoint(i, gr->GetX()[correspondenceFullArray[rejList[i]]], gr->GetY()[correspondenceFullArray[rejList[i]]]);
+    grrej->SetPointError(i, gr->GetEX()[correspondenceFullArray[rejList[i]]], gr->GetEY()[correspondenceFullArray[rejList[i]]]);
+    if(!knownProblems.Contains(Form("%d",(int)gr->GetX()[correspondenceFullArray[rejList[i]]])))
+      rejRunList->Add(new TObjString(Form("[%d], %s",  (int)gr->GetX()[correspondenceFullArray[rejList[i]]], reason)));
+  }
+  grrej->SetMarkerColor(kRed);
+  //grrej->SetMarkerStyle(gr->GetMarkerStyle());
+  grrej->SetMarkerStyle(29);
+  grrej->SetMarkerSize(1.5);
+
+
+  delete rejList;
+
+  if(doDraw) {
+    Float_t minXDraw = gr->GetXaxis()->GetBinLowEdge(1);
+    Float_t maxXDraw = gr->GetXaxis()->GetBinLowEdge(gr->GetXaxis()->GetNbins());
+
+    grrej->Draw("P");
+    TLine * l = new TLine (minXDraw, mean,maxXDraw, mean);
+    l->SetLineStyle(kDashed);
+    l->Draw();
+
+
+  }
+
+  return grrej;
+
+
+
+} 
+
+void loadlibs()
+{
+  gSystem->Load("libVMC");
+  gSystem->Load("libTree");
+  gSystem->Load("libSTEERBase");
+  gSystem->Load("libESD");
+  gSystem->Load("libAOD");
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  gSystem->Load("libCORRFW");
+  gSystem->Load("libMinuit");
+  gSystem->Load("libPWG2spectra");
+  gSystem->Load("libPWG0base"); 
+}
+void GetHisto(TGraphErrors * gr, TH1F *ftemp)
+{
+
+  for(Int_t ipoint = 0; ipoint < gr->GetN(); ipoint++){
+  //for(Int_t ipoint = 0; ipoint < gr->GetN(); ipoint++){
+    ftemp->Fill(gr->GetY()[ipoint]);
+  }
+  
+
+  ftemp->Sumw2();
+  ftemp->SetMarkerColor(kRed+2);
+  ftemp->SetLineColor(kRed+2);
+  ftemp->SetMarkerStyle(30);
+  ftemp->GetYaxis()->SetTitle("Entries");
+  ftemp->GetXaxis()->SetLabelSize(0.07);
+  ftemp->GetXaxis()->SetTitleSize(0.09);
+  ftemp->GetYaxis()->SetLabelSize(0.04);
+  ftemp->GetYaxis()->SetTitleSize(0.05);
+  ftemp->GetYaxis()->SetTitleOffset(0.7);
+  ftemp->GetYaxis()->CenterTitle(0);
+  ftemp->GetYaxis()->SetLabelFont(42);
+  ftemp->GetYaxis()->SetTitleFont(42);
+  ftemp->GetYaxis()->SetNoExponent(kTRUE);
+  ftemp->GetXaxis()->SetLabelFont(42);
+  ftemp->GetXaxis()->SetTitleFont(42);
+  ftemp->GetXaxis()->SetNdivisions(5);
+
+
+  return ftemp;
+}