]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/QA/tasks/macros/drawGlobalESDHistograms.C
- fill more histograms to match the central barrel task output
[u/mrichter/AliRoot.git] / HLT / QA / tasks / macros / drawGlobalESDHistograms.C
index c2056e54186adceb370f433625d33ccb46f783af..c0f6ab4624f2242cd7ce1d8dc62564eaed56efd1 100644 (file)
@@ -34,8 +34,9 @@ using std::endl;
 
 // --------------------- forward declerations --------------//
 
-void printStats(TH1F *h1, TH1F *h2);
 void plot(TH1F *h1, TH1F *h2);
+void printStats(TH1F *h1);
+void printStats(TH1F *h1, TH1F *h2);
 
 //==========================================================//
 
@@ -67,84 +68,113 @@ void drawGlobalESDHistograms(const char* filename="HLT-OFFLINE-GLOBAL-comparison
  folder.ReplaceAll(",","_");
  gSystem->Exec("mkdir "+folder); // create a folder whose name contains run number and date of run
 
- TCanvas *c1 = new TCanvas("c1","HLT vs. offline",1200,700);
- c1->Divide(3,3);
+ TCanvas *c1 = new TCanvas("c1","track properties",1200,700);
+ c1->Divide(4,2);
+
  TH1F *h1 = NULL;
  TH1F *h2 = NULL;
 
- h1 = (TH1F*)list->FindObject("fNcluster_hlt"); if(!h1) { printf("Empty histogram fNcluster_hlt\n"); return; }
- h2 = (TH1F*)list->FindObject("fNcluster_off"); if(!h2) { printf("Empty histogram fNcluster_off\n"); return; }
- h1->SetTitle("TPC cluster distribution");
- h1->GetXaxis()->SetTitle("TPC clusters per track");
+
+ h1 = (TH1F*)list->FindObject("fMomentum_hlt"); if(!h1) { printf("Empty histogram fMomentum_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fMomentum_off"); if(!h2) { printf("Empty histogram fMomentum_off\n"); return; }
+ h1->SetXTitle("p_{t} (GeV/c)"); 
+ h1->SetTitle("transverse momentum");
+
+ c1->cd(1);
+ plot(h1,h2);
 
  TLegend *leg1 = new TLegend(0.6,0.2,0.8,0.5);
  leg1->SetFillColor(10);
  leg1->SetLineColor(10);
  leg1->AddEntry(h1,"HLT", "l");
  leg1->AddEntry(h2,"OFF", "l");
+ leg1->Draw("same");
 
- c1->cd(1);
+//------------------------------------------------- 
+
+ h1 = (TH1F*)list->FindObject("fNcluster_hlt"); if(!h1) { printf("Empty histogram fNcluster_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fNcluster_off"); if(!h2) { printf("Empty histogram fNcluster_off\n"); return; }
+ h1->SetTitle("TPC cluster distribution");
+ h1->GetXaxis()->SetTitle("TPC clusters per track");
+
+ c1->cd(2);
+ plot(h1,h2);
+
+//------------------------------------------------- 
+
+ h1 = (TH1F*)list->FindObject("fEta_hlt"); if(!h1) { printf("Empty histogram fEta_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fEta_off"); if(!h2) { printf("Empty histogram fEta_off\n"); return; }
+ h1->SetTitle("pseudorapidity");
+ h1->SetXTitle("#eta");
+
+ c1->cd(3);
+ plot(h1,h2);
+
+//-------------------------------------------------
+
+ h1 = (TH1F*)list->FindObject("fPhi_hlt"); if(!h1) { printf("Empty histogram fPhi_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fPhi_off"); if(!h2) { printf("Empty histogram fPhi_off\n"); return; }
+ h1->SetTitle("azimuthal angle");
+ h1->SetXTitle("#phi (deg)");
+
+ c1->cd(4);
  plot(h1,h2);
 
 //-------------------------------------------------
 
- h1 = (TH1F*)list->FindObject("fDCA_hlt"); if(!h1) { printf("Empty histogram fDCA_hlt\n"); return; }
- h2 = (TH1F*)list->FindObject("fDCA_off"); if(!h2) { printf("Empty histogram fDCA_off\n"); return; }
+ h1 = (TH1F*)list->FindObject("fDCAr_hlt"); if(!h1) { printf("Empty histogram fDCAr_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fDCAr_off"); if(!h2) { printf("Empty histogram fDCAr_off\n"); return; }
  h1->SetTitle("DCA between track and vertex on XY plane");
  h1->SetXTitle("DCAr (cm)");
  
- c1->cd(2);
+ c1->cd(5);
  plot(h1,h2);
 
 //------------------------------------------------- 
 
- h1 = (TH1F*)list->FindObject("fMult_hlt"); if(!h1) { printf("Empty histogram fMult_hlt\n"); return; }
- h2 = (TH1F*)list->FindObject("fMult_off"); if(!h2) { printf("Empty histogram fMult_off\n"); return; }
- h1->SetTitle("track multiplicity");
-
- c1->cd(3);
+ h1 = (TH1F*)list->FindObject("fDCAz_hlt"); if(!h1) { printf("Empty histogram fDCAz_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fDCAz_off"); if(!h2) { printf("Empty histogram fDCAz_off\n"); return; }
+ h1->SetTitle("DCA between track and beam line");
+ h1->SetXTitle("DCAz (cm)");
+ c1->cd(6);
  plot(h1,h2);
 
 //------------------------------------------------- 
 
+
  h1 = (TH1F*)list->FindObject("fCharge_hlt"); if(!h1) { printf("Empty histogram fCharge_hlt\n"); return; }
  h2 = (TH1F*)list->FindObject("fCharge_off"); if(!h2) { printf("Empty histogram fCharge_off\n"); return; }
  h1->SetXTitle("polarity"); 
  h1->SetTitle("charge distribution");
 
- c1->cd(4);
+ c1->cd(7);
  plot(h1,h2);
 
 //------------------------------------------------- 
+ h1 = (TH1F*)list->FindObject("fNITScluster_hlt"); if(!h1) { printf("Empty histogram fNITScluster_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fNITScluster_off"); if(!h2) { printf("Empty histogram fNITScluster_off\n"); return; }
+ h1->SetTitle("ITS cluster distribution");
+ h1->GetXaxis()->SetTitle("ITS clusters per track");
 
- h1 = (TH1F*)list->FindObject("fMomentum_hlt"); if(!h1) { printf("Empty histogram fMomentum_hlt\n"); return; }
- h2 = (TH1F*)list->FindObject("fMomentum_off"); if(!h2) { printf("Empty histogram fMomentum_off\n"); return; }
- h1->SetXTitle("p_{t} (GeV/c)"); 
- h1->SetTitle("transverse momentum");
-
- c1->cd(5);
+ c1->cd(8);
  plot(h1,h2);
- leg1->Draw("same");
 
-//------------------------------------------------- 
 
- h1 = (TH1F*)list->FindObject("fEta_hlt"); if(!h1) { printf("Empty histogram fEta_hlt\n"); return; }
- h2 = (TH1F*)list->FindObject("fEta_off"); if(!h2) { printf("Empty histogram fEta_off\n"); return; }
- h1->SetTitle("pseudorapidity");
- h1->SetXTitle("#eta");
+//============= EVENT PROPERTIES ===============//
 
- c1->cd(6);
- plot(h1,h2);
-
-//------------------------------------------------- 
+ TCanvas *c2 = new TCanvas("c2","vertex event properties",1200,700);
+ c2->Divide(3,2);
 
  h1 = (TH1F*)list->FindObject("fXvertex_hlt"); if(!h1) { printf("Empty histogram fXvertex_hlt\n"); return; }
  h2 = (TH1F*)list->FindObject("fXvertex_off"); if(!h2) { printf("Empty histogram fXvertex_off\n"); return; }
  h1->SetXTitle("x (cm)");
  h1->SetTitle("x of primary vertex");
 
- c1->cd(7);
+ c2->cd(1);
  plot(h1,h2);
+ leg1->Draw("same");
 
 //------------------------------------------------- 
 
@@ -153,7 +183,7 @@ void drawGlobalESDHistograms(const char* filename="HLT-OFFLINE-GLOBAL-comparison
  h1->SetXTitle("y (cm)");
  h1->SetTitle("y of primary vertex");
  
- c1->cd(8);
+ c2->cd(2);
  plot(h1,h2);
 
 //------------------------------------------------- 
@@ -163,13 +193,76 @@ void drawGlobalESDHistograms(const char* filename="HLT-OFFLINE-GLOBAL-comparison
  h1->SetXTitle("z (cm)");
  h1->SetTitle("z of primary vertex");
 
- c1->cd(9);
+ c2->cd(3);
+ plot(h1,h2);
+
+//------------------------------------------------- 
+ h1 = (TH1F*)list->FindObject("fSPDXvertex_hlt"); if(!h1) { printf("Empty histogram fSPDXvertex_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fSPDXvertex_off"); if(!h2) { printf("Empty histogram fSPDXvertex_off\n"); return; }
+ h1->SetXTitle("x (cm)");
+ h1->SetTitle("x of SPD primary vertex");
+
+ c2->cd(4);
  plot(h1,h2);
 
 //------------------------------------------------- 
 
- c1->SaveAs(folder+"/HLT-offline.png");  
- c1->SaveAs(folder+"/HLT-offline.root");  
+ h1 = (TH1F*)list->FindObject("fSPDYvertex_hlt"); if(!h1) { printf("Empty histogram fSPDYvertex_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fSPDYvertex_off"); if(!h2) { printf("Empty histogram fSPDYvertex_off\n"); return; }
+ h1->SetXTitle("y (cm)");
+ h1->SetTitle("y of SPD primary vertex");
+ c2->cd(5);
+ plot(h1,h2);
+
+//------------------------------------------------- 
+
+ h1 = (TH1F*)list->FindObject("fSPDZvertex_hlt"); if(!h1) { printf("Empty histogram fSPDZvertex_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fSPDZvertex_off"); if(!h2) { printf("Empty histogram fSPDZvertex_off\n"); return; }
+ h1->SetXTitle("z (cm)");
+ h1->SetTitle("z of SPD primary vertex");
+
+ c2->cd(6);
+ plot(h1,h2);
+
+//------------------------------------------------- 
+
+ TCanvas *c3 = new TCanvas("c3","general event properties",1200,500);
+ c3->Divide(3,1);
+
+ h1 = (TH1F*)list->FindObject("fMult_hlt"); if(!h1) { printf("Empty histogram fMult_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fMult_off"); if(!h2) { printf("Empty histogram fMult_off\n"); return; }
+ h1->SetTitle("TPC track multiplicity");
+
+ c3->cd(1);
+ plot(h1,h2);
+ leg1->Draw("same");
+
+//------------------------------------------------- 
+
+ h1 = (TH1F*)list->FindObject("fNcont_hlt"); if(!h1) { printf("Empty histogram fNcont_hlt\n"); return; }
+ h2 = (TH1F*)list->FindObject("fNcont_off"); if(!h2) { printf("Empty histogram fNcont_off\n"); return; }
+ h1->SetTitle("# of contributors");
+
+ c3->cd(2);
+ plot(h1,h2);
+
+//------------------------------------------------- 
+
+ h1 = (TH1F*)list->FindObject("fV0cent"); if(!h1) { printf("Empty histogram fV0cent\n"); return; }
+ c3->cd(3);
+ h1->Draw();
+ printStats(h1);
+
+//------------------------------------------------- 
+
+ c1->SaveAs(folder+"/track_properties.png");  
+ c1->SaveAs(folder+"/track_properties.root");  
+ c2->SaveAs(folder+"/vertex_event_properties.png");  
+ c2->SaveAs(folder+"/vertex_event_properties.root");  
+ c3->SaveAs(folder+"/general_event_properties.png");  
+ c3->SaveAs(folder+"/general_event_properties.root");  
  return;       
 }
 
@@ -189,6 +282,13 @@ void printStats(TH1F* h1, TH1F* h2){
   return;
 }
 
+void printStats(TH1F* h1){    
+  gPad->Update();
+  TPaveStats *st1 = (TPaveStats*)h1->FindObject("stats"); if(!st1) { printf("TPaveStats st1 is 0x0\n"); return; }      
+  st1->SetLineColor(0);
+  return;
+}
+
 void plot(TH1F *h1, TH1F *h2){ 
   //Y axis
   if(h1->GetMaximum() > h2->GetMaximum()) h2->SetMaximum(1.1*h1->GetMaximum());