#include #include #include #include #include "TLorentzVector.h" #include #include "THStack.h" #include"TFile.h" #include "TH1.h" // put here the include files you need #include "TStopwatch.h" #include using namespace std; #include #include #include #include using namespace std; void Stack_Hist_Signals() { double lumi = 300; gStyle->SetOptStat(0); //to switch for stat. box TString dirname = "."; TString rootH0BB = "h90BP1_bb.root"; TString rootH1BB= "h90BP2_bb.root"; TString rootH2BB = "h95BP1_bb.root"; TString rootH3BB = "h95BP3_bb.root"; TString rootH4BB = "h96BP1_bb.root"; TString rootH5BB = "h96BP2_bb.root"; TString rootH6BB = "h96BP3_bb.root"; TString rootH7BB = "h96BP6_bb.root"; TString rootH8BB = "h_bb.root"; TString rootH9BB = "z_bb.root"; TString rootH10BB = "bb.root"; TString ps_name = "bb_plots_log.ps"; delete gROOT->GetListOfFiles()->FindObject(rootH0BB); delete gROOT->GetListOfFiles()->FindObject( rootH1BB); delete gROOT->GetListOfFiles()->FindObject(rootH2BB); delete gROOT->GetListOfFiles()->FindObject(rootH3BB); delete gROOT->GetListOfFiles()->FindObject(rootH4BB); delete gROOT->GetListOfFiles()->FindObject(rootH5BB); delete gROOT->GetListOfFiles()->FindObject(rootH6BB); delete gROOT->GetListOfFiles()->FindObject(rootH7BB); delete gROOT->GetListOfFiles()->FindObject(rootH8BB); delete gROOT->GetListOfFiles()->FindObject(rootH9BB); TFile *rootH0BBbar= new TFile(rootH0BB); TFile *rootH1BBbar = new TFile(rootH1BB); TFile *rootH2BBbar= new TFile(rootH2BB); TFile *rootH3BBbar = new TFile(rootH3BB); TFile *rootH4BBbar = new TFile(rootH4BB); TFile *rootH5BBbar = new TFile(rootH5BB); TFile *rootH6BBbar = new TFile(rootH6BB); TFile *rootH7BBbar = new TFile(rootH7BB); TFile *rootH8BBbar = new TFile(rootH8BB); TFile *rootH9BBbar = new TFile(rootH9BB); TFile *rootH10BBbar = new TFile(rootH10BB); TH1F *hmc[11][9];TString hname_mc[9]; hname_mc[0]="b1_pt"; hname_mc[1]="b1_eta"; hname_mc[2]="b2_pt"; hname_mc[3]="b2_eta"; hname_mc[4]="h_mass"; hname_mc[5]="h_pt"; hname_mc[6]="h_eta"; hname_mc[7]="DR_b"; hname_mc[8]="scalarHt_Ht"; for(int i=0; i<9;i++ ){ hmc[0][i] = (TH1F*)rootH0BBbar->Get(hname_mc[i]); hmc[1][i] = (TH1F*)rootH1BBbar->Get(hname_mc[i]); hmc[2][i] = (TH1F*)rootH2BBbar->Get(hname_mc[i]); hmc[3][i] = (TH1F*)rootH3BBbar->Get(hname_mc[i]); hmc[4][i] = (TH1F*)rootH4BBbar->Get(hname_mc[i]); hmc[5][i] = (TH1F*)rootH5BBbar->Get(hname_mc[i]); hmc[6][i] = (TH1F*)rootH6BBbar->Get(hname_mc[i]); hmc[7][i] = (TH1F*)rootH7BBbar->Get(hname_mc[i]); hmc[8][i] = (TH1F*)rootH8BBbar->Get(hname_mc[i]); hmc[9][i] = (TH1F*)rootH9BBbar->Get(hname_mc[i]); hmc[10][i] = (TH1F*)rootH10BBbar->Get(hname_mc[i]); hmc[0][i]->SetLineColor(kYellow); hmc[1][i]->SetLineColor(kViolet ); hmc[2][i]->SetLineColor(kBlue); hmc[3][i]->SetLineColor(kGray); hmc[4][i]->SetLineColor(kRed -9 ); hmc[5][i]->SetLineColor(kRed -6); hmc[6][i]->SetLineColor(kRed -10); hmc[7][i]->SetLineColor(kRed ); hmc[8][i]->SetLineColor(kOrange ); hmc[9][i]->SetLineColor(kCyan ); hmc[10][i]->SetLineColor(kGreen ); hmc[0][i]->SetMarkerColor(kYellow); hmc[1][i]->SetMarkerColor( kViolet); hmc[2][i]->SetMarkerColor(kBlue); hmc[3][i]->SetMarkerColor(kGray); hmc[4][i]->SetMarkerColor(kRed -9); hmc[5][i]->SetMarkerColor(kRed -6); hmc[6][i]->SetMarkerColor(kRed -10); hmc[7][i]->SetMarkerColor(kRed ); hmc[8][i]->SetMarkerColor(kOrange ); hmc[9][i]->SetMarkerColor(kCyan); hmc[10][i]->SetMarkerColor(kGreen); hmc[0][i]->Scale(1/hmc[0][i]->Integral()); hmc[1][i]->Scale(1/hmc[1][i]->Integral()); hmc[2][i]->Scale(1/hmc[2][i]->Integral()); hmc[3][i]->Scale(1/hmc[3][i]->Integral()); hmc[4][i]->Scale(1/hmc[4][i]->Integral()); hmc[5][i]->Scale(1/hmc[5][i]->Integral()); hmc[6][i]->Scale(1/hmc[6][i]->Integral()); hmc[7][i]->Scale(1/hmc[7][i]->Integral()); hmc[8][i]->Scale(1/hmc[8][i]->Integral()); hmc[9][i]->Scale(1/hmc[9][i]->Integral()); hmc[10][i]->Scale(1/hmc[10][i]->Integral()); } TLegend* legend = new TLegend(0.7,0.55,0.88,.88,Form("L = %1.1lf fb^{-1}",lumi)); legend->AddEntry( hmc[0][0],"h90BP1_bb ","signal0");//H1BBbar sample legend->AddEntry( hmc[1][0],"h90BP2_bb","signal1");//H2BBbar sample legend->AddEntry( hmc[2][0],"h95BP1_bb","signal2");//H3BBbar sample legend->AddEntry( hmc[3][0],"h95BP3_bb","signal3");//H4BBbar sample legend->AddEntry( hmc[4][0],"h96BP1-bb","signal4");//H5BBbar sample legend->AddEntry( hmc[5][0],"h96BP2_bb","signal5");//H6BBbar sample legend->AddEntry( hmc[6][0],"h96BP3_bb","signal6");//H7BBbar sample legend->AddEntry( hmc[7][0],"h96BP6_bb","signal7");//H8BBbar sample legend->AddEntry( hmc[8][0],"h_bb","f0"); //H9BBbar sample legend->AddEntry( hmc[9][0],"z_bb","f1"); //H10BBbar sample legend->AddEntry( hmc[10][0],"pp_bb","f2"); //H11BBbar sample legend->SetBorderSize(1.); //no border for legend legend->SetFillColor(0); legend->SetHeader("L_{data} = 300 fb^{-1}"); TPostScript* ps = new TPostScript(ps_name,112);//111 portrait 112 landscape 113 eps ps->Range(20.0,20.0); TCanvas* C = new TCanvas("Fig","Fig"); gPad->SetLogy(); for(int i=0; i<9; i++ ){ hmc[0][i]->Draw("Hist"); hmc[1][i]->Draw("Hist,same") ; hmc[2][i]->Draw("Hist,same") ; hmc[3][i]->Draw("Hist,same") ; hmc[4][i]->Draw("Hist,same") ; hmc[5][i]->Draw("Hist,same") ; hmc[6][i]->Draw("Hist,same") ; hmc[7][i]->Draw("Hist,same") ; hmc[8][i]->Draw("Hist,same") ; hmc[9][i]->Draw("Hist,same") ; hmc[10][i]->Draw("Hist,same") ; gPad->RedrawAxis(); legend->Draw(); C->Update(); } ps->Print(); ps->Close(); system("ps2pdf bb_plots_log.ps");cout<<" ps converted..."<Integral(); double Ns2=hmc[1][4]->Integral(); double Ns3=hmc[2][4]->Integral(); double Ns4=hmc[3][4]->Integral(); double Ns5=hmc[4][4]->Integral(); double Ns6=hmc[5][4]->Integral(); double Ns7=hmc[6][4]->Integral(); double Ns8=hmc[7][4]->Integral(); double Nb1=hmc[8][4]->Integral(); double Nb2=hmc[9][4]->Integral(); double Nb3=hmc[10][4]->Integral(); cout<<" number of signal events h1mass 90BP1 = "<< Ns1<