]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Improved labeling of QA histograms
authorhqvigsta <hqvigsta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2012 12:29:18 +0000 (12:29 +0000)
committerhqvigsta <hqvigsta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2012 12:29:18 +0000 (12:29 +0000)
PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C
PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQAFill.C
PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/ExtractQA.C

index 873971dc3cf6d73f0a11d664a78e5620cd115ed2..1ba1d4573ecff86574004ce95825d7a5c77ff997 100644 (file)
@@ -4,6 +4,7 @@ TFile* file;
 const char* prefixToName = "imgs/";
 const char* appendToName = ".pdf";
 const int kNCents = 1;
+const int kFirstBinTo = 64;
 
 void Draw(const char* name, const char* options = "", double yFrom=0., double yTo=-1.)
 {
@@ -11,22 +12,25 @@ void Draw(const char* name, const char* options = "", double yFrom=0., double yT
   //hist->SetAxisRange(0, 30 );
   hist->GetXaxis()->SetLabelSize(0.011);
   //hist->GetXaxis()->SetTitle("Run");
-  hist->GetXaxis()->SetRange(1,84);
+  hist->GetXaxis()->SetRange(1,kFirstBinTo);
   if( yFrom < yTo )
     hist->GetYaxis()->SetRangeUser(yFrom, yTo);
 
 
   //if( ! TString(options).Contains("same") )
   TCanvas* canv = new TCanvas;
-  canv->SetGrid();
-  hist->GetYaxis()->SetNdivisions(16);
+  //canv->SetGrid();
+  //hist->GetYaxis()->SetNdivisions(16);
 
   canv->Divide(1,2);
 
   hist->GetXaxis()->SetLabelSize(0.051);
 
+  if( TString(options).Contains("LINFIT") )
+    hist->Fit("pol0", "Q");
+  
   canv->cd(1);
-  hist->GetXaxis()->SetRange(1,84);
+  hist->GetXaxis()->SetRange(1,kFirstBinTo);
   hist->DrawCopy(options);
 
   canv->cd(2);
@@ -61,7 +65,7 @@ void DrawPID()
 
     canv->cd(1);
     grNPhotAll->SetTitle("#LTN_{clusters}^{PID}#GT");
-    grNPhotAll->GetXaxis()->SetRange(0, 84);
+    grNPhotAll->GetXaxis()->SetRange(0, kFirstBinTo);
     grNPhotAll->DrawCopy();
     grNPhotDisp->DrawCopy("same");
     grNPhotDisp2->DrawCopy("same");
@@ -108,7 +112,7 @@ void DrawCPVRatio()
     TCanvas* canv = new TCanvas;
     canv->Divide(1,2);
     canv->cd(1);
-    grNPhotCPV->GetXaxis()->SetRange(0, 84);
+    grNPhotCPV->GetXaxis()->SetRange(0, kFirstBinTo);
     grNPhotCPV->DrawCopy();
 
     canv->cd(2);
@@ -143,7 +147,7 @@ void DrawNPhotAllAndHigh()
   
     canv->cd(1);
     grNPhotAll->SetTitle("#LTN_{clusters}#GT");
-    grNPhotAll->GetXaxis()->SetRange(0, 84);
+    grNPhotAll->GetXaxis()->SetRange(0, kFirstBinTo);
     grNPhotAll->GetYaxis()->SetRange(15, 40);
     //grNPhotAll->GetYaxis()->SetRangeUser(15, 45);
     grNPhotAll->DrawCopy();
@@ -204,7 +208,7 @@ void DrawPIDRatiosHighCore(const char* pidNames[], int nPids, const char* high)
 
       canv->cd(1);
       hPID->SetTitle( Form("#LTN_{clusters}^{PID}#GT / #LTN_{clusters}^{%s}#GT, cent=%d, %s", pidNames[0], cent, high) );
-      hPID->GetXaxis()->SetRange(0, 84);
+      hPID->GetXaxis()->SetRange(0, kFirstBinTo);
       hPID->DrawCopy(same);
 
       canv->cd(2);
@@ -237,6 +241,7 @@ void DrawPIDRatios()
 void DrawQA()
 {
   gStyle->SetOptStat(0);
+  gStyle->SetOptFit(1);
 
   file = TFile::Open("outputQA.root", "read");
 
@@ -275,9 +280,9 @@ void DrawQA()
   DrawNPhotAllAndHigh();
   //DrawPIDRatios();
 
-  Draw("grMPi0");
-  Draw("grWPi0");
-  Draw("grNPi0");
+  Draw("grMPi0", "LINFIT", 0.13, 0.15 );
+  Draw("grWPi0", "LINFIT");
+  Draw("grNPi0", "LINFIT");
 
   file->Close();
 }
index 19b258eaf2631b41097fd543e517354b121a892e..98efbff6066d4150e65a9f1aeb5bf5d2f1032ebf 100644 (file)
@@ -8,6 +8,7 @@ const int kNCents = 1;
 void Draw(const char* name, const char* options = "", double yFrom=0., double yTo=-1.)
 {
   TH1* hist = ((TH1*)file->Get(name))->Clone();
+  hist->GetXaxis()->SetTitle("Fill");
 
   if( yFrom < yTo )
     hist->GetYaxis()->SetRangeUser(yFrom, yTo);
index 6676149dc5bc293fe72fb9cffb5d81dd4d8345f0..81a0fea87fb94ceef82a8de7a8a82e60a126e60e 100644 (file)
@@ -518,6 +518,7 @@ void QAWriteNPi0()
   }
   grNPi0     ->LabelsOption("v");
   grNPi0     ->SetMarkerStyle(33);
+  grNPi0->GetYaxis()->SetTitle("#LTN#GT");
   grNPi0     ->Write();
 
   TH1F *grMPi0 = new TH1F("grMPi0","M(#pi^{0})",runIndex,0,runIndex);
@@ -528,6 +529,7 @@ void QAWriteNPi0()
   }
   grMPi0     ->LabelsOption("v");
   grMPi0     ->SetMarkerStyle(33);
+  grMPi0->GetYaxis()->SetTitle("#LTM#GT");
   grMPi0     ->Write();
 
   TH1F *grWPi0 = new TH1F("grWPi0","#sigma(#pi^{0})",runIndex,0,runIndex);
@@ -538,6 +540,7 @@ void QAWriteNPi0()
   }
   grWPi0     ->LabelsOption("v");
   grWPi0     ->SetMarkerStyle(33);
+  grWPi0->GetYaxis()->SetTitle("#LT#sigma#GT");
   grWPi0     ->Write();
 }
 
@@ -575,6 +578,11 @@ TH1F *AddWriteTH1F(const char *name, const char *title, Double_t* values, Double
   hist->SetMarkerStyle(33);
   hist->Write();
 
+  if( TString(name).Contains("En") )
+    hist->GetYaxis()->SetTitle("#LTE#GT");
+  if( TString(name).Contains("NPhot") )
+    hist->GetYaxis()->SetTitle("#LTN#GT");
+
   return hist;
 }