From: hqvigsta Date: Mon, 15 Oct 2012 12:29:18 +0000 (+0000) Subject: Improved labeling of QA histograms X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=5f3e9080f75843e8ec9bfb4655e70febe7b1467f;p=u%2Fmrichter%2FAliRoot.git Improved labeling of QA histograms --- diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C index 873971dc3cf..1ba1d4573ec 100644 --- a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C +++ b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQA.C @@ -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(); } diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQAFill.C b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQAFill.C index 19b258eaf26..98efbff6066 100644 --- a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQAFill.C +++ b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/DrawQAFill.C @@ -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); diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/ExtractQA.C b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/ExtractQA.C index 6676149dc5b..81a0fea87fb 100644 --- a/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/ExtractQA.C +++ b/PWGGA/PHOSTasks/PHOS_PbPb/macros/QA/ExtractQA.C @@ -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; }