//Scaled Histogrammakes { //gROOT->LoadMacro("~/Desktop/atlasstyle/AtlasStyle.C"); //SetAtlasStyle(); TFile* file = new TFile("analysis.root","OPEN"); TCanvas* canvas = new TCanvas("canvas", "canvas", 10, 10, 500, 500); double Lumi_data = 10; //fb-1 double Lumi_mc_s = 1.04649; //fb-1 signal double Lumi_mc_b = 6.84981; //fb-1 background double scaleFactor_s = Lumi_data/Lumi_mc_s; double scaleFactor_b = Lumi_data/Lumi_mc_b; //Make some scaled histograms TH1D* hFishSig = (TH1D*)file->Get("hFishSig"); TH1D* hFishBkg = (TH1D*)file->Get("hFishBkg"); TH1D* hBDTSig = (TH1D*)file->Get("hBDTSig"); TH1D* hBDTBkg = (TH1D*)file->Get("hBDTBkg"); hFishSig.SetLineStyle(2); hFishSig.SetLineColor(2); hBDTSig.SetLineStyle(2); hBDTSig.SetLineColor(2); THStack Fisher_Stack("Fisher_Stack","Fisher Statistic Comparison"); THStack BDT_Stack("BST_Stack","BDT Statisitic Comparison"); hFishSig.Scale(scaleFactor_s); hFishBkg.Scale(scaleFactor_b); hBDTSig.Scale(scaleFactor_s); hBDTBkg.Scale(scaleFactor_b); Fisher_Stack.Add(hFishSig); Fisher_Stack.Add(hFishBkg); BDT_Stack.Add(hBDTSig); BDT_Stack.Add(hBDTBkg); TLegend* leg = new TLegend(0.5, 0.75, 0.9, 0.9); leg->AddEntry(hFishSig, "signal", "l"); // l for line, f for box, p for point leg->AddEntry(hFishBkg, "background", "l"); Fisher_Stack.Draw("nostackhist"); Fisher_Stack->GetXaxis()->SetTitle("t_{Fisher}"); Fisher_Stack->GetYaxis()->SetTitle("Number of scaled events"); leg->Draw(); canvas->Print("./TMVAOutputs/Stack_Fisher.png"); TLegend* leg2 = new TLegend(0.5, 0.75, 0.9, 0.9); leg2->AddEntry(hBDTSig, "signal", "l"); // l for line, f for box, p for point leg2->AddEntry(hBDTBkg, "background", "l"); BDT_Stack.Draw("nostackhist"); BDT_Stack->GetXaxis()->SetTitle("t_{BDT}"); BDT_Stack->GetYaxis()->SetTitle("Number of scaled events"); leg2->Draw(); canvas->Print("./TMVAOutputs/Stack_BDT.png"); }