#include #include #include #include #include #include #include "THStack.h" #include void stack_histos() { //THStack hs("hs", "mass of Za close to nomial Zmass"); TFile *hhbb4m = TFile::Open("/media/aya/LinuxSpace/Pheno_Work/output_demo_5_gghhbb4M_AllDiagrams_20210922.root", "READ"); TFile *ZZ4Mu = TFile::Open("/media/aya/LinuxSpace/Pheno_Work_2/analysis/BackGrounds/output_demo_ZZ4M_20210919.root", "READ"); TFile *ttbar = TFile::Open("/media/aya/LinuxSpace/Pheno_Work_2/analysis/BackGrounds/output_demo_ttbar_20210920.root", "READ"); TFile *DrellY = TFile::Open("/media/aya/LinuxSpace/Pheno_Work_2/analysis/BackGrounds/output_demo_DY_20210920.root", "READ"); // Call histos h_mh1_ZaZb from all input root files TH1* h1 = static_cast(hhbb4m->Get("h_mh1_ZaZb")); TH1* h2 = static_cast(ZZ4Mu->Get("h_mh1_ZaZb")); TH1* h3 = static_cast(ttbar->Get("h_mh1_ZaZb")); // Custom appearance of histos h1->SetLineColor(kRed); h1->SetFillColor(kRed); h1->Draw("hist"); h2->SetLineColor(kBlue); h2->SetFillColor(kBlue); h2->Draw("hist same"); h3->SetLineColor(kGreen); h3->SetFillColor(kGreen); h3->Draw("hist same"); // Call histos h_mh1_b1b2 from all input root files /* TH1* h4 = static_cast(hhbb4m->Get("h_mh1_b1b2")); TH1* h5 = static_cast(ZZ4Mu->Get("h_mh1_b1b2")); TH1* h6 = static_cast(ttbar->Get("h_mh1_b1b2")); // Custom appearance of histos h4->SetLineColor(kRed); h4->SetFillColor(kRed); h4->Draw("hist"); h5->SetLineColor(kBlue); h5->SetFillColor(kBlue); h5->Draw("hist same"); h6->SetLineColor(kGreen); h6->SetFillColor(kGreen); h6->Draw("hist same"); */ // Add legends auto legend = new TLegend(0.1,0.5,0.3,0.7); // set legend dimensions legend->AddEntry(h1, "H->bb4l", "f"); legend->AddEntry(h2, "ZZ->4Mu", "f"); legend->AddEntry(h3, "ttbar", "f"); legend->Draw(); }