]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added comparison graphs for the Jet QA AOD processing macros.
authordkeijden <dkeijden@cern.ch>
Wed, 7 Jan 2015 10:35:57 +0000 (11:35 +0100)
committersjena <sjena@cern.ch>
Wed, 7 Jan 2015 10:54:46 +0000 (11:54 +0100)
Signed-off-by: sjena <sjena@cern.ch>
PWGPP/analysisQA/README
PWGPP/analysisQA/processJETrackQA.C
PWGPP/analysisQA/processJETriggerQA_V2.C

index bc75069b3aacd8a4a16d9f14e0f90c4e3bc28ad0..2a49232f1dbea5ba6b2f0588627f0e43eac2757c 100644 (file)
@@ -50,6 +50,7 @@ processJETrackQA.C
 
 Processes the results of the JE_PWG4HighPtTrackQA wagon. Should be run with the following arguments:
 TString strFileIn   = "AnalysisResults.root" : the path to the input file.
+TString strFileIn2  = ""                     : the path to a second input file (the train output file), that will be used to compare the graphs with. In the plots this data will be labelled 'previous production. An empty string will give the bare plots without comparisons.
 TString suffix      = "eps"                  : the suffix that determines the output format. For example: eps, pdf, png, etc.
 Int_t cent          = 10                     : the centrality class of the results. Options: 0 (0-10%), 1 (10-30%), 2 (30-50%), 3 (50-80%) and 10 (0-80%). Usually they are published with class 10.
 Int_t trig          = 1                      : linked to the trigger. Default depends on data period: lhc11h: 1, containing lhc12 or lhc13: 5, or else: 6. On doubt one can always referr to the table at the bottom of this paragraph in after checking the AnalysisResults.root file with a browser.
@@ -74,11 +75,12 @@ processJETriggerQA_V2.C
 
 Processes the results of the JE_TriggerQAFullR020 wagon, and if present, can also be used for the results of the JE_TriggerQAFullR020_EMCEGA and JE_TriggerQAFullR020_EMCEJE wagon. Should be run with the following arguments:
 TString strFileIn    = "AnalysisResults.root"      : the path to the input file.
+TString strFileIn2   = ""                          : the path to a second input file (the train output file), that will be used to compare the graphs with. In the plots this data will be labelled 'previous production. An empty string will give the bare plots without comparisons.
 TString suftype      ="eps"                        : the suffix that deternmines the output format. For example: eps, pdf, png, etc.
 Float_t jetR         = 0.2                         : the jetR. Default train value is 0.2, but can otherwise be found by opening the AnalysisResults.root file with the browser.
 Float_t minTrkPT     = 0.15                        : the lower Track momentum cut-off. Default train value is 0.15, but can otherwise be found by opening the AnalysisResults.root file with the browser.
 Float_t minClusterET = 0.3                         : the lower Cluster energy cut-off. Default train value is 0.3, but can otherwise be found by opening the AnalysisResults.root file with the browser.
-nt_t run            = 0                           : enables to add a run number to the plots. Not neccessary for general QA, and can be suppresed by giving the number 0.
+nt_t run             = 0                           : enables to add a run number to the plots. Not neccessary for general QA, and can be suppresed by giving the number 0.
 TString trigsuffix   = ""                          : leave empty to open the results of the JE_TriggerQAFullR020 wagon, but or use "EJE" or "EGA" to use the triggered results otherwise.
 const char* outfile  = "JETriggerQA_outfile.root"  : the path to the place to store the plots as root file. This is in addition to the image files made with in the 'suffix' format.
 
index a10871423627ec6502d3fe49013f07d6cac440b6..ff46649542a119e8c0142235aecdfdc99226d9d4 100644 (file)
@@ -7,7 +7,8 @@
 
 
 const Float_t ptmin =  0.0 ;
-void processJETrackQA(TString strFileIn   = "AnalysisResults.root", 
+void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
+                      TString strFileIn2  = "", 
                      TString suffix      = "eps",
                      Int_t cent          = 10, 
                      Int_t trig          = 1, 
@@ -42,6 +43,11 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   Int_t globCnoSPDCuts = 5;
 
   TFile * f1 = TFile::Open(strFileIn.Data());
+  TFile * f2; Bool_t drawComp = kFALSE;
+  if(strFileIn2!="") {
+    f2 = TFile::Open(strFileIn2.Data());
+    drawComp = kTRUE;
+  }
 
   //Load histograms
   TList *histsGlobSt = 0x0;
@@ -66,17 +72,45 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   if(NEventsGlobCnoSPD==0)
     NEventsGlobCnoSPD=0.1;
 
+  // Perform the same actions for the comparisongraphs
+  TList *histsGlobSt2 = 0x0; TList *histsGlobCnoSPD2 = 0x0; TH1F *fNEventSelGlobSt2; float NEventsGlobSt2; TH1F *fNEventSelGlobCnoSPD2; float NEventsGlobCnoSPD2;
+  if(drawComp) {
+    histsGlobSt2 = (TList*)f2->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globStTrackType,globStCuts,strTrigger.Data(),cent,globStTrackType,globStCuts,strTrigger2.Data()));
+    fNEventSelGlobSt2 = (TH1F*)histsGlobSt2->FindObject("fNEventSel");
+    NEventsGlobSt2 = fNEventSelGlobSt2->GetEntries();
+  
+    histsGlobCnoSPD2 = (TList*)f1->Get(Form("PWG4_HighPtTrackQACent%dTrackType%dCuts%d%s/qa_histsQAtrackCent%dType%dcuts%d%s",cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger.Data(),cent,globCnoSPDTrackType,globCnoSPDCuts,strTrigger2.Data()));
+    //histsGlobCnoSPD->Print();
+    fNEventSelGlobCnoSPD2 = (TH1F*)histsGlobCnoSPD2->FindObject("fNEventSel");
+    NEventsGlobCnoSPD2 = fNEventSelGlobCnoSPD2->GetEntries();
+
+    if(NEventsGlobSt2==0)
+      NEventsGlobSt2=0.1;
+    if(NEventsGlobCnoSPD2==0)
+      NEventsGlobCnoSPD2=0.1;
+  }
+
   //---------------------------------------------------------------------------------------------------
   //                       phi distribution of hybrid tracks
   //---------------------------------------------------------------------------------------------------
 
   TH2F *fPtPhiGlobSt = histsGlobSt->FindObject("fPtPhi");
   TH2F *fPtPhiGlobCnoSPD = histsGlobCnoSPD->FindObject("fPtPhi");
-  fPtPhiGlobSt->SetXTitle("p_{T,track} [GeV]");
+  fPtPhiGlobSt->SetXTitle("p_{T,track} [GeV/c]");
   fPtPhiGlobSt->SetYTitle("#varphi");
-  fPtPhiGlobCnoSPD->SetXTitle("p_{T,track} [GeV]");
+  fPtPhiGlobCnoSPD->SetXTitle("p_{T,track} [GeV/c]");
   fPtPhiGlobCnoSPD->SetYTitle("#varphi");
 
+  TH2F* fPtPhiGlobSt2; TH2F* fPtPhiGlobCnoSPD2;
+  if(drawComp) {
+    fPtPhiGlobSt2 = (TH2F*) histsGlobSt2->FindObject("fPtPhi");
+    fPtPhiGlobCnoSPD2 = (TH2F*) histsGlobCnoSPD2->FindObject("fPtPhi");
+    fPtPhiGlobSt2->SetXTitle("p_{T,track} [GeV/c]");
+    fPtPhiGlobSt2->SetYTitle("#varphi");
+    fPtPhiGlobCnoSPD2->SetXTitle("p_{T,track} [GeV/c]");
+    fPtPhiGlobCnoSPD2->SetYTitle("#varphi");
+  }
+
   TCanvas *c2 =new TCanvas("c2","c2: Phi",600,450);
   Int_t binMin = 1;
   if(ptmin>0.) binMin = fPtPhiGlobSt->GetXaxis()->FindBin(ptmin+0.00001);
@@ -94,11 +128,41 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   fPhiGlobSum->SetTitle("fPhiGlobSum");
   fPhiGlobSum->SetName("fPhiGlobSum");
   fPhiGlobSum->Add(fPhiGlobCnoSPD);
+  fPhiGlobSum->SetLineColor(1);
+  fPhiGlobSum->SetMarkerColor(1);
 
   fPhiGlobSt->Scale(1./NEventsGlobSt,"width");
   fPhiGlobCnoSPD->Scale(1./NEventsGlobSt,"width");
   fPhiGlobSum->Scale(1./NEventsGlobSt,"width");
 
+  if(drawComp) {
+    TH1D *fPhiGlobSt2 = fPtPhiGlobSt2->ProjectionY("fPhiGlobSt_old",binMin,fPtPhiGlobSt->GetNbinsX());
+    TH1D *fPhiGlobCnoSPD2 = fPtPhiGlobCnoSPD2->ProjectionY("fPhiGlobCnoSPD_old",binMin,fPtPhiGlobSt->GetNbinsX());
+  
+    fPhiGlobSt2->SetLineStyle(2);
+    fPhiGlobSt2->SetLineColor(2);
+    fPhiGlobSt2->SetLineWidth(5);
+  
+    fPhiGlobCnoSPD2->SetLineStyle(2);
+    fPhiGlobCnoSPD2->SetLineColor(4);
+    fPhiGlobCnoSPD2->SetLineWidth(5);
+  
+    TH1D *fPhiGlobSum2 = fPhiGlobSt2->Clone();
+    fPhiGlobSum2->SetTitle("fPhiGlobSum_old");
+    fPhiGlobSum2->SetName("fPhiGlobSum_old");
+    fPhiGlobSum2->Add(fPhiGlobCnoSPD2);
+
+    fPhiGlobSum2->SetLineStyle(2);
+    fPhiGlobSum2->SetLineWidth(5);
+    fPhiGlobSum2->SetLineColor(1);
+    fPhiGlobSum2->SetMarkerColor(1);
+  
+    fPhiGlobSt2->Scale(1./NEventsGlobSt2,"width");
+    fPhiGlobCnoSPD2->Scale(1./NEventsGlobSt2,"width");
+    fPhiGlobSum2->Scale(1./NEventsGlobSt2,"width");
+  }
+
   gPad->SetLeftMargin(0.2);
   gPad->SetRightMargin(0.02);
   gPad->SetBottomMargin(0.12);
@@ -113,10 +177,12 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
 
   fPhiGlobSt->DrawCopy("same");
   fPhiGlobCnoSPD->DrawCopy("same");
-  fPhiGlobSum->SetLineColor(1);
-  fPhiGlobSum->SetMarkerColor(1);
   fPhiGlobSum->DrawCopy("same");
+  if(drawComp) {
+    fPhiGlobSt2->DrawCopy("same");
+    fPhiGlobCnoSPD2->DrawCopy("same");
+    fPhiGlobSum2->DrawCopy("same");
+  }
 
   TLegend *leg2 = NULL;
   if(run>0) leg2 = new TLegend(0.22,0.65,0.88,0.88,Form("Hybrid tracks. run:%d",run));
@@ -128,6 +194,8 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   leg2->AddEntry(fPhiGlobSt,"Restricted Tracks","l");
   leg2->AddEntry(fPhiGlobCnoSPD,"Complementary Tracks","l");
   leg2->AddEntry(fPhiGlobSum,"Sum","l");
+  if(drawComp)
+    leg2->AddEntry(fPhiGlobSum2, "Previous production", "l");
   leg2->Draw();
 
   TLatex textNEvents;
@@ -158,17 +226,48 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   fPtGlobSum->SetName("fPtGlobSum");
   fPtGlobSum->Add(fPtGlobCnoSPD);
 
+  fPtGlobSum->SetLineColor(1);
+  fPtGlobSum->SetMarkerColor(1);
+
   fPtGlobSt->Scale(1./NEventsGlobSt,"width");
   fPtGlobCnoSPD->Scale(1./NEventsGlobSt,"width");
   fPtGlobSum->Scale(1./NEventsGlobSt,"width");
 
+
+  if(drawComp) {
+    TH1D *fPtGlobSt2 = fPtPhiGlobSt2->ProjectionX("fPtGlobSt_old");
+    TH1D *fPtGlobCnoSPD2 = fPtPhiGlobCnoSPD2->ProjectionX("fPtGlobCnoSPD_old");
+    fPtGlobSt2->SetLineStyle(2); 
+    fPtGlobSt2->SetLineColor(2);
+    fPtGlobSt2->SetLineWidth(5);
+  
+    fPtGlobCnoSPD2->SetLineStyle(2);
+    fPtGlobCnoSPD2->SetLineColor(4);
+    fPtGlobCnoSPD2->SetLineWidth(5);
+  
+    TH1D *fPtGlobSum2 = fPtGlobSt2->Clone();
+    fPtGlobSum2->SetTitle("fPtGlobSum_old");
+    fPtGlobSum2->SetName("fPtGlobSum_old");
+    fPtGlobSum2->Add(fPtGlobCnoSPD2);
+    fPtGlobSum2->SetLineStyle(2);
+    fPtGlobSum2->SetLineColor(1);
+    fPtGlobSum2->SetMarkerColor(1);
+    fPtGlobSum2->SetLineWidth(5);
+
+    fPtGlobSt2->Scale(1./NEventsGlobSt2,"width");
+    fPtGlobCnoSPD2->Scale(1./NEventsGlobSt2,"width");
+    fPtGlobSum2->Scale(1./NEventsGlobSt2,"width");
+  }
+
   gPad->SetLeftMargin(0.2);
   gPad->SetRightMargin(0.02);
   gPad->SetBottomMargin(0.12);
 
   TH1F *frame1 = gPad->DrawFrame(0.,1e-7,100.,fPtGlobSum->GetBinContent(fPtGlobSum->GetMaximumBin())*1.5);
-  frame1->SetXTitle("p_{T} [GeV]");
-  frame1->SetYTitle("#frac{1}{N_{evts}}#frac{dN}{dp_{T}} [GeV^{-1}]");
+  frame1->SetXTitle("p_{T} [GeV/c]");
+  frame1->SetYTitle("#frac{1}{N_{evts}}#frac{dN}{dp_{T}} [(GeV/c)^{-1}]");
   frame1->GetXaxis()->SetTitleSize(0.06);
   frame1->GetYaxis()->SetTitleSize(0.06);
   frame1->GetXaxis()->SetTitleOffset(0.75);
@@ -178,10 +277,12 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
 
   fPtGlobSt->DrawCopy("same");
   fPtGlobCnoSPD->DrawCopy("same");
-  fPtGlobSum->SetLineColor(1);
-  fPtGlobSum->SetMarkerColor(1);
   fPtGlobSum->DrawCopy("same");
+  if(drawComp) {
+    fPtGlobSt2->DrawCopy("same");
+    fPtGlobCnoSPD2->DrawCopy("same"); 
+    fPtGlobSum2->DrawCopy("same");
+  }
 
   TLegend *leg1 = NULL;
   if(run>0) leg1 = new TLegend(0.35,0.65,0.88,0.88,Form("Hybrid tracks. run:%d",run));
@@ -193,6 +294,8 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   leg1->AddEntry(fPtGlobSt,"Restricted Tracks","l");
   leg1->AddEntry(fPtGlobCnoSPD,"Complementary Tracks","l");
   leg1->AddEntry(fPtGlobSum,"Sum","l");
+  if(drawComp)
+    leg1->AddEntry(fPtGlobSum2,"Previous production","l");
   leg1->Draw();
 
   TLatex textNEvents;
@@ -205,7 +308,6 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   //                       pT resolution
   //---------------------------------------------------------------------------------------------------
 
-
   TProfile *fProfPtPtSigma1PtGlobSt = histsGlobSt->FindObject("fProfPtPtSigma1Pt");
   TProfile *fProfPtPtSigma1PtGlobCnoSPD = histsGlobCnoSPD->FindObject("fProfPtPtSigma1Pt");
 
@@ -225,6 +327,27 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
     }
   }
 
+  if(drawComp) {
+    TProfile *fProfPtPtSigma1PtGlobSt2 = histsGlobSt2->FindObject("fProfPtPtSigma1Pt");
+    TProfile *fProfPtPtSigma1PtGlobCnoSPD2 = histsGlobCnoSPD2->FindObject("fProfPtPtSigma1Pt");
+  
+    fProfPtPtSigma1PtGlobSt2->SetTitle("fProfPtPtSigma1PtGlobSt_old");
+    fProfPtPtSigma1PtGlobSt2->SetName("fProfPtPtSigma1PtGlobSt_old");
+    fProfPtPtSigma1PtGlobCnoSPD2->SetTitle("fProfPtPtSigma1PtGlobCnoSPD_old");
+    fProfPtPtSigma1PtGlobCnoSPD2->SetName("fProfPtPtSigma1PtGlobCnoSPD_old");
+  
+    for(Int_t i =1 ; i<fProfPtPtSigma1PtGlobSt2->GetNbinsX(); i++) {
+      if(fProfPtPtSigma1PtGlobSt2->GetBinEffectiveEntries(i)<10.) {
+        fProfPtPtSigma1PtGlobSt2->SetBinContent(i,0);
+        fProfPtPtSigma1PtGlobSt2->SetBinError(i,0);
+      }
+      if(fProfPtPtSigma1PtGlobCnoSPD2->GetBinEffectiveEntries(i)<10.) {
+        fProfPtPtSigma1PtGlobCnoSPD2->SetBinContent(i,0);
+        fProfPtPtSigma1PtGlobCnoSPD2->SetBinError(i,0);
+      }
+    }
+  }
+
   TCanvas *c3 =new TCanvas("c3","c3: pT resolution",600,450);
   gPad->SetLeftMargin(0.12);
   gPad->SetRightMargin(0.02);
@@ -239,17 +362,32 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
 
   fProfPtPtSigma1PtGlobSt->SetLineColor(2);
   fProfPtPtSigma1PtGlobSt->SetLineWidth(3);
-  fProfPtPtSigma1PtGlobSt->SetMarkerStyle(21);
+  fProfPtPtSigma1PtGlobSt->SetMarkerStyle(26);
   fProfPtPtSigma1PtGlobSt->SetMarkerColor(2);
 
   fProfPtPtSigma1PtGlobCnoSPD->SetLineColor(4);
   fProfPtPtSigma1PtGlobCnoSPD->SetLineWidth(3);
-  fProfPtPtSigma1PtGlobCnoSPD->SetMarkerStyle(24);
+  fProfPtPtSigma1PtGlobCnoSPD->SetMarkerStyle(26);
   fProfPtPtSigma1PtGlobCnoSPD->SetMarkerColor(4);
 
   fProfPtPtSigma1PtGlobSt->DrawCopy("same");
   fProfPtPtSigma1PtGlobCnoSPD->DrawCopy("same");
 
+  if(drawComp) {
+    fProfPtPtSigma1PtGlobSt2->SetLineColor(2);
+    fProfPtPtSigma1PtGlobSt2->SetLineWidth(3);
+    fProfPtPtSigma1PtGlobSt2->SetMarkerStyle(32);
+    fProfPtPtSigma1PtGlobSt2->SetMarkerColor(2);
+  
+    fProfPtPtSigma1PtGlobCnoSPD2->SetLineColor(4);
+    fProfPtPtSigma1PtGlobCnoSPD2->SetLineWidth(3);
+    fProfPtPtSigma1PtGlobCnoSPD2->SetMarkerStyle(32);
+    fProfPtPtSigma1PtGlobCnoSPD2->SetMarkerColor(4);
+  
+    fProfPtPtSigma1PtGlobSt2->DrawCopy("same");
+    fProfPtPtSigma1PtGlobCnoSPD2->DrawCopy("same");
+  }
+
   TLegend *leg3 = NULL;
   if(run>0) leg3 = new TLegend(0.16,0.6,0.88,0.88,Form("Hybrid tracks. run:%d",run));
   else leg3 = new TLegend(0.16,0.6,0.88,0.88,"Hybrid tracks");
@@ -259,6 +397,8 @@ void processJETrackQA(TString strFileIn   = "AnalysisResults.root",
   leg3->SetTextSize(0.06);
   leg3->AddEntry(fProfPtPtSigma1PtGlobSt,"Restricted Tracks","lp");
   leg3->AddEntry(fProfPtPtSigma1PtGlobCnoSPD,"Complementary Tracks","lp");
+  if(drawComp)
+    leg3->AddEntry(fProfPtPtSigma1PtGlobSt2, "Previous production", "lp");
   leg3->Draw();
 
   c3->SaveAs(Form("%sPtResolutionCent%d%sRun%d.%s",prefix.Data(),cent,strTrigger.Data(),run,suffix.Data()));
index d6c5860e4127c295e3ad248006a0676acfc7837c..c666bb1f4588d594c8e5072ed43b42b128f6160c 100644 (file)
@@ -9,6 +9,7 @@ To procees JE Triggere QA wagon's output
 const Float_t ptmin =  0. ; //lower cutoff of jet pt spectrum
 
 void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root", 
+                           TString strFileIn2   = "",
                           TString suftype      = "eps",
                           Float_t jetR         = 0.2, 
                           Float_t minTrkPT     = 0.15, 
@@ -24,6 +25,11 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
   TString prefix = "fig_je_TriggerQA_";
 
   TFile * f1 = TFile::Open(strFileIn.Data());
+  Bool_t drawComp = kFALSE;
+  if(strFileIn2!="") {
+    TFile * f2 = TFile::Open(strFileIn2.Data());
+    drawComp = kTRUE;
+  }
 
   if(!trigsuffix=="" || !trigsuffix=="EJE" || !trigsuffix=="EGA")
   {cout << "Unknown trigger suffix. It should be either empty, EJE or EGA." << endl; return;}
@@ -34,12 +40,21 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
        TMath::Nint(jetR*10), TMath::Nint(minTrkPT*1000), TMath::Nint(minClusterET*1000),trigsuffix.Data(),
        TMath::Nint(jetR*10), TMath::Nint(minTrkPT*1000), TMath::Nint(minClusterET*1000),  
        TMath::Nint(jetR*10), TMath::Nint(minTrkPT*1000), TMath::Nint(minClusterET*1000),trigsuffix.Data());
-  TList *histList = 0x0;
-  histList =  (TList*)f1->Get(folder);
-  if(histList==0){
+  TList *histList[2];
+  histList[0] =  (TList*)f1->Get(folder);
+  if(histList[0]==0){
     cout << "Could not find " << folder << " in " << strFileIn << endl;
     return;
   }
+  //Load histogram list for comparison
+  if(drawComp) {
+    TList *histList[1] = 0x0;
+    histList[1] =  (TList*)f2->Get(folder);
+    if(histList==0){
+      cout << "Could not find " << folder << " in " << strFileIn2 << endl;
+      return;
+    }
+  }
 
   //---------------------------------------------------------------------------------------------------
   //       jet histograms
@@ -47,45 +62,57 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
 
   const Int_t kJetType = 2;
   TString suffix[kJetType] = {"Charged","Full"};
-  TH3F *h3PtEtaPhiJet[kJetType];
-  TH1F *hPtJet[kJetType];
-  TH2F *hEtaPhiJet[kJetType];
-  TH2F *hRhoCent[kJetType];
-
-  TH1F *hNEventSel = histList->FindObject("fhNEvents");
-  Float_t nEvents  = hNEventSel->GetBinContent(2);
+  TString suffix2[2] = {"","_old"};
+  TH3F *h3PtEtaPhiJet[kJetType][2];
+  TH1F *hPtJet[kJetType][2];
+  TH2F *hEtaPhiJet[kJetType][2];
+  TH2F *hRhoCent[kJetType][2];
+  //Number [0] is for the original data, [1] is for the comparison graphs.
+
+  TH1F *hNEventSel[2]; Float_t nEvents[2];
+  hNEventSel[0] = (TH1F*) histList[0]->FindObject("fhNEvents");
+  Float_t nEvents[0]  = hNEventSel[0]->GetBinContent(2);
+  if(drawComp) {
+    TH1F *hNEventSel[1] = (TH1F*) histList[1]->FindObject("fhNEvents");
+    Float_t nEvents[1]  = hNEventSel[1]->GetBinContent(2);
+  }
 
-  TProfile *hTriggerbit = histList->FindObject("fhTriggerbit");
+  TProfile *hTriggerbit = histList[0]->FindObject("fhTriggerbit");
   UInt_t triggerbit = hTriggerbit->GetBinContent(1);
 
   for(Int_t itype = 0; itype < kJetType; itype++){
+    for(Int_t comp = 0; comp < 2; comp++){
+      if((comp==1)&&(drawComp==kFALSE)) continue;
+      h3PtEtaPhiJet[itype][comp] = (TH3F*)  histList[comp]->FindObject(Form("fh3PtEtaPhiJet%s",suffix[itype].Data()));
+      if(! h3PtEtaPhiJet[itype][comp]) continue;
+      //jet pt spectra
+      Int_t binMin = 1;
 
-     h3PtEtaPhiJet[itype] = (TH3F*)  histList->FindObject(Form("fh3PtEtaPhiJet%s",suffix[itype].Data()));
-     if(! h3PtEtaPhiJet[itype]) continue;
-
-     //jet pt spectra
-     Int_t binMin = 1;
-     if(ptmin>0.) binMin = h3PtEtaPhiJet[itype]->GetXaxis()->FindBin(ptmin+0.00001);
-     h3PtEtaPhiJet[itype]->GetXaxis()->SetRange(binMin, h3PtEtaPhiJet[itype]->GetNbinsX());
-
-     hPtJet[itype] = (TH1F*) h3PtEtaPhiJet[itype]->Project3D("x");
-     if(nEvents>0)
-     hPtJet[itype]->Scale(1./nEvents,"width");
-     SetHist((TH1F*) hPtJet[itype],"p_{T,corr}^{jet} (GeV)","1/N_{evt} dN/dp_{T,corr}^{jet} (GeV^{-1})");
-     hPtJet[itype]->SetName(Form("hPtJet%s",suffix[itype].Data())); 
-
-     //eta versus phi
-     hEtaPhiJet[itype] = (TH2F*) h3PtEtaPhiJet[itype]->Project3D("yz");
-     SetHist((TH1F*) hEtaPhiJet[itype],"#varphi^{jet} (rad)","#eta^{jet}");
-     hEtaPhiJet[itype]->SetName(Form("hEtaPhiJet%s",suffix[itype].Data()));
+      if(ptmin>0.) binMin = h3PtEtaPhiJet[itype][comp]->GetXaxis()->FindBin(ptmin+0.00001);
+      h3PtEtaPhiJet[itype][comp]->GetXaxis()->SetRange(binMin, h3PtEtaPhiJet[itype][comp]->GetNbinsX());
+      hPtJet[itype][comp] = (TH1F*) h3PtEtaPhiJet[itype][comp]->Project3D("x");
+      hPtJet[itype][comp]->Scale(1./nEvents[comp],"width");
+      SetHist((TH1F*) hPtJet[itype][comp],"p_{T,corr}^{jet} [GeV/c]","1/N_{evt} dN/dp_{T,corr}^{jet} [(GeV/c)^{-1}]");
+      hPtJet[itype][comp]->SetName(Form("hPtJet%s%s",suffix[itype].Data(),suffix2[comp].Data())); 
+      //eta versus phi
+      hEtaPhiJet[itype][comp] = (TH2F*) h3PtEtaPhiJet[itype][comp]->Project3D("yz");
+      SetHist((TH1F*) hEtaPhiJet[itype][comp],"#varphi^{jet} (rad)","#eta^{jet}");
+      hEtaPhiJet[itype][comp]->SetName(Form("hEtaPhiJet%s%s",suffix[itype].Data(),suffix2[comp].Data()));
+    }
   }
 
   for(Int_t itype = 0; itype < kJetType; itype++){
-  //rho versus centrality
-    hRhoCent[itype] = (TH2F*) histList->FindObject(Form("fHistRhovsCent%s",suffix[itype].Data()));
-     if(!hRhoCent[itype]) continue;
-     SetHist((TH1F*) hRhoCent[itype], "Centrality (%)", Form("%s#rho (GeV/c*rad^{-1})", (suffix[itype]=="Full")?"s":"" ));
-     hRhoCent[itype]->SetName(Form("hRhoCent%s",suffix[itype].Data()));
+    for(Int_t comp = 0; comp < 2; comp++){
+      if((comp==1)&&(drawComp==kFALSE)) continue;
+      //rho versus centrality
+      hRhoCent[itype][comp] = (TH2F*) histList[comp]->FindObject(Form("fHistRhovsCent%s",suffix[itype].Data()));
+      if(!hRhoCent[itype][comp]) continue;
+      SetHist((TH1F*) hRhoCent[itype][comp], "Centrality (%)", Form("%s#rho [GeV/c*rad^{-1}]", (suffix[itype]=="Full")?"s":"" ));
+      hRhoCent[itype][comp]->SetName(Form("hRhoCent%s%s",suffix[itype].Data(),suffix2[comp].Data()));
+    }
   }
 
   //______________
@@ -107,26 +134,30 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
     if(triggerbit & AliVEvent::kMB)  longtrigname += "kMB";
   }
 
-  if(trigsuffix=="EJE")  longtrigname += "AndkEMCEJE";
-  if(trigsuffix=="EGA")  longtrigname += "AndkEMCEGA";
+  if(trigsuffix=="EJE")  longtrigname += " and kEMCEJE";
+  if(trigsuffix=="EGA")  longtrigname += " and kEMCEGA";
  
   for(Int_t itype = 0; itype < kJetType; itype++){ //loop over charged and full jets
 
      //draw pt spectrum
-     if(!hPtJet[itype]) continue; 
+     if(!hPtJet[itype][0]) continue; 
      c[nCan] = new TCanvas(Form("c%d",nCan),Form("c%d: Pt %s jets",nCan,suffix[itype].Data()),600,450);
      SetCanvas((TCanvas*) c[nCan]);
      c[nCan]->SetLogy();
 
-     frame[nCan] = gPad->DrawFrame(hPtJet[itype]->GetBinLowEdge(1),  
+     frame[nCan] = gPad->DrawFrame(hPtJet[itype][0]->GetBinLowEdge(1),  
                                    1e-7,
-                                   hPtJet[itype]->GetBinLowEdge(hPtJet[itype]->GetNbinsX()+1), 
-                                   hPtJet[itype]->GetBinContent(hPtJet[itype]->GetMaximumBin())*2.);
+                                   hPtJet[itype][0]->GetBinLowEdge(hPtJet[itype][0]->GetNbinsX()+1), 
+                                   hPtJet[itype][0]->GetBinContent(hPtJet[itype][0]->GetMaximumBin())*2.);
 
-     SetHist((TH1F*) frame[nCan],hPtJet[itype]->GetXaxis()->GetTitle(),hPtJet[itype]->GetYaxis()->GetTitle());
+     SetHist((TH1F*) frame[nCan],hPtJet[itype][0]->GetXaxis()->GetTitle(),hPtJet[itype][0]->GetYaxis()->GetTitle());
 
-     hPtJet[itype]->DrawCopy("same");
+     if(drawComp) {
+       hPtJet[itype][1]->SetLineColor(2);
+       hPtJet[itype][1]->SetLineWidth(5);
+       hPtJet[itype][1]->DrawCopy("same");
+     }
+     hPtJet[itype][0]->DrawCopy("same");
  
      leg = new TLegend(0.15,0.5,0.88,0.88);
      SetLeg(leg);
@@ -135,8 +166,12 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
      if(run>0) txt += Form(" run:%d",run); 
      leg->AddEntry((TObject*) 0, txt.Data(),"");
      leg->AddEntry((TObject*) 0, Form("Trigger: %s",longtrigname.Data()),"");
-     leg->AddEntry((TObject*) 0, Form("p_{T,trk}> %d MeV",TMath::Nint(minTrkPT*1000)),"");
-     if(itype==1) leg->AddEntry((TObject*) 0, Form("E_{T}>%d MeV",TMath::Nint(minClusterET*1000)),""); 
+     leg->AddEntry((TObject*) 0, Form("p_{T,trk}> %d MeV/c",TMath::Nint(minTrkPT*1000)),"");
+     if(itype==1) leg->AddEntry((TObject*) 0, Form("E_{T}>%d MeV/c",TMath::Nint(minClusterET*1000)),"");
+     if(drawComp){
+       leg->AddEntry(hPtJet[itype][0], "Recent data", "l");
+       leg->AddEntry(hPtJet[itype][1], "Previous data", "l");
+     }
      leg->AddEntry((TObject*) 0, Form("#it{N}_{events} = %.0f",nEvents),"");
      leg->Draw();
 
@@ -148,72 +183,85 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
   //_________________
   //draw eta versus phi
   for(Int_t itype = 0; itype < kJetType; itype++){ //loop over charged and full jets
-     if(!hEtaPhiJet[itype]) continue; 
-     c[nCan] = new TCanvas(Form("c%d",nCan),Form("c%d: eta-phi %s jets",nCan,suffix[itype].Data()),600,450);
-     SetCanvas((TCanvas*) c[nCan]);
-     c[nCan]->SetRightMargin(0.15);
-
-     frame[nCan] = gPad->DrawFrame(hEtaPhiJet[itype]->GetXaxis()->GetBinLowEdge(1),  
-                                   hEtaPhiJet[itype]->GetYaxis()->GetBinLowEdge(1),
-                                   hEtaPhiJet[itype]->GetXaxis()->GetBinLowEdge(hEtaPhiJet[itype]->GetNbinsX()),
-                                   hEtaPhiJet[itype]->GetYaxis()->GetBinLowEdge(hEtaPhiJet[itype]->GetNbinsY()));
-
-     SetHist((TH1F*) frame[nCan],hEtaPhiJet[itype]->GetXaxis()->GetTitle(),hEtaPhiJet[itype]->GetYaxis()->GetTitle());
-
-     hEtaPhiJet[itype]->DrawCopy("same,colz");
-     leg = new TLegend(0.15,0.5,0.88,0.88);
-     SetLeg(leg);
-
-     TString txt =  Form("%s jets AKT R=%.1f",suffix[itype].Data(),jetR);
-     if(run>0) txt += Form(" run:%d",run); 
-     leg->AddEntry((TObject*) 0, txt.Data(),"");
-     leg->AddEntry((TObject*) 0, Form("Trigger: %s",longtrigname.Data()),"");
-     leg->AddEntry((TObject*) 0, Form("p_{T,trk}> %d MeV",TMath::Nint(minTrkPT*1000)),"");
-     if(itype==1) leg->AddEntry((TObject*) 0, Form("E_{T}>%d MeV",TMath::Nint(minClusterET*1000)),"");
-     leg->AddEntry((TObject*) 0, Form("#it{N}_{events} = %.0f",nEvents),"");
-     leg->AddEntry((TObject*) 0, Form("p_{T,corr}^{jet} > %.1f GeV", ptmin),"");
-     leg->Draw();
+    if(!hEtaPhiJet[itype][0]) continue;
+    c[nCan] = new TCanvas(Form("c%d",nCan),Form("c%d: eta-phi %s jets",nCan,suffix[itype].Data()),600,450);
+    if(drawComp) c[nCan]->Divide(2,1);
+
+    for(Int_t comp = 0; comp < 2; comp++) {
+      if((comp==1)&&(!drawComp)) continue;
+      c[nCan]->cd(comp+1);
+      SetCanvas(gPad);
+      gPad->SetRightMargin(0.14);
+//      c[nCan]->SetRightMargin(0.15);
+  
+      frame[nCan] = gPad->DrawFrame(hEtaPhiJet[itype][comp]->GetXaxis()->GetBinLowEdge(1),  
+                                     hEtaPhiJet[itype][comp]->GetYaxis()->GetBinLowEdge(1),
+                                     hEtaPhiJet[itype][comp]->GetXaxis()->GetBinLowEdge(hEtaPhiJet[itype][comp]->GetNbinsX()),
+                                     hEtaPhiJet[itype][comp]->GetYaxis()->GetBinLowEdge(hEtaPhiJet[itype][comp]->GetNbinsY()));
+  
+      SetHist((TH1F*) frame[nCan],hEtaPhiJet[itype][comp]->GetXaxis()->GetTitle(),hEtaPhiJet[itype][comp]->GetYaxis()->GetTitle());
+  
+      hEtaPhiJet[itype][comp]->DrawCopy("colz");
+  
+      leg = new TLegend(0.15,0.5,0.88,0.88);
+      SetLeg(leg);
+  
+      TString txt =  Form("%s jets AKT R=%.1f",suffix[itype].Data(),jetR);
+      if(run>0) txt += Form(" run:%d",run); 
+      leg->AddEntry((TObject*) 0, txt.Data(),"");
+      if(drawComp) leg->AddEntry((TObject*) 0, comp ? "Recent production" : "Previous production", "");
+      leg->AddEntry((TObject*) 0, Form("Trigger: %s",longtrigname.Data()),"");
+      leg->AddEntry((TObject*) 0, Form("p_{T,trk}> %d MeV/c",TMath::Nint(minTrkPT*1000)),"");
+      if(itype==1) leg->AddEntry((TObject*) 0, Form("E_{T}>%d MeV/c",TMath::Nint(minClusterET*1000)),"");
+      leg->AddEntry((TObject*) 0, Form("#it{N}_{events} = %.0f",nEvents),"");
+      leg->AddEntry((TObject*) 0, Form("p_{T,corr}^{jet} > %.1f GeV/c", ptmin),"");
+      leg->Draw();
+    }
 
-     c[nCan]->SaveAs(Form("%s_EtaPhi_AKT%02d_pT%04d_ET%04d_Run%d_Trigger%s_%s.%s",prefix.Data(),TMath::Nint(jetR*10),
+    c[nCan]->SaveAs(Form("%s_EtaPhi_AKT%02d_pT%04d_ET%04d_Run%d_Trigger%s_%s.%s",prefix.Data(),TMath::Nint(jetR*10),
                          TMath::Nint(minTrkPT*1000),TMath::Nint(minClusterET*1000), run, longtrigname.Data(), suffix[itype].Data(), suftype.Data()));
 
-     nCan++;
+    nCan++;
   }//end of the loop over charged and full jets
   //_________________
   //draw rho versus centrality
   for(Int_t itype = 0; itype < kJetType; itype++){ //loop over charged and full jets
-     if(hRhoCent[itype]) {
-       c[nCan] = new TCanvas(Form("c%d",nCan),Form("c%d: Rho-Cent",nCan),600,450);
-       SetCanvas((TCanvas*) c[nCan]);
-       c[nCan]->SetRightMargin(0.15);
+     if(!hRhoCent[itype][0]) continue;
+     c[nCan] = new TCanvas(Form("c%d",nCan),Form("c%d: Rho-Cent",nCan),600,450);
+     if(drawComp) c[nCan]->Divide(2,1);
+
+     for(Int_t comp = 0; comp < 2; comp++) {
+       if((comp==1)&&(!drawComp)) continue;
+       c[nCan]->cd(comp+1);
+       SetCanvas(gPad);
+       gPad->SetRightMargin(0.15);
        c[nCan]->SetLogz();
   
-       frame[nCan] = gPad->DrawFrame(hRhoCent[itype]->GetXaxis()->GetBinLowEdge(1),
-                                     hRhoCent[itype]->GetYaxis()->GetBinLowEdge(1),
-                                     hRhoCent[itype]->GetXaxis()->GetBinLowEdge(hRhoCent[itype]->GetNbinsX()),
-                                     hRhoCent[itype]->GetYaxis()->GetBinLowEdge(hRhoCent[itype]->GetNbinsY()));
-  
-       SetHist((TH1F*) frame[nCan],hRhoCent[itype]->GetXaxis()->GetTitle(),hRhoCent[itype]->GetYaxis()->GetTitle());
+       frame[nCan] = gPad->DrawFrame(hRhoCent[itype][comp]->GetXaxis()->GetBinLowEdge(1),
+                                     hRhoCent[itype][comp]->GetYaxis()->GetBinLowEdge(1),
+                                     hRhoCent[itype][comp]->GetXaxis()->GetBinLowEdge(hRhoCent[itype][comp]->GetNbinsX()),
+                                     hRhoCent[itype][comp]->GetYaxis()->GetBinLowEdge(hRhoCent[itype][comp]->GetNbinsY()));
   
-       hRhoCent[itype]->DrawCopy("colz");
+       SetHist((TH1F*) frame[nCan],hRhoCent[itype][comp]->GetXaxis()->GetTitle(),hRhoCent[itype][comp]->GetYaxis()->GetTitle());
+
+       hRhoCent[itype][comp]->DrawCopy("colz");
   
-       leg = new TLegend(0.15,0.5,0.88,0.88);
+       leg = new TLegend(-0.05,0.5,0.88,0.88);
        SetLeg(leg);
   
        TString txt =  Form("%s jets AKT R=%.1f",suffix[itype].Data(),jetR);
        if(run>0) txt += Form(" run:%d",run); 
   
        leg->AddEntry((TObject*) 0, txt.Data(),"");
+       if(drawComp) leg->AddEntry((TObject*) 0, comp ? "Recent production" : "Previous production", "");
        leg->AddEntry((TObject*) 0, Form("Trigger: %s",longtrigname.Data()),"");
        leg->AddEntry((TObject*) 0, Form("#it{N}_{events} = %.0f",nEvents),"");
        leg->Draw();
-  
-       c[nCan]->SaveAs(Form("%s_RhoCent_AKT%02d_pT%04d_ET%04d_Run%d_Trigger%s_%s.%s",prefix.Data(),TMath::Nint(jetR*10),
-                           TMath::Nint(minTrkPT*1000),TMath::Nint(minClusterET*1000), run, longtrigname.Data(), suffix[itype].Data(), suftype.Data()));
-       nCan++; 
     }
+
+    c[nCan]->SaveAs(Form("%s_RhoCent_AKT%02d_pT%04d_ET%04d_Run%d_Trigger%s_%s.%s",prefix.Data(),TMath::Nint(jetR*10),
+                         TMath::Nint(minTrkPT*1000),TMath::Nint(minClusterET*1000), run, longtrigname.Data(), suffix[itype].Data(), suftype.Data()));
+    nCan++;
   }//end of the loop over charged and full jets
 
   //---------------------------------------------------------------------------------------------------
@@ -252,10 +300,13 @@ void processJETriggerQA_V2(TString strFileIn    = "AnalysisResults.root",
   cdd->ls();
   
   for(Int_t itype = 0; itype < kJetType; itype++){ //loop over charged and full jets
-    
-    if(hPtJet[itype])     hPtJet[itype]->Write(Form("%s%d_%s",prefix.Data(), itype, hPtJet[itype]->GetName()));
-    if(hEtaPhiJet[itype]) hEtaPhiJet[itype]->Write(Form("%s%d_%s",prefix.Data(), itype, hEtaPhiJet[itype]->GetName()));
-    if(hRhoCent[itype])   hRhoCent[itype]->Write(Form("%s%d_%s",prefix.Data(), itype, hRhoCent[itype]->GetName()));
+
+    if(hPtJet[itype][0])     hPtJet[itype][0]->Write(Form("%s%d_%s",prefix.Data(), itype, hPtJet[itype][0]->GetName()));
+    if(drawComp) if(hPtJet[itype][1])     hPtJet[itype][1]->Write(Form("%s%d_%s",prefix.Data(), itype, hPtJet[itype][1]->GetName()));
+    if(hEtaPhiJet[itype][0]) hEtaPhiJet[itype][0]->Write(Form("%s%d_%s",prefix.Data(), itype, hEtaPhiJet[itype][0]->GetName()));
+    if(drawComp) if(hEtaPhiJet[itype][1]) hEtaPhiJet[itype][1]->Write(Form("%s%d_%s",prefix.Data(), itype, hEtaPhiJet[itype][1]->GetName()));
+    if(hRhoCent[itype][0])   hRhoCent[itype][0]->Write(Form("%s%d_%s",prefix.Data(), itype, hRhoCent[itype][0]->GetName()));
+    if(drawComp) if(hRhoCent[itype][1])   hRhoCent[itype][1]->Write(Form("%s%d_%s",prefix.Data(), itype, hRhoCent[itype][1]->GetName()));
   }
   
   fout->Close();
@@ -278,7 +329,7 @@ void SetHist(TH1* h,TString titx, TString tity){
 }
 //_____________________________________________________________________
 
-void SetCanvas(TCanvas* c){
+void SetCanvas(TVirtualPad* c){
    c->SetLeftMargin(0.15);
    c->SetBottomMargin(0.15);
    c->SetRightMargin(0.05);