diff --git a/Software/Tools/Style.C b/Software/Tools/Style.C index c424e6e..762afa8 100644 --- a/Software/Tools/Style.C +++ b/Software/Tools/Style.C @@ -33,6 +33,8 @@ void DrawHistCompare3(TCanvas *canvas, TH1 *hist1, TH1 *hist2, TH1 *hist3, TLegend *leg, TString folder = ""); +void DrawHistFunc(TCanvas *canvas, TH1 *hist, TF1 *func, TString folder = ""); + void DrawHist2(TCanvas *canvas, TH2 *hist, TString option = "", TString folder = ""); void DrawHistStats(TCanvas *canvas, TH1 *hist, TPaveStats *stats, TString option = "", TString folder = ""); @@ -194,6 +196,7 @@ TStyle *style = getLHCbStyle(); style->SetOptStat("emruo"); style->SetTitleOffset(1.05,"Y"); + style->SetStatY(0.88); // TGaxis::SetMaxDigits(3); return; @@ -340,7 +343,24 @@ return; } -// DrawHist2 draws the "hist" histogram in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file names "canvas.pdf". +// DrawHistFunc draws the "hist" histogram and the "func" function in the "canvas" canvas and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". +void DrawHistFunc(TCanvas *canvas, TH1 *hist, TF1 *func, TString folder){ + TString path; + path = folder; + TString name = canvas->GetName(); + canvas->cd(); + hist->Draw("E"); + func->Draw("SAME"); + canvas->Update(); + canvas->Write(); + name = path + "/" + name + ".pdf"; + canvas->SaveAs(name); + canvas->Close(); + + return; +} + +// DrawHist2 draws the "hist" histogram in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". void DrawHist2(TCanvas *canvas, TH2 *hist, TString option, TString folder) { TString path; path = folder; @@ -356,7 +376,7 @@ return; } -// DrawHistStats draws the "hist" histogram and the "stats" stats in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file names "canvas.pdf". +// DrawHistStats draws the "hist" histogram and the "stats" stats in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". void DrawHistStats(TCanvas *canvas, TH1 *hist, TPaveStats *stats, TString option, TString folder) { TString path; path = folder; @@ -373,7 +393,7 @@ return; } -// DrawHistStats2 draws the "hist" histogram and the "stats" stats in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file names "canvas.pdf". +// DrawHistStats2 draws the "hist" histogram and the "stats" stats in the "canvas" canvas, by default with the "" option, and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". void DrawHistStats2(TCanvas *canvas, TH2 *hist, TPaveStats *stats, TString option, TString folder) { TString path; path = folder;