void CompareWithRazor(const double mass_stop, const double mass_lsp, const std::string sr, const std::string& suffix = "png") { // get observed limits const std::string limit_path = "test"; const unsigned int num_obs = 7; stop::Yield::value_t ul_obs[num_obs] = { ExtractObsUpperLimitCombine(Form("%s/higgsCombine_t2tt_%1.0f_%1.0f_%s.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), //ExtractObsUpperLimitCombine(Form("%s/higgsCombine_razor_combine_Had_T2tt_MG_%1.0f.000000_MCHI_%1.0f.000000.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp )), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_junk2.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_jescorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_btagcorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_isrcorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractObsUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_lepacorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())) }; // get exp limits stop::Yield::value_t ul_exp[num_obs] = { ExtractExpUpperLimitCombine(Form("%s/higgsCombine_t2tt_%1.0f_%1.0f_%s.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), //ExtractExpUpperLimitCombine(Form("%s/higgsCombine_razor_combine_Had_T2tt_MG_%1.0f.000000_MCHI_%1.0f.000000.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp )), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_junk2.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_jescorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_btagcorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_isrcorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())), ExtractExpUpperLimitCombine(Form("%s/higgsCombine_combined_t2tt_%1.0f_%1.0f_%s_lepacorr.Asymptotic.mH120.1234.root" , limit_path.c_str() , mass_stop , mass_lsp, sr.c_str())) }; // output table const char* const fmt = "1.5"; CTable t1; t1.useTitle(); t1.setTitle(Form("Comparison of limits for m_stop = %1.0f and m_lsp = %1.0f", mass_stop, mass_lsp)); t1.setTable()( "obs limits", "exp limits") ("Single lepton" , ul_obs[0].pm(fmt) , ul_exp[0].value ) ("Razor hadronic" , ul_obs[1].pm(fmt) , ul_exp[1].value ) ("combined (uncorrelated)" , ul_obs[2].pm(fmt) , ul_exp[2].value ) ("combined (JES 100%% corr)" , ul_obs[3].pm(fmt) , ul_exp[3].value ) ("combined (Btag 100%% corr)" , ul_obs[4].pm(fmt) , ul_exp[4].value ) ("combined (ISR 100%% corr)" , ul_obs[5].pm(fmt) , ul_exp[5].value ) ("combined (lepton 100%% anti-corr)", ul_obs[6].pm(fmt) , ul_exp[6].value ) ; cout << t1 << std::endl; // output plot TH1F h_obs("h_obs", Form("Observed signal strength (r-value), m_{stop} = %1.0f GeV, m_{LSP} = %1.0f GeV, SR= %s;Card;r-value", mass_stop, mass_lsp, sr.c_str()), 7, 0.5, 7.5); TH1F h_exp("h_exp", Form("Expected signal strength (r-value), m_{stop} = %1.0f GeV, m_{LSP} = %1.0f GeV, SR= %s;Card;r-value", mass_stop, mass_lsp, sr.c_str()), 7, 0.5, 7.5); FillLimitHistogram(h_obs, ul_obs); FillLimitHistogram(h_exp, ul_exp); TCanvas c1; rt::TH1Overlay p_obs(Form("Signal strength (r-value), m_{stop} = %1.0f GeV, m_{LSP} = %1.0f GeV, SR= %s;Card;r-value", mass_stop, mass_lsp, sr.c_str()), "sb::off lg::top_left"); p_obs.Add(&h_obs, "Observed", kBlack, 2); p_obs.Add(&h_exp, "Expected", kRed , 2); p_obs.Draw(); lt::mkdir("plots/razor_compare", /*force=*/true); c1.Print(Form("plots/razor_compare/p_rvalue_%1.0f_%1.0f_%s.%s", mass_stop, mass_lsp, sr.c_str(), suffix.c_str())); }
void plotCLs() { ModTDRStyle(2800, 2400, 0.06, 0.12, 0.14, 0.22); gStyle->SetPadTickX(1); gStyle->SetPadTickY(1); const unsigned Number = 2; Double_t Red[Number] = {1.00, 0.17}; Double_t Green[Number] = {1.00, 0.16}; Double_t Blue[Number] = {1.00, 0.47}; Double_t Length[Number] = {0.00, 1.00}; Int_t nb = 255; TColor::CreateGradientColorTable(Number, Length, Red, Green, Blue, nb); gStyle->SetNumberContours(nb); TFile f("combined_output.root"); TTree *t =(TTree*)gDirectory->Get("limit"); TGraph2D graph = TGraph2DFromTree(t, "mA", "tanb", "limit", //"quantileExpected > -1.1 && quantileExpected < -0.9"); "quantileExpected > 0.49 && quantileExpected < 0.51"); TGraph2D graph_exp = TGraph2DFromTree(t, "mA", "tanb", "limit", "quantileExpected > 0.49 && quantileExpected < 0.51"); TGraph2D graph_lo68 = TGraph2DFromTree(t, "mA", "tanb", "limit", "quantileExpected > 0.15 && quantileExpected < 0.16"); TGraph2D graph_hi68 = TGraph2DFromTree(t, "mA", "tanb", "limit", "quantileExpected > 0.83 && quantileExpected < 0.84"); TGraph2D graph_lo95 = TGraph2DFromTree(t, "mA", "tanb", "limit", "quantileExpected > 0.02 && quantileExpected < 0.03"); TGraph2D graph_hi95 = TGraph2DFromTree(t, "mA", "tanb", "limit", "quantileExpected > 0.97 && quantileExpected < 0.98"); TH2D hist("hist", "hist", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> cgraphs = SetupHist(&hist, &graph); TH2D h_exp("h_exp", "h_exp", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> g_exp = SetupHist(&h_exp, &graph_exp); TH2D h_lo68("h_lo68", "h_lo68", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> g_lo68 = SetupHist(&h_lo68, &graph_lo68); TH2D h_hi68("h_hi68", "h_hi68", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> g_hi68 = SetupHist(&h_hi68, &graph_hi68); TH2D h_lo95("h_lo95", "h_lo95", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> g_lo95 = SetupHist(&h_lo95, &graph_lo95); TH2D h_hi95("h_hi95", "h_hi95", 91, 90, 1000, 91, 1, 59); std::vector<TGraph *> g_hi95 = SetupHist(&h_hi95, &graph_hi95); TCanvas * canv = new TCanvas("cls", "cls"); canv->cd(); std::vector<TPad*> pads = OnePad(); hist.SetMinimum(0.); hist.SetMaximum(1.); hist.Draw("COLZ"); for (unsigned i = 0; i < g_exp.size(); ++i) { g_exp[i]->SetLineStyle(1); g_exp[i]->SetLineColor(kBlue); g_exp[i]->SetLineWidth(3); g_exp[i]->Draw("L SAME"); } for (unsigned i = 0; i < g_hi68.size(); ++i) { g_hi68[i]->SetLineStyle(7); g_hi68[i]->SetLineColor(kBlue); g_hi68[i]->SetLineWidth(3); g_hi68[i]->Draw("L SAME"); } for (unsigned i = 0; i < g_lo68.size(); ++i) { g_lo68[i]->SetLineStyle(7); g_lo68[i]->SetLineColor(kBlue); g_lo68[i]->SetLineWidth(3); g_lo68[i]->Draw("L SAME"); } for (unsigned i = 0; i < g_hi95.size(); ++i) { g_hi95[i]->SetLineStyle(2); g_hi95[i]->SetLineColor(kBlue); g_hi95[i]->SetLineWidth(3); g_hi95[i]->Draw("L SAME"); } for (unsigned i = 0; i < g_lo95.size(); ++i) { g_lo95[i]->SetLineStyle(2); g_lo95[i]->SetLineColor(kBlue); g_lo95[i]->SetLineWidth(3); g_lo95[i]->Draw("L SAME"); } for (unsigned i = 0; i < cgraphs.size(); ++i) { cgraphs[i]->SetLineStyle(1); cgraphs[i]->SetLineColor(kRed); cgraphs[i]->SetLineWidth(4); cgraphs[i]->Draw("L SAME"); } hist.GetXaxis()->SetTitle("m_{A} (GeV)"); hist.GetYaxis()->SetTitle("tan#beta"); hist.GetZaxis()->SetTitle("Observed CLs"); DrawTitle(pads[0], "CombineHarvester", 1); DrawTitle(pads[0], "MSSM h/H/A#rightarrow#tau#tau, #mu_{}#tau_{h} 8 TeV", 3); TLegend *leg = PositionedLegend(0.25, 0.20, 1, 0.025); leg->AddEntry(cgraphs[0], "95% CL Observed", "L"); leg->AddEntry(g_exp[0], "Expected", "L"); leg->AddEntry(g_lo68[0], " #pm1#sigma Expected", "L"); leg->AddEntry(g_lo95[0], " #pm2#sigma Expected", "L"); leg->Draw(); FixOverlay(); canv->Print("cls.png"); }