{ #include "TStyle.h" gROOT->Reset(); gROOT->SetStyle("Plain"); gStyle->SetOptStat(kFALSE); // Create a histograms and stack //JetPt THStack hs1("hs1",""); TH1F* JetPt_50PU_TopJets; TH1F* JetPt_50PU_TTbar; TH1F* JetPt_50PU_DiBoson; TH1F* JetPt_50PU_BosonJets; TH1F* JetPt_50PU_TDR4; TH1F* JetPt_50PU_TDR5; TH1F* JetPt_50PU_TDR6; TH1F* JetPt_50PU_TDR8; TFile *bkg1 = TFile::Open("SingleS_P+MET_50PU_TopJets_mt2w_his.root"); TFile *bkg2 = TFile::Open("SingleS_P+MET_50PU_TTbar_mt2w_his.root"); TFile *bkg3 = TFile::Open("SingleS_P+MET_50PU_DiBoson_mt2w_his.root"); TFile *bkg4 = TFile::Open("SingleS_P+MET_50PU_BosonJets_mt2w_his.root"); TFile *sgnl4 = TFile::Open("SingleS_P+MET_50PU_TDR4_mt2w_his.root"); TFile *sgnl5 = TFile::Open("SingleS_P+MET_50PU_TDR5_mt2w_his.root"); TFile *sgnl6 = TFile::Open("SingleS_P+MET_50PU_TDR6_mt2w_his.root"); TFile *sgnl8 = TFile::Open("SingleS_P+MET_50PU_TDR8_mt2w_his.root"); //JetPt JetPt_50PU_TopJets= (TH1F*) bkg1->Get("hJetPt"); JetPt_50PU_TTbar= (TH1F*) bkg2->Get("hJetPt"); JetPt_50PU_DiBoson= (TH1F*) bkg3->Get("hJetPt"); JetPt_50PU_BosonJets= (TH1F*) bkg4->Get("hJetPt"); JetPt_50PU_TDR4= (TH1F*) sgnl4->Get("hJetPt"); JetPt_50PU_TDR5= (TH1F*) sgnl5->Get("hJetPt"); JetPt_50PU_TDR6= (TH1F*) sgnl6->Get("hJetPt"); JetPt_50PU_TDR8= (TH1F*) sgnl8->Get("hJetPt"); TFile* file = new TFile ("stacked_plots_300/stack_JetPt_50PU.root","RECREATE"); TCanvas* c1 = new TCanvas("c1","stack_JetPt",800,20,1000,800) ; c1->cd(1); c1->SetLogy(); file->Write(); hs1.Draw(); TLatex T1; T1.DrawLatexNDC(.05,.95, "Delphes samples #sqrt{s}=14 TeV, #int Ldt=300 fb^{-1}"); JetPt_50PU_DiBoson->SetFillColor(kRed); hs1->Add(JetPt_50PU_DiBoson); JetPt_50PU_TopJets->SetFillColor(kAzure+1); hs1->Add(JetPt_50PU_TopJets); JetPt_50PU_BosonJets->SetFillColor(kYellow); hs1->Add(JetPt_50PU_BosonJets); JetPt_50PU_TTbar->SetFillColor(kBlue); hs1->Add(JetPt_50PU_TTbar); JetPt_50PU_TDR4->Draw("SAME"); JetPt_50PU_TDR4->SetLineStyle(2); JetPt_50PU_TDR4->SetLineColor(1); JetPt_50PU_TDR4->SetLineWidth(4); JetPt_50PU_TDR5->Draw("SAME"); JetPt_50PU_TDR4->SetLineStyle(2); JetPt_50PU_TDR5->SetLineColor(8); JetPt_50PU_TDR5->SetLineWidth(4); JetPt_50PU_TDR6->Draw("SAME"); JetPt_50PU_TDR6->SetLineStyle(2); JetPt_50PU_TDR6->SetLineColor(28); JetPt_50PU_TDR6->SetLineWidth(4); JetPt_50PU_TDR8->Draw("SAME"); JetPt_50PU_TDR8->SetLineStyle(2); JetPt_50PU_TDR8->SetLineColor(46); JetPt_50PU_TDR8->SetLineWidth(4); hs1->GetXaxis()->SetRangeUser(0, 600); //hs1->SetTitle("Delphes samples #sqrt{s}=14 TeV, #int{Ldt}=300 fb^{-1} "); hs1->GetHistogram()->GetXaxis()->SetTitle("P_{T} [GeV]"); hs1->GetHistogram()->GetYaxis()->SetTitle("Events/20 GeV"); TLegend *pl = new TLegend(0.7, 0.6, 0.9, 0.8); pl->SetTextSize(0.02); pl->SetFillColor(0); pl->AddEntry(JetPt_50PU_TDR4, "TDR4 JetPt 50PU", "lep"); pl->AddEntry(JetPt_50PU_TDR5, "TDR5 JetPt 50PU", "lep"); pl->AddEntry(JetPt_50PU_TDR6, "TDR6 JetPt 50PU", "lep"); pl->AddEntry(JetPt_50PU_TDR8, "TDR8 JetPt 50PU", "lep"); pl->AddEntry(JetPt_50PU_TTbar, "t#bar{t} JetPt 50PU", "lpf"); pl->AddEntry(JetPt_50PU_TopJets, "TopJets JetPt 50PU", "lpf"); pl->AddEntry(JetPt_50PU_DiBoson, "DiBoson JetPt 50PU", "lpf"); pl->AddEntry(JetPt_50PU_BosonJets, "BosonJets JetPt 50PU", "lpf"); pl->SetFillColor(0); pl->SetLineColor(2); pl->Draw("same"); c1->SaveAs("stacked_plots_300/stack_50PU_JetPt.png"); c1->SaveAs("stacked_plots_300/stack_50PU_JetPt.pdf"); c1->SaveAs("stacked_plots_300/stack_50PU_JetPt.root"); }