diff --git a/LimitSetting/Models/models_2D.rs b/LimitSetting/Models/models_2D.rs deleted file mode 100644 index cf73b57..0000000 --- a/LimitSetting/Models/models_2D.rs +++ /dev/null @@ -1,568 +0,0 @@ -mgg[100,180]; - -#CMS_hhbbgg_13TeV_mgg_bkg_slope1 -CMS_hhbbgg_13TeV_mgg_bkg_slope1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat3[0.5.,-99, 99]; - -mgg_sig_m0_cat0[124.2, 123, 125]; -mgg_sig_sigma_cat0[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat0[1.0, 0.0, 2.5]; -mgg_sig_n_cat0[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat0[4.0, 0.5, 10.0]; -mgg_sig_frac_cat0[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat1[124.2, 123, 125]; -mgg_sig_sigma_cat1[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat1[1.0, 0.0, 2.5]; -mgg_sig_n_cat1[2.0, 1.5, 10]; -mgg_sig_gsigma_cat1[4.0, 0.5, 10.0]; -mgg_sig_frac_cat1[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat2[124.2, 123, 125]; -mgg_sig_sigma_cat2[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat2[1.0, 0.0, 2.5]; -mgg_sig_n_cat2[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat2[4.0, 0.5, 10.0]; -mgg_sig_frac_cat2[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat3[124.2, 123, 125]; -mgg_sig_sigma_cat3[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat3[1.0, 0.0, 2.5]; -mgg_sig_n_cat3[2.0, 1.5, 10]; -mgg_sig_gsigma_cat3[4.0, 0.5, 10.0]; -mgg_sig_frac_cat3[0.1, 0.05, 0.4]; - -mggGaussSig_cat0 = Gaussian(mgg, mgg_sig_m0_cat0, mgg_sig_gsigma_cat0); -mggCBSig_cat0 = CBShape(mgg, mgg_sig_m0_cat0, mgg_sig_sigma_cat0, mgg_sig_alpha_cat0, mgg_sig_n_cat0); -mggSig_cat0 = AddPdf(mggGaussSig_cat0, mggCBSig_cat0, mgg_sig_frac_cat0); - -mggGaussSig_cat1 = Gaussian(mgg, mgg_sig_m0_cat1, mgg_sig_gsigma_cat1); -mggCBSig_cat1 = CBShape(mgg, mgg_sig_m0_cat1, mgg_sig_sigma_cat1, mgg_sig_alpha_cat1, mgg_sig_n_cat1); -mggSig_cat1 = AddPdf(mggGaussSig_cat1, mggCBSig_cat1, mgg_sig_frac_cat1); - -mggGaussSig_cat2 = Gaussian(mgg, mgg_sig_m0_cat2, mgg_sig_gsigma_cat2); -mggCBSig_cat2 = CBShape(mgg, mgg_sig_m0_cat2, mgg_sig_sigma_cat2, mgg_sig_alpha_cat2, mgg_sig_n_cat2); -mggSig_cat2 = AddPdf(mggGaussSig_cat2, mggCBSig_cat2, mgg_sig_frac_cat2); - -mggGaussSig_cat3 = Gaussian(mgg, mgg_sig_m0_cat3, mgg_sig_gsigma_cat3); -mggCBSig_cat3 = CBShape(mgg, mgg_sig_m0_cat3, mgg_sig_sigma_cat3, mgg_sig_alpha_cat3, mgg_sig_n_cat3); -mggSig_cat3 = AddPdf(mggGaussSig_cat3, mggCBSig_cat3, mgg_sig_frac_cat3); - -mgg_hig_m0_0_cat0[124.2, 123, 125]; -mgg_hig_sigma_0_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat1[124.2, 123, 125]; -mgg_hig_sigma_0_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat2[124.2, 123, 125]; -mgg_hig_sigma_0_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat3[124.2, 123, 125]; -mgg_hig_sigma_0_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_0_cat0 = Gaussian(mgg, mgg_hig_m0_0_cat0, mgg_hig_gsigma_0_cat0); -mggCBHig_0_cat0 = CBShape(mgg, mgg_hig_m0_0_cat0, mgg_hig_sigma_0_cat0, mgg_hig_alpha_0_cat0, mgg_hig_n_0_cat0); -mggHig_0_cat0 = AddPdf(mggGaussHig_0_cat0, mggCBHig_0_cat0, mgg_hig_frac_0_cat0); - -mggGaussHig_0_cat1 = Gaussian(mgg, mgg_hig_m0_0_cat1, mgg_hig_gsigma_0_cat1); -mggCBHig_0_cat1 = CBShape(mgg, mgg_hig_m0_0_cat1, mgg_hig_sigma_0_cat1, mgg_hig_alpha_0_cat1, mgg_hig_n_0_cat1); -mggHig_0_cat1 = AddPdf(mggGaussHig_0_cat1, mggCBHig_0_cat1, mgg_hig_frac_0_cat1); - -mggGaussHig_0_cat2 = Gaussian(mgg, mgg_hig_m0_0_cat2, mgg_hig_gsigma_0_cat2); -mggCBHig_0_cat2 = CBShape(mgg, mgg_hig_m0_0_cat2, mgg_hig_sigma_0_cat2, mgg_hig_alpha_0_cat2, mgg_hig_n_0_cat2); -mggHig_0_cat2 = AddPdf(mggGaussHig_0_cat2, mggCBHig_0_cat2, mgg_hig_frac_0_cat2); - -mggGaussHig_0_cat3 = Gaussian(mgg, mgg_hig_m0_0_cat3, mgg_hig_gsigma_0_cat3); -mggCBHig_0_cat3 = CBShape(mgg, mgg_hig_m0_0_cat3, mgg_hig_sigma_0_cat3, mgg_hig_alpha_0_cat3, mgg_hig_n_0_cat3); -mggHig_0_cat3 = AddPdf(mggGaussHig_0_cat3, mggCBHig_0_cat3, mgg_hig_frac_0_cat3); - -mgg_hig_m0_1_cat0[124.2, 123, 125]; -mgg_hig_sigma_1_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat1[124.2, 123, 125]; -mgg_hig_sigma_1_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat2[124.2, 123, 125]; -mgg_hig_sigma_1_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat3[124.2, 123, 125]; -mgg_hig_sigma_1_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_1_cat0 = Gaussian(mgg, mgg_hig_m0_1_cat0, mgg_hig_gsigma_1_cat0); -mggCBHig_1_cat0 = CBShape(mgg, mgg_hig_m0_1_cat0, mgg_hig_sigma_1_cat0, mgg_hig_alpha_1_cat0, mgg_hig_n_1_cat0); -mggHig_1_cat0 = AddPdf(mggGaussHig_1_cat0, mggCBHig_1_cat0, mgg_hig_frac_1_cat0); - -mggGaussHig_1_cat1 = Gaussian(mgg, mgg_hig_m0_1_cat1, mgg_hig_gsigma_1_cat1); -mggCBHig_1_cat1 = CBShape(mgg, mgg_hig_m0_1_cat1, mgg_hig_sigma_1_cat1, mgg_hig_alpha_1_cat1, mgg_hig_n_1_cat1); -mggHig_1_cat1 = AddPdf(mggGaussHig_1_cat1, mggCBHig_1_cat1, mgg_hig_frac_1_cat1); - -mggGaussHig_1_cat2 = Gaussian(mgg, mgg_hig_m0_1_cat2, mgg_hig_gsigma_1_cat2); -mggCBHig_1_cat2 = CBShape(mgg, mgg_hig_m0_1_cat2, mgg_hig_sigma_1_cat2, mgg_hig_alpha_1_cat2, mgg_hig_n_1_cat2); -mggHig_1_cat2 = AddPdf(mggGaussHig_1_cat2, mggCBHig_1_cat2, mgg_hig_frac_1_cat2); - -mggGaussHig_1_cat3 = Gaussian(mgg, mgg_hig_m0_1_cat3, mgg_hig_gsigma_1_cat3); -mggCBHig_1_cat3 = CBShape(mgg, mgg_hig_m0_1_cat3, mgg_hig_sigma_1_cat3, mgg_hig_alpha_1_cat3, mgg_hig_n_1_cat3); -mggHig_1_cat3 = AddPdf(mggGaussHig_1_cat3, mggCBHig_1_cat3, mgg_hig_frac_1_cat3); - -mgg_hig_m0_2_cat0[124.2, 123, 125]; -mgg_hig_sigma_2_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat1[124.2, 123, 125]; -mgg_hig_sigma_2_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat2[124.2, 123, 125]; -mgg_hig_sigma_2_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat3[124.2, 123, 125]; -mgg_hig_sigma_2_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_2_cat0 = Gaussian(mgg, mgg_hig_m0_2_cat0, mgg_hig_gsigma_2_cat0); -mggCBHig_2_cat0 = CBShape(mgg, mgg_hig_m0_2_cat0, mgg_hig_sigma_2_cat0, mgg_hig_alpha_2_cat0, mgg_hig_n_2_cat0); -mggHig_2_cat0 = AddPdf(mggGaussHig_2_cat0, mggCBHig_2_cat0, mgg_hig_frac_2_cat0); - -mggGaussHig_2_cat1 = Gaussian(mgg, mgg_hig_m0_2_cat1, mgg_hig_gsigma_2_cat1); -mggCBHig_2_cat1 = CBShape(mgg, mgg_hig_m0_2_cat1, mgg_hig_sigma_2_cat1, mgg_hig_alpha_2_cat1, mgg_hig_n_2_cat1); -mggHig_2_cat1 = AddPdf(mggGaussHig_2_cat1, mggCBHig_2_cat1, mgg_hig_frac_2_cat1); - -mggGaussHig_2_cat2 = Gaussian(mgg, mgg_hig_m0_2_cat2, mgg_hig_gsigma_2_cat2); -mggCBHig_2_cat2 = CBShape(mgg, mgg_hig_m0_2_cat2, mgg_hig_sigma_2_cat2, mgg_hig_alpha_2_cat2, mgg_hig_n_2_cat2); -mggHig_2_cat2 = AddPdf(mggGaussHig_2_cat2, mggCBHig_2_cat2, mgg_hig_frac_2_cat2); - -mggGaussHig_2_cat3 = Gaussian(mgg, mgg_hig_m0_2_cat3, mgg_hig_gsigma_2_cat3); -mggCBHig_2_cat3 = CBShape(mgg, mgg_hig_m0_2_cat3, mgg_hig_sigma_2_cat3, mgg_hig_alpha_2_cat3, mgg_hig_n_2_cat3); -mggHig_2_cat3 = AddPdf(mggGaussHig_2_cat3, mggCBHig_2_cat3, mgg_hig_frac_2_cat3); - -mgg_hig_m0_3_cat0[124.2, 123, 125]; -mgg_hig_sigma_3_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat1[124.2, 123, 125]; -mgg_hig_sigma_3_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat2[124.2, 123, 125]; -mgg_hig_sigma_3_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat3[124.2, 123, 125]; -mgg_hig_sigma_3_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_3_cat0 = Gaussian(mgg, mgg_hig_m0_3_cat0, mgg_hig_gsigma_3_cat0); -mggCBHig_3_cat0 = CBShape(mgg, mgg_hig_m0_3_cat0, mgg_hig_sigma_3_cat0, mgg_hig_alpha_3_cat0, mgg_hig_n_3_cat0); -mggHig_3_cat0 = AddPdf(mggGaussHig_3_cat0, mggCBHig_3_cat0, mgg_hig_frac_3_cat0); - -mggGaussHig_3_cat1 = Gaussian(mgg, mgg_hig_m0_3_cat1, mgg_hig_gsigma_3_cat1); -mggCBHig_3_cat1 = CBShape(mgg, mgg_hig_m0_3_cat1, mgg_hig_sigma_3_cat1, mgg_hig_alpha_3_cat1, mgg_hig_n_3_cat1); -mggHig_3_cat1 = AddPdf(mggGaussHig_3_cat1, mggCBHig_3_cat1, mgg_hig_frac_3_cat1); - -mggGaussHig_3_cat2 = Gaussian(mgg, mgg_hig_m0_3_cat2, mgg_hig_gsigma_3_cat2); -mggCBHig_3_cat2 = CBShape(mgg, mgg_hig_m0_3_cat2, mgg_hig_sigma_3_cat2, mgg_hig_alpha_3_cat2, mgg_hig_n_3_cat2); -mggHig_3_cat2 = AddPdf(mggGaussHig_3_cat2, mggCBHig_3_cat2, mgg_hig_frac_3_cat2); - -mggGaussHig_3_cat3 = Gaussian(mgg, mgg_hig_m0_3_cat3, mgg_hig_gsigma_3_cat3); -mggCBHig_3_cat3 = CBShape(mgg, mgg_hig_m0_3_cat3, mgg_hig_sigma_3_cat3, mgg_hig_alpha_3_cat3, mgg_hig_n_3_cat3); -mggHig_3_cat3 = AddPdf(mggGaussHig_3_cat3, mggCBHig_3_cat3, mgg_hig_frac_3_cat3); - -mgg_hig_m0_4_cat0[124.2, 123, 125]; -mgg_hig_sigma_4_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat1[124.2, 123, 125]; -mgg_hig_sigma_4_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat2[124.2, 123, 125]; -mgg_hig_sigma_4_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat3[124.2, 123, 125]; -mgg_hig_sigma_4_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_4_cat0 = Gaussian(mgg, mgg_hig_m0_4_cat0, mgg_hig_gsigma_4_cat0); -mggCBHig_4_cat0 = CBShape(mgg, mgg_hig_m0_4_cat0, mgg_hig_sigma_4_cat0, mgg_hig_alpha_4_cat0, mgg_hig_n_4_cat0); -mggHig_4_cat0 = AddPdf(mggGaussHig_4_cat0, mggCBHig_4_cat0, mgg_hig_frac_4_cat0); - -mggGaussHig_4_cat1 = Gaussian(mgg, mgg_hig_m0_4_cat1, mgg_hig_gsigma_4_cat1); -mggCBHig_4_cat1 = CBShape(mgg, mgg_hig_m0_4_cat1, mgg_hig_sigma_4_cat1, mgg_hig_alpha_4_cat1, mgg_hig_n_4_cat1); -mggHig_4_cat1 = AddPdf(mggGaussHig_4_cat1, mggCBHig_4_cat1, mgg_hig_frac_4_cat1); - -mggGaussHig_4_cat2 = Gaussian(mgg, mgg_hig_m0_4_cat2, mgg_hig_gsigma_4_cat2); -mggCBHig_4_cat2 = CBShape(mgg, mgg_hig_m0_4_cat2, mgg_hig_sigma_4_cat2, mgg_hig_alpha_4_cat2, mgg_hig_n_4_cat2); -mggHig_4_cat2 = AddPdf(mggGaussHig_4_cat2, mggCBHig_4_cat2, mgg_hig_frac_4_cat2); - -mggGaussHig_4_cat3 = Gaussian(mgg, mgg_hig_m0_4_cat3, mgg_hig_gsigma_4_cat3); -mggCBHig_4_cat3 = CBShape(mgg, mgg_hig_m0_4_cat3, mgg_hig_sigma_4_cat3, mgg_hig_alpha_4_cat3, mgg_hig_n_4_cat3); -mggHig_4_cat3 = AddPdf(mggGaussHig_4_cat3, mggCBHig_4_cat3, mgg_hig_frac_4_cat3); - -mjj[80,200]; - -mjj_sig_m0_cat0[110.0, 99, 140]; -mjj_sig_sigma_cat0[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat0[2.0, 1.0, 2.5]; -mjj_sig_n_cat0[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat0[25.0, 20.0, 80.0]; -mjj_sig_frac_cat0[0.1, 0.001, 0.99]; - -mjjGaussSig_cat0 = Gaussian(mjj, mjj_sig_m0_cat0, mjj_sig_gsigma_cat0); -mjjCBSig_cat0 = CBShape(mjj, mjj_sig_m0_cat0, mjj_sig_sigma_cat0, mjj_sig_alpha_cat0, mjj_sig_n_cat0); -mjjSig_cat0 = AddPdf(mjjGaussSig_cat0, mjjCBSig_cat0, mjj_sig_frac_cat0); - -mjj_sig_m0_cat1[110.0, 99, 140]; -mjj_sig_sigma_cat1[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat1[2.0, 1.2, 5]; -mjj_sig_n_cat1[2.0, 1.5, 10]; -mjj_sig_gsigma_cat1[25.0, 20.0, 80.0]; -mjj_sig_frac_cat1[0.1, 0.001, 0.99]; - -mjjGaussSig_cat1 = Gaussian(mjj, mjj_sig_m0_cat1, mjj_sig_gsigma_cat1); -mjjCBSig_cat1 = CBShape(mjj, mjj_sig_m0_cat1, mjj_sig_sigma_cat1, mjj_sig_alpha_cat1, mjj_sig_n_cat1); -mjjSig_cat1 = AddPdf(mjjGaussSig_cat1, mjjCBSig_cat1, mjj_sig_frac_cat1); - -mjj_sig_m0_cat2[110.0, 99, 140]; -mjj_sig_sigma_cat2[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat2[2.0, 1.0, 2.5]; -mjj_sig_n_cat2[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat2[25.0, 20.0, 80.0]; -mjj_sig_frac_cat2[0.1, 0.001, 0.99]; - -mjjGaussSig_cat2 = Gaussian(mjj, mjj_sig_m0_cat2, mjj_sig_gsigma_cat2); -mjjCBSig_cat2 = CBShape(mjj, mjj_sig_m0_cat2, mjj_sig_sigma_cat2, mjj_sig_alpha_cat2, mjj_sig_n_cat2); -mjjSig_cat2 = AddPdf(mjjGaussSig_cat2, mjjCBSig_cat2, mjj_sig_frac_cat2); - -mjj_sig_m0_cat3[110.0, 99, 140]; -mjj_sig_sigma_cat3[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat3[2.0, 1.0, 2.5]; -mjj_sig_n_cat3[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat3[25.0, 20.0, 80.0]; -mjj_sig_frac_cat3[0.1, 0.001, 0.99]; - -mjjGaussSig_cat3 = Gaussian(mjj, mjj_sig_m0_cat3, mjj_sig_gsigma_cat3); -mjjCBSig_cat3 = CBShape(mjj, mjj_sig_m0_cat3, mjj_sig_sigma_cat3, mjj_sig_alpha_cat3, mjj_sig_n_cat3); -mjjSig_cat3 = AddPdf(mjjGaussSig_cat3, mjjCBSig_cat3, mjj_sig_frac_cat3); - -CMS_hhbbgg_13TeV_mjj_bkg_slope1[0.9,-100.0, 1000.0]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat3[0.5,-100, 100]; - -mjj_hig_m0_0_cat0[100, 80, 200]; -mjj_hig_sigma_0_cat0[25, 10, 50]; -mjj_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat0[50, 10, 100]; -mjj_hig_frac_0_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat1[100, 80, 200]; -mjj_hig_sigma_0_cat1[25, 10, 50]; -mjj_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat1[50, 10, 100]; -mjj_hig_frac_0_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat2[100, 80, 200]; -mjj_hig_sigma_0_cat2[25, 10, 50]; -mjj_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat2[50, 10, 100]; -mjj_hig_frac_0_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat3[100, 80, 200]; -mjj_hig_sigma_0_cat3[25, 10, 50]; -mjj_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat3[50, 10, 100]; -mjj_hig_frac_0_cat3[0.1, 0, 0.4]; - -mjjGaussHig_0_cat0 = Gaussian(mjj, mjj_hig_m0_0_cat0, mjj_hig_gsigma_0_cat0); -mjjCBHig_0_cat0 = CBShape(mjj, mjj_hig_m0_0_cat0, mjj_hig_sigma_0_cat0, mjj_hig_alpha_0_cat0, mjj_hig_n_0_cat0); -mjjHig_0_cat0 = AddPdf(mjjGaussHig_0_cat0, mjjCBHig_0_cat0, mjj_hig_frac_0_cat0); - -mjjGaussHig_0_cat1 = Gaussian(mjj, mjj_hig_m0_0_cat1, mjj_hig_gsigma_0_cat1); -mjjCBHig_0_cat1 = CBShape(mjj, mjj_hig_m0_0_cat1, mjj_hig_sigma_0_cat1, mjj_hig_alpha_0_cat1, mjj_hig_n_0_cat1); -mjjHig_0_cat1 = AddPdf(mjjGaussHig_0_cat1, mjjCBHig_0_cat1, mjj_hig_frac_0_cat1); - -mjjGaussHig_0_cat2 = Gaussian(mjj, mjj_hig_m0_0_cat2, mjj_hig_gsigma_0_cat2); -mjjCBHig_0_cat2 = CBShape(mjj, mjj_hig_m0_0_cat2, mjj_hig_sigma_0_cat2, mjj_hig_alpha_0_cat2, mjj_hig_n_0_cat2); -mjjHig_0_cat2 = AddPdf(mjjGaussHig_0_cat2, mjjCBHig_0_cat2, mjj_hig_frac_0_cat2); - -mjjGaussHig_0_cat3 = Gaussian(mjj, mjj_hig_m0_0_cat3, mjj_hig_gsigma_0_cat3); -mjjCBHig_0_cat3 = CBShape(mjj, mjj_hig_m0_0_cat3, mjj_hig_sigma_0_cat3, mjj_hig_alpha_0_cat3, mjj_hig_n_0_cat3); -mjjHig_0_cat3 = AddPdf(mjjGaussHig_0_cat3, mjjCBHig_0_cat3, mjj_hig_frac_0_cat3); - -mjj_hig_m0_1_cat0[100, 80, 200]; -mjj_hig_sigma_1_cat0[25, 10, 50]; -mjj_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat0[50, 10, 100]; -mjj_hig_frac_1_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat1[100, 80, 200]; -mjj_hig_sigma_1_cat1[25, 10, 50]; -mjj_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat1[50, 10, 100]; -mjj_hig_frac_1_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat2[100, 80, 200]; -mjj_hig_sigma_1_cat2[25, 10, 50]; -mjj_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat2[50, 10, 100]; -mjj_hig_frac_1_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat3[100, 80, 200]; -mjj_hig_sigma_1_cat3[25, 10, 50]; -mjj_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat3[50, 10, 100]; -mjj_hig_frac_1_cat3[0.1, 0, 0.4]; - -mjjGaussHig_1_cat0 = Gaussian(mjj, mjj_hig_m0_1_cat0, mjj_hig_gsigma_1_cat0); -mjjCBHig_1_cat0 = CBShape(mjj, mjj_hig_m0_1_cat0, mjj_hig_sigma_1_cat0, mjj_hig_alpha_1_cat0, mjj_hig_n_1_cat0); -mjjHig_1_cat0 = AddPdf(mjjGaussHig_1_cat0, mjjCBHig_1_cat0, mjj_hig_frac_1_cat0); - -mjjGaussHig_1_cat1 = Gaussian(mjj, mjj_hig_m0_1_cat1, mjj_hig_gsigma_1_cat1); -mjjCBHig_1_cat1 = CBShape(mjj, mjj_hig_m0_1_cat1, mjj_hig_sigma_1_cat1, mjj_hig_alpha_1_cat1, mjj_hig_n_1_cat1); -mjjHig_1_cat1 = AddPdf(mjjGaussHig_1_cat1, mjjCBHig_1_cat1, mjj_hig_frac_1_cat1); - -mjjGaussHig_1_cat2 = Gaussian(mjj, mjj_hig_m0_1_cat2, mjj_hig_gsigma_1_cat2); -mjjCBHig_1_cat2 = CBShape(mjj, mjj_hig_m0_1_cat2, mjj_hig_sigma_1_cat2, mjj_hig_alpha_1_cat2, mjj_hig_n_1_cat2); -mjjHig_1_cat2 = AddPdf(mjjGaussHig_1_cat2, mjjCBHig_1_cat2, mjj_hig_frac_1_cat2); - -mjjGaussHig_1_cat3 = Gaussian(mjj, mjj_hig_m0_1_cat3, mjj_hig_gsigma_1_cat3); -mjjCBHig_1_cat3 = CBShape(mjj, mjj_hig_m0_1_cat3, mjj_hig_sigma_1_cat3, mjj_hig_alpha_1_cat3, mjj_hig_n_1_cat3); -mjjHig_1_cat3 = AddPdf(mjjGaussHig_1_cat3, mjjCBHig_1_cat3, mjj_hig_frac_1_cat3); - -mjj_hig_m0_2_cat0[100, 80, 200]; -mjj_hig_sigma_2_cat0[25, 10, 50]; -mjj_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat0[50, 10, 100]; -mjj_hig_frac_2_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat1[100, 80, 200]; -mjj_hig_sigma_2_cat1[25, 10, 50]; -mjj_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat1[50, 10, 100]; -mjj_hig_frac_2_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat2[100, 80, 200]; -mjj_hig_sigma_2_cat2[25, 10, 50]; -mjj_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat2[50, 10, 100]; -mjj_hig_frac_2_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat3[100, 80, 200]; -mjj_hig_sigma_2_cat3[25, 10, 50]; -mjj_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat3[50, 10, 100]; -mjj_hig_frac_2_cat3[0.1, 0, 0.4]; - -mjjGaussHig_2_cat0 = Gaussian(mjj, mjj_hig_m0_2_cat0, mjj_hig_gsigma_2_cat0); -mjjCBHig_2_cat0 = CBShape(mjj, mjj_hig_m0_2_cat0, mjj_hig_sigma_2_cat0, mjj_hig_alpha_2_cat0, mjj_hig_n_2_cat0); -mjjHig_2_cat0 = AddPdf(mjjGaussHig_2_cat0, mjjCBHig_2_cat0, mjj_hig_frac_2_cat0); - -mjjGaussHig_2_cat1 = Gaussian(mjj, mjj_hig_m0_2_cat1, mjj_hig_gsigma_2_cat1); -mjjCBHig_2_cat1 = CBShape(mjj, mjj_hig_m0_2_cat1, mjj_hig_sigma_2_cat1, mjj_hig_alpha_2_cat1, mjj_hig_n_2_cat1); -mjjHig_2_cat1 = AddPdf(mjjGaussHig_2_cat1, mjjCBHig_2_cat1, mjj_hig_frac_2_cat1); - -mjjGaussHig_2_cat2 = Gaussian(mjj, mjj_hig_m0_2_cat2, mjj_hig_gsigma_2_cat2); -mjjCBHig_2_cat2 = CBShape(mjj, mjj_hig_m0_2_cat2, mjj_hig_sigma_2_cat2, mjj_hig_alpha_2_cat2, mjj_hig_n_2_cat2); -mjjHig_2_cat2 = AddPdf(mjjGaussHig_2_cat2, mjjCBHig_2_cat2, mjj_hig_frac_2_cat2); - -mjjGaussHig_2_cat3 = Gaussian(mjj, mjj_hig_m0_2_cat3, mjj_hig_gsigma_2_cat3); -mjjCBHig_2_cat3 = CBShape(mjj, mjj_hig_m0_2_cat3, mjj_hig_sigma_2_cat3, mjj_hig_alpha_2_cat3, mjj_hig_n_2_cat3); -mjjHig_2_cat3 = AddPdf(mjjGaussHig_2_cat3, mjjCBHig_2_cat3, mjj_hig_frac_2_cat3); - -mjj_hig_m0_3_cat0[100, 80, 200]; -mjj_hig_sigma_3_cat0[25, 10, 50]; -mjj_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat0[50, 10, 100]; -mjj_hig_frac_3_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat1[100, 80, 200]; -mjj_hig_sigma_3_cat1[25, 10, 50]; -mjj_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat1[50, 10, 100]; -mjj_hig_frac_3_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat2[100, 80, 200]; -mjj_hig_sigma_3_cat2[25, 10, 50]; -mjj_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat2[50, 10, 100]; -mjj_hig_frac_3_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat3[100, 80, 200]; -mjj_hig_sigma_3_cat3[25, 10, 50]; -mjj_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat3[50, 10, 100]; -mjj_hig_frac_3_cat3[0.1, 0, 0.4]; - -mjjGaussHig_3_cat0 = Gaussian(mjj, mjj_hig_m0_3_cat0, mjj_hig_gsigma_3_cat0); -mjjCBHig_3_cat0 = CBShape(mjj, mjj_hig_m0_3_cat0, mjj_hig_sigma_3_cat0, mjj_hig_alpha_3_cat0, mjj_hig_n_3_cat0); -mjjHig_3_cat0 = AddPdf(mjjGaussHig_3_cat0, mjjCBHig_3_cat0, mjj_hig_frac_3_cat0); - -mjjGaussHig_3_cat1 = Gaussian(mjj, mjj_hig_m0_3_cat1, mjj_hig_gsigma_3_cat1); -mjjCBHig_3_cat1 = CBShape(mjj, mjj_hig_m0_3_cat1, mjj_hig_sigma_3_cat1, mjj_hig_alpha_3_cat1, mjj_hig_n_3_cat1); -mjjHig_3_cat1 = AddPdf(mjjGaussHig_3_cat1, mjjCBHig_3_cat1, mjj_hig_frac_3_cat1); - -mjjGaussHig_3_cat2 = Gaussian(mjj, mjj_hig_m0_3_cat2, mjj_hig_gsigma_3_cat2); -mjjCBHig_3_cat2 = CBShape(mjj, mjj_hig_m0_3_cat2, mjj_hig_sigma_3_cat2, mjj_hig_alpha_3_cat2, mjj_hig_n_3_cat2); -mjjHig_3_cat2 = AddPdf(mjjGaussHig_3_cat2, mjjCBHig_3_cat2, mjj_hig_frac_3_cat2); - -mjjGaussHig_3_cat3 = Gaussian(mjj, mjj_hig_m0_3_cat3, mjj_hig_gsigma_3_cat3); -mjjCBHig_3_cat3 = CBShape(mjj, mjj_hig_m0_3_cat3, mjj_hig_sigma_3_cat3, mjj_hig_alpha_3_cat3, mjj_hig_n_3_cat3); -mjjHig_3_cat3 = AddPdf(mjjGaussHig_3_cat3, mjjCBHig_3_cat3, mjj_hig_frac_3_cat3); - -mjj_hig_m0_4_cat0[100, 80, 200]; -mjj_hig_sigma_4_cat0[25, 10, 50]; -mjj_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat0[50, 10, 100]; -mjj_hig_frac_4_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat1[100, 80, 200]; -mjj_hig_sigma_4_cat1[25, 10, 50]; -mjj_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat1[50, 10, 100]; -mjj_hig_frac_4_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat2[100, 80, 200]; -mjj_hig_sigma_4_cat2[25, 10, 50]; -mjj_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat2[50, 10, 100]; -mjj_hig_frac_4_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat3[100, 80, 200]; -mjj_hig_sigma_4_cat3[25, 10, 50]; -mjj_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat3[50, 10, 100]; -mjj_hig_frac_4_cat3[0.1, 0, 0.4]; - -mjjGaussHig_4_cat0 = Gaussian(mjj, mjj_hig_m0_4_cat0, mjj_hig_gsigma_4_cat0); -mjjCBHig_4_cat0 = CBShape(mjj, mjj_hig_m0_4_cat0, mjj_hig_sigma_4_cat0, mjj_hig_alpha_4_cat0, mjj_hig_n_4_cat0); -mjjHig_4_cat0 = AddPdf(mjjGaussHig_4_cat0, mjjCBHig_4_cat0, mjj_hig_frac_4_cat0); - -mjjGaussHig_4_cat1 = Gaussian(mjj, mjj_hig_m0_4_cat1, mjj_hig_gsigma_4_cat1); -mjjCBHig_4_cat1 = CBShape(mjj, mjj_hig_m0_4_cat1, mjj_hig_sigma_4_cat1, mjj_hig_alpha_4_cat1, mjj_hig_n_4_cat1); -mjjHig_4_cat1 = AddPdf(mjjGaussHig_4_cat1, mjjCBHig_4_cat1, mjj_hig_frac_4_cat1); - -mjjGaussHig_4_cat2 = Gaussian(mjj, mjj_hig_m0_4_cat2, mjj_hig_gsigma_4_cat2); -mjjCBHig_4_cat2 = CBShape(mjj, mjj_hig_m0_4_cat2, mjj_hig_sigma_4_cat2, mjj_hig_alpha_4_cat2, mjj_hig_n_4_cat2); -mjjHig_4_cat2 = AddPdf(mjjGaussHig_4_cat2, mjjCBHig_4_cat2, mjj_hig_frac_4_cat2); - -mjjGaussHig_4_cat3 = Gaussian(mjj, mjj_hig_m0_4_cat3, mjj_hig_gsigma_4_cat3); -mjjCBHig_4_cat3 = CBShape(mjj, mjj_hig_m0_4_cat3, mjj_hig_sigma_4_cat3, mjj_hig_alpha_4_cat3, mjj_hig_n_4_cat3); -mjjHig_4_cat3 = AddPdf(mjjGaussHig_4_cat3, mjjCBHig_4_cat3, mjj_hig_frac_4_cat3); diff --git a/LimitSetting/Models/models_2D_sig.rs b/LimitSetting/Models/models_2D_sig.rs deleted file mode 100644 index 6e2a364..0000000 --- a/LimitSetting/Models/models_2D_sig.rs +++ /dev/null @@ -1,570 +0,0 @@ -mgg[100,180]; - -#CMS_hhbbgg_13TeV_mgg_bkg_slope1 -CMS_hhbbgg_13TeV_mgg_bkg_slope1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat3[0.5.,-99, 99]; - -mgg_sig_m0_cat0[124.2, 123, 125]; -mgg_sig_sigma_cat0[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat0[1.0, 0.0, 2.5]; -mgg_sig_n_cat0[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat0[4.0, 0.5, 10.0]; -mgg_sig_frac_cat0[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat1[124.2, 123, 125]; -mgg_sig_sigma_cat1[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat1[1.0, 0.0, 2.5]; -mgg_sig_n_cat1[2.0, 1.5, 10]; -mgg_sig_gsigma_cat1[4.0, 0.5, 10.0]; -mgg_sig_frac_cat1[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat2[124.2, 123, 125]; -mgg_sig_sigma_cat2[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat2[1.0, 0.0, 2.5]; -mgg_sig_n_cat2[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat2[4.0, 0.5, 10.0]; -mgg_sig_frac_cat2[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat3[124.2, 123, 125]; -mgg_sig_sigma_cat3[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat3[1.0, 0.0, 2.5]; -mgg_sig_n_cat3[2.0, 1.5, 10]; -mgg_sig_gsigma_cat3[4.0, 0.5, 10.0]; -mgg_sig_frac_cat3[0.1, 0.05, 0.4]; - -mggGaussSig_cat0 = Gaussian(mgg, mgg_sig_m0_cat0, mgg_sig_gsigma_cat0); -mggCBSig_cat0 = CBShape(mgg, mgg_sig_m0_cat0, mgg_sig_sigma_cat0, mgg_sig_alpha_cat0, mgg_sig_n_cat0); -mggSig_cat0 = AddPdf(mggGaussSig_cat0, mggCBSig_cat0, mgg_sig_frac_cat0); - -mggGaussSig_cat1 = Gaussian(mgg, mgg_sig_m0_cat1, mgg_sig_gsigma_cat1); -mggCBSig_cat1 = CBShape(mgg, mgg_sig_m0_cat1, mgg_sig_sigma_cat1, mgg_sig_alpha_cat1, mgg_sig_n_cat1); -mggSig_cat1 = AddPdf(mggGaussSig_cat1, mggCBSig_cat1, mgg_sig_frac_cat1); - -mggGaussSig_cat2 = Gaussian(mgg, mgg_sig_m0_cat2, mgg_sig_gsigma_cat2); -mggCBSig_cat2 = CBShape(mgg, mgg_sig_m0_cat2, mgg_sig_sigma_cat2, mgg_sig_alpha_cat2, mgg_sig_n_cat2); -mggSig_cat2 = AddPdf(mggGaussSig_cat2, mggCBSig_cat2, mgg_sig_frac_cat2); - -mggGaussSig_cat3 = Gaussian(mgg, mgg_sig_m0_cat3, mgg_sig_gsigma_cat3); -mggCBSig_cat3 = CBShape(mgg, mgg_sig_m0_cat3, mgg_sig_sigma_cat3, mgg_sig_alpha_cat3, mgg_sig_n_cat3); -mggSig_cat3 = AddPdf(mggGaussSig_cat3, mggCBSig_cat3, mgg_sig_frac_cat3); - -mgg_hig_m0_0_cat0[124.2, 123, 125]; -mgg_hig_sigma_0_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat1[124.2, 123, 125]; -mgg_hig_sigma_0_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat2[124.2, 123, 125]; -mgg_hig_sigma_0_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat3[124.2, 123, 125]; -mgg_hig_sigma_0_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_0_cat0 = Gaussian(mgg, mgg_hig_m0_0_cat0, mgg_hig_gsigma_0_cat0); -mggCBHig_0_cat0 = CBShape(mgg, mgg_hig_m0_0_cat0, mgg_hig_sigma_0_cat0, mgg_hig_alpha_0_cat0, mgg_hig_n_0_cat0); -mggHig_0_cat0 = AddPdf(mggGaussHig_0_cat0, mggCBHig_0_cat0, mgg_hig_frac_0_cat0); - -mggGaussHig_0_cat1 = Gaussian(mgg, mgg_hig_m0_0_cat1, mgg_hig_gsigma_0_cat1); -mggCBHig_0_cat1 = CBShape(mgg, mgg_hig_m0_0_cat1, mgg_hig_sigma_0_cat1, mgg_hig_alpha_0_cat1, mgg_hig_n_0_cat1); -mggHig_0_cat1 = AddPdf(mggGaussHig_0_cat1, mggCBHig_0_cat1, mgg_hig_frac_0_cat1); - -mggGaussHig_0_cat2 = Gaussian(mgg, mgg_hig_m0_0_cat2, mgg_hig_gsigma_0_cat2); -mggCBHig_0_cat2 = CBShape(mgg, mgg_hig_m0_0_cat2, mgg_hig_sigma_0_cat2, mgg_hig_alpha_0_cat2, mgg_hig_n_0_cat2); -mggHig_0_cat2 = AddPdf(mggGaussHig_0_cat2, mggCBHig_0_cat2, mgg_hig_frac_0_cat2); - -mggGaussHig_0_cat3 = Gaussian(mgg, mgg_hig_m0_0_cat3, mgg_hig_gsigma_0_cat3); -mggCBHig_0_cat3 = CBShape(mgg, mgg_hig_m0_0_cat3, mgg_hig_sigma_0_cat3, mgg_hig_alpha_0_cat3, mgg_hig_n_0_cat3); -mggHig_0_cat3 = AddPdf(mggGaussHig_0_cat3, mggCBHig_0_cat3, mgg_hig_frac_0_cat3); - -mgg_hig_m0_1_cat0[124.2, 123, 125]; -mgg_hig_sigma_1_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat1[124.2, 123, 125]; -mgg_hig_sigma_1_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat2[124.2, 123, 125]; -mgg_hig_sigma_1_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat3[124.2, 123, 125]; -mgg_hig_sigma_1_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_1_cat0 = Gaussian(mgg, mgg_hig_m0_1_cat0, mgg_hig_gsigma_1_cat0); -mggCBHig_1_cat0 = CBShape(mgg, mgg_hig_m0_1_cat0, mgg_hig_sigma_1_cat0, mgg_hig_alpha_1_cat0, mgg_hig_n_1_cat0); -mggHig_1_cat0 = AddPdf(mggGaussHig_1_cat0, mggCBHig_1_cat0, mgg_hig_frac_1_cat0); - -mggGaussHig_1_cat1 = Gaussian(mgg, mgg_hig_m0_1_cat1, mgg_hig_gsigma_1_cat1); -mggCBHig_1_cat1 = CBShape(mgg, mgg_hig_m0_1_cat1, mgg_hig_sigma_1_cat1, mgg_hig_alpha_1_cat1, mgg_hig_n_1_cat1); -mggHig_1_cat1 = AddPdf(mggGaussHig_1_cat1, mggCBHig_1_cat1, mgg_hig_frac_1_cat1); - -mggGaussHig_1_cat2 = Gaussian(mgg, mgg_hig_m0_1_cat2, mgg_hig_gsigma_1_cat2); -mggCBHig_1_cat2 = CBShape(mgg, mgg_hig_m0_1_cat2, mgg_hig_sigma_1_cat2, mgg_hig_alpha_1_cat2, mgg_hig_n_1_cat2); -mggHig_1_cat2 = AddPdf(mggGaussHig_1_cat2, mggCBHig_1_cat2, mgg_hig_frac_1_cat2); - -mggGaussHig_1_cat3 = Gaussian(mgg, mgg_hig_m0_1_cat3, mgg_hig_gsigma_1_cat3); -mggCBHig_1_cat3 = CBShape(mgg, mgg_hig_m0_1_cat3, mgg_hig_sigma_1_cat3, mgg_hig_alpha_1_cat3, mgg_hig_n_1_cat3); -mggHig_1_cat3 = AddPdf(mggGaussHig_1_cat3, mggCBHig_1_cat3, mgg_hig_frac_1_cat3); - -mgg_hig_m0_2_cat0[124.2, 123, 125]; -mgg_hig_sigma_2_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat1[124.2, 123, 125]; -mgg_hig_sigma_2_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat2[124.2, 123, 125]; -mgg_hig_sigma_2_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat3[124.2, 123, 125]; -mgg_hig_sigma_2_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_2_cat0 = Gaussian(mgg, mgg_hig_m0_2_cat0, mgg_hig_gsigma_2_cat0); -mggCBHig_2_cat0 = CBShape(mgg, mgg_hig_m0_2_cat0, mgg_hig_sigma_2_cat0, mgg_hig_alpha_2_cat0, mgg_hig_n_2_cat0); -mggHig_2_cat0 = AddPdf(mggGaussHig_2_cat0, mggCBHig_2_cat0, mgg_hig_frac_2_cat0); - -mggGaussHig_2_cat1 = Gaussian(mgg, mgg_hig_m0_2_cat1, mgg_hig_gsigma_2_cat1); -mggCBHig_2_cat1 = CBShape(mgg, mgg_hig_m0_2_cat1, mgg_hig_sigma_2_cat1, mgg_hig_alpha_2_cat1, mgg_hig_n_2_cat1); -mggHig_2_cat1 = AddPdf(mggGaussHig_2_cat1, mggCBHig_2_cat1, mgg_hig_frac_2_cat1); - -mggGaussHig_2_cat2 = Gaussian(mgg, mgg_hig_m0_2_cat2, mgg_hig_gsigma_2_cat2); -mggCBHig_2_cat2 = CBShape(mgg, mgg_hig_m0_2_cat2, mgg_hig_sigma_2_cat2, mgg_hig_alpha_2_cat2, mgg_hig_n_2_cat2); -mggHig_2_cat2 = AddPdf(mggGaussHig_2_cat2, mggCBHig_2_cat2, mgg_hig_frac_2_cat2); - -mggGaussHig_2_cat3 = Gaussian(mgg, mgg_hig_m0_2_cat3, mgg_hig_gsigma_2_cat3); -mggCBHig_2_cat3 = CBShape(mgg, mgg_hig_m0_2_cat3, mgg_hig_sigma_2_cat3, mgg_hig_alpha_2_cat3, mgg_hig_n_2_cat3); -mggHig_2_cat3 = AddPdf(mggGaussHig_2_cat3, mggCBHig_2_cat3, mgg_hig_frac_2_cat3); - -mgg_hig_m0_3_cat0[124.2, 123, 125]; -mgg_hig_sigma_3_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat1[124.2, 123, 125]; -mgg_hig_sigma_3_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat2[124.2, 123, 125]; -mgg_hig_sigma_3_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat3[124.2, 123, 125]; -mgg_hig_sigma_3_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_3_cat0 = Gaussian(mgg, mgg_hig_m0_3_cat0, mgg_hig_gsigma_3_cat0); -mggCBHig_3_cat0 = CBShape(mgg, mgg_hig_m0_3_cat0, mgg_hig_sigma_3_cat0, mgg_hig_alpha_3_cat0, mgg_hig_n_3_cat0); -mggHig_3_cat0 = AddPdf(mggGaussHig_3_cat0, mggCBHig_3_cat0, mgg_hig_frac_3_cat0); - -mggGaussHig_3_cat1 = Gaussian(mgg, mgg_hig_m0_3_cat1, mgg_hig_gsigma_3_cat1); -mggCBHig_3_cat1 = CBShape(mgg, mgg_hig_m0_3_cat1, mgg_hig_sigma_3_cat1, mgg_hig_alpha_3_cat1, mgg_hig_n_3_cat1); -mggHig_3_cat1 = AddPdf(mggGaussHig_3_cat1, mggCBHig_3_cat1, mgg_hig_frac_3_cat1); - -mggGaussHig_3_cat2 = Gaussian(mgg, mgg_hig_m0_3_cat2, mgg_hig_gsigma_3_cat2); -mggCBHig_3_cat2 = CBShape(mgg, mgg_hig_m0_3_cat2, mgg_hig_sigma_3_cat2, mgg_hig_alpha_3_cat2, mgg_hig_n_3_cat2); -mggHig_3_cat2 = AddPdf(mggGaussHig_3_cat2, mggCBHig_3_cat2, mgg_hig_frac_3_cat2); - -mggGaussHig_3_cat3 = Gaussian(mgg, mgg_hig_m0_3_cat3, mgg_hig_gsigma_3_cat3); -mggCBHig_3_cat3 = CBShape(mgg, mgg_hig_m0_3_cat3, mgg_hig_sigma_3_cat3, mgg_hig_alpha_3_cat3, mgg_hig_n_3_cat3); -mggHig_3_cat3 = AddPdf(mggGaussHig_3_cat3, mggCBHig_3_cat3, mgg_hig_frac_3_cat3); - -mgg_hig_m0_4_cat0[124.2, 123, 125]; -mgg_hig_sigma_4_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat1[124.2, 123, 125]; -mgg_hig_sigma_4_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat2[124.2, 123, 125]; -mgg_hig_sigma_4_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat3[124.2, 123, 125]; -mgg_hig_sigma_4_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_4_cat0 = Gaussian(mgg, mgg_hig_m0_4_cat0, mgg_hig_gsigma_4_cat0); -mggCBHig_4_cat0 = CBShape(mgg, mgg_hig_m0_4_cat0, mgg_hig_sigma_4_cat0, mgg_hig_alpha_4_cat0, mgg_hig_n_4_cat0); -mggHig_4_cat0 = AddPdf(mggGaussHig_4_cat0, mggCBHig_4_cat0, mgg_hig_frac_4_cat0); - -mggGaussHig_4_cat1 = Gaussian(mgg, mgg_hig_m0_4_cat1, mgg_hig_gsigma_4_cat1); -mggCBHig_4_cat1 = CBShape(mgg, mgg_hig_m0_4_cat1, mgg_hig_sigma_4_cat1, mgg_hig_alpha_4_cat1, mgg_hig_n_4_cat1); -mggHig_4_cat1 = AddPdf(mggGaussHig_4_cat1, mggCBHig_4_cat1, mgg_hig_frac_4_cat1); - -mggGaussHig_4_cat2 = Gaussian(mgg, mgg_hig_m0_4_cat2, mgg_hig_gsigma_4_cat2); -mggCBHig_4_cat2 = CBShape(mgg, mgg_hig_m0_4_cat2, mgg_hig_sigma_4_cat2, mgg_hig_alpha_4_cat2, mgg_hig_n_4_cat2); -mggHig_4_cat2 = AddPdf(mggGaussHig_4_cat2, mggCBHig_4_cat2, mgg_hig_frac_4_cat2); - -mggGaussHig_4_cat3 = Gaussian(mgg, mgg_hig_m0_4_cat3, mgg_hig_gsigma_4_cat3); -mggCBHig_4_cat3 = CBShape(mgg, mgg_hig_m0_4_cat3, mgg_hig_sigma_4_cat3, mgg_hig_alpha_4_cat3, mgg_hig_n_4_cat3); -mggHig_4_cat3 = AddPdf(mggGaussHig_4_cat3, mggCBHig_4_cat3, mgg_hig_frac_4_cat3); - -mjj[80,200]; - -mjj_sig_m0_cat0[110.0, 99, 140]; -mjj_sig_sigma_cat0[10.0, 1.0, 60.0]; -mjj_sig_alpha_cat0[1.0, 0.0001, 5.0]; -mjj_sig_n_cat0[15.0, 1.0, 20.0]; -mjj_sig_gsigma_cat0[60.0, 40.0, 150.0]; -mjj_sig_frac_cat0[0.3, 0.01, 0.5]; - -mjjGaussSig_cat0 = Gaussian(mjj, mjj_sig_m0_cat0, mjj_sig_gsigma_cat0); -mjjCBSig_cat0 = CBShape(mjj, mjj_sig_m0_cat0, mjj_sig_sigma_cat0, mjj_sig_alpha_cat0, mjj_sig_n_cat0); -mjjSig_cat0 = AddPdf(mjjGaussSig_cat0, mjjCBSig_cat0, mjj_sig_frac_cat0); - -mjj_sig_m0_cat1[110.0, 99, 140]; -mjj_sig_sigma_cat1[10.0, 1.0, 60.0]; -mjj_sig_alpha_cat1[10.0, 0.001, 5.0]; -mjj_sig_n_cat1[15.0, 1.0, 20]; -mjj_sig_gsigma_cat1[60.0, 40.0, 150.0]; -mjj_sig_frac_cat1[0.3, 0.01, 0.5]; - -mjjGaussSig_cat1 = Gaussian(mjj, mjj_sig_m0_cat1, mjj_sig_gsigma_cat1); -mjjCBSig_cat1 = CBShape(mjj, mjj_sig_m0_cat1, mjj_sig_sigma_cat1, mjj_sig_alpha_cat1, mjj_sig_n_cat1); -mjjSig_cat1 = AddPdf(mjjGaussSig_cat1, mjjCBSig_cat1, mjj_sig_frac_cat1); - -mjj_sig_m0_cat2[110.0, 99, 140]; -mjj_sig_sigma_cat2[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat2[2.0, 1.0, 2.5]; -mjj_sig_n_cat2[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat2[25.0, 20.0, 80.0]; -mjj_sig_frac_cat2[0.1, 0.001, 0.99]; - -mjjGaussSig_cat2 = Gaussian(mjj, mjj_sig_m0_cat2, mjj_sig_gsigma_cat2); -mjjCBSig_cat2 = CBShape(mjj, mjj_sig_m0_cat2, mjj_sig_sigma_cat2, mjj_sig_alpha_cat2, mjj_sig_n_cat2); -mjjSig_cat2 = AddPdf(mjjGaussSig_cat2, mjjCBSig_cat2, mjj_sig_frac_cat2); - -mjj_sig_m0_cat3[110.0, 99, 140]; -mjj_sig_sigma_cat3[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat3[2.0, 1.0, 2.5]; -mjj_sig_n_cat3[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat3[25.0, 20.0, 80.0]; -mjj_sig_frac_cat3[0.1, 0.001, 0.99]; - -mjjGaussSig_cat3 = Gaussian(mjj, mjj_sig_m0_cat3, mjj_sig_gsigma_cat3); -mjjCBSig_cat3 = CBShape(mjj, mjj_sig_m0_cat3, mjj_sig_sigma_cat3, mjj_sig_alpha_cat3, mjj_sig_n_cat3); -mjjSig_cat3 = AddPdf(mjjGaussSig_cat3, mjjCBSig_cat3, mjj_sig_frac_cat3); - -CMS_hhbbgg_13TeV_mjj_bkg_slope1[0.9,-100.0, 1000.0]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat3[0.5,-100, 100]; - -mjj_hig_m0_0_cat0[100, 80, 200]; -mjj_hig_sigma_0_cat0[25, 10, 50]; -mjj_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat0[50, 10, 100]; -mjj_hig_frac_0_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat1[100, 80, 200]; -mjj_hig_sigma_0_cat1[25, 10, 50]; -mjj_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat1[50, 10, 100]; -mjj_hig_frac_0_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat2[100, 80, 200]; -mjj_hig_sigma_0_cat2[25, 10, 50]; -mjj_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat2[50, 10, 100]; -mjj_hig_frac_0_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat3[100, 80, 200]; -mjj_hig_sigma_0_cat3[25, 10, 50]; -mjj_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat3[50, 10, 100]; -mjj_hig_frac_0_cat3[0.1, 0, 0.4]; - -mjjGaussHig_0_cat0 = Gaussian(mjj, mjj_hig_m0_0_cat0, mjj_hig_gsigma_0_cat0); -mjjCBHig_0_cat0 = CBShape(mjj, mjj_hig_m0_0_cat0, mjj_hig_sigma_0_cat0, mjj_hig_alpha_0_cat0, mjj_hig_n_0_cat0); -mjjHig_0_cat0 = AddPdf(mjjGaussHig_0_cat0, mjjCBHig_0_cat0, mjj_hig_frac_0_cat0); - -mjjGaussHig_0_cat1 = Gaussian(mjj, mjj_hig_m0_0_cat1, mjj_hig_gsigma_0_cat1); -mjjCBHig_0_cat1 = CBShape(mjj, mjj_hig_m0_0_cat1, mjj_hig_sigma_0_cat1, mjj_hig_alpha_0_cat1, mjj_hig_n_0_cat1); -mjjHig_0_cat1 = AddPdf(mjjGaussHig_0_cat1, mjjCBHig_0_cat1, mjj_hig_frac_0_cat1); - -mjjGaussHig_0_cat2 = Gaussian(mjj, mjj_hig_m0_0_cat2, mjj_hig_gsigma_0_cat2); -mjjCBHig_0_cat2 = CBShape(mjj, mjj_hig_m0_0_cat2, mjj_hig_sigma_0_cat2, mjj_hig_alpha_0_cat2, mjj_hig_n_0_cat2); -mjjHig_0_cat2 = AddPdf(mjjGaussHig_0_cat2, mjjCBHig_0_cat2, mjj_hig_frac_0_cat2); - -mjjGaussHig_0_cat3 = Gaussian(mjj, mjj_hig_m0_0_cat3, mjj_hig_gsigma_0_cat3); -mjjCBHig_0_cat3 = CBShape(mjj, mjj_hig_m0_0_cat3, mjj_hig_sigma_0_cat3, mjj_hig_alpha_0_cat3, mjj_hig_n_0_cat3); -mjjHig_0_cat3 = AddPdf(mjjGaussHig_0_cat3, mjjCBHig_0_cat3, mjj_hig_frac_0_cat3); - -mjj_hig_m0_1_cat0[100, 80, 200]; -mjj_hig_sigma_1_cat0[25, 10, 50]; -mjj_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat0[50, 10, 100]; -mjj_hig_frac_1_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat1[100, 80, 200]; -mjj_hig_sigma_1_cat1[25, 10, 50]; -mjj_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat1[50, 10, 100]; -mjj_hig_frac_1_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat2[100, 80, 200]; -mjj_hig_sigma_1_cat2[25, 10, 50]; -mjj_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat2[50, 10, 100]; -mjj_hig_frac_1_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat3[100, 80, 200]; -mjj_hig_sigma_1_cat3[25, 10, 50]; -mjj_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat3[50, 10, 100]; -mjj_hig_frac_1_cat3[0.1, 0, 0.4]; - -mjjGaussHig_1_cat0 = Gaussian(mjj, mjj_hig_m0_1_cat0, mjj_hig_gsigma_1_cat0); -mjjCBHig_1_cat0 = CBShape(mjj, mjj_hig_m0_1_cat0, mjj_hig_sigma_1_cat0, mjj_hig_alpha_1_cat0, mjj_hig_n_1_cat0); -mjjHig_1_cat0 = AddPdf(mjjGaussHig_1_cat0, mjjCBHig_1_cat0, mjj_hig_frac_1_cat0); - -mjjGaussHig_1_cat1 = Gaussian(mjj, mjj_hig_m0_1_cat1, mjj_hig_gsigma_1_cat1); -mjjCBHig_1_cat1 = CBShape(mjj, mjj_hig_m0_1_cat1, mjj_hig_sigma_1_cat1, mjj_hig_alpha_1_cat1, mjj_hig_n_1_cat1); -mjjHig_1_cat1 = AddPdf(mjjGaussHig_1_cat1, mjjCBHig_1_cat1, mjj_hig_frac_1_cat1); - -mjjGaussHig_1_cat2 = Gaussian(mjj, mjj_hig_m0_1_cat2, mjj_hig_gsigma_1_cat2); -mjjCBHig_1_cat2 = CBShape(mjj, mjj_hig_m0_1_cat2, mjj_hig_sigma_1_cat2, mjj_hig_alpha_1_cat2, mjj_hig_n_1_cat2); -mjjHig_1_cat2 = AddPdf(mjjGaussHig_1_cat2, mjjCBHig_1_cat2, mjj_hig_frac_1_cat2); - -mjjGaussHig_1_cat3 = Gaussian(mjj, mjj_hig_m0_1_cat3, mjj_hig_gsigma_1_cat3); -mjjCBHig_1_cat3 = CBShape(mjj, mjj_hig_m0_1_cat3, mjj_hig_sigma_1_cat3, mjj_hig_alpha_1_cat3, mjj_hig_n_1_cat3); -mjjHig_1_cat3 = AddPdf(mjjGaussHig_1_cat3, mjjCBHig_1_cat3, mjj_hig_frac_1_cat3); - -mjj_hig_m0_2_cat0[100, 80, 200]; -mjj_hig_sigma_2_cat0[25, 10, 50]; -mjj_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat0[50, 10, 100]; -mjj_hig_frac_2_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat1[100, 80, 200]; -mjj_hig_sigma_2_cat1[25, 10, 50]; -mjj_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat1[50, 10, 100]; -mjj_hig_frac_2_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat2[100, 80, 200]; -mjj_hig_sigma_2_cat2[25, 10, 50]; -mjj_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat2[50, 10, 100]; -mjj_hig_frac_2_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat3[100, 80, 200]; -mjj_hig_sigma_2_cat3[25, 10, 50]; -mjj_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat3[50, 10, 100]; -mjj_hig_frac_2_cat3[0.1, 0, 0.4]; - -mjjGaussHig_2_cat0 = Gaussian(mjj, mjj_hig_m0_2_cat0, mjj_hig_gsigma_2_cat0); -mjjCBHig_2_cat0 = CBShape(mjj, mjj_hig_m0_2_cat0, mjj_hig_sigma_2_cat0, mjj_hig_alpha_2_cat0, mjj_hig_n_2_cat0); -mjjHig_2_cat0 = AddPdf(mjjGaussHig_2_cat0, mjjCBHig_2_cat0, mjj_hig_frac_2_cat0); - -mjjGaussHig_2_cat1 = Gaussian(mjj, mjj_hig_m0_2_cat1, mjj_hig_gsigma_2_cat1); -mjjCBHig_2_cat1 = CBShape(mjj, mjj_hig_m0_2_cat1, mjj_hig_sigma_2_cat1, mjj_hig_alpha_2_cat1, mjj_hig_n_2_cat1); -mjjHig_2_cat1 = AddPdf(mjjGaussHig_2_cat1, mjjCBHig_2_cat1, mjj_hig_frac_2_cat1); - -mjjGaussHig_2_cat2 = Gaussian(mjj, mjj_hig_m0_2_cat2, mjj_hig_gsigma_2_cat2); -mjjCBHig_2_cat2 = CBShape(mjj, mjj_hig_m0_2_cat2, mjj_hig_sigma_2_cat2, mjj_hig_alpha_2_cat2, mjj_hig_n_2_cat2); -mjjHig_2_cat2 = AddPdf(mjjGaussHig_2_cat2, mjjCBHig_2_cat2, mjj_hig_frac_2_cat2); - -mjjGaussHig_2_cat3 = Gaussian(mjj, mjj_hig_m0_2_cat3, mjj_hig_gsigma_2_cat3); -mjjCBHig_2_cat3 = CBShape(mjj, mjj_hig_m0_2_cat3, mjj_hig_sigma_2_cat3, mjj_hig_alpha_2_cat3, mjj_hig_n_2_cat3); -mjjHig_2_cat3 = AddPdf(mjjGaussHig_2_cat3, mjjCBHig_2_cat3, mjj_hig_frac_2_cat3); - -mjj_hig_m0_3_cat0[100, 80, 200]; -mjj_hig_sigma_3_cat0[25, 10, 50]; -mjj_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat0[50, 10, 100]; -mjj_hig_frac_3_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat1[100, 80, 200]; -mjj_hig_sigma_3_cat1[25, 10, 50]; -mjj_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat1[50, 10, 100]; -mjj_hig_frac_3_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat2[100, 80, 200]; -mjj_hig_sigma_3_cat2[25, 10, 50]; -mjj_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat2[50, 10, 100]; -mjj_hig_frac_3_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat3[100, 80, 200]; -mjj_hig_sigma_3_cat3[25, 10, 50]; -mjj_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat3[50, 10, 100]; -mjj_hig_frac_3_cat3[0.1, 0, 0.4]; - -mjjGaussHig_3_cat0 = Gaussian(mjj, mjj_hig_m0_3_cat0, mjj_hig_gsigma_3_cat0); -mjjCBHig_3_cat0 = CBShape(mjj, mjj_hig_m0_3_cat0, mjj_hig_sigma_3_cat0, mjj_hig_alpha_3_cat0, mjj_hig_n_3_cat0); -mjjHig_3_cat0 = AddPdf(mjjGaussHig_3_cat0, mjjCBHig_3_cat0, mjj_hig_frac_3_cat0); - -mjjGaussHig_3_cat1 = Gaussian(mjj, mjj_hig_m0_3_cat1, mjj_hig_gsigma_3_cat1); -mjjCBHig_3_cat1 = CBShape(mjj, mjj_hig_m0_3_cat1, mjj_hig_sigma_3_cat1, mjj_hig_alpha_3_cat1, mjj_hig_n_3_cat1); -mjjHig_3_cat1 = AddPdf(mjjGaussHig_3_cat1, mjjCBHig_3_cat1, mjj_hig_frac_3_cat1); - -mjjGaussHig_3_cat2 = Gaussian(mjj, mjj_hig_m0_3_cat2, mjj_hig_gsigma_3_cat2); -mjjCBHig_3_cat2 = CBShape(mjj, mjj_hig_m0_3_cat2, mjj_hig_sigma_3_cat2, mjj_hig_alpha_3_cat2, mjj_hig_n_3_cat2); -mjjHig_3_cat2 = AddPdf(mjjGaussHig_3_cat2, mjjCBHig_3_cat2, mjj_hig_frac_3_cat2); - -mjjGaussHig_3_cat3 = Gaussian(mjj, mjj_hig_m0_3_cat3, mjj_hig_gsigma_3_cat3); -mjjCBHig_3_cat3 = CBShape(mjj, mjj_hig_m0_3_cat3, mjj_hig_sigma_3_cat3, mjj_hig_alpha_3_cat3, mjj_hig_n_3_cat3); -mjjHig_3_cat3 = AddPdf(mjjGaussHig_3_cat3, mjjCBHig_3_cat3, mjj_hig_frac_3_cat3); - -mjj_hig_m0_4_cat0[100, 80, 200]; -mjj_hig_sigma_4_cat0[25, 10, 50]; -mjj_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat0[50, 10, 100]; -mjj_hig_frac_4_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat1[100, 80, 200]; -mjj_hig_sigma_4_cat1[25, 10, 50]; -mjj_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat1[50, 10, 100]; -mjj_hig_frac_4_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat2[100, 80, 200]; -mjj_hig_sigma_4_cat2[25, 10, 50]; -mjj_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat2[50, 10, 100]; -mjj_hig_frac_4_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat3[100, 80, 200]; -mjj_hig_sigma_4_cat3[25, 10, 50]; -mjj_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat3[50, 10, 100]; -mjj_hig_frac_4_cat3[0.1, 0, 0.4]; - -mjjGaussHig_4_cat0 = Gaussian(mjj, mjj_hig_m0_4_cat0, mjj_hig_gsigma_4_cat0); -mjjCBHig_4_cat0 = CBShape(mjj, mjj_hig_m0_4_cat0, mjj_hig_sigma_4_cat0, mjj_hig_alpha_4_cat0, mjj_hig_n_4_cat0); -mjjHig_4_cat0 = AddPdf(mjjGaussHig_4_cat0, mjjCBHig_4_cat0, mjj_hig_frac_4_cat0); - -mjjGaussHig_4_cat1 = Gaussian(mjj, mjj_hig_m0_4_cat1, mjj_hig_gsigma_4_cat1); -mjjCBHig_4_cat1 = CBShape(mjj, mjj_hig_m0_4_cat1, mjj_hig_sigma_4_cat1, mjj_hig_alpha_4_cat1, mjj_hig_n_4_cat1); -mjjHig_4_cat1 = AddPdf(mjjGaussHig_4_cat1, mjjCBHig_4_cat1, mjj_hig_frac_4_cat1); - -mjjGaussHig_4_cat2 = Gaussian(mjj, mjj_hig_m0_4_cat2, mjj_hig_gsigma_4_cat2); -mjjCBHig_4_cat2 = CBShape(mjj, mjj_hig_m0_4_cat2, mjj_hig_sigma_4_cat2, mjj_hig_alpha_4_cat2, mjj_hig_n_4_cat2); -mjjHig_4_cat2 = AddPdf(mjjGaussHig_4_cat2, mjjCBHig_4_cat2, mjj_hig_frac_4_cat2); - -mjjGaussHig_4_cat3 = Gaussian(mjj, mjj_hig_m0_4_cat3, mjj_hig_gsigma_4_cat3); -mjjCBHig_4_cat3 = CBShape(mjj, mjj_hig_m0_4_cat3, mjj_hig_sigma_4_cat3, mjj_hig_alpha_4_cat3, mjj_hig_n_4_cat3); -mjjHig_4_cat3 = AddPdf(mjjGaussHig_4_cat3, mjjCBHig_4_cat3, mjj_hig_frac_4_cat3); - -mtot[200,1600]; diff --git a/LimitSetting/Models/models_2D_sig_mjj.rs b/LimitSetting/Models/models_2D_sig_mjj.rs deleted file mode 100644 index 90b143e..0000000 --- a/LimitSetting/Models/models_2D_sig_mjj.rs +++ /dev/null @@ -1,570 +0,0 @@ -mgg[100,180]; - -#CMS_hhbbgg_13TeV_mgg_bkg_slope1 -CMS_hhbbgg_13TeV_mgg_bkg_slope1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mgg_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat3[0.5.,-99, 99]; - -mgg_sig_m0_cat0[124.2, 123, 125]; -mgg_sig_sigma_cat0[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat0[1.0, 0.0, 2.5]; -mgg_sig_n_cat0[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat0[4.0, 0.5, 10.0]; -mgg_sig_frac_cat0[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat1[124.2, 123, 125]; -mgg_sig_sigma_cat1[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat1[1.0, 0.0, 2.5]; -mgg_sig_n_cat1[2.0, 1.5, 10]; -mgg_sig_gsigma_cat1[4.0, 0.5, 10.0]; -mgg_sig_frac_cat1[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat2[124.2, 123, 125]; -mgg_sig_sigma_cat2[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat2[1.0, 0.0, 2.5]; -mgg_sig_n_cat2[2.0, 1.0, 5.0]; -mgg_sig_gsigma_cat2[4.0, 0.5, 10.0]; -mgg_sig_frac_cat2[0.1, 0.05, 0.4]; - -mgg_sig_m0_cat3[124.2, 123, 125]; -mgg_sig_sigma_cat3[2.0, 1.0, 3.0]; -mgg_sig_alpha_cat3[1.0, 0.0, 2.5]; -mgg_sig_n_cat3[2.0, 1.5, 10]; -mgg_sig_gsigma_cat3[4.0, 0.5, 10.0]; -mgg_sig_frac_cat3[0.1, 0.05, 0.4]; - -mggGaussSig_cat0 = Gaussian(mgg, mgg_sig_m0_cat0, mgg_sig_gsigma_cat0); -mggCBSig_cat0 = CBShape(mgg, mgg_sig_m0_cat0, mgg_sig_sigma_cat0, mgg_sig_alpha_cat0, mgg_sig_n_cat0); -mggSig_cat0 = AddPdf(mggGaussSig_cat0, mggCBSig_cat0, mgg_sig_frac_cat0); - -mggGaussSig_cat1 = Gaussian(mgg, mgg_sig_m0_cat1, mgg_sig_gsigma_cat1); -mggCBSig_cat1 = CBShape(mgg, mgg_sig_m0_cat1, mgg_sig_sigma_cat1, mgg_sig_alpha_cat1, mgg_sig_n_cat1); -mggSig_cat1 = AddPdf(mggGaussSig_cat1, mggCBSig_cat1, mgg_sig_frac_cat1); - -mggGaussSig_cat2 = Gaussian(mgg, mgg_sig_m0_cat2, mgg_sig_gsigma_cat2); -mggCBSig_cat2 = CBShape(mgg, mgg_sig_m0_cat2, mgg_sig_sigma_cat2, mgg_sig_alpha_cat2, mgg_sig_n_cat2); -mggSig_cat2 = AddPdf(mggGaussSig_cat2, mggCBSig_cat2, mgg_sig_frac_cat2); - -mggGaussSig_cat3 = Gaussian(mgg, mgg_sig_m0_cat3, mgg_sig_gsigma_cat3); -mggCBSig_cat3 = CBShape(mgg, mgg_sig_m0_cat3, mgg_sig_sigma_cat3, mgg_sig_alpha_cat3, mgg_sig_n_cat3); -mggSig_cat3 = AddPdf(mggGaussSig_cat3, mggCBSig_cat3, mgg_sig_frac_cat3); - -mgg_hig_m0_0_cat0[124.2, 123, 125]; -mgg_hig_sigma_0_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat1[124.2, 123, 125]; -mgg_hig_sigma_0_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat2[124.2, 123, 125]; -mgg_hig_sigma_0_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_0_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_0_cat3[124.2, 123, 125]; -mgg_hig_sigma_0_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_0_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_0_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_0_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_0_cat0 = Gaussian(mgg, mgg_hig_m0_0_cat0, mgg_hig_gsigma_0_cat0); -mggCBHig_0_cat0 = CBShape(mgg, mgg_hig_m0_0_cat0, mgg_hig_sigma_0_cat0, mgg_hig_alpha_0_cat0, mgg_hig_n_0_cat0); -mggHig_0_cat0 = AddPdf(mggGaussHig_0_cat0, mggCBHig_0_cat0, mgg_hig_frac_0_cat0); - -mggGaussHig_0_cat1 = Gaussian(mgg, mgg_hig_m0_0_cat1, mgg_hig_gsigma_0_cat1); -mggCBHig_0_cat1 = CBShape(mgg, mgg_hig_m0_0_cat1, mgg_hig_sigma_0_cat1, mgg_hig_alpha_0_cat1, mgg_hig_n_0_cat1); -mggHig_0_cat1 = AddPdf(mggGaussHig_0_cat1, mggCBHig_0_cat1, mgg_hig_frac_0_cat1); - -mggGaussHig_0_cat2 = Gaussian(mgg, mgg_hig_m0_0_cat2, mgg_hig_gsigma_0_cat2); -mggCBHig_0_cat2 = CBShape(mgg, mgg_hig_m0_0_cat2, mgg_hig_sigma_0_cat2, mgg_hig_alpha_0_cat2, mgg_hig_n_0_cat2); -mggHig_0_cat2 = AddPdf(mggGaussHig_0_cat2, mggCBHig_0_cat2, mgg_hig_frac_0_cat2); - -mggGaussHig_0_cat3 = Gaussian(mgg, mgg_hig_m0_0_cat3, mgg_hig_gsigma_0_cat3); -mggCBHig_0_cat3 = CBShape(mgg, mgg_hig_m0_0_cat3, mgg_hig_sigma_0_cat3, mgg_hig_alpha_0_cat3, mgg_hig_n_0_cat3); -mggHig_0_cat3 = AddPdf(mggGaussHig_0_cat3, mggCBHig_0_cat3, mgg_hig_frac_0_cat3); - -mgg_hig_m0_1_cat0[124.2, 123, 125]; -mgg_hig_sigma_1_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat1[124.2, 123, 125]; -mgg_hig_sigma_1_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat2[124.2, 123, 125]; -mgg_hig_sigma_1_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_1_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_1_cat3[124.2, 123, 125]; -mgg_hig_sigma_1_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_1_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_1_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_1_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_1_cat0 = Gaussian(mgg, mgg_hig_m0_1_cat0, mgg_hig_gsigma_1_cat0); -mggCBHig_1_cat0 = CBShape(mgg, mgg_hig_m0_1_cat0, mgg_hig_sigma_1_cat0, mgg_hig_alpha_1_cat0, mgg_hig_n_1_cat0); -mggHig_1_cat0 = AddPdf(mggGaussHig_1_cat0, mggCBHig_1_cat0, mgg_hig_frac_1_cat0); - -mggGaussHig_1_cat1 = Gaussian(mgg, mgg_hig_m0_1_cat1, mgg_hig_gsigma_1_cat1); -mggCBHig_1_cat1 = CBShape(mgg, mgg_hig_m0_1_cat1, mgg_hig_sigma_1_cat1, mgg_hig_alpha_1_cat1, mgg_hig_n_1_cat1); -mggHig_1_cat1 = AddPdf(mggGaussHig_1_cat1, mggCBHig_1_cat1, mgg_hig_frac_1_cat1); - -mggGaussHig_1_cat2 = Gaussian(mgg, mgg_hig_m0_1_cat2, mgg_hig_gsigma_1_cat2); -mggCBHig_1_cat2 = CBShape(mgg, mgg_hig_m0_1_cat2, mgg_hig_sigma_1_cat2, mgg_hig_alpha_1_cat2, mgg_hig_n_1_cat2); -mggHig_1_cat2 = AddPdf(mggGaussHig_1_cat2, mggCBHig_1_cat2, mgg_hig_frac_1_cat2); - -mggGaussHig_1_cat3 = Gaussian(mgg, mgg_hig_m0_1_cat3, mgg_hig_gsigma_1_cat3); -mggCBHig_1_cat3 = CBShape(mgg, mgg_hig_m0_1_cat3, mgg_hig_sigma_1_cat3, mgg_hig_alpha_1_cat3, mgg_hig_n_1_cat3); -mggHig_1_cat3 = AddPdf(mggGaussHig_1_cat3, mggCBHig_1_cat3, mgg_hig_frac_1_cat3); - -mgg_hig_m0_2_cat0[124.2, 123, 125]; -mgg_hig_sigma_2_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat1[124.2, 123, 125]; -mgg_hig_sigma_2_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat2[124.2, 123, 125]; -mgg_hig_sigma_2_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_2_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_2_cat3[124.2, 123, 125]; -mgg_hig_sigma_2_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_2_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_2_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_2_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_2_cat0 = Gaussian(mgg, mgg_hig_m0_2_cat0, mgg_hig_gsigma_2_cat0); -mggCBHig_2_cat0 = CBShape(mgg, mgg_hig_m0_2_cat0, mgg_hig_sigma_2_cat0, mgg_hig_alpha_2_cat0, mgg_hig_n_2_cat0); -mggHig_2_cat0 = AddPdf(mggGaussHig_2_cat0, mggCBHig_2_cat0, mgg_hig_frac_2_cat0); - -mggGaussHig_2_cat1 = Gaussian(mgg, mgg_hig_m0_2_cat1, mgg_hig_gsigma_2_cat1); -mggCBHig_2_cat1 = CBShape(mgg, mgg_hig_m0_2_cat1, mgg_hig_sigma_2_cat1, mgg_hig_alpha_2_cat1, mgg_hig_n_2_cat1); -mggHig_2_cat1 = AddPdf(mggGaussHig_2_cat1, mggCBHig_2_cat1, mgg_hig_frac_2_cat1); - -mggGaussHig_2_cat2 = Gaussian(mgg, mgg_hig_m0_2_cat2, mgg_hig_gsigma_2_cat2); -mggCBHig_2_cat2 = CBShape(mgg, mgg_hig_m0_2_cat2, mgg_hig_sigma_2_cat2, mgg_hig_alpha_2_cat2, mgg_hig_n_2_cat2); -mggHig_2_cat2 = AddPdf(mggGaussHig_2_cat2, mggCBHig_2_cat2, mgg_hig_frac_2_cat2); - -mggGaussHig_2_cat3 = Gaussian(mgg, mgg_hig_m0_2_cat3, mgg_hig_gsigma_2_cat3); -mggCBHig_2_cat3 = CBShape(mgg, mgg_hig_m0_2_cat3, mgg_hig_sigma_2_cat3, mgg_hig_alpha_2_cat3, mgg_hig_n_2_cat3); -mggHig_2_cat3 = AddPdf(mggGaussHig_2_cat3, mggCBHig_2_cat3, mgg_hig_frac_2_cat3); - -mgg_hig_m0_3_cat0[124.2, 123, 125]; -mgg_hig_sigma_3_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat1[124.2, 123, 125]; -mgg_hig_sigma_3_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat2[124.2, 123, 125]; -mgg_hig_sigma_3_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_3_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_3_cat3[124.2, 123, 125]; -mgg_hig_sigma_3_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_3_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_3_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_3_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_3_cat0 = Gaussian(mgg, mgg_hig_m0_3_cat0, mgg_hig_gsigma_3_cat0); -mggCBHig_3_cat0 = CBShape(mgg, mgg_hig_m0_3_cat0, mgg_hig_sigma_3_cat0, mgg_hig_alpha_3_cat0, mgg_hig_n_3_cat0); -mggHig_3_cat0 = AddPdf(mggGaussHig_3_cat0, mggCBHig_3_cat0, mgg_hig_frac_3_cat0); - -mggGaussHig_3_cat1 = Gaussian(mgg, mgg_hig_m0_3_cat1, mgg_hig_gsigma_3_cat1); -mggCBHig_3_cat1 = CBShape(mgg, mgg_hig_m0_3_cat1, mgg_hig_sigma_3_cat1, mgg_hig_alpha_3_cat1, mgg_hig_n_3_cat1); -mggHig_3_cat1 = AddPdf(mggGaussHig_3_cat1, mggCBHig_3_cat1, mgg_hig_frac_3_cat1); - -mggGaussHig_3_cat2 = Gaussian(mgg, mgg_hig_m0_3_cat2, mgg_hig_gsigma_3_cat2); -mggCBHig_3_cat2 = CBShape(mgg, mgg_hig_m0_3_cat2, mgg_hig_sigma_3_cat2, mgg_hig_alpha_3_cat2, mgg_hig_n_3_cat2); -mggHig_3_cat2 = AddPdf(mggGaussHig_3_cat2, mggCBHig_3_cat2, mgg_hig_frac_3_cat2); - -mggGaussHig_3_cat3 = Gaussian(mgg, mgg_hig_m0_3_cat3, mgg_hig_gsigma_3_cat3); -mggCBHig_3_cat3 = CBShape(mgg, mgg_hig_m0_3_cat3, mgg_hig_sigma_3_cat3, mgg_hig_alpha_3_cat3, mgg_hig_n_3_cat3); -mggHig_3_cat3 = AddPdf(mggGaussHig_3_cat3, mggCBHig_3_cat3, mgg_hig_frac_3_cat3); - -mgg_hig_m0_4_cat0[124.2, 123, 125]; -mgg_hig_sigma_4_cat0[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat0[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat0[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat0[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat1[124.2, 123, 125]; -mgg_hig_sigma_4_cat1[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat1[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat1[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat1[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat2[124.2, 123, 125]; -mgg_hig_sigma_4_cat2[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat2[2.0, 1.0, 5.0]; -mgg_hig_gsigma_4_cat2[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat2[0.1, 0.05, 0.4]; - -mgg_hig_m0_4_cat3[124.2, 123, 125]; -mgg_hig_sigma_4_cat3[2.0, 1.0, 3.0]; -mgg_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mgg_hig_n_4_cat3[2.0, 1.5, 10]; -mgg_hig_gsigma_4_cat3[4.0, 0.5, 10.0]; -mgg_hig_frac_4_cat3[0.1, 0.05, 0.4]; - -mggGaussHig_4_cat0 = Gaussian(mgg, mgg_hig_m0_4_cat0, mgg_hig_gsigma_4_cat0); -mggCBHig_4_cat0 = CBShape(mgg, mgg_hig_m0_4_cat0, mgg_hig_sigma_4_cat0, mgg_hig_alpha_4_cat0, mgg_hig_n_4_cat0); -mggHig_4_cat0 = AddPdf(mggGaussHig_4_cat0, mggCBHig_4_cat0, mgg_hig_frac_4_cat0); - -mggGaussHig_4_cat1 = Gaussian(mgg, mgg_hig_m0_4_cat1, mgg_hig_gsigma_4_cat1); -mggCBHig_4_cat1 = CBShape(mgg, mgg_hig_m0_4_cat1, mgg_hig_sigma_4_cat1, mgg_hig_alpha_4_cat1, mgg_hig_n_4_cat1); -mggHig_4_cat1 = AddPdf(mggGaussHig_4_cat1, mggCBHig_4_cat1, mgg_hig_frac_4_cat1); - -mggGaussHig_4_cat2 = Gaussian(mgg, mgg_hig_m0_4_cat2, mgg_hig_gsigma_4_cat2); -mggCBHig_4_cat2 = CBShape(mgg, mgg_hig_m0_4_cat2, mgg_hig_sigma_4_cat2, mgg_hig_alpha_4_cat2, mgg_hig_n_4_cat2); -mggHig_4_cat2 = AddPdf(mggGaussHig_4_cat2, mggCBHig_4_cat2, mgg_hig_frac_4_cat2); - -mggGaussHig_4_cat3 = Gaussian(mgg, mgg_hig_m0_4_cat3, mgg_hig_gsigma_4_cat3); -mggCBHig_4_cat3 = CBShape(mgg, mgg_hig_m0_4_cat3, mgg_hig_sigma_4_cat3, mgg_hig_alpha_4_cat3, mgg_hig_n_4_cat3); -mggHig_4_cat3 = AddPdf(mggGaussHig_4_cat3, mggCBHig_4_cat3, mgg_hig_frac_4_cat3); - -mjj[60,180]; - -mjj_sig_m0_cat0[110.0, 99, 140]; -mjj_sig_sigma_cat0[10.0, 1.0, 60.0]; -mjj_sig_alpha_cat0[1.0, 0.0001, 5.0]; -mjj_sig_n_cat0[15.0, 1.0, 20.0]; -mjj_sig_gsigma_cat0[60.0, 40.0, 150.0]; -mjj_sig_frac_cat0[0.3, 0.01, 0.5]; - -mjjGaussSig_cat0 = Gaussian(mjj, mjj_sig_m0_cat0, mjj_sig_gsigma_cat0); -mjjCBSig_cat0 = CBShape(mjj, mjj_sig_m0_cat0, mjj_sig_sigma_cat0, mjj_sig_alpha_cat0, mjj_sig_n_cat0); -mjjSig_cat0 = AddPdf(mjjGaussSig_cat0, mjjCBSig_cat0, mjj_sig_frac_cat0); - -mjj_sig_m0_cat1[110.0, 99, 140]; -mjj_sig_sigma_cat1[10.0, 1.0, 60.0]; -mjj_sig_alpha_cat1[10.0, 0.001, 5.0]; -mjj_sig_n_cat1[15.0, 1.0, 20]; -mjj_sig_gsigma_cat1[60.0, 40.0, 150.0]; -mjj_sig_frac_cat1[0.3, 0.01, 0.5]; - -mjjGaussSig_cat1 = Gaussian(mjj, mjj_sig_m0_cat1, mjj_sig_gsigma_cat1); -mjjCBSig_cat1 = CBShape(mjj, mjj_sig_m0_cat1, mjj_sig_sigma_cat1, mjj_sig_alpha_cat1, mjj_sig_n_cat1); -mjjSig_cat1 = AddPdf(mjjGaussSig_cat1, mjjCBSig_cat1, mjj_sig_frac_cat1); - -mjj_sig_m0_cat2[110.0, 99, 140]; -mjj_sig_sigma_cat2[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat2[2.0, 1.0, 2.5]; -mjj_sig_n_cat2[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat2[25.0, 20.0, 80.0]; -mjj_sig_frac_cat2[0.1, 0.001, 0.99]; - -mjjGaussSig_cat2 = Gaussian(mjj, mjj_sig_m0_cat2, mjj_sig_gsigma_cat2); -mjjCBSig_cat2 = CBShape(mjj, mjj_sig_m0_cat2, mjj_sig_sigma_cat2, mjj_sig_alpha_cat2, mjj_sig_n_cat2); -mjjSig_cat2 = AddPdf(mjjGaussSig_cat2, mjjCBSig_cat2, mjj_sig_frac_cat2); - -mjj_sig_m0_cat3[110.0, 99, 140]; -mjj_sig_sigma_cat3[10.0, 1.0, 20.0]; -mjj_sig_alpha_cat3[2.0, 1.0, 2.5]; -mjj_sig_n_cat3[2.0, 1.0, 5.0]; -mjj_sig_gsigma_cat3[25.0, 20.0, 80.0]; -mjj_sig_frac_cat3[0.1, 0.001, 0.99]; - -mjjGaussSig_cat3 = Gaussian(mjj, mjj_sig_m0_cat3, mjj_sig_gsigma_cat3); -mjjCBSig_cat3 = CBShape(mjj, mjj_sig_m0_cat3, mjj_sig_sigma_cat3, mjj_sig_alpha_cat3, mjj_sig_n_cat3); -mjjSig_cat3 = AddPdf(mjjGaussSig_cat3, mjjCBSig_cat3, mjj_sig_frac_cat3); - -CMS_hhbbgg_13TeV_mjj_bkg_slope1[0.9,-100.0, 1000.0]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat0[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat1[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat2[0.9,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat3[0.9,-100, 100]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat0[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat1[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat2[0.5,-99, 99]; -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat3[0.5,-99, 99]; - -CMS_hhbbgg_13TeV_mjj_bkg_slope3[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat2[0.5,-100, 100]; -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat3[0.5,-100, 100]; - -mjj_hig_m0_0_cat0[100, 80, 200]; -mjj_hig_sigma_0_cat0[25, 10, 50]; -mjj_hig_alpha_0_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat0[50, 10, 100]; -mjj_hig_frac_0_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat1[100, 80, 200]; -mjj_hig_sigma_0_cat1[25, 10, 50]; -mjj_hig_alpha_0_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat1[50, 10, 100]; -mjj_hig_frac_0_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat2[100, 80, 200]; -mjj_hig_sigma_0_cat2[25, 10, 50]; -mjj_hig_alpha_0_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_0_cat2[50, 10, 100]; -mjj_hig_frac_0_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_0_cat3[100, 80, 200]; -mjj_hig_sigma_0_cat3[25, 10, 50]; -mjj_hig_alpha_0_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_0_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_0_cat3[50, 10, 100]; -mjj_hig_frac_0_cat3[0.1, 0, 0.4]; - -mjjGaussHig_0_cat0 = Gaussian(mjj, mjj_hig_m0_0_cat0, mjj_hig_gsigma_0_cat0); -mjjCBHig_0_cat0 = CBShape(mjj, mjj_hig_m0_0_cat0, mjj_hig_sigma_0_cat0, mjj_hig_alpha_0_cat0, mjj_hig_n_0_cat0); -mjjHig_0_cat0 = AddPdf(mjjGaussHig_0_cat0, mjjCBHig_0_cat0, mjj_hig_frac_0_cat0); - -mjjGaussHig_0_cat1 = Gaussian(mjj, mjj_hig_m0_0_cat1, mjj_hig_gsigma_0_cat1); -mjjCBHig_0_cat1 = CBShape(mjj, mjj_hig_m0_0_cat1, mjj_hig_sigma_0_cat1, mjj_hig_alpha_0_cat1, mjj_hig_n_0_cat1); -mjjHig_0_cat1 = AddPdf(mjjGaussHig_0_cat1, mjjCBHig_0_cat1, mjj_hig_frac_0_cat1); - -mjjGaussHig_0_cat2 = Gaussian(mjj, mjj_hig_m0_0_cat2, mjj_hig_gsigma_0_cat2); -mjjCBHig_0_cat2 = CBShape(mjj, mjj_hig_m0_0_cat2, mjj_hig_sigma_0_cat2, mjj_hig_alpha_0_cat2, mjj_hig_n_0_cat2); -mjjHig_0_cat2 = AddPdf(mjjGaussHig_0_cat2, mjjCBHig_0_cat2, mjj_hig_frac_0_cat2); - -mjjGaussHig_0_cat3 = Gaussian(mjj, mjj_hig_m0_0_cat3, mjj_hig_gsigma_0_cat3); -mjjCBHig_0_cat3 = CBShape(mjj, mjj_hig_m0_0_cat3, mjj_hig_sigma_0_cat3, mjj_hig_alpha_0_cat3, mjj_hig_n_0_cat3); -mjjHig_0_cat3 = AddPdf(mjjGaussHig_0_cat3, mjjCBHig_0_cat3, mjj_hig_frac_0_cat3); - -mjj_hig_m0_1_cat0[100, 80, 200]; -mjj_hig_sigma_1_cat0[25, 10, 50]; -mjj_hig_alpha_1_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat0[50, 10, 100]; -mjj_hig_frac_1_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat1[100, 80, 200]; -mjj_hig_sigma_1_cat1[25, 10, 50]; -mjj_hig_alpha_1_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat1[50, 10, 100]; -mjj_hig_frac_1_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat2[100, 80, 200]; -mjj_hig_sigma_1_cat2[25, 10, 50]; -mjj_hig_alpha_1_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_1_cat2[50, 10, 100]; -mjj_hig_frac_1_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_1_cat3[100, 80, 200]; -mjj_hig_sigma_1_cat3[25, 10, 50]; -mjj_hig_alpha_1_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_1_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_1_cat3[50, 10, 100]; -mjj_hig_frac_1_cat3[0.1, 0, 0.4]; - -mjjGaussHig_1_cat0 = Gaussian(mjj, mjj_hig_m0_1_cat0, mjj_hig_gsigma_1_cat0); -mjjCBHig_1_cat0 = CBShape(mjj, mjj_hig_m0_1_cat0, mjj_hig_sigma_1_cat0, mjj_hig_alpha_1_cat0, mjj_hig_n_1_cat0); -mjjHig_1_cat0 = AddPdf(mjjGaussHig_1_cat0, mjjCBHig_1_cat0, mjj_hig_frac_1_cat0); - -mjjGaussHig_1_cat1 = Gaussian(mjj, mjj_hig_m0_1_cat1, mjj_hig_gsigma_1_cat1); -mjjCBHig_1_cat1 = CBShape(mjj, mjj_hig_m0_1_cat1, mjj_hig_sigma_1_cat1, mjj_hig_alpha_1_cat1, mjj_hig_n_1_cat1); -mjjHig_1_cat1 = AddPdf(mjjGaussHig_1_cat1, mjjCBHig_1_cat1, mjj_hig_frac_1_cat1); - -mjjGaussHig_1_cat2 = Gaussian(mjj, mjj_hig_m0_1_cat2, mjj_hig_gsigma_1_cat2); -mjjCBHig_1_cat2 = CBShape(mjj, mjj_hig_m0_1_cat2, mjj_hig_sigma_1_cat2, mjj_hig_alpha_1_cat2, mjj_hig_n_1_cat2); -mjjHig_1_cat2 = AddPdf(mjjGaussHig_1_cat2, mjjCBHig_1_cat2, mjj_hig_frac_1_cat2); - -mjjGaussHig_1_cat3 = Gaussian(mjj, mjj_hig_m0_1_cat3, mjj_hig_gsigma_1_cat3); -mjjCBHig_1_cat3 = CBShape(mjj, mjj_hig_m0_1_cat3, mjj_hig_sigma_1_cat3, mjj_hig_alpha_1_cat3, mjj_hig_n_1_cat3); -mjjHig_1_cat3 = AddPdf(mjjGaussHig_1_cat3, mjjCBHig_1_cat3, mjj_hig_frac_1_cat3); - -mjj_hig_m0_2_cat0[100, 80, 200]; -mjj_hig_sigma_2_cat0[25, 10, 50]; -mjj_hig_alpha_2_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat0[50, 10, 100]; -mjj_hig_frac_2_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat1[100, 80, 200]; -mjj_hig_sigma_2_cat1[25, 10, 50]; -mjj_hig_alpha_2_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat1[50, 10, 100]; -mjj_hig_frac_2_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat2[100, 80, 200]; -mjj_hig_sigma_2_cat2[25, 10, 50]; -mjj_hig_alpha_2_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_2_cat2[50, 10, 100]; -mjj_hig_frac_2_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_2_cat3[100, 80, 200]; -mjj_hig_sigma_2_cat3[25, 10, 50]; -mjj_hig_alpha_2_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_2_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_2_cat3[50, 10, 100]; -mjj_hig_frac_2_cat3[0.1, 0, 0.4]; - -mjjGaussHig_2_cat0 = Gaussian(mjj, mjj_hig_m0_2_cat0, mjj_hig_gsigma_2_cat0); -mjjCBHig_2_cat0 = CBShape(mjj, mjj_hig_m0_2_cat0, mjj_hig_sigma_2_cat0, mjj_hig_alpha_2_cat0, mjj_hig_n_2_cat0); -mjjHig_2_cat0 = AddPdf(mjjGaussHig_2_cat0, mjjCBHig_2_cat0, mjj_hig_frac_2_cat0); - -mjjGaussHig_2_cat1 = Gaussian(mjj, mjj_hig_m0_2_cat1, mjj_hig_gsigma_2_cat1); -mjjCBHig_2_cat1 = CBShape(mjj, mjj_hig_m0_2_cat1, mjj_hig_sigma_2_cat1, mjj_hig_alpha_2_cat1, mjj_hig_n_2_cat1); -mjjHig_2_cat1 = AddPdf(mjjGaussHig_2_cat1, mjjCBHig_2_cat1, mjj_hig_frac_2_cat1); - -mjjGaussHig_2_cat2 = Gaussian(mjj, mjj_hig_m0_2_cat2, mjj_hig_gsigma_2_cat2); -mjjCBHig_2_cat2 = CBShape(mjj, mjj_hig_m0_2_cat2, mjj_hig_sigma_2_cat2, mjj_hig_alpha_2_cat2, mjj_hig_n_2_cat2); -mjjHig_2_cat2 = AddPdf(mjjGaussHig_2_cat2, mjjCBHig_2_cat2, mjj_hig_frac_2_cat2); - -mjjGaussHig_2_cat3 = Gaussian(mjj, mjj_hig_m0_2_cat3, mjj_hig_gsigma_2_cat3); -mjjCBHig_2_cat3 = CBShape(mjj, mjj_hig_m0_2_cat3, mjj_hig_sigma_2_cat3, mjj_hig_alpha_2_cat3, mjj_hig_n_2_cat3); -mjjHig_2_cat3 = AddPdf(mjjGaussHig_2_cat3, mjjCBHig_2_cat3, mjj_hig_frac_2_cat3); - -mjj_hig_m0_3_cat0[100, 80, 200]; -mjj_hig_sigma_3_cat0[25, 10, 50]; -mjj_hig_alpha_3_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat0[50, 10, 100]; -mjj_hig_frac_3_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat1[100, 80, 200]; -mjj_hig_sigma_3_cat1[25, 10, 50]; -mjj_hig_alpha_3_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat1[50, 10, 100]; -mjj_hig_frac_3_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat2[100, 80, 200]; -mjj_hig_sigma_3_cat2[25, 10, 50]; -mjj_hig_alpha_3_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_3_cat2[50, 10, 100]; -mjj_hig_frac_3_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_3_cat3[100, 80, 200]; -mjj_hig_sigma_3_cat3[25, 10, 50]; -mjj_hig_alpha_3_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_3_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_3_cat3[50, 10, 100]; -mjj_hig_frac_3_cat3[0.1, 0, 0.4]; - -mjjGaussHig_3_cat0 = Gaussian(mjj, mjj_hig_m0_3_cat0, mjj_hig_gsigma_3_cat0); -mjjCBHig_3_cat0 = CBShape(mjj, mjj_hig_m0_3_cat0, mjj_hig_sigma_3_cat0, mjj_hig_alpha_3_cat0, mjj_hig_n_3_cat0); -mjjHig_3_cat0 = AddPdf(mjjGaussHig_3_cat0, mjjCBHig_3_cat0, mjj_hig_frac_3_cat0); - -mjjGaussHig_3_cat1 = Gaussian(mjj, mjj_hig_m0_3_cat1, mjj_hig_gsigma_3_cat1); -mjjCBHig_3_cat1 = CBShape(mjj, mjj_hig_m0_3_cat1, mjj_hig_sigma_3_cat1, mjj_hig_alpha_3_cat1, mjj_hig_n_3_cat1); -mjjHig_3_cat1 = AddPdf(mjjGaussHig_3_cat1, mjjCBHig_3_cat1, mjj_hig_frac_3_cat1); - -mjjGaussHig_3_cat2 = Gaussian(mjj, mjj_hig_m0_3_cat2, mjj_hig_gsigma_3_cat2); -mjjCBHig_3_cat2 = CBShape(mjj, mjj_hig_m0_3_cat2, mjj_hig_sigma_3_cat2, mjj_hig_alpha_3_cat2, mjj_hig_n_3_cat2); -mjjHig_3_cat2 = AddPdf(mjjGaussHig_3_cat2, mjjCBHig_3_cat2, mjj_hig_frac_3_cat2); - -mjjGaussHig_3_cat3 = Gaussian(mjj, mjj_hig_m0_3_cat3, mjj_hig_gsigma_3_cat3); -mjjCBHig_3_cat3 = CBShape(mjj, mjj_hig_m0_3_cat3, mjj_hig_sigma_3_cat3, mjj_hig_alpha_3_cat3, mjj_hig_n_3_cat3); -mjjHig_3_cat3 = AddPdf(mjjGaussHig_3_cat3, mjjCBHig_3_cat3, mjj_hig_frac_3_cat3); - -mjj_hig_m0_4_cat0[100, 80, 200]; -mjj_hig_sigma_4_cat0[25, 10, 50]; -mjj_hig_alpha_4_cat0[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat0[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat0[50, 10, 100]; -mjj_hig_frac_4_cat0[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat1[100, 80, 200]; -mjj_hig_sigma_4_cat1[25, 10, 50]; -mjj_hig_alpha_4_cat1[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat1[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat1[50, 10, 100]; -mjj_hig_frac_4_cat1[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat2[100, 80, 200]; -mjj_hig_sigma_4_cat2[25, 10, 50]; -mjj_hig_alpha_4_cat2[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat2[2.0, 1.0, 5.0]; -mjj_hig_gsigma_4_cat2[50, 10, 100]; -mjj_hig_frac_4_cat2[0.1, 0, 0.4]; - -mjj_hig_m0_4_cat3[100, 80, 200]; -mjj_hig_sigma_4_cat3[25, 10, 50]; -mjj_hig_alpha_4_cat3[1.0, 0.0, 2.5]; -mjj_hig_n_4_cat3[2.0, 1.5, 10]; -mjj_hig_gsigma_4_cat3[50, 10, 100]; -mjj_hig_frac_4_cat3[0.1, 0, 0.4]; - -mjjGaussHig_4_cat0 = Gaussian(mjj, mjj_hig_m0_4_cat0, mjj_hig_gsigma_4_cat0); -mjjCBHig_4_cat0 = CBShape(mjj, mjj_hig_m0_4_cat0, mjj_hig_sigma_4_cat0, mjj_hig_alpha_4_cat0, mjj_hig_n_4_cat0); -mjjHig_4_cat0 = AddPdf(mjjGaussHig_4_cat0, mjjCBHig_4_cat0, mjj_hig_frac_4_cat0); - -mjjGaussHig_4_cat1 = Gaussian(mjj, mjj_hig_m0_4_cat1, mjj_hig_gsigma_4_cat1); -mjjCBHig_4_cat1 = CBShape(mjj, mjj_hig_m0_4_cat1, mjj_hig_sigma_4_cat1, mjj_hig_alpha_4_cat1, mjj_hig_n_4_cat1); -mjjHig_4_cat1 = AddPdf(mjjGaussHig_4_cat1, mjjCBHig_4_cat1, mjj_hig_frac_4_cat1); - -mjjGaussHig_4_cat2 = Gaussian(mjj, mjj_hig_m0_4_cat2, mjj_hig_gsigma_4_cat2); -mjjCBHig_4_cat2 = CBShape(mjj, mjj_hig_m0_4_cat2, mjj_hig_sigma_4_cat2, mjj_hig_alpha_4_cat2, mjj_hig_n_4_cat2); -mjjHig_4_cat2 = AddPdf(mjjGaussHig_4_cat2, mjjCBHig_4_cat2, mjj_hig_frac_4_cat2); - -mjjGaussHig_4_cat3 = Gaussian(mjj, mjj_hig_m0_4_cat3, mjj_hig_gsigma_4_cat3); -mjjCBHig_4_cat3 = CBShape(mjj, mjj_hig_m0_4_cat3, mjj_hig_sigma_4_cat3, mjj_hig_alpha_4_cat3, mjj_hig_n_4_cat3); -mjjHig_4_cat3 = AddPdf(mjjGaussHig_4_cat3, mjjCBHig_4_cat3, mjj_hig_frac_4_cat3); - -mtot[200,1600]; diff --git a/LimitSetting/Models/old_LowMassResDatacardModel.txt b/LimitSetting/Models/old_LowMassResDatacardModel.txt deleted file mode 100644 index 06a46f8..0000000 --- a/LimitSetting/Models/old_LowMassResDatacardModel.txt +++ /dev/null @@ -1,46 +0,0 @@ -imax 2 -jmax 1 -kmax * ---------------- -shapes data_obs cat0 INPUTBKGLOC w_all:data_obs_cat0 -shapes data_obs cat1 INPUTBKGLOC w_all:data_obs_cat1 -############## shape with reparametrization -shapes Bkg cat0 INPUTBKGLOC w_all:BkgPdf_cat0 -shapes Bkg cat1 INPUTBKGLOC w_all:BkgPdf_cat1 -# signal -shapes Sig cat0 INPUTSIGLOC w_all:CMS_sig_cat0 -shapes Sig cat1 INPUTSIGLOC w_all:CMS_sig_cat1 ---------------- -bin cat0 cat1 -observation OBSCAT0 OBSCAT1 ------------------------------- -bin cat0 cat0 cat1 cat1 -process Sig Bkg Sig Bkg -process 0 1 0 1 -rate SIGCAT0 1 SIGCAT1 1 - -# General -lumi_13TeV lnN 1.027 - 1.027 - -#Normalization -CMS_eff_DiphoTriggerAndPreSel lnN 1.020 - 1.020 - -CMS_eff_PhoEGMMVAID lnN 1.010 - 1.010 - -CMS_eff_MassWindowJetSel lnN 1.050 - 1.050 - -CMS_eff_bTagging lnN 1.0/0.975 - 1.01 - -#Shape -CMS_hgg_sig_m0_absShift param 1 0.01 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) -CMS_hgg_sig_sigmaScale param 1 0.01 # optimistic estimate of resolution uncertainty -CMS_hbb_sig_m0_absShift param 1 0.02 # displacement of the dijet mean error -CMS_hbb_sig_sigmaScale param 1 0.08 # optimistic estimate of resolution uncertainty - -#Curve Normalization params -BkgPdf_cat0_norm flatParam # Normalization uncertainty on background slope -BkgPdf_cat1_norm flatParam # Normalization uncertainty on background slope - -#Curve Shape params -CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat0 flatParam # Mean and absolute uncertainty on background slope -CMS_hhbbgg_13TeV_mgg_bkg_slope2_cat0 flatParam # Mean and absolute uncertainty on background slope -CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0 flatParam # Mean and absolute uncertainty on background slope -CMS_hhbbgg_13TeV_mjj_bkg_slope1_cat1 flatParam # Mean and absolute uncertainty on background slope -CMS_hhbbgg_13TeV_mjj_bkg_slope2_cat1 flatParam # Mean and absolute uncertainty on background slope -CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1 flatParam # Mean and absolute uncertainty on background slope - diff --git a/LimitSetting/README.md b/LimitSetting/README.md deleted file mode 100644 index 9e0932c..0000000 --- a/LimitSetting/README.md +++ /dev/null @@ -1,28 +0,0 @@ -### Running Resonant Limits - - -#### Make Low mass+High mass plot: -``` -python scripts/LowHighResPlotter.py \ --L \ --H \ --l \ --G/-R (Graviton or Radion) \ --o (if plot observed) -``` - -#### Make signal region fits with errors: -``` -python scripts/MakeBkgPlot.py \ --w DataWorkspace.root \ --c 0 [cat0 or cat1] \ --o mgg,mjj [observables] \ --l 2.70 [lumi] \ --a "pp#rightarrowX#rightarrowHH#rightarrowb#bar{b}#gamma#gamma|M_{X} = $i GeV Selection" [legend] \ --b 80,40 [bins for respective observables] -``` - -The script that reads the fitting results (expected number of signal events, which order of pol was used, etc) is in LimitSetting/scripts/DataCardMaker.py. -The code is still creating the old version of datacards (Run1), this should be removed. - - diff --git a/LimitSetting/scripts/BkgPlotter.py b/LimitSetting/scripts/BkgPlotter.py deleted file mode 100644 index b061831..0000000 --- a/LimitSetting/scripts/BkgPlotter.py +++ /dev/null @@ -1,263 +0,0 @@ -from ROOT import * -from math import sqrt - -def MakeBkgPlot(data, pdf, var, label, lumi, cat, analysis, doBands, fname, binning): - - gROOT.SetBatch(kTRUE) - -# pdf.fitTo(data) - - frame = var.frame(RooFit.Title(" "),RooFit.Bins(binning)) - - data.plotOn(frame,RooFit.DataError(RooAbsData.SumW2),RooFit.XErrorSize(0)) - - pdf.plotOn(frame,RooFit.LineColor(kRed+1),RooFit.Precision(1E-10)) - - curve = frame.getObject( int(frame.numItems()-1) ) - datah = frame.getObject( int(frame.numItems()-2) ) - datah.SetLineWidth(1) -# datah.SetMarkerStyle(20) - -# sigmas = MakeBands(data, pdf, var, frame, curve) -# sigmas[0].SetFillColor(kBlue-5) -# sigmas[1].SetFillColor(kCyan) - - Max = frame.GetMaximum() - c = TCanvas("c", "c", 800, 600) -# c.SetLogy() - frame.Draw() - xmax = frame.GetXaxis().GetXmax() - xmin = frame.GetXaxis().GetXmin() - - deltabin = (xmax - xmin)/binning - sigmas = MakeBands(data, pdf, var, frame, curve, xmin, xmax, deltabin) - print xmax, xmin - sigmas[0].SetFillColor(kAzure-4) - sigmas[0].SetLineColor(kAzure-4) - sigmas[1].SetFillColor(kCyan) - sigmas[1].SetLineColor(kCyan) - - sigmas[1].Draw("AE3") - sigmas[1].SetMaximum(Max*1.75) - sigmas[1].SetMinimum(0.00001) - sigmas[1].GetXaxis().SetTitle(label) - sigmas[1].GetXaxis().SetTitleSize(0.045) - sigmas[1].GetYaxis().SetTitleSize(0.045) - sigmas[1].GetXaxis().SetRangeUser(xmin*1.0001, xmax*0.9999) - sigmas[1].GetYaxis().SetTitle("Events/("+str(int(deltabin))+" GeV)") - if deltabin < 1: - sigmas[1].GetYaxis().SetTitle("Events/("+"%.01f"%deltabin+" GeV)") - - c.Update() - sigmas[0].Draw("E3same") - frame.Draw("same") - - datah.Draw("EPsame") - - tlatex = TLatex() - tlatex.SetNDC() - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.SetTextSize(20) - tlatex.DrawLatex(0.68, 0.91, "L = " + str(lumi) + " fb^{-1} (13 TeV)") - tlatex.SetTextSize(25) - Cat = "High Purity Category" - if int(cat) == 1: - Cat = "Medium Purity Category" - if int(cat) == -1: - Cat = "High Mass (Single Cat.)" - print cat, Cat - if "|" in analysis: - an = analysis.split("|") -# tlatex.SetTextFont(63) - tlatex.DrawLatex(0.14, 0.85, an[0]) -# tlatex.SetTextFont(43) - tlatex.DrawLatex(0.14, 0.79, an[1]) - tlatex.DrawLatex(0.14, 0.73, Cat) - else: -# tlatex.SetTextFont(63) - tlatex.DrawLatex(0.14, 0.85, analysis) -# tlatex.SetTextFont(43) - tlatex.DrawLatex(0.14, 0.79, Cat) - - leg = TLegend(0.50, 0.60, 0.89, 0.9) - - leg.SetFillStyle(0) - leg.SetLineWidth(0) - leg.SetBorderSize(0) - - nBkgParams = pdf.getParameters(data).getSize() - print "Number of background parameters:", nBkgParams - - bkgModel = "#splitline{Background model}{" - if nBkgParams == 2: - bkgModel += "(1st Order Bernstein Pol.)}" - if nBkgParams == 3: - bkgModel += "(2nd Order Bernstein Pol.)}" - - leg.AddEntry(datah, "Data", "pe") - leg.AddEntry(curve, bkgModel, "l") - leg.AddEntry(sigmas[0], "Fit #pm 1#sigma", "f") - leg.AddEntry(sigmas[1], "Fit #pm 2#sigma", "f") - leg.Draw() - - c.SaveAs(fname+".pdf") - c.SaveAs(fname+".png") - -def MakeBands(data, pdf, var, frame, curve, xmin, xmax, deltabin): - - onesigma = TGraphAsymmErrors() - twosigma = TGraphAsymmErrors() - - bins = [] - bins.append([xmin*1.001, xmin, xmin+deltabin]) - for ibin in range(1,frame.GetXaxis().GetNbins()+1): - lowedge = frame.GetXaxis().GetBinLowEdge(ibin) - upedge = frame.GetXaxis().GetBinUpEdge(ibin) - center = frame.GetXaxis().GetBinCenter(ibin) - bins.append( (center,lowedge,upedge) ) - bins.append([xmax*0.999, xmax-deltabin, xmax]) - - - allbins = [] - for ibin,bin in enumerate(bins): - center,lowedge,upedge = bin - - nombkg = curve.interpolate(center) - largeNum = nombkg*50#(1 + sqrt(nombkg)*2) -# if nombkg < 1: -# largeNum = 9999999999999999999999999999999999 - largeNum = max(1,largeNum) - - nlim = RooRealVar("nlim%s" % var.GetName(),"",0.,-largeNum,largeNum) -# nlim.removeRange() - - onesigma.SetPoint(ibin,center,nombkg) - twosigma.SetPoint(ibin,center,nombkg) - - nlim.setVal(nombkg) - - if 1: - print "computing error band ", ibin, lowedge, upedge, nombkg, - - var.setRange("errRange",lowedge,upedge) - errm = 0 - errp = 0 - counter = 0 -# while errm == 0 or errp == 0: - errmSum = 0 - countermSum = 0 - errpSum = 0 - counterpSum = 0 - epdf = RooExtendPdf("epdf","",pdf,nlim, "errRange") - nll = epdf.createNLL(data,RooFit.Extended()) - minim = RooMinimizer(nll) - for ct in range(0, 500): -# epdf = RooExtendPdf("epdf","",pdf,nlim, "errRange") -# nll = epdf.createNLL(data,RooFit.Extended()) - # nll = pdf.createNLL(data) - minim = RooMinimizer(nll) - minim.setMinimizerType("Minuit2") - minim.setStrategy(0) - minim.setPrintLevel( -1 )#if not options.verbose else 2) - minim.migrad() -# minim.hesse() -# minim.migrad() -# minim.minos() - minim.setStrategy(0) - minim.minos(RooArgSet(nlim)) - - errm, errp = -nlim.getErrorLo(),nlim.getErrorHi() -# if errm !=0 and errp !=0: break - - if abs(errm) > nombkg*0.01: - errmSum += -nlim.getErrorLo() - countermSum+=1 -# if len(countermSum) < 3: countermSum.append(-nlim.getErrorLo()) - if abs(errp) > nombkg*0.01: - errpSum += nlim.getErrorHi() - counterpSum+=1 -# if len(counterpSum) < 3: counterpSum.append(nlim.getErrorHi()) -# del minim -# del nll -# del epdf - if counterpSum > 10 and countermSum > 10: break - -# if len(counterpSum) > 2 and len(countermSum) > 2: break -# counter +=1 -# if counter > 10: break - - - - errm = errmSum/float(countermSum) - errp = errpSum/float(counterpSum) - -# if len(countermSum) == 3: -# errm = sorted(countermSum)[1] -# else: -# errm = 0 -# if len(counterpSum) == 3: -# errp = sorted(counterpSum)[1] -# else: -# errp = 0 - - onesigma.SetPointError(ibin,center-lowedge,upedge-center,errm,errp) - - errm = 0 - errp = 0 - counter = 0 - errmSum = 0 - countermSum = [] - errpSum = 0 - counterpSum = [] -# while errm == 0 or errp == 0: - for ct in range(0,2000): -# epdf = RooExtendPdf("epdf","",pdf,nlim, "errRange") -# nll = epdf.createNLL(data,RooFit.Extended()) - # nll = pdf.createNLL(data) -# minim = RooMinimizer(nll) - minim.setMinimizerType("Minuit2") -# minim.setStrategy(2) - minim.setPrintLevel( -1 )#if not options.verbose else 2) - minim.setErrorLevel(2.) - minim.migrad() - minim.minos(RooArgSet(nlim)) - - errm, errp = -nlim.getErrorLo(),nlim.getErrorHi() -# if errm != 0 and errp !=0: break - - if abs(errm) > nombkg*0.01: - errmSum += -nlim.getErrorLo() - if len(countermSum) < 3: countermSum.append(-nlim.getErrorLo()) - if abs(errp) > nombkg*0.01: - errpSum += nlim.getErrorHi() - if len(counterpSum) < 3: counterpSum.append(nlim.getErrorHi()) - -# del epdf -# del nll -# del minim - - print len(counterpSum) - if len(counterpSum) > 2 and len(countermSum) > 2: break -# counter += 1 -# if counter > 10: break - -# errm = errmSum/float(countermSum) -# errp = errpSum/float(counterpSum) - errm = sorted(countermSum)[1] - errp = sorted(counterpSum)[1] - allbins.append([errm,errp,nombkg]) - twosigma.SetPointError(ibin,center-lowedge,upedge-center,errm,errp) - -# del minim -# del nll - - print allbins - return [onesigma,twosigma] diff --git a/LimitSetting/scripts/DataCardMaker.py b/LimitSetting/scripts/DataCardMaker.py deleted file mode 100644 index 63fa7a2..0000000 --- a/LimitSetting/scripts/DataCardMaker.py +++ /dev/null @@ -1,83 +0,0 @@ -import sys, getopt, os - -def main(argv): - Folder = '' - nCats = -99 - signalExp = '' - observed = '' - isRes = 0 - try: - opts, args = getopt.getopt(argv,"f:n:s:b:o:r",["Folder=", "nCats=", "signalExp=", "observed=", "isRes"]) - except getopt.GetoptError: - print 'DataCardMaker.py -f -n -s -o [if resonant: -r]' - sys.exit(2) - for opt, arg in opts: - if opt == "-m": - mass = int(arg) - if opt == "-f": - Folder = arg - if opt == "-n": - nCats = int(arg) - if opt == "-s": - signalExp = arg - if opt == "-o": - observed = arg - if opt == "-r": - isRes = 1 - - if Folder == '' or nCats == -99 or signalExp == '' or observed == '': - print 'DataCardMaker.py -f -n -s -o [if resonant: -r]' - sys.exit(2) - - if isRes == 1 and nCats == 1: - print 'Resonant needs two cats!' - sys.exit(2) - - if nCats == 2: - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/LowMassResDatacardModel.txt' - if isRes == 0: - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/NonResDatacardModel.txt' - - inputDatacard = open(inputDatacardName, 'r') - outputDatacard = open(Folder+'/datacards/hhbbgg_13TeV_DataCard.txt', 'w') - outToWrite = '' - for line in inputDatacard: - outTemp = line.replace("INPUTBKGLOC", Folder+'/workspaces/hhbbgg.inputbkg_13TeV.root') - outTemp2 = outTemp.replace("INPUTSIGLOC", Folder+'/workspaces/hhbbgg.mH125_13TeV.inputsig.root') - outTemp3 = outTemp2.replace("OBSCAT0", '{:.0f}'.format(float(str(observed.split(',')[0])))) - outTemp4 = outTemp3.replace("OBSCAT1", '{:.0f}'.format(float(str(observed.split(',')[1])))) - outTemp5 = outTemp4.replace("SIGCAT0", str(signalExp.split(',')[0])) - outTemp6 = outTemp5.replace("SIGCAT1", str(signalExp.split(',')[1])) - if float(observed.split(',')[0]) < 11: - newTemp1 = outTemp6 - newTemp2 = newTemp1.replace('CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0', '### CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0') - outTemp6 = newTemp2.replace('CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0', '### CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0') - if float(observed.split(',')[1]) < 11: - newTemp1 = outTemp6 - newTemp2 = newTemp1.replace('CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat1', '### CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat1') - outTemp6 = newTemp2.replace('CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1', '### CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1') - outToWrite += outTemp6 - outputDatacard.write(outToWrite) - outputDatacard.close() - - if nCats == 1 and isRes == 1: - inputDatacardName = 'Models/HighMassResDatacardModel.txt' - inputDatacard = open(inputDatacardName, 'r') - outputDatacard = open(Folder+'/datacards/hhbbgg_13TeV_DataCard.txt', 'w') - outToWrite = '' - for line in inputDatacard: - outTemp = line.replace("INPUTBKGLOC", Folder+'/workspaces/hhbbgg.inputbkg_13TeV.root') - outTemp2 = outTemp.replace("INPUTSIGLOC", Folder+'/workspaces/hhbbgg.mH125_13TeV.inputsig.root') - outTemp3 = outTemp2.replace("OBSCAT0", str(observed)) - outTemp5 = outTemp3.replace("SIGCAT0", str(signalExp)) - if float(observed.split(',')[0]) < 11: - newTemp1 = outTemp5 - newTemp2 = newTemp1.replace('CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0', '### CMS_hhbbgg_13TeV_mgg_bkg_slope3_cat0') - outTemp5 = newTemp2.replace('CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0', '### CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0') - outToWrite += outTemp5 - outputDatacard.write(outToWrite) - outputDatacard.close() - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/LowHighResPlotter.py b/LimitSetting/scripts/LowHighResPlotter.py deleted file mode 100644 index fffc4ec..0000000 --- a/LimitSetting/scripts/LowHighResPlotter.py +++ /dev/null @@ -1,308 +0,0 @@ -from ROOT import * -gROOT.SetBatch(True) -import sys, getopt, os -from array import array -from ResonantCrossSections import * - -col1 = TColor(11111, 249./255., 243./255., 33./255.) - -def main(argv): - lowfolder = "" - highfolder = "" - lumi = "" - doObs = 0 - radion = 0 - graviton = 0 - try: - opts, args = getopt.getopt(argv,"L:H:l:oRG",["LowFolder=", "HighFolder=", "lumi=", "observed", "radion", "graviton"]) - except getopt.GetoptError: - print 'ResPlotter.py -f -l lumi' - sys.exit(2) - for opt, arg in opts: - if opt == "-f": - folder = arg - if opt == "-l": - lumi = arg - if opt == "-L": - lowfolder = arg - if opt == "-H": - highfolder = arg - if opt == "-o": - doObs = 1 - if opt == "-R": - radion = 1 - if opt == "-G": - graviton = 1 - - if graviton == 1 and radion == 1: - print "Either choose -R or -G..." - sys.exit(2) - - if lowfolder == "" or highfolder == "": - print 'ResPlotter.py -f ' - sys.exit(2) - - if not os.path.isdir(lowfolder) or not os.path.isdir(highfolder): - print "FOLDER DOESN'T EXIST!" - sys.exit(2) - - dirs = os.listdir(lowfolder) - massList = [] - centralVal = [] - s1_up = [] - s1_down = [] - s2_up = [] - s2_down = [] - zeros = [] - observed = [] - Maximum = 0 - for d in dirs: - if "Radion" not in d and "Graviton" not in d: - continue - if(radion): mass = int(d.replace("Radion_M", "")) - if(graviton): mass = int(d.replace("Graviton_M", "")) - if mass > 500: continue - massList.append( mass ) - limFile = open(lowfolder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - cenVal = -1 - for line in limFile: - if "50.0%" in line: - cenVal = float(line.split(" < ")[1]) - centralVal.append( cenVal ) - if cenVal == -1: - print "CENTRAL VALUE NOT FOUND!" - sys.exit(2) - limFile = open(lowfolder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - zeros.append(0) - for line in limFile: - if "Observed" in line: - val = float( line.split(" < ")[1] ) - observed.append(val) - continue - if "2.5%" in line: - val = cenVal - float(line.split(" < ")[1]) - s2_down.append( val ) - continue - if "16.0%" in line: - val = cenVal - float(line.split(" < ")[1]) - s1_down.append( val ) - continue - if "84.0%" in line: - val = float(line.split(" < ")[1]) - cenVal - s1_up.append( val ) - continue - if "97.5%" in line: - val = float(line.split(" < ")[1]) - cenVal - s2_up.append( val ) - if val > Maximum: - Maximum = val - continue - gr_centralVal_1s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s1_down), array('d', s1_up)) - gr_centralVal_2s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s2_down), array('d', s2_up)) - - gr_observed = TGraph(len(massList), array('d', massList), array('d', observed)) - - highdirs = sorted(os.listdir(highfolder)) - h_massList = [] - h_centralVal = [] - h_s1_up = [] - h_s1_down = [] - h_s2_up = [] - h_s2_down = [] - h_zeros = [] - h_observed = [] - for d in highdirs: - if "Radion" not in d and "Graviton" not in d: - continue - if(radion): mass = int(d.replace("Radion_M", "")) - if(graviton): mass = int(d.replace("Graviton_M", "")) - if int(mass) < 500: continue - h_massList.append( mass ) - limFile = open(highfolder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - cenVal = -1 - for line in limFile: - if "50.0%" in line: - cenVal = float(line.split(" < ")[1]) - h_centralVal.append( cenVal ) - if cenVal == -1: - print "CENTRAL VALUE NOT FOUND!" - sys.exit(2) - limFile = open(highfolder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - h_zeros.append(0) - for line in limFile: - if "Observed" in line: - val = float(line.split(" < ")[1]) - h_observed.append( val ) - if "2.5%" in line: - val = cenVal - float(line.split(" < ")[1]) - h_s2_down.append( val ) - continue - if "16.0%" in line: - val = cenVal - float(line.split(" < ")[1]) - h_s1_down.append( val ) - continue - if "84.0%" in line: - val = float(line.split(" < ")[1]) - cenVal - h_s1_up.append( val ) - continue - if "97.5%" in line: - val = float(line.split(" < ")[1]) - cenVal - h_s2_up.append( val ) - continue - - h_gr_centralVal_1s = TGraphAsymmErrors(len(h_massList), array('d', h_massList), array('d', h_centralVal), array('d', h_zeros), array('d', h_zeros), array('d', h_s1_down), array('d', h_s1_up)) - h_gr_centralVal_2s = TGraphAsymmErrors(len(h_massList), array('d', h_massList), array('d', h_centralVal), array('d', h_zeros), array('d', h_zeros), array('d', h_s2_down), array('d', h_s2_up)) - - h_gr_observed = TGraph(len(h_massList), array('d', h_massList), array('d', h_observed)) - - h_gr_observed.SetLineWidth(3) - h_gr_observed.SetLineColor(kBlack) - h_gr_observed.SetLineStyle(kDashed) - h_gr_observed.SetMarkerStyle(20) - gr_observed.SetLineWidth(3) - gr_observed.SetLineColor(kBlack) - gr_observed.SetLineStyle(kDashed) - gr_observed.SetMarkerStyle(20) - - leg = "" - if(graviton or radion): leg = TLegend(0.5, 0.7, 0.89, 0.87) - if(0): leg = TLegend(0.5, 0.51, 0.89, 0.7) - leg.SetFillStyle(0) - leg.SetLineWidth(0) - leg.SetBorderSize(0) - - c0 = TCanvas("c", "c", 800, 600) - c0.SetLogy() -# gr_centralVal_2s.SetMaximum(Maximum*2.5) - gr_centralVal_2s.SetMaximum(400) - gr_centralVal_2s.SetMinimum(0.8) - gr_centralVal_2s.Draw("AP3") - gr_centralVal_2s.SetLineColor(0) -# gr_centralVal_2s.SetFillColor(kGreen+1) - gr_centralVal_2s.SetFillColor(11111) - gr_centralVal_2s.SetLineWidth(4) - gr_centralVal_2s.SetTitle("") -# gr_centralVal_2s.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s.GetXaxis().SetLimits(massList[0] - 20, h_massList[len(h_massList)-1]+20) - gr_centralVal_2s.GetXaxis().SetTitle("M_{X} [GeV]") - gr_centralVal_2s.GetXaxis().SetTitleSize(0.045) - gr_centralVal_2s.GetYaxis().SetTitleSize(0.045) - gr_centralVal_2s.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH#rightarrowbb#gamma#gamma) [fb]") - c0.Update() - gr_centralVal_1s.Draw("3same") - gr_centralVal_1s.SetMarkerStyle(21) - gr_centralVal_1s.SetMarkerColor(kBlue+1) - gr_centralVal_1s.SetLineWidth(3) - gr_centralVal_1s.SetLineColor(kBlue+1) -# gr_centralVal_1s.SetFillColor(kYellow) -# gr_centralVal_1s.SetFillColor(11111) - gr_centralVal_1s.SetFillColor(kGreen+1) - c0.Update() - gr_centralVal_1s.Draw("XLsame") - sigma1 = gr_centralVal_1s.Clone() - sigma1.SetLineColor(0) - -# h_gr_centralVal_2s.SetFillColor(kGreen+1) - h_gr_centralVal_2s.SetFillColor(11111) - h_gr_centralVal_2s.SetLineColor(0) - h_gr_centralVal_2s.Draw("3same") -# h_gr_centralVal_1s.SetFillColor(kYellow) -# h_gr_centralVal_1s.SetFillColor(11111) - h_gr_centralVal_1s.SetFillColor(kGreen+1) - h_gr_centralVal_1s.Draw("3same") - c0.Update() - h_gr_centralVal_1s.SetLineColor(kBlue+1) - h_gr_centralVal_1s.SetLineWidth(3) - h_gr_centralVal_1s.Draw("XLsame") - h_sigma1 = h_gr_centralVal_1s.Clone() - h_sigma1.SetLineColor(0) - - if(doObs): h_gr_observed.Draw("PLsame") - if(doObs): gr_observed.Draw("PLsame") - if(doObs): leg.AddEntry(gr_observed, "Observed 95% upper limit", "lp") - - leg.SetTextSize(0.035) - - if(graviton or radion): legRes = TLegend(0.13, 0.7, 0.5, 0.87) - if(0): legRes = TLegend(0.5, 0.7, 0.89, 0.89) - legRes.SetFillStyle(0) - legRes.SetLineWidth(0) - legRes.SetBorderSize(0) - if(radion): - legRes.SetHeader("#splitline{pp#rightarrowX#rightarrowHH#rightarrowb#bar{b}#gamma#gamma}{Spin-0 Resonance}") - legRes.AddEntry(gr_rad, "Bulk Radion, #Lambda_{R} = 1 TeV", "l") - gr_rad.Draw("Lsame") - if(graviton): - legRes.SetHeader("#splitline{pp#rightarrowX#rightarrowHH#rightarrowb#bar{b}#gamma#gamma}{Spin-2 Resonance}") - legRes.AddEntry(gr_rad, "Bulk Graviton, k/#bar{M}_{Pl} = 1", "l") - gr_grav.Draw("Lsame") - legRes.SetTextSize(0.038) - legRes.Draw("same") - - leg.AddEntry(gr_centralVal_1s, "Expected 95% upper limit", "l") - leg.AddEntry(sigma1, "Expected limit #pm 1#sigma", "f") - leg.AddEntry(gr_centralVal_2s, "Expected limit #pm 2#sigma", "f") -# leg.AddEntry(h_gr_centralVal_1s, "High Mass Expected 95% upper limit", "l") -# leg.AddEntry(h_sigma1, "High Mass Expected limit #pm 1#sigma", "f") -# leg.AddEntry(h_gr_centralVal_2s, "High Mass Expected limit #pm 2#sigma", "f") - leg.Draw("same") - - line = "" - if(0): line = TLine(500, 0, 500, gr_centralVal_2s.GetYaxis().GetXmax()) - if(graviton or radion): line = TLine(500, 0, 500, gr_centralVal_2s.GetYaxis().GetXmax()*0.15) - line.SetLineStyle(2) - line.Draw("same") - - tlatex = TLatex() - tlatex.SetNDC() - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.SetTextSize(23) -# tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - tlatex.DrawLatex(0.65, 0.91,"L = " + str(lumi) + " fb^{-1} (13 TeV)") - c0.SaveAs(lowfolder+"/Low_High_ResPlot.pdf") - - sys.exit(2) - - gr_centralVal_1s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s1_down]), array('d', [i/2.6 for i in s1_up])) - gr_centralVal_2s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s2_down]), array('d', [i/2.6 for i in s2_up])) - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s_hh.SetMaximum(Maximum*2/2.6) - gr_centralVal_2s_hh.Draw("AP") - gr_centralVal_2s_hh.SetLineColor(kGreen+1) - gr_centralVal_2s_hh.SetLineWidth(4) - gr_centralVal_2s_hh.SetTitle("") - gr_centralVal_2s_hh.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s_hh.GetXaxis().SetTitle("Benchmark Points") - gr_centralVal_2s_hh.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH)/Br(HH#rightarrowbb#gamma#gamma) [pb]") - c0.Update() - gr_centralVal_1s_hh.Draw("EP") - gr_centralVal_1s_hh.SetMarkerStyle(21) - gr_centralVal_1s_hh.SetMarkerColor(kBlue+1) - gr_centralVal_1s_hh.SetLineWidth(5) - gr_centralVal_1s_hh.SetLineColor(kYellow) - - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(23) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - leg.Draw("same") - c0.SaveAs(folder+"/ResPlot_hh.pdf") - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/MakeBkgPlot.py b/LimitSetting/scripts/MakeBkgPlot.py deleted file mode 100644 index 0bba633..0000000 --- a/LimitSetting/scripts/MakeBkgPlot.py +++ /dev/null @@ -1,65 +0,0 @@ -from ROOT import * -from BkgPlotter import * -import sys, getopt, os - -def main(argv): - gSystem.Load("libHiggsAnalysisCombinedLimit.so") - - wfile = "" - cat = -1 - obs = "" - lumi = "" - doBands = 1 - analysis = "" - bins = [] - try: - opts, args = getopt.getopt(argv,"w:c:o:l:a:b:",["workspace=", "cat=", "observable=","lumi=","analysis=","bins="]) - except getopt.GetoptError: - print 'MakeBkgPlot.py -w -c -o -l -a -b ' - sys.exit(2) - for opt, arg in opts: - if opt == "-w": - wfile = arg - if opt == "-c": - cat = arg - if opt == "-o": - obs = str(arg).split(',') - if 'mjj' not in obs and 'mgg' not in obs: - print 'Observable must be either mjj or mgg' - sys.exit(2) - if opt == "-b": - arr = str(arg).split(',') - for b in arr: bins.append(int(b)) - if opt == "-l": - lumi = arg - if opt == "-a": - analysis = arg - if wfile == "" or cat == -1 or obs == "" or lumi == "" or analysis == "": - print 'MakeBkgPlot.py -w -c -o -l -a ' - sys.exit(2) - - - wroot = TFile(wfile, "READ") - workspace = wroot.Get("w_all") - - CAT = cat - print CAT - if int(CAT) == -1: - CAT = "0" - for i,ob in enumerate(obs): - data2D = workspace.data("data_obs_cat"+str(CAT)) - data2D.Print() - pdf = workspace.pdf(ob+"BkgTmpBer1_cat"+str(CAT)) -# pdf = workspace.pdf("BkgPdf_cat"+str(cat)) - var = workspace.var(ob) - data = data2D.reduce(RooArgSet(var)) - - label = "M(jj) [GeV]" - if 'mgg' in ob: - label = "M(#gamma#gamma) [GeV]" - - MakeBkgPlot(data, pdf, var, label, lumi, cat, analysis, doBands, "background_fit_"+ob, bins[i]) - -if __name__ == "__main__": - main(sys.argv[1:]) - diff --git a/LimitSetting/scripts/NonResPlotter.py b/LimitSetting/scripts/NonResPlotter.py deleted file mode 100644 index a6f1668..0000000 --- a/LimitSetting/scripts/NonResPlotter.py +++ /dev/null @@ -1,156 +0,0 @@ -from ROOT import * -gROOT.SetBatch(True) -import sys, getopt, os -from array import array - -col1 = TColor(11111, 249./255., 243./255., 33./255.) - -def main(argv): - folder = "" - lumi = "" - try: - opts, args = getopt.getopt(argv,"f:l:",["folder=", "lumi="]) - except getopt.GetoptError: - print 'NonResonantOrganizer.py -f -l lumi' - sys.exit(2) - for opt, arg in opts: - if opt == "-f": - folder = arg - if opt == "-l": - lumi = arg - if folder == "": - print 'NonResonantOrganizer.py -f ' - sys.exit(2) - - if not os.path.isdir(folder): - print "FOLDER DOESN'T EXIST!" - sys.exit(2) - - dirs = os.listdir(folder) - nodesList = [] - centralVal = [] - s1_up = [] - s1_down = [] - s2_up = [] - s2_down = [] - zeros = [] - Maximum = 0 - for d in dirs: - if "Node" not in d: - continue - nodeNumber = int(d.replace("Node", "")) - nodesList.append( nodeNumber ) - limFile = open(folder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(nodeNumber)+"_higgs.txt") - cenVal = -1 - for line in limFile: - if "50.0%" in line: - cenVal = float(line.split(" < ")[1]) - centralVal.append( cenVal ) - if cenVal == -1: - print "CENTRAL VALUE NOT FOUND!" - sys.exit(2) - limFile = open(folder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(nodeNumber)+"_higgs.txt") - zeros.append(0) - for line in limFile: - if "2.5%" in line: - val = cenVal - float(line.split(" < ")[1]) - s2_down.append( val ) - continue - if "16.0%" in line: - val = cenVal - float(line.split(" < ")[1]) - s1_down.append( val ) - continue - if "84.0%" in line: - val = float(line.split(" < ")[1]) - cenVal - s1_up.append( val ) - continue - if "97.5%" in line: - val = float(line.split(" < ")[1]) - cenVal - s2_up.append( val ) - if val > Maximum: - Maximum = val - continue - print s1_down, s2_down - gr_centralVal_1s = TGraphAsymmErrors(len(nodesList), array('d', nodesList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s1_down), array('d', s1_up)) - gr_centralVal_2s = TGraphAsymmErrors(len(nodesList), array('d', nodesList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s2_down), array('d', s2_up)) - for i,n in enumerate(nodesList): - print "Node",n," - ",centralVal[i] - - leg = TLegend(0.5, 0.7, 0.89, 0.89) - leg.SetFillStyle(0); - leg.SetLineWidth(0); - leg.SetBorderSize(0); - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s.SetMaximum(Maximum*2) - gr_centralVal_2s.Draw("APZ") - gr_centralVal_2s.SetLineColor(11111) - gr_centralVal_2s.SetLineWidth(8) - gr_centralVal_2s.SetTitle("") - gr_centralVal_2s.GetXaxis().SetLimits(-1, 14) - gr_centralVal_2s.GetXaxis().SetTitle("Shape Benchmark Points") - gr_centralVal_2s.GetYaxis().SetTitle("#sigma(pp#rightarrowHH#rightarrowbb#gamma#gamma) [fb]") - c0.Update() - gr_centralVal_1s.Draw("EPZ") - gr_centralVal_1s.SetMarkerStyle(21) - gr_centralVal_1s.SetMarkerColor(kBlue+1) - gr_centralVal_1s.SetLineWidth(7) - gr_centralVal_1s.SetLineColor(kGreen+1) - - leg.AddEntry(gr_centralVal_1s, "Expected 95% upper limit", "p") - leg.AddEntry(gr_centralVal_1s, "Expected limit #pm 1#sigma", "l") - leg.AddEntry(gr_centralVal_2s, "Expected limit #pm 2#sigma", "l") - leg.Draw("same") - - tlatex = TLatex() - tlatex.SetNDC() - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.SetTextSize(23) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - c0.SaveAs(folder+"/NonResPlot.pdf") - c0.SaveAs(folder+"/NonResPlot.png") - - gr_centralVal_1s_hh = TGraphAsymmErrors(len(nodesList), array('d', nodesList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s1_down]), array('d', [i/2.6 for i in s1_up])) - gr_centralVal_2s_hh = TGraphAsymmErrors(len(nodesList), array('d', nodesList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s2_down]), array('d', [i/2.6 for i in s2_up])) - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s_hh.SetMaximum(Maximum*2/2.6) - gr_centralVal_2s_hh.Draw("APZ") - gr_centralVal_2s_hh.SetLineColor(11111) - gr_centralVal_2s_hh.SetLineWidth(8) - gr_centralVal_2s_hh.SetTitle("") - gr_centralVal_2s_hh.GetXaxis().SetLimits(-1, 14) - gr_centralVal_2s_hh.GetXaxis().SetTitle("Benchmark Points") - gr_centralVal_2s_hh.GetYaxis().SetTitle("#sigma(pp#rightarrowHH)/Br(HH#rightarrowbb#gamma#gamma) [pb]") - c0.Update() - gr_centralVal_1s_hh.Draw("EPZ") - gr_centralVal_1s_hh.SetMarkerStyle(21) - gr_centralVal_1s_hh.SetMarkerColor(kBlue+1) - gr_centralVal_1s_hh.SetLineWidth(7) - gr_centralVal_1s_hh.SetLineColor(kGreen+1) - - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - leg.Draw("same") - c0.SaveAs(folder+"/NonResPlot_hh.pdf") - c0.SaveAs(folder+"/NonResPlot_hh.png") - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/NonResonantOrganizer.py b/LimitSetting/scripts/NonResonantOrganizer.py deleted file mode 100644 index 1c2da7e..0000000 --- a/LimitSetting/scripts/NonResonantOrganizer.py +++ /dev/null @@ -1,73 +0,0 @@ -import sys, getopt, os - -def main(argv): - folder = "" - try: - opts, args = getopt.getopt(argv,"f:",["folders="]) - except getopt.GetoptError: - print 'NonResonantOrganizer.py -f ' - sys.exit(2) - for opt, arg in opts: - if opt == "-f": - folder = arg - if folder == "": - print 'NonResonantOrganizer.py -f ' - sys.exit(2) - - prevDir = "" - nodesList = [] - nodeSeparateLocation = folder+"/SeparateCategories/" - if not os.path.isdir(nodeSeparateLocation): - prevDir = os.listdir(folder) - os.mkdir(folder+"/SeparateCategories/") - for f in prevDir: - if ".json" in f: - continue - os.rename(folder+"/"+f, folder+"/SeparateCategories/"+f) - node = f.replace("HighMass_", "").replace("LowMass_", "") - if node not in nodesList: - nodesList.append(node) - - if os.path.isdir(nodeSeparateLocation): - prevDir = os.listdir(folder+"/SeparateCategories/") - for f in prevDir: - if ".json" in f: - continue - node = f.replace("HighMass_", "").replace("LowMass_", "") - if node not in nodesList: - nodesList.append(node) - - if len(nodesList) < 1: - print "EMPTY LIST OF NODES!!" - sys.exit(2) - - postFix = "/datacards/hhbbgg_13TeV_DataCard.txt" - for n in nodesList: - if not os.path.isdir(folder+"/"+n): os.mkdir(folder+"/"+n) - if not os.path.isdir(folder+"/"+n+"/datacards/"): os.mkdir(folder+"/"+n+"/datacards/") - HMdatacard = nodeSeparateLocation+"/HighMass_"+n+postFix - LMdatacard = nodeSeparateLocation+"/LowMass_"+n+postFix - os.system("combineCards.py "+ HMdatacard + " " + LMdatacard + " > " + folder+"/"+n+postFix) - combinedCardName = folder+"/"+n+postFix - #CombineDatacards_MediumBTag_v44/SeparateCategories//HighMass_Node0/datacards/ - combinedCard = open(combinedCardName, "r") - lines = [] - for line in combinedCard: - if str(folder+"/SeparateCategories//HighMass_"+str(n)+"/datacards/") in line: - lines.append(line.replace(folder+"/SeparateCategories//HighMass_"+str(n)+"/datacards/"+folder, folder+"/SeparateCategories/")) - continue - if str(folder+"/SeparateCategories//LowMass_"+str(n)+"/datacards/") in line: - lines.append(line.replace(folder+"/SeparateCategories//LowMass_"+str(n)+"/datacards/"+folder, folder+"/SeparateCategories/")) - continue - else: - lines.append(line) - combinedCard.close() - os.system("rm "+combinedCardName) - combinedCard = open(combinedCardName, "w") - for line in lines: - combinedCard.write(line) - combinedCard.close() - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/ResCatPlotter.py b/LimitSetting/scripts/ResCatPlotter.py deleted file mode 100644 index 99838b2..0000000 --- a/LimitSetting/scripts/ResCatPlotter.py +++ /dev/null @@ -1,217 +0,0 @@ -from ROOT import * -gROOT.SetBatch(True) -import sys, getopt, os -from array import array - -def main(argv): - folder = "" - lumi = "" - spin = "spin-0" - try: - opts, args = getopt.getopt(argv,"f:l:s:",["folder=", "lumi=", "spin="]) - except getopt.GetoptError: - print 'ResPlotter.py -f -l lumi' - sys.exit(2) - for opt, arg in opts: - if opt == "-f": - folder = arg - if opt == "-l": - lumi = arg - if opt == "-s": - if arg == 2: - spin = "spin-2" - if folder == "": - print 'ResPlotter.py -f ' - sys.exit(2) - - if not os.path.isdir(folder): - print "FOLDER DOESN'T EXIST!" - sys.exit(2) - - dirs = os.listdir(folder) - massList = [] - centralVal = [] - centCat0 = [] - centCat1 = [] - s1_up = [] - s1_down = [] - s2_up = [] - s2_down = [] - zeros = [] - Maximum = 0 - for d in dirs: - if "Radion" not in d: - continue - mass = int(d.replace("Radion_M", "")) - if mass > 500: continue - massList.append( mass ) - thisfname = folder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt" - limFile = open(thisfname) - - print "Creating workspace with masking..." - datacardfile = folder+"/"+d+"/datacards/hhbbgg_13TeV_DataCard.txt" - combCommand = "text2workspace.py "+datacardfile+ " --channel-masks" -# os.system(combCommand) - print "Run combine for cat0 separately" - combCommand = "combine -M Asymptotic " + datacardfile.replace(".txt", ".root") + " --setPhysicsModelParameters mask_cat0=0,mask_cat1=1 >> " + thisfname.replace(".txt", "_cat0.txt") -# os.system(combCommand) - print "Run combine for cat1 separately" - combCommand = "combine -M Asymptotic " + datacardfile.replace(".txt", ".root") + " --setPhysicsModelParameters mask_cat0=1,mask_cat1=0 >> " + thisfname.replace(".txt", "_cat1.txt") -# os.system(combCommand) - - thisfnameCat0 = thisfname.replace(".txt", "_cat0.txt") - thisfnameCat1 = thisfname.replace(".txt", "_cat1.txt") - - cenVal = -1 - for line in limFile: - if "50.0%" in line: - cenVal = float(line.split(" < ")[1]) - centralVal.append( cenVal ) - if cenVal == -1: - print "CENTRAL VALUE NOT FOUND!" - sys.exit(2) - - cenVal0 = -1 - cat0file = open(thisfnameCat0) - for line in cat0file: - if "50.0%" in line: - cenVal0 = float(line.split(" < ")[1]) - centCat0.append( cenVal0 ) - if cenVal0 > Maximum: - Maximum = cenVal0 - if cenVal0 == -1: - print "CENTRAL VALUE NOT FOUND FOR CAT0!" - sys.exit(2) - - cenVal1 = -1 - cat1file = open(thisfnameCat1) - for line in cat1file: - if "50.0%" in line: - cenVal1 = float(line.split(" < ")[1]) - centCat1.append( cenVal1 ) - if cenVal1 > Maximum: - Maximum = cenVal1 - if cenVal1 == -1: - print "CENTRAL VALUE NOT FOUND FOR CAT1!" - sys.exit(2) - - limFile = open(thisfname) - zeros.append(0) - for line in limFile: - if "2.5%" in line: - val = cenVal - float(line.split(" < ")[1]) - s2_down.append( val ) - continue - if "16.0%" in line: - val = cenVal - float(line.split(" < ")[1]) - s1_down.append( val ) - continue - if "84.0%" in line: - val = float(line.split(" < ")[1]) - cenVal - s1_up.append( val ) - continue - if "97.5%" in line: - val = float(line.split(" < ")[1]) - cenVal - s2_up.append( val ) - if val > Maximum: - Maximum = val - continue - print s1_down, s2_down - gr_centralVal_1s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s1_down), array('d', s1_up)) - gr_centralVal_2s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s2_down), array('d', s2_up)) - - gr_cat0 = TGraph(len(massList), array('d', massList), array('d', centCat0)) - gr_cat1 = TGraph(len(massList), array('d', massList), array('d', centCat1)) - - gr_cat0.SetLineColor(kMagenta) - gr_cat1.SetLineColor(kCyan+2) - gr_cat0.SetLineWidth(4) - gr_cat1.SetLineWidth(4) - - leg = TLegend(0.4, 0.6, 0.9, 0.9) - #leg.SetFillStyle(0); - leg.SetLineWidth(0); - leg.SetBorderSize(0); - - c0 = TCanvas("c", "c", 800, 600) - c0.SetGrid() - c0.SetLogy() - gr_centralVal_2s.SetMaximum(Maximum*20) - gr_centralVal_2s.Draw("AP3") - gr_centralVal_2s.SetLineColor(0) - gr_centralVal_2s.SetFillColor(kGreen+1) - gr_centralVal_2s.SetLineWidth(4) - gr_centralVal_2s.SetTitle("") - gr_centralVal_2s.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s.GetXaxis().SetTitle("M(X, "+spin+") [GeV]") - gr_centralVal_2s.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH#rightarrowbb#gamma#gamma) [fb]") - c0.Update() - gr_centralVal_1s.Draw("3same") - gr_centralVal_1s.SetMarkerStyle(21) - gr_centralVal_1s.SetMarkerColor(kBlue+1) - gr_centralVal_1s.SetLineWidth(3) - gr_centralVal_1s.SetLineColor(kBlue+1) - gr_centralVal_1s.SetFillColor(kYellow) - c0.Update() - gr_centralVal_1s.Draw("XLsame") - sigma1 = gr_centralVal_1s.Clone() - sigma1.SetLineColor(0) - leg.AddEntry(gr_centralVal_1s, "Expected 95% upper limit", "l") - leg.AddEntry(gr_cat0, "Expected 95% upper limit from High Purity Cat.", "l") - leg.AddEntry(gr_cat1, "Expected 95% upper limit from Med. Purity Cat.", "l") - leg.AddEntry(sigma1, "Expected limit #pm 1#sigma", "f") - leg.AddEntry(gr_centralVal_2s, "Expected limit #pm 2#sigma", "f") - leg.Draw("same") - - gr_cat0.Draw("Lsame") - gr_cat1.Draw("Lsame") - - tlatex = TLatex() - tlatex.SetNDC() - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - c0.SaveAs(folder+"/ResPlot.pdf") - - gr_centralVal_1s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s1_down]), array('d', [i/2.6 for i in s1_up])) - gr_centralVal_2s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s2_down]), array('d', [i/2.6 for i in s2_up])) - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s_hh.SetMaximum(Maximum*2/2.6) - gr_centralVal_2s_hh.Draw("AP") - gr_centralVal_2s_hh.SetLineColor(kGreen+1) - gr_centralVal_2s_hh.SetLineWidth(4) - gr_centralVal_2s_hh.SetTitle("") - gr_centralVal_2s_hh.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s_hh.GetXaxis().SetTitle("Benchmark Points") - gr_centralVal_2s_hh.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH)/Br(HH#rightarrowbb#gamma#gamma) [pb]") - c0.Update() - gr_centralVal_1s_hh.Draw("EP") - gr_centralVal_1s_hh.SetMarkerStyle(21) - gr_centralVal_1s_hh.SetMarkerColor(kBlue+1) - gr_centralVal_1s_hh.SetLineWidth(5) - gr_centralVal_1s_hh.SetLineColor(kYellow) - - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - leg.Draw("same") - c0.SaveAs(folder+"/ResPlot_hh.pdf") - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/ResPlotter.py b/LimitSetting/scripts/ResPlotter.py deleted file mode 100644 index f228796..0000000 --- a/LimitSetting/scripts/ResPlotter.py +++ /dev/null @@ -1,180 +0,0 @@ -from ROOT import * -gROOT.SetBatch(True) -import sys, getopt, os -from array import array - -def main(argv): - folder = "" - lumi = "" - obs = 0 - try: - opts, args = getopt.getopt(argv,"f:l:o",["folder=", "lumi=", "observed"]) - except getopt.GetoptError: - print 'ResPlotter.py -f -l lumi' - sys.exit(2) - for opt, arg in opts: - if opt == "-f": - folder = arg - if opt == "-l": - lumi = arg - if opt == "-o": - obs = 1 - if folder == "": - print 'ResPlotter.py -f ' - sys.exit(2) - - if not os.path.isdir(folder): - print "FOLDER DOESN'T EXIST!" - sys.exit(2) - - dirs = os.listdir(folder) - massList = [] - centralVal = [] - s1_up = [] - s1_down = [] - s2_up = [] - s2_down = [] - zeros = [] - Maximum = 0 - observed = [] - for d in dirs: - isRad = 0 - isGrav = 0 - if "Radion" in d: - isRad = 1 - if "Graviton" in d: - isGrav = 1 - if isRad == 0 and isGrav == 0: - continue - ffold = "Radion_M" - if isGrav == 1: - ffold = "Graviton_M" - mass = int(d.replace(ffold, "")) - massList.append( mass ) - limFile = open(folder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - cenVal = -1 - for line in limFile: - if "50.0%" in line: - cenVal = float(line.split(" < ")[1]) - centralVal.append( cenVal ) - if cenVal == -1: - print "CENTRAL VALUE NOT FOUND!" - sys.exit(2) - limFile = open(folder+"/"+d+"/logs/higgsCombineTest.Asymptotic.mH125.0._m"+str(mass)+"_higgs.txt") - zeros.append(0) - for line in limFile: - if "Observed Limit: r <" in line: - val = float(line.split(" < ")[1]) - observed.append(val) - if "2.5%" in line: - val = cenVal - float(line.split(" < ")[1]) - s2_down.append( val ) - continue - if "16.0%" in line: - val = cenVal - float(line.split(" < ")[1]) - s1_down.append( val ) - continue - if "84.0%" in line: - val = float(line.split(" < ")[1]) - cenVal - s1_up.append( val ) - continue - if "97.5%" in line: - val = float(line.split(" < ")[1]) - cenVal - s2_up.append( val ) - if val > Maximum: - Maximum = val - continue - - gr_centralVal_1s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s1_down), array('d', s1_up)) - gr_centralVal_2s = TGraphAsymmErrors(len(massList), array('d', massList), array('d', centralVal), array('d', zeros), array('d', zeros), array('d', s2_down), array('d', s2_up)) - gr_observed = TGraph(len(massList), array('d', massList), array('d',observed)) - gr_observed.SetLineWidth(3) - gr_observed.SetLineColor(kBlack) - - print "Mass", "Expected", "Observed" - for jj,m in enumerate(massList): - if obs: print m, centralVal[jj], observed[jj] - if not obs: print m, centralVal[jj] - - leg = TLegend(0.65, 0.7, 0.89, 0.89) - leg.SetFillStyle(0); - leg.SetLineWidth(0); - leg.SetBorderSize(0); - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s.SetMaximum(Maximum*2) - gr_centralVal_2s.Draw("AP3") - gr_centralVal_2s.SetLineColor(0) - gr_centralVal_2s.SetFillColor(kGreen+1) - gr_centralVal_2s.SetLineWidth(4) - gr_centralVal_2s.SetTitle("") - gr_centralVal_2s.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s.GetXaxis().SetTitle("M(X) [GeV]") - gr_centralVal_2s.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH#rightarrowbb#gamma#gamma) [fb]") - c0.Update() - gr_centralVal_1s.Draw("3same") - gr_centralVal_1s.SetMarkerStyle(21) - gr_centralVal_1s.SetMarkerColor(kBlue+1) - gr_centralVal_1s.SetLineWidth(3) - gr_centralVal_1s.SetLineColor(kBlue+1) - gr_centralVal_1s.SetFillColor(kYellow) - c0.Update() - gr_centralVal_1s.Draw("XLsame") - sigma1 = gr_centralVal_1s.Clone() - sigma1.SetLineColor(0) - if(obs): gr_observed.Draw("Lsame") - if(obs): leg.AddEntry(gr_observed, "Observed 95% upper limit", "l") - leg.AddEntry(gr_centralVal_1s, "Expected 95% upper limit", "l") - leg.AddEntry(sigma1, "Expected limit #pm 1#sigma", "f") - leg.AddEntry(gr_centralVal_2s, "Expected limit #pm 2#sigma", "f") - leg.Draw("same") - - tlatex = TLatex() - tlatex.SetNDC() - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - c0.SaveAs(folder+"/ResPlot.pdf") - - gr_centralVal_1s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s1_down]), array('d', [i/2.6 for i in s1_up])) - gr_centralVal_2s_hh = TGraphAsymmErrors(len(massList), array('d', massList), array('d', [i/2.6 for i in centralVal]), array('d', zeros), array('d', zeros), array('d', [i/2.6 for i in s2_down]), array('d', [i/2.6 for i in s2_up])) - - c0 = TCanvas("c", "c", 800, 600) - gr_centralVal_2s_hh.SetMaximum(Maximum*2/2.6) - gr_centralVal_2s_hh.Draw("AP") - gr_centralVal_2s_hh.SetLineColor(kGreen+1) - gr_centralVal_2s_hh.SetLineWidth(4) - gr_centralVal_2s_hh.SetTitle("") - gr_centralVal_2s_hh.GetXaxis().SetLimits(massList[0] - 20, massList[len(massList)-1]+20) - gr_centralVal_2s_hh.GetXaxis().SetTitle("Benchmark Points") - gr_centralVal_2s_hh.GetYaxis().SetTitle("#sigma(pp#rightarrowX#rightarrowHH)/Br(HH#rightarrowbb#gamma#gamma) [pb]") - c0.Update() - gr_centralVal_1s_hh.Draw("EP") - gr_centralVal_1s_hh.SetMarkerStyle(21) - gr_centralVal_1s_hh.SetMarkerColor(kBlue+1) - gr_centralVal_1s_hh.SetLineWidth(5) - gr_centralVal_1s_hh.SetLineColor(kYellow) - - tlatex.SetTextAngle(0) - tlatex.SetTextColor(kBlack) - tlatex.SetTextFont(63) - tlatex.SetTextAlign(11) - tlatex.SetTextSize(25) - tlatex.DrawLatex(0.11, 0.91, "CMS") - tlatex.SetTextFont(53) - tlatex.DrawLatex(0.18, 0.91, "Preliminary") - tlatex.SetTextFont(43) - tlatex.DrawLatex(0.6, 0.91, "#sqrt{s} = 13 TeV, L = " + str(lumi) + " fb^{-1}") - leg.Draw("same") - c0.SaveAs(folder+"/ResPlot_hh.pdf") - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/LimitSetting/scripts/ResonantCrossSections.py b/LimitSetting/scripts/ResonantCrossSections.py deleted file mode 100644 index 8bf73be..0000000 --- a/LimitSetting/scripts/ResonantCrossSections.py +++ /dev/null @@ -1,27 +0,0 @@ -from ROOT import * -from array import array - -masses = [250, 260, 300, 400, 500, 600, 700, 750, 800, 900] - -#k/pl = 0.5 -grav = [1e-8, 5.35e-02, 1.06e+00, 1.81e+00, 9.58e-01, 4.47e-01, 2.21e-01, 1.59e-01, 1.17e-01, 6.36e-02] -#k/pl = 1.0 -grav2 = [4*x for x in grav] - -gr_grav = TGraph(len(masses), array('d', masses), array('d', grav2)) - -#LR = 3 TeV -#rad = [6.7, 6.62e+00, 6.17e+00, 2.53e+00, 1.30e+00, 7.87e-01, 5.06e-01, 4.11e-01, 3.40e-01, 2.34e-01] -#LR = 1 TeV -rad = [60, 5.96e+01, 5.56e+01, 2.28e+01, 1.17e+01, 7.08e+00, 4.55e+00, 3.70e+00, 3.06e+00, 2.10e+00] - -gr_rad = TGraph(len(masses), array('d', masses), array('d', rad)) - -gr_grav.SetLineColor(kRed) -gr_grav.SetLineStyle(2) -gr_grav.SetLineWidth(3) - -gr_rad.SetLineColor(kRed) -gr_rad.SetLineStyle(2) -gr_rad.SetLineWidth(3) - diff --git a/LimitSetting/Models/HighMassResDatacardModel.txt b/Models/HighMassResDatacardModel.txt similarity index 100% rename from LimitSetting/Models/HighMassResDatacardModel.txt rename to Models/HighMassResDatacardModel.txt diff --git a/LimitSetting/Models/LowMassResDatacardModel.txt b/Models/LowMassResDatacardModel.txt similarity index 100% rename from LimitSetting/Models/LowMassResDatacardModel.txt rename to Models/LowMassResDatacardModel.txt diff --git a/LimitSetting/Models/NonResDatacardModel.txt b/Models/NonResDatacardModel.txt similarity index 100% rename from LimitSetting/Models/NonResDatacardModel.txt rename to Models/NonResDatacardModel.txt diff --git a/LimitSetting/Models/NonResDatacardModel_2.txt b/Models/NonResDatacardModel_2.txt similarity index 100% rename from LimitSetting/Models/NonResDatacardModel_2.txt rename to Models/NonResDatacardModel_2.txt diff --git a/LimitSetting/Models/NonResDatacardModel_HM.txt b/Models/NonResDatacardModel_HM.txt similarity index 100% rename from LimitSetting/Models/NonResDatacardModel_HM.txt rename to Models/NonResDatacardModel_HM.txt diff --git a/LimitSetting/Models/NonResDatacardModel_HM_wHiggs.txt b/Models/NonResDatacardModel_HM_wHiggs.txt similarity index 67% rename from LimitSetting/Models/NonResDatacardModel_HM_wHiggs.txt rename to Models/NonResDatacardModel_HM_wHiggs.txt index 0fa845a..ed9d6cd 100644 --- a/LimitSetting/Models/NonResDatacardModel_HM_wHiggs.txt +++ b/Models/NonResDatacardModel_HM_wHiggs.txt @@ -41,7 +41,8 @@ process 0 1 2 3 4 5 6 0 1 2 3 4 5 6 rate SIGCAT0 1 GGHC0 TTHC0 VHC0 BBHC0 VBFC0 SIGCAT1 1 GGHC1 TTHC1 VHC1 BBHC1 VBFC1 # General -lumi_13TeV lnN 1.027 - 1.027 1.027 1.027 1.027 1.027 1.027 - 1.027 1.027 1.027 1.027 1.027 +lumi_13TeV lnN 1.025 - 1.025 1.025 1.025 1.025 1.025 1.025 - 1.025 1.025 1.025 1.025 1.025 + #Normalization CMS_eff_DiphoTrig lnN 1.020 - 1.020 1.020 1.020 1.020 1.020 1.020 - 1.020 1.020 1.020 1.020 1.020 CMS_eff_PhoID lnN 1.010 - 1.010 1.010 1.010 1.010 1.010 1.010 - 1.010 1.010 1.010 1.010 1.010 @@ -49,37 +50,25 @@ CMS_eff_JetSel lnN 1.005 - 1.005 1.005 1.005 1.005 1.005 CMS_eff_mxCat lnN 0.995/1.005 - 0.995/1.005 0.995/1.005 0.995/1.005 0.995/1.005 0.995/1.005 1.005/0.995 - 0.995/1.005 - 0.995/1.005 0.995/1.005 0.995/1.005 0.995/1.005 0.995/1.005 1.005/0.995 CMS_eff_cats lnN 1.05/0.95 - 1.05/0.95 1.05/0.95 1.05/0.95 1.05/0.95 1.05/0.95 0.98/1.02 - 0.98/1.02 0.98/1.02 0.98/1.02 0.98/1.02 0.98/1.02 - -# General -#lumi_13TeV lnN 1.027 - 1.027 1.027 1.027 1.027 1.027 1.027 - 1.027 1.027 1.027 1.027 1.027 -#Normalization -#CMS_eff_DiphoTrig lnN 1.020 - 1.020 1.020 1.020 1.020 1.020 1.020 - 1.020 1.020 1.020 1.020 1.020 -#CMS_eff_PhoID lnN 1.010 - 1.010 1.010 1.010 1.010 1.010 1.010 - 1.010 1.010 1.010 1.010 1.010 -#CMS_eff_JetSel lnN 1.030 - 1.030 1.030 1.030 1.030 1.030 1.030 - 1.030 1.030 1.030 1.030 1.030 -#CMS_eff_cats lnN 1.045/0.955 - 1.045/0.955 1.045/0.955 1.045/0.955 1.045/0.955 1.045/0.955 0.99/1.01 - 0.99/1.01 0.99/1.01 0.99/1.01 0.99/1.01 0.99/1.01 - #Shape - -CMS_hgg_sig_m0_absShift_cat2 param 1 0.01 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) -CMS_hgg_sig_sigmaScale_cat2 param 1 0.01 # optimistic estimate of resolution uncertainty +CMS_hgg_sig_m0_absShift_cat2 param 1 0.005 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) +CMS_hgg_sig_sigmaScale_cat2 param 1 0.05 # optimistic estimate of resolution uncertainty CMS_hbb_sig_m0_absShift_cat2 param 1 0.01 # displacement of the dijet mean error CMS_hbb_sig_sigmaScale_cat2 param 1 0.05 # optimistic estimate of resolution uncertainty -CMS_hgg_sig_m0_absShift_cat3 param 1 0.01 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) -CMS_hgg_sig_sigmaScale_cat3 param 1 0.01 # optimistic estimate of resolution uncertainty +CMS_hgg_sig_m0_absShift_cat3 param 1 0.005 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) +CMS_hgg_sig_sigmaScale_cat3 param 1 0.05 # optimistic estimate of resolution uncertainty CMS_hbb_sig_m0_absShift_cat3 param 1 0.01 # displacement of the dijet mean error CMS_hbb_sig_sigmaScale_cat3 param 1 0.05 # optimistic estimate of resolution uncertainty -#CMS_hbb_sig_m0_absShift param 1 0.02 # displacement of the dijet mean error -#CMS_hbb_sig_sigmaScale param 1 0.08 # optimistic estimate of resolution uncertainty - #Curve Normalization params CMS_Bkg_cat2_norm flatParam # Normalization uncertainty on background slope CMS_Bkg_cat3_norm flatParam # Normalization uncertainty on background slope #Higgs TH -theory lnN - - 1.039 - - - - - - 1.039 - - - - -PDF_as lnN - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 -QCD_scale lnN - - - 0.918/1.058 0.969/1.038 - 1.021 - - - 0.918/1.058 0.969/1.038 - 1.021 +theory_ggHN3LO lnN - - 1.039 - - - - - - 1.039 - - - - +pdf lnN - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 +QCD_scale lnN - - - 0.918/1.058 0.969/1.038 - 1.021 - - - 0.918/1.058 0.969/1.038 - 1.021 +theory_bbH_scale lnN - - - - - 0.76/1.20 - - - - - - 0.76/1.20 - #Curve Shape params CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat2 flatParam diff --git a/LimitSetting/Models/NonResDatacardModel_LM.txt b/Models/NonResDatacardModel_LM.txt similarity index 100% rename from LimitSetting/Models/NonResDatacardModel_LM.txt rename to Models/NonResDatacardModel_LM.txt diff --git a/LimitSetting/Models/NonResDatacardModel_LM_wHiggs.txt b/Models/NonResDatacardModel_LM_wHiggs.txt similarity index 68% rename from LimitSetting/Models/NonResDatacardModel_LM_wHiggs.txt rename to Models/NonResDatacardModel_LM_wHiggs.txt index 29fa0a6..226660d 100644 --- a/LimitSetting/Models/NonResDatacardModel_LM_wHiggs.txt +++ b/Models/NonResDatacardModel_LM_wHiggs.txt @@ -41,7 +41,8 @@ process 0 1 2 3 4 5 6 0 1 2 3 4 5 6 rate SIGCAT0 1 GGHC0 TTHC0 VHC0 BBHC0 VBFC0 SIGCAT1 1 GGHC1 TTHC1 VHC1 BBHC1 VBFC1 # General -lumi_13TeV lnN 1.027 - 1.027 1.027 1.027 1.027 1.027 1.027 - 1.027 1.027 1.027 1.027 1.027 +lumi_13TeV lnN 1.025 - 1.025 1.025 1.025 1.025 1.025 1.025 - 1.025 1.025 1.025 1.025 1.025 + #Normalization CMS_eff_DiphoTrig lnN 1.020 - 1.020 1.020 1.020 1.020 1.020 1.020 - 1.020 1.020 1.020 1.020 1.020 CMS_eff_PhoID lnN 1.010 - 1.010 1.010 1.010 1.010 1.010 1.010 - 1.010 1.010 1.010 1.010 1.010 @@ -49,35 +50,25 @@ CMS_eff_JetSel lnN 1.005 - 1.005 1.005 1.005 1.005 1.005 CMS_eff_mxCat lnN 1.005/0.995 - 1.005/0.995 1.005/0.995 1.005/0.995 1.005/0.995 1.005/0.995 1.005/0.995 - 1.005/0.995 - 1.005/0.995 1.005/0.995 1.005/0.995 1.005/0.995 1.005/0.995 0.995/0.995 CMS_eff_cats lnN 1.05/0.95 - 1.05/0.95 1.05/0.95 1.05/0.95 1.05/0.95 1.05/0.95 0.98/1.02 - 0.98/1.02 0.98/1.02 0.98/1.02 0.98/1.02 0.98/1.02 -# General -#lumi_13TeV lnN 1.027 - 1.027 1.027 1.027 1.027 1.027 1.027 - 1.027 1.027 1.027 1.027 1.027 -#Normalization -#CMS_eff_DiphoTrig lnN 1.020 - 1.020 1.020 1.020 1.020 1.020 1.020 - 1.020 1.020 1.020 1.020 1.020 -#CMS_eff_PhoID lnN 1.010 - 1.010 1.010 1.010 1.010 1.010 1.010 - 1.010 1.010 1.010 1.010 1.010 -#CMS_eff_JetSel lnN 1.030 - 1.030 1.030 1.030 1.030 1.030 1.030 - 1.030 1.030 1.030 1.030 1.030 -#CMS_eff_cats lnN 1.045/0.955 - 1.045/0.955 1.045/0.955 1.045/0.955 1.045/0.955 1.045/0.955 0.99/1.01 - 0.99/1.01 0.99/1.01 0.99/1.01 0.99/1.01 0.99/1.01 - #Shape -CMS_hgg_sig_m0_absShift_cat0 param 1 0.01 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) -CMS_hgg_sig_sigmaScale_cat0 param 1 0.01 # optimistic estimate of resolution uncertainty +CMS_hgg_sig_m0_absShift_cat0 param 1 0.005 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) +CMS_hgg_sig_sigmaScale_cat0 param 1 0.05 # optimistic estimate of resolution uncertainty CMS_hbb_sig_m0_absShift_cat0 param 1 0.01 # displacement of the dijet mean error CMS_hbb_sig_sigmaScale_cat0 param 1 0.05 # optimistic estimate of resolution uncertainty -CMS_hgg_sig_m0_absShift_cat1 param 1 0.01 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) -CMS_hgg_sig_sigmaScale_cat1 param 1 0.01 # optimistic estimate of resolution uncertainty +CMS_hgg_sig_m0_absShift_cat1 param 1 0.005 # displacement of the dipho mean error = sqrt(0.4^ 2 + 0.2^ 2) +CMS_hgg_sig_sigmaScale_cat1 param 1 0.05 # optimistic estimate of resolution uncertainty CMS_hbb_sig_m0_absShift_cat1 param 1 0.01 # displacement of the dijet mean error -CMS_hbb_sig_sigmaScale_cat1 param 1 0.05 # optimistic estimate of resolution uncertainty - -#CMS_hbb_sig_m0_absShift param 1 0.02 # displacement of the dijet mean error -#CMS_hbb_sig_sigmaScale param 1 0.08 # optimistic estimate of resolution uncertainty +CMS_hbb_sig_sigmaScale_cat1 param 1 0.05 # optimistic estimate of resolution uncertainty #Curve Normalization params CMS_Bkg_cat0_norm flatParam # Normalization uncertainty on background slope CMS_Bkg_cat1_norm flatParam # Normalization uncertainty on background slope #Higgs TH -theory lnN - - 1.039 - - - - - - 1.039 - - - - -PDF_as lnN - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 -QCD_scale lnN - - - 0.918/1.058 0.969/1.038 - 1.021 - - - 0.918/1.058 0.969/1.038 - 1.021 +theory_ggHN3LO lnN - - 1.039 - - - - - - 1.039 - - - - +pdf lnN - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 - - 1.032 1.036 1.016 0.76/1.20 0.997/1.004 +QCD_scale lnN - - - 0.918/1.058 0.969/1.038 - 1.021 - - - 0.918/1.058 0.969/1.038 - 1.021 +theory_bbH_scale lnN - - - - - 0.76/1.20 - - - - - - 0.76/1.20 - #Curve Shape params CMS_hhbbgg_13TeV_mgg_bkg_slope1_cat0 flatParam diff --git a/LimitSetting/Models/models_2D_dcb.rs b/Models/models_2D_dcb.rs similarity index 100% rename from LimitSetting/Models/models_2D_dcb.rs rename to Models/models_2D_dcb.rs diff --git a/LimitSetting/Models/models_2D_higgs.rs b/Models/models_2D_higgs.rs similarity index 100% rename from LimitSetting/Models/models_2D_higgs.rs rename to Models/models_2D_higgs.rs diff --git a/LimitSetting/Models/models_2D_higgs_mjj70.rs b/Models/models_2D_higgs_mjj70.rs similarity index 97% rename from LimitSetting/Models/models_2D_higgs_mjj70.rs rename to Models/models_2D_higgs_mjj70.rs index d03a673..f49e901 100644 --- a/LimitSetting/Models/models_2D_higgs_mjj70.rs +++ b/Models/models_2D_higgs_mjj70.rs @@ -139,17 +139,17 @@ CMS_hhbbgg_13TeV_mjj_bkg_slope3[0.5,-10000, 10000]; CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat0[0.5,-10000, 10000]; CMS_hhbbgg_13TeV_mjj_bkg_slope3_cat1[0.5,-10000, 10000]; -mjj_hig_slope1_ggh_cat0[0.1, -1000, 1000]; -mjj_hig_slope2_ggh_cat0[0.1, -1000, 1000]; -mjj_hig_slope3_ggh_cat0[0.1, -1000, 1000]; +mjj_hig_slope1_ggh_cat0[0.1, 0, 10]; +mjj_hig_slope2_ggh_cat0[0.1, 0, 10]; +mjj_hig_slope3_ggh_cat0[0.1, 0, 10]; mjj_hig_slope1_ggh_cat1[0.1, -1000, 1000]; mjj_hig_slope2_ggh_cat1[0.1, -1000, 1000]; mjj_hig_slope3_ggh_cat1[0.1, -1000, 1000]; -mjj_hig_slope1_vbf_cat0[0.1, -1000, 1000]; -mjj_hig_slope2_vbf_cat0[0.1, -1000, 1000]; -mjj_hig_slope3_vbf_cat0[0.1, -1000, 1000]; +mjj_hig_slope1_vbf_cat0[0.1, 0, 10]; +mjj_hig_slope2_vbf_cat0[0.1, 0, 10]; +mjj_hig_slope3_vbf_cat0[0.1, 0, 10]; mjj_hig_slope1_vbf_cat1[0.1, -1000, 1000]; mjj_hig_slope2_vbf_cat1[0.1, -1000, 1000]; diff --git a/NonRes.json b/NonRes.json deleted file mode 100644 index f13e60f..0000000 --- a/NonRes.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - - "LTDIR" : "/src/HiggsAnalysis/bbggLimits/LMCleaningPt25_LTrees/LT_NonRes_LClean_MVAHMC0985_HMC1750__TYPE", - - "signal" : { - "types" : ["HighMass", "LowMass"], - "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/models_2D_dcb.rs" - }, - "other" : { - - "doDoubleSidedCB": 1, - "Combinelxbatch" : 1, - "version" : 66, - "integratedLumi" : 36.5, - "energy" : "13TeV", - "higgsMass" : 125.0, - "addHiggs" : 0, - "doBlinding" : 0, - "doBands" : 0, - "ncat" : 2, - "analysisType" : "fitTo2D_resSearch_withRegKinFit", - "doSingleLimit" : 1, - "drawSignalFit" : 1, - "drawBackgroundFit" : 0, - "useSigTheoryUnc" : 0, - "doBrazilianFlag" : false, - "runCombine" :true, - "combineOption" : 2, - "minMggMassFit" : 100, - "maxMggMassFit" : 180, - "minMjjMassFit" : 60, - "maxMjjMassFit" : 180, - "minSigFitMgg" :115, - "maxSigFitMgg" :135, - "minSigFitMjj" :60, - "maxSigFitMjj" :180, - "minHigMggFit" :115, - "maxHigMggFit" :135, - "minHigMjjFit":60, - "maxHigMjjFit":180, - "HH":false, - "base":true, - "low":false, - "obs":false, - "twotag":false, - "doBias":false, - "biasConfig": "BiasStudies/ForBias.json" - - }, - "data" : { - "name" :"DoubleEG" - }, - "higgs" : { - "type" : ["ggh_m125_powheg_8TeV","tth_m125_8TeV"] - } -} diff --git a/README.md b/README.md index da191ca..d11d768 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ git clone https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsA cd HiggsAnalysis/CombinedLimit git fetch origin git checkout v6.3.1 -scramv1 b clean; scramv1 b # always make a clean build, as scram doesn't always see updates to src/LinkDef.h +scramv1 b clean +scramv1 b ``` #### Step 2: Get HH support stuff @@ -26,15 +27,15 @@ scramv1 b clean; scramv1 b # always make a clean build, as scram doesn't always ``` cd ${CMSSW_BASE}/src/ git clone git@github.com:cms-hh/HHStatAnalysis.git -scramv1 b HHStatAnalysis/AnalyticalModels #only build whats needed, no need Harvester (will keep complaining, though. If you want to compile the full HHStatAnalysis, also get CombineHarvester package.) +scramv1 b HHStatAnalysis/AnalyticalModels cd ${CMSSW_BASE}/src/HHStatAnalysis git clone git@github.com:cms-hh/Support.git ``` -#### Step 3: Get bbggTools +#### Step 3: Get bbggLimits code ``` cd ${CMSSW_BASE}/src/HiggsAnalysis/ -git clone -b dev-rafael-May8 git@github.com:ResonantHbbHgg/bbggLimits.git +git clone git@github.com:ResonantHbbHgg/bbggLimits.git cd ${CMSSW_BASE}/src/HiggsAnalysis/bbggLimits/ scramv1 b # a lot of complaints about bbggHighMassFitter.cc (this is not used anymore, needs to be deleted) ``` @@ -49,41 +50,23 @@ makeAllTrees.py -x nonres [--NRW] ### Working examples -Make non-res shape benchmark points trees (MVA based with 400 Mhh threshold): +Make non-res shape benchmark points trees (MVA based with 350 M(HH) threshold): ``` -makeAllTrees.py -x nonres \ --d /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/Regression_Data/Hadd \ --s /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/Regression_Signal/Hadd/ \ --f LT_NonRes_MVABased400Reg_ \ ---doCatMVA --MVAHMC0 0.960 --MVAHMC1 0.6 --MVALMC0 0.96 --MVALMC1 0.750 --massNR 400 +makeAllTrees.py -x nonres -f LT_OutDir \ +--doCatMVA --MVAHMC0 0.970 --MVAHMC1 0.600 --MVALMC0 0.985 --MVALMC1 0.600 --massNR 350 --LMLJBTC 0.55 --LMSJBTC 0.55 ``` - -Make non-res shape benchmark points trees (cut based with 400 Mhh threshold and cut on cos theta star): +You can aslo provide the locations of the flat trees if they are not the ones hardcoded in +the script, via `-s`, `-d`, `-b` options. For example, to make the trees from single H, use: ``` -makeAllTrees.py -x nonres \ --d /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/newData_HHTagger/Hadd \ --s /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/Signal_HHTagger400/Hadd/ \ --f LT_NonRes_CatBased400CTS_ --massNR 400 --ctsCut 0.8 -``` - -Make resonant limit trees with low mass categorization: -``` -makeAllTrees.py -x res \ --d /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/newData_HHTagger/Hadd \ --s /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/Signal_HHTagger400/Hadd/ \ --f LT_ResLMnW -``` - -Make resonant limit trees with high mass categorization: -``` -makeAllTrees.py -x res \ --d /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/newData_HHTagger/Hadd \ --s /afs/cern.ch/work/r/rateixei/work/DiHiggs/flashgg_Moriond17/CMSSW_8_0_25/src/flashgg/bbggTools/test/RunJobs/Signal_HHTagger400/Hadd/ \ --f LT_ResHM --highMassRes -``` +makeAllTrees.py -x nonres -f LT_OutDir -s FlatT_SignalDir -d 0 \ +--doCatMVA --MVAHMC0 0.970 --MVAHMC1 0.600 --MVALMC0 0.985 --MVALMC1 0.600 --massNR 350 --doSMHiggs --LMLJBTC 0.55 --LMSJBTC 0.55 --genDiPhotonFilte +``` + +In order to re-produce the limit trees used for EPS17 results, follow instructions in +[SmartScripts/README.md](SmartScripts/README.md). -### Details +#### Details The *C++ Loop* code to produce the Limit Trees is located at *src/bbggLTMaker.cc*. In order to run it over a single tree use the python script *scripts/pyLimitTreeMaker.py*, which exists in the @@ -98,26 +81,39 @@ where `fileName.root` is a an input Flat tree to be run over, and `pyLimitTreeMaker.py` and runs it over many input files. -More options for the `pyLimitTreeMaker.py` can be specified: -* `-f ` or `-i ` -* `-o ` - directory will be created. -* `--min `, `--max ` -* `--scale ` - scale; should be 1 for data. -* `--photonCR` - do photon control region. -* `--KF` - use Mtot_KF to cut on mass window. -* `--MX` - use MX to cut on mass window; choose either `--MX` or `--KF`!. -* `--tilt` - select tilted mass window. -* `--doNoCat` - no categorization, all is *cat0*. -* `--btagWP ` - set btagging working point for categories. -* `--doCatMixed` - do categories with mixed btagging; Cat0: 2>low, Cat1: 1high -* `--singleCat` - only one category, High Mass analysis. -* `--doBVariation ` - apply b-tagging SF factors: 0, 1 or -1. -* `--doPhoVariation ` - Apply photon SF factors: 0, 1 or -1. -* `--cosThetaStar ` - cut on CosTheta Star variable - - -### Set the Limits -In order to reporduce EPS17 results, follow instructions here: -https://github.com/ResonantHbbHgg/bbggLimits/blob/master/SmartScripts/README.md +More options for the `pyLimitTreeMaker.py` can be specified, +as can be seen [directly in the code](https://github.com/ResonantHbbHgg/bbggLimits/blob/10c319b013134e5bb15a561557f960dc2f1ea6b2/scripts/pyLimitTreeMaker.py#L11-L85) + +### Set the Limits +Once the limit trees are produced, we would like to make the 2D fits in +(m(gg), m(bb)) plane, for each category, and then run the limits. + +The main functions to do the fits are implemented in `src/bbgg2DFitter.cc`. The python +scripts are needed to handle many different situations (resonant, non-resonant, +re-weighting to various benchmark points, etc.). In order to run just one limit you need +`scripts/pyLimits.py`. Minimal options for the *SM* point are: +``` +pyLimits.py -f conf_NonRes_EPS17.json -o outputDirName --nodes SM +``` + +The above command must be run on _lxplus_, because the input root files are located on EOS +(the path is specified in json config file). +The `pyLimits.py` script would call _runFullChain()_ method which is implemented in +`python/LimitsUtil.py`. So in fact, the [LimitsUtil.py](python/LimitsUtil.py) script is +the base code which interacts with the functions in `bbgg2DFitter.cc`. +Using the `--nodes SM` option tells it to use the Limit Tree produced from a single SM MC +sample. Alternatively, one can do the re-weighting of the merged non-resonant +samples and therefore increase the statistics of the SM signal. Analytical re-weighting was used for EPS17 results of 2016 data. +Run it like so: +``` +pyLimits.py -f conf_NonRes_EPS17.json -o outputDirName --analyticalRW +``` + +In case of problems it's useful to increase verbosity level with `-v 1(2,3)` option. In this case the logs should be found in your `/tmp/username/logs` and in the _master_ log, `outputDirName/mainLog_date-time.log` + +The above command should give you the limits identical to +[the ones on SVN](https://svnweb.cern.ch/cern/wsvn/cmshcg/trunk/cadi/HIG-17-008/NonResonant/Benchmarks/CombinedCard_Node_SMkl1p0_kt1p0_cg0p0_c20p0_c2g0p0/result_2_L_CombinedCard_Node_SMkl1p0_kt1p0_cg0p0_c20p0_c2g0p0.log). +In order to reporduce the rest of _EPS17_ results, follow the instructions here: +[SmartScripts/README.md](SmartScripts/README.md) Good luck! diff --git a/Res.json b/Res.json deleted file mode 100644 index 4021ec0..0000000 --- a/Res.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - - "LTDIR" : "/src/HiggsAnalysis/bbggLimits/LT_Res_MVA_Radion", - - "signal" : { - "types" : ["Radion"], - "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/models_2D_dcb.rs" - }, - "other" : { - - "doDoubleSidedCB": 1, - "Combinelxbatch" : 0, - "version" : 66, - - "integratedLumi" : 36.5, - "energy" : "13TeV", - "higgsMass" : 125.0, - "addHiggs" : 0, - "doBlinding" : 0, - "doBands" : 0, - "ncat" : 2, - "analysisType" : "fitTo2D_resSearch_withRegKinFit", - "doSingleLimit" : 0, - "drawSignalFit" : 0, - "drawBackgroundFit" : 0, - "useSigTheoryUnc" : 0, - "doBrazilianFlag" : false, - - "runCombine" : false, - "combineOption" : 2, - - "minMggMassFit" : 100, - "maxMggMassFit" : 180, - "minMjjMassFit" : 60, - "maxMjjMassFit" : 180, - "minSigFitMgg" :115, - "maxSigFitMgg" :135, - "minSigFitMjj" :60, - "maxSigFitMjj" :180, - "minHigMggFit" :115, - "maxHigMggFit" :135, - "minHigMjjFit":60, - "maxHigMjjFit":180, - "HH":false, - "base":true, - "low":false, - "obs":false, - "twotag":false, - "doBias":1, - "biasConfig": "BiasStudies/ForBias.json" - - }, - "data" : { - "name" :"DoubleEG_M-MASS" - }, - "higgs" : { - "type" : ["ggh_m125_powheg_8TeV","tth_m125_8TeV"] - } -} diff --git a/SmartScripts/README.md b/SmartScripts/README.md index 20a8668..e8540ee 100644 --- a/SmartScripts/README.md +++ b/SmartScripts/README.md @@ -1,5 +1,8 @@ # Steps for full analysis +In order to reproduce exactly the results put out for EPS-2017, checkout the *v2.1-goodbye-rafael* tag of this repository. +Set up the environment from the main [README.md](README.md), then follow instructions below. + ## Nonresonant Analysis #### 1) Make limit trees diff --git a/conf_NonRes_EPS17.json b/conf_NonRes_EPS17.json new file mode 100644 index 0000000..db14302 --- /dev/null +++ b/conf_NonRes_EPS17.json @@ -0,0 +1,57 @@ + +{ + "LTDIR" : "/store/group/phys_higgs/resonant_HH/RunII/LimitTrees/ForApproval_2016/LT_350_HMHPC_970_HMMPC_600_LMHPC_985_LMMPC_600_TYPE", + "signal" : { + "types" : ["HighMass", "LowMass"], + "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/Models/models_2D_higgs_mjj70.rs" + }, + "other" : { + "doDoubleSidedCB": 1, + "Combinelxbatch" : 0, + "energy" : "13TeV", + "higgsMass" : 125.0, + "addHiggs" : 1, + "doBlinding" : 0, + "doBands" : 0, + "ncat" : 2, + "doSingleLimit" : 0, + "drawSignalFit" : 0, + "drawBackgroundFit" : 0, + "useSigTheoryUnc" : 0, + "doBrazilianFlag" : false, + "runCombine" :true, + "combineOption" : 2, + "minMggMassFit" : 100, + "maxMggMassFit" : 180, + "minMjjMassFit" : 70, + "maxMjjMassFit" : 190, + "minSigFitMgg" :115, + "maxSigFitMgg" :135, + "minSigFitMjj" :70, + "maxSigFitMjj" :190, + "minHigMggFit" :115, + "maxHigMggFit" :135, + "minHigMjjFit":70, + "maxHigMjjFit":190, + "HH":false, + "base":true, + "low":false, + "obs":false, + "twotag":false, + "doBias":false, + "biasConfig": "BiasStudies/ForBias.json" + + }, + "data" : { + "name" :"DoubleEG" + }, + "higgs" : { + "type" : { + "vbf": "VBFHToGG_M-125_13TeV_powheg_pythia8", + "bbh": "bbHToGG_M-125_13TeV_amcatnlo", + "ggh": "GluGluHToGG_M-125_13TeV_powheg_pythia8", + "tth": "ttHToGG_M125_13TeV_powheg_pythia8_v2", + "vh" : "VHToGG_M125_13TeV_amcatnloFXFX_madspin_pythia8" + } + } +} diff --git a/interface/BrazilianFlag.h b/interface/BrazilianFlag.h deleted file mode 100644 index 2d3b7c3..0000000 --- a/interface/BrazilianFlag.h +++ /dev/null @@ -1,6 +0,0 @@ - -#ifndef BrazilianFlag_h -#define BrazilianFlag_h -#include - void BrazilianFlag(std::string path_dir,bool HH=false,bool base=true,bool low=false,bool obs=false,bool twobtag=false,std::string energy="8",float lumi=13.9); -#endif diff --git a/interface/Colors.h b/interface/Colors.h deleted file mode 100644 index 1169b5f..0000000 --- a/interface/Colors.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef COLORS_H -#define COLORS_H - -#include -const std::string rouge="\033[31m"; -const std::string red=rouge; -const std::string blanc="\033[39m"; -const std::string white=blanc; -const std::string normal=blanc; -const std::string vert="\033[32m"; -const std::string green=vert; -const std::string jaune="\033[33m"; -const std::string yellow=jaune; -const std::string bleu="\033[34m"; -const std::string blue=bleu; -const std::string magenta="\033[35m"; -const std::string cyan="\033[36m"; -const std::string gris="\033[37m"; -const std::string grey=gris; -#endif diff --git a/interface/bbgg2DFitter.h b/interface/bbgg2DFitter.h index 09a47d9..e183075 100644 --- a/interface/bbgg2DFitter.h +++ b/interface/bbgg2DFitter.h @@ -129,30 +129,29 @@ class bbgg2DFitter { void SetVerbosityLevel(Int_t v) {_verbLvl=v;} void SetCut(TString cut) {_cut = cut;} void SetType(std::string tp) { _signalType = tp; } - RooArgSet* defineVariables(); //DONE - int AddSigData(float mass, TString signalfile); //DONE - std::vector AddHigData(float mass, TString signalfile, int higgschannel, TString higName); //DONE - void AddBkgData(TString datafile); //DONE - void SigModelFit(float mass); //DONE - void HigModelFit(float mass, int higgschannel, TString higName); //DONE - RooFitResult* BkgModelFit(Bool_t m,bool h); //DONE + RooArgSet* defineVariables(bool s); + int AddSigData(float mass, TString signalfile); + std::vector AddHigData(float mass, TString signalfile, int higgschannel, TString higName); + void AddBkgData(TString datafile); + void SigModelFit(float mass); + void HigModelFit(float mass, int higgschannel, TString higName); + RooFitResult* BkgModelFit(Bool_t m,bool h); RooFitResult* BkgModelFit(Bool_t m,bool h,std::vectorhiggstrue,std::maphiggsNumber) { - return BkgModelFit(m, h);} //DONE - void MakePlots(float mass); //DONE + return BkgModelFit(m, h);} + void MakePlots(float mass); void SetFitStrategy( int st) { _fitStrategy = st; } void MakePlotsHiggs(float mass); void MakePlotsHiggs(float mass,std::vectorhiggstrue,std::maphiggsNumber) { MakePlotsHiggs(mass);} - void MakeSigWS(std::string filename); //DONE - void MakeHigWS(std::string filename, int higgschannel, TString higName); //DONE - void MakeBkgWS(std::string filename); //DONE + void MakeSigWS(std::string filename); + void MakeHigWS(std::string filename, int higgschannel, TString higName); + void MakeBkgWS(std::string filename); void MakeFitsForBias(std::string biasConfig, std::string outputFile); void DoARW() {_doARW = 1;} - // const char* filenameh0, const char* filenameh1, const char* filenameh2, const char* filenameh4); - void SetConstantParams(const RooArgSet* params); //DONE - void PrintWorkspace();// {_w->Print("v");} - TStyle * style(); //DONE + void SetConstantParams(const RooArgSet* params); + void PrintWorkspace(); + TStyle * style(); void SetSigExpectedCats(int cat, float expec) { if(sigExpec.find(cat) != sigExpec.end() ){std::cout << "[SetSigExpectedCats] Cat already set!" << std::endl;} else { sigExpec[cat] = expec; }} void SetBkgExpectedCats(int cat, float expec) { diff --git a/interface/bbggHighMassFitter.h b/interface/bbggHighMassFitter.h deleted file mode 100644 index 36dd8ec..0000000 --- a/interface/bbggHighMassFitter.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef bbggHighMassFitter_h -#define bbggHighMassFitter_h - -// C++ headers -//#include -//#include -#include -//#include -// ROOT headers -#include -#include -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -class bbggHighMassFitter { -public : - //parameters - Int_t _NCAT; - Double_t _MMIN /*= 1000.*/; - Double_t _MMAX /*= 3000*/; - std::string _filePOSTfix/*=""*/; - double _analysisLumi /*= 2.1977*/; // Luminosity you use in your analysis - double _nEventsInSignalMC /*= 0.*/; //number of events in Signal MC sample - int _iGraviton /*= 0*/; - TString _mainCut/*("1")*/; - double _signalScaler/*=0*/;//analysisLumi/nEventsInSignalMC; // assume signal cross section on 1/fb - double _scaleFactorHP/*=1*/;// already done on 1 GeV Histo level - double _scaleFactorLP/*=1*/;// already done on 1 GeV Histo level - RooWorkspace* _w; - std::string _folder_name; - void Initialize(RooWorkspace* w,Double_t MMIN,Double_t MMAX,std::string filePOSTfix,double analysisLumi,double nEventsInSignalMC,int iGraviton,TString mainCut,double signalScaler,double scaleFactorHP, double scaleFactorLP,std::string folder_name,Int_t NCAT); - bbggHighMassFitter() {} - virtual ~bbggHighMassFitter(); - RooArgSet* defineVariables(); - void AddSigData(Float_t, int, std::vector); - void AddBkgData(std::vector); - void SigModelFit(Float_t, TString signalname, std::vector); - void BkgModelFit(Bool_t, std::vector, RooFitResult** fitresults); - void MakePlots(Float_t, RooFitResult** , TString signalname, std::vector); - void MakeSigWS(const char* filename, TString signalname, std::vector); - void MakeBkgWS(const char* filename, std::vector); - void SetConstantParams(const RooArgSet* params); - void MakeDataCard_1Channel(const char* fileBaseName, const char* fileBkgName, int iChan, TString signalname, int signalsample, std::vector cat_names, double mass); - //Double_t effSigma(TH1 *hist); - TStyle * style(); //DONE - //ClassDef(bbggHighMassFitter,0); -}; - -#endif - diff --git a/interface/bbggLTMaker.h b/interface/bbggLTMaker.h index a6e0fdf..b2398e9 100644 --- a/interface/bbggLTMaker.h +++ b/interface/bbggLTMaker.h @@ -92,7 +92,6 @@ public : int photonCR; int doKinFit; int doMX; - int tilt; int doNoCat; int doCatNonRes; int doCatLowMass; @@ -104,7 +103,6 @@ public : int doNonResWeights; int photonCRNormToSig; int GenDiPhotonFilter; - double tiltWindow; double massThreshold; bool isCustMVA; bool isRes; @@ -268,7 +266,6 @@ public : void SetMin( double par ) { mtotMin = par; } void IsMX( int par ) { doMX = par; } void IsKinFit( int par ) { doKinFit = par; } - void SetTilt( int par ) { tilt = par;} //normalization void SetNormalization(double norm, double norm2=1) { normalization = norm; normalizationNR = norm2;} //categorization diff --git a/python/CombineUtils.py b/python/CombineUtils.py index 90445a6..a7a34b1 100644 --- a/python/CombineUtils.py +++ b/python/CombineUtils.py @@ -74,7 +74,6 @@ def runCombineOnLXBatch(inDir, doBlind, log, combineOpt=1, Label=None): return __BAD__ print "im here9" - print "im here9" cardName = inDir+"/hhbbgg_13TeV_DataCard.txt" resFile = inDir+"/result_"+str(combineOpt) @@ -96,7 +95,7 @@ def runCombineOnLXBatch(inDir, doBlind, log, combineOpt=1, Label=None): cd CMSSWBASE/src/HiggsAnalysis/bbggLimits/ eval `scramv1 runtime -sh` -mkdir /tmp/USER/LABELP/ +mkdir -p /tmp/USER/LABELP/ cd /tmp/USER/LABELP/ combine -M COMBINEMETHOD -m 125 LABEL BLINDED --datacard CARDNAME > RESFILE 2>&1 diff --git a/python/DataCardUtils.py b/python/DataCardUtils.py index 67389b1..90b06e2 100644 --- a/python/DataCardUtils.py +++ b/python/DataCardUtils.py @@ -4,9 +4,9 @@ def DataCardMaker_wHiggs(Folder, nCats, signalExp, observed, higgsExp, HType): if HType=="HighMass": - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/NonResDatacardModel_HM_wHiggs.txt' + inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/Models/NonResDatacardModel_HM_wHiggs.txt' else: - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/NonResDatacardModel_LM_wHiggs.txt' + inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/Models/NonResDatacardModel_LM_wHiggs.txt' inputDatacard = open(inputDatacardName, 'r') outputDatacard = open(Folder+'/datacards/hhbbgg_13TeV_DataCard.txt', 'w') @@ -41,11 +41,11 @@ def DataCardMaker(Folder, nCats, signalExp, observed, isRes = 0, HType=0): sys.exit(2) if nCats == 2: - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/LowMassResDatacardModel.txt' + inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/Models/LowMassResDatacardModel.txt' if isRes == 0 and HType=="HighMass": - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/NonResDatacardModel_HM.txt' + inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/Models/NonResDatacardModel_HM.txt' if isRes == 0 and HType=="LowMass": - inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/NonResDatacardModel_LM.txt' + inputDatacardName = os.getenv("CMSSW_BASE")+'/src/HiggsAnalysis/bbggLimits/Models/NonResDatacardModel_LM.txt' inputDatacard = open(inputDatacardName, 'r') outputDatacard = open(Folder+'/datacards/hhbbgg_13TeV_DataCard.txt', 'w') diff --git a/python/DefineScans.py b/python/DefineScans.py index acd4da5..42a62ef 100644 --- a/python/DefineScans.py +++ b/python/DefineScans.py @@ -34,6 +34,6 @@ klJHEP = [1.0, 7.5, 1.0, 1.0, -3.5, 1.0, 2.4, 5.0, 15.0, 1.0, 10.0, 2.4, 15.0, 0.0] ktJHEP = [1.0, 1.0, 1.0, 1.0, 1.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.5, 1.0, 1.0, 1.0] -c2JHEP = [0.0, -1.0, 0.5, -1.5, -3.0, 0.0, 0.0, 0.0, 0.0, 1.0, -1.0, 0.0, 1.0, 0.0] cgJHEP = [0.0, 0.0, -0.8, 0.0, 0.0, 0.8, 0.2, 0.2, -1.0, -0.6, 0.0, 1.0, 0.0, 0.0] +c2JHEP = [0.0, -1.0, 0.5, -1.5, -3.0, 0.0, 0.0, 0.0, 0.0, 1.0, -1.0, 0.0, 1.0, 0.0] c2gJHEP = [0.0, 0.0, 0.6, -0.8, 0.0, -1.0, -0.2, -0.2, 1.0, 0.6, 0.0, -1.0, 0.0, 0.0] diff --git a/python/LimitsUtil.py b/python/LimitsUtil.py index 3ebd79b..2f21e35 100755 --- a/python/LimitsUtil.py +++ b/python/LimitsUtil.py @@ -3,7 +3,6 @@ import logging from shutil import copy from pprint import pformat -# import pebble as pb from multiprocessing import Pool, TimeoutError, current_process from HiggsAnalysis.bbggLimits.DataCardUtils import * from HiggsAnalysis.bbggLimits.IOUtils import * @@ -11,63 +10,16 @@ from HiggsAnalysis.bbggLimits.AnalyticalReweighting import * from os import listdir from os.path import isfile, join +import getpass +__username__ = getpass.getuser() __BAD__ = 666 - def printTime(t1, t2, log): tNew = time.time() log.debug('Time since start of worker: %.2f sec; since previous point: %.2f sec' %(tNew-t2,tNew-t1)) return tNew -###### -###### -def runCombine(inDir, doBlind, log, combineOpt = 1, Combinelxbatch = 0, Label = None): - log.info('Running combine tool. Dir: %s Blinded: %r', inDir, doBlind) - log.debug('inDir should be the immediate directory where the card is located') - if Combinelxbatch: - runCombineOnLXBatch(inDir, doBlind, log, combineOpt, Label) - return - - if doBlind and combineOpt!=3: - # In HybridNew this option does not work - blinded = "--run blind" - else: - blinded = '' - - if combineOpt==1: - combineMethod = 'Asymptotic' - elif combineOpt==2: - combineMethod = 'Asymptotic --X-rtd TMCSO_AdaptivePseudoAsimov=50' - elif combineOpt==3: - combineMethod = 'HybridNew --testStat=LHC --frequentist' - else: - log.error('This option is not supported: %r', combineOpt) - return __BAD__ - - - cardName = inDir+"/hhbbgg_13TeV_DataCard.txt" - resFile = inDir+"/result_"+str(combineOpt)+".log" - - - command1 = ' '.join(['combine -M', combineMethod,'-m 125 -n',Label,blinded,cardName,">",resFile,"2>&1"]) - log.info('Combine command we run:\n%s', command1) - - combExitCode = os.system(command1) - - if combineOpt in [1,2]: - fName = 'higgsCombine'+Label+'.Asymptotic.mH125.root' - elif combineOpt in [3]: - fName = 'higgsCombine'+Label+'.HybridNew.mH125.root' - - outDir = inDir - os.rename(fName, outDir+'/'+fName.replace('.root', '_%i.root'%combineOpt)) - - return combExitCode - -###### -###### - def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): #print 'Running: ', sys._getframe().f_code.co_name, " Node=",point @@ -82,11 +34,13 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): logLvl = logging.DEBUG LTDir_type = os.getenv("CMSSW_BASE")+Params['LTDIR'] - if '/tmp' in Params['LTDIR'] or '/store' in Params['LTDIR']: + if '/tmp' in Params['LTDIR'] or '/store' in Params['LTDIR'] or '/afs' in Params['LTDIR']: LTDir_type = Params['LTDIR'] - print LTDir_type + if '/store' in Params['LTDIR']: + LTDir_type = 'root://eoscms//eos/cms'+Params['LTDIR'] + signalModelCard = os.getenv("CMSSW_BASE")+Params['signal']['signalModelCard'] - lumi = Params['other']["integratedLumi"]; + lumi = 35.87 # Only used for plot produced by bbgg2Dfitter energy = str(Params['other']["energy"]) mass = Params['other']["higgsMass"] addHiggs = Params['other']["addHiggs"] @@ -99,7 +53,6 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): drawSignalFit = Params['other']['drawSignalFit'] doCombine = Params['other']["runCombine"] useSigTheoryUnc = Params['other']["useSigTheoryUnc"] - analysisType = Params['other']["analysisType"] HH = Params['other']["HH"] base = Params['other']["base"] low = Params['other']["low"] @@ -127,6 +80,8 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): if point!=None and NRgridPoint!=-1: print 'WARning: cannot have both the Node and grid Point. Chose one and try again' return __BAD__ + elif opt.analyticalRW==True: + Label = "_ARW_" elif point!=None: Label = "_Node_"+str(point) elif NRgridPoint!=-1: @@ -135,6 +90,8 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): print 'WARning: using list of nodes from the json input file' return __BAD__ + print "Label=",Label + sigCat = 0 isRes = 0 if point==None: @@ -154,12 +111,12 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): if opt.outDir: - baseFolder="./"+opt.outDir+"_v"+str(Params['other']["version"]) + baseFolder="./"+opt.outDir else: - baseFolder="./bbggToolsResults_v"+str(Params['other']["version"]) + baseFolder="./bbggToolsResults" # Create PID file to track the job: - pidfile = "/tmp/PIDs/PoolWorker"+Label+".pid" + pidfile = "/tmp/"+__username__+"/PIDs/PoolWorker"+Label+".pid" file(pidfile, 'w').write(str(PID)) procName = current_process().name @@ -167,7 +124,7 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): logging.basicConfig(level=logLvl, format='%(asctime)s PID:%(process)d %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M', - filename='/tmp/logs/processLog_'+str(procName)+'.log', + filename='/tmp/'+__username__+'/logs/processLog_'+str(procName)+'.log', filemode='w') except: print 'I got excepted!' @@ -223,24 +180,24 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): theFitter.SetVerbosityLevel(opt.verb) -# if opt.analyticalRW == True: -# theFitter.DoARW() + # if opt.analyticalRW == True: + # theFitter.DoARW() if 'HighMass' in t: theFitter.SetNCat0(2) else: theFitter.SetNCat0(0) - print 'Using Double Sided Crystal Ball as Signal Model:',doDoubleSidedCB + if opt.verb>0: + procLog.info('Using Double Sided Crystal Ball as Signal Model: %r', doDoubleSidedCB) if doDoubleSidedCB: theFitter.UseDoubleSidedCB() LTDir = LTDir_type.replace('TYPE', t) - onlyfiles = [fff for fff in listdir(LTDir) if isfile(join(LTDir, fff))] - print 'Files in ', LTDir - print onlyfiles mass = 125.0 - + if opt.verb>0: + procLog.info('Signal File:\n'+LTDir+thisSignalFile) + openStatus = theFitter.AddSigData( mass, str(LTDir+thisSignalFile)) if openStatus==-1: procLog.error('There is a problem with openStatus') @@ -266,14 +223,15 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): if opt.verb>0: p4 = printTime(p3,start,procLog) if addHiggs: - procLog.debug('Here will add SM Higgs contributions') higTypes = Params['higgs']['type'] - print 'Higgs types:', higTypes + if opt.verb>1: + procLog.debug('Here will add SM Higgs contributions \n Higgs types: '+ pformat(higTypes)) higgsExp = {} for iht,HT in enumerate(higTypes): higgsExp[HT] = [0,0] ht = higTypes[HT] - print ht, HT + if opt.verb>1: + procLog.debug('iht = %r, ht = %r, HT = %r' % (iht,ht,HT)) higFileName = str(LTDir)+"/LT_output_"+str(ht)+".root" exphig = theFitter.AddHigData( mass,higFileName,iht, str(HT)) @@ -282,7 +240,8 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): higgsExp[HT] = [exphig[0], exphig[1]] - print "Done SM Higgs bzz" + if opt.verb>1: + procLog.debug("Done SM Higgs bzz") ddata = str(LTDir + '/LT_'+dataName+'.root') ddata = ddata.replace("MASS", str(point)) @@ -302,7 +261,7 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): return __BAD__ if opt.verb>1: - fitresults.Print() + procLog.debug("\n Fit Results: \n\n"+pformat(fitresults.Print())) wsFileBkgName = "hhbbgg.inputbkg_13TeV" theFitter.MakeBkgWS( wsFileBkgName); @@ -319,10 +278,7 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): procLog.info("\t BIAS FITS DONE. Node=%r, GridPoint=%r, type=%r", point,NRgridPoint,t) if opt.verb>0: p7 = printTime(p6,start,procLog) - # This is making cards ala 8 TeV. We don't need this for now - #theFitter.MakeDataCard( fileBaseName, wsFileBkgName, useSigTheoryUnc) - #print "\t 8TeV DATACARD DONE" - print "IM HERE" + print PID, "IM HERE" sigExp = [] bkgObs = [] @@ -343,7 +299,7 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): sigExpStr += "," bkgObsStr += "," - print "IM HERE2" + print PID, "IM HERE2" # Make datacards: myLoc = os.getenv("CMSSW_BASE") + '/src/HiggsAnalysis/bbggLimits/'+newFolder @@ -354,17 +310,17 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): procLog.info("\t DATACARD DONE. Node/Mass=%r, GridPoint=%r, type=%r", point,NRgridPoint,t) if opt.verb>0: p8 = printTime(p7,start,procLog) - print "IM HERE3" + print PID, "IM HERE3" # Limits by type: if doSingleLimit or isRes: - print "IM HERE4" + print PID, "IM HERE4" if doCombine: - print "IM HERE5" + print PID, "IM HERE5" if Combinelxbatch: - print "IM HERE6" + print PID, "IM HERE6" runCombineOnLXBatch(myLoc+"/datacards/", doBlinding, procLog, combineOpt, t+Label) else: - print "IM HERE7" + print PID, "IM HERE7" runCombine(newFolder+"/datacards/", doBlinding, procLog, combineOpt, Combinelxbatch, t+Label) @@ -405,7 +361,7 @@ def runFullChain(opt, Params, point=None, NRgridPoint=-1, extraLabel=''): if doCombine: if Combinelxbatch: - print "IM HERE6" + print PID, "IM HERE6" myLoc = os.getenv("CMSSW_BASE") + '/src/HiggsAnalysis/bbggLimits/' + newDir runCombineOnLXBatch(myLoc+"/", doBlinding, procLog, combineOpt, "CombinedCard"+Label) else: diff --git a/scripts/MakeBenchmarksPlot.py b/scripts/MakeBenchmarksPlot.py index 4461ff3..ac749b5 100644 --- a/scripts/MakeBenchmarksPlot.py +++ b/scripts/MakeBenchmarksPlot.py @@ -15,7 +15,7 @@ parser.add_argument("--unblind", dest="unblind", action='store_true', default=False) opt = parser.parse_args() -outfile = TFile(opt.out, 'RECREATE') +#outfile = TFile(opt.out+'.root', 'RECREATE') myLineHeight = 0.02 myLineWidth = 0.05 @@ -30,30 +30,28 @@ for ii in xrange(0, len(klJHEP)): -# for ikt in scan['kt']: -# for cg in scan['cg']: -# for c2 in scan['c2']: -# for c2g in scan['c2g']: - - kl = klJHEP[ii] - kt = ktJHEP[ii] - c2 = c2JHEP[ii] - cg = cgJHEP[ii] - c2g = c2gJHEP[ii] - - nodename = 'kl'+str(kl).replace('.', 'p').replace('-', 'm') + '_kt' + str(kt).replace('.', 'p').replace('-', 'm') + '_cg'+ str(cg).replace('.', 'p').replace('-', 'm') + '_c2' + str(c2).replace('.', 'p').replace('-', 'm') + '_c2g' + str(c2g).replace('.', 'p').replace('-', 'm') - name = opt.f + '/CombinedCard_Node_SM'+nodename + '/higgsCombineCombinedCard_Node_SM' + nodename + '.Asymptotic.mH125.root' - print name - rfile = TFile(name, 'READ') - if rfile.IsZombie(): continue - tree = rfile.Get("limit") - if tree == None or tree.GetEntriesFast() < 1: continue - for qt in quantiles: - tree.Draw("limit", "quantileExpected>"+str(float(qt)-0.001) + ' && quantileExpected < ' +str(float(qt)+0.001), "goff") - lims[qt].append(tree.GetV1()[0]) - rfile.Close() - -print plots + kl = klJHEP[ii] + kt = ktJHEP[ii] + c2 = c2JHEP[ii] + cg = cgJHEP[ii] + c2g = c2gJHEP[ii] + + #nodename = 'Node_SM'+'_'.join(['kl'+str(kl), 'kt' + str(kt), 'cg'+ str(cg), 'c2' + str(c2), 'c2g' + str(c2g)]).replace('.', 'p').replace('-', 'm') + nodename = "_".join(['ARW','kl'+str(kl), 'kt' + str(kt), 'cg'+ str(cg), 'c2' + str(c2), 'c2g' + str(c2g)]).replace('.', 'p').replace('-', 'm') + name = opt.f + '/CombinedCard_'+nodename + '/higgsCombineCombinedCard_' + nodename + '.Asymptotic.mH125.root' + + print name + + rfile = TFile(name, 'READ') + if rfile.IsZombie(): continue + tree = rfile.Get("limit") + if tree == None or tree.GetEntriesFast() < 1: continue + for qt in quantiles: + tree.Draw("limit", "quantileExpected>"+str(float(qt)-0.001) + ' && quantileExpected < ' +str(float(qt)+0.001), "goff") + lims[qt].append(tree.GetV1()[0]) + rfile.Close() + print 'Expected limit at r=0.5: ', lims['0.500'] + # print plots h1 = TH1F('h1', '', 14, 0.5, 14.5) h1.GetXaxis().SetTitle("Shape benchmark hypothesis") @@ -67,7 +65,7 @@ if ib == 13: ibin = 14 for qt in quantiles: - print lims['-1'] + # print lims['-1'] if '-1' in qt: plots[qt].SetPoint(ib, ibin, lims['-1'][ib]) else: @@ -168,6 +166,9 @@ c0.SaveAs(opt.out+"NonResPlot.pdf") c0.SaveAs(opt.out+"NonResPlot.png") + +plots['0.500'].Print("all") + sys.exit() ''' diff --git a/scripts/RunnerOfLimitsCustom.py b/scripts/RunnerOfLimitsCustom.py deleted file mode 100644 index a030428..0000000 --- a/scripts/RunnerOfLimitsCustom.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -import os,sys -import argparse -parser = argparse.ArgumentParser(description='Limit Tree maker') -parser.add_argument("--dirname", dest="dirname", default="900", type=str) -opt = parser.parse_args() - -tempfile= ''' -{ - "LTDIR" : "/src/HiggsAnalysis/bbggLimits/DIRNAME_TYPE", - "signal" : { - "types" : ["HighMass", "LowMass"], - "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/models_2D_higgs.rs" - }, - "other" : { - "doDoubleSidedCB": 1, - "Combinelxbatch" : 1, - "version" : 66, - "integratedLumi" : 36.5, - "energy" : "13TeV", - "higgsMass" : 125.0, - "addHiggs" : 1, - "doBlinding" : 0, - "doBands" : 0, - "ncat" : 2, - "analysisType" : "fitTo2D_resSearch_withRegKinFit", - "doSingleLimit" : 1, - "drawSignalFit" : 0, - "drawBackgroundFit" : 0, - "useSigTheoryUnc" : 0, - "doBrazilianFlag" : false, - "runCombine" :true, - "combineOption" : 2, - "minMggMassFit" : 100, - "maxMggMassFit" : 180, - "minMjjMassFit" : 60, - "maxMjjMassFit" : 180, - "minSigFitMgg" :115, - "maxSigFitMgg" :135, - "minSigFitMjj" :60, - "maxSigFitMjj" :180, - "minHigMggFit" :115, - "maxHigMggFit" :135, - "minHigMjjFit":60, - "maxHigMjjFit":180, - "HH":false, - "base":true, - "low":false, - "obs":false, - "twotag":false, - "doBias":false, - "biasConfig": "BiasStudies/ForBias.json" - - }, - "data" : { - "name" :"DoubleEG" - }, - "higgs" : { - "type" : { - "vbf": "VBFHToGG_M-125_13TeV_powheg_pythia8", - "bbh": "bbHToGG_M-125_13TeV_amcatnlo", - "ggh": "GluGluHToGG_M-125_13TeV_powheg_pythia8", - "tth": "ttHToGG_M125_13TeV_powheg_pythia8_v2", - "vh" : "VHToGG_M125_13TeV_amcatnloFXFX_madspin_pythia8" - } - } -} -''' - -jsonname = "json_"+opt.dirname+".json" -outfile = open(jsonname, "w+") -towrite = tempfile.replace("DIRNAME", opt.dirname) -outfile.write(towrite) -outfile.close() -command = "pyLimits.py -f " + jsonname + " -o LIMS_"+opt.dirname+" --nodes SM --overwrite -j 1 --extraLabel "+opt.dirname+" -v 5" -print command -os.system(command) diff --git a/scripts/RunnerOfLimitsCustom_mjj70.py b/scripts/RunnerOfLimitsCustom_mjj70.py index 44c5221..a6030d0 100644 --- a/scripts/RunnerOfLimitsCustom_mjj70.py +++ b/scripts/RunnerOfLimitsCustom_mjj70.py @@ -17,12 +17,11 @@ "LTDIR" : "DIRLOC/DIRNAME_TYPE", "signal" : { "types" : SIGTYPES, - "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/models_2D_higgs_mjj70.rs" + "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/Models/models_2D_higgs_mjj70.rs" }, "other" : { "doDoubleSidedCB": 1, "Combinelxbatch" : 1, - "version" : 66, "integratedLumi" : 36.5, "energy" : "13TeV", "higgsMass" : 125.0, @@ -30,14 +29,13 @@ "doBlinding" : 0, "doBands" : 0, "ncat" : 2, - "analysisType" : "fitTo2D_resSearch_withRegKinFit", - "doSingleLimit" : 1, + "doSingleLimit" : 0, "drawSignalFit" : 0, "drawBackgroundFit" : 0, "useSigTheoryUnc" : 0, "doBrazilianFlag" : false, "runCombine" :true, - "combineOption" : 2, + "combineOption" : 1, "minMggMassFit" : 100, "maxMggMassFit" : 180, "minMjjMassFit" : 70, @@ -79,7 +77,8 @@ jsonname = opt.jsonname sigTypes = '["HighMass", "LowMass"]' -toRun = '--nodes SM' +toRun = '' +#toRun = '--nodes SM' addHiggs = '1' rMass = '' if '-10' not in opt.mass: diff --git a/scripts/RunnerOfResonantLimitsCustom.py b/scripts/RunnerOfResonantLimitsCustom.py index 6c280d8..bcc4bff 100644 --- a/scripts/RunnerOfResonantLimitsCustom.py +++ b/scripts/RunnerOfResonantLimitsCustom.py @@ -12,7 +12,7 @@ "LTDIR" : "/src/HiggsAnalysis/bbggLimits/DIRNAME", "signal" : { "types" : ["Radion"], - "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/LimitSetting/Models/models_2D_higgs.rs" + "signalModelCard" : "/src/HiggsAnalysis/bbggLimits/Models/models_2D_higgs.rs" }, "other" : { "doDoubleSidedCB": 1, diff --git a/scripts/draw2DScan.py b/scripts/draw2DScan.py deleted file mode 100755 index 4f94289..0000000 --- a/scripts/draw2DScan.py +++ /dev/null @@ -1,546 +0,0 @@ -#! /bin/env python - -# Making various plots given the input limits -# This script is kindly provided by Olivier Bondu -# -# USAGE: ./draw2DScan.py limits_grid.json lambda yt -o out2Ddraw -# -# -# NOTE: You may need to run a setup script to get missing python packages. -# The script should be in the current directory. Run like this: -# source setup_for_2Dlimits.sh - -import os, sys, argparse -import copy -import json -import numpy as np -import matplotlib as mpl -import matplotlib.pyplot as plt -import matplotlib.patches as mpatches -import matplotlib.lines as mlines -import matplotlib.transforms as mtransforms -import matplotlib.path as mpath -import matplotlib.contour as mcontour - -import HiggsAnalysis.bbggLimits.ParametersGrid as pg - -# To Do: incorparate style file in here -# import cp3_llbb.CommonTools.CMSStyle as CMSStyle - -#os.system('source setup_for_2Dlimits.sh') - -class EmptyHandle(object): - """ - A dummy class representing a empty Handle in the legend - """ - pass - -class EmptyHandleHandler(object): - """ - A Legend handler for EmptyHandle - """ - - def legend_artist(self, legend, orig_handle, - fontsize, handlebox): - """ - Set handlebox width at 0 and return a dummy artist - - Parameters - ---------- - legend : :class:`matplotlib.legend.Legend` instance - The legend for which these legend artists are being created. - orig_handle : :class:`matplotlib.artist.Artist` or similar - The object for which these legend artists are being created. - fontsize : float or int - The fontsize in pixels. The artists being created should - be scaled according to the given fontsize. - handlebox : :class:`matplotlib.offsetbox.OffsetBox` instance - The box which has been created to hold this legend entry's - artists. Artists created in the `legend_artist` method must - be added to this handlebox inside this method. - """ - - handlebox.set_width(0) - - artist = mlines.Line2D([], [], visible=False) - - handlebox.add_artist(artist) - - return artist - -## Matplotlib hack -# Override algorithm in matplotlib.contour to check if the contour label is not overlaid by one of our point - -def locate_label(self, linecontour, labelwidth): - """ - Find a good place to plot a label (relatively flat - part of the contour). - """ - - nsize = len(linecontour) - - # SB: Always cut the contour line in 50 segments - # if labelwidth > 1: - # xsize = int(np.ceil(nsize / labelwidth)) - # else: - # xsize = 1 - - xsize = 50 - - if xsize == 1: - ysize = nsize - else: - ysize = int(labelwidth) - - XX = np.resize(linecontour[:, 0], (xsize, ysize)) - YY = np.resize(linecontour[:, 1], (xsize, ysize)) - # I might have fouled up the following: - yfirst = YY[:, 0].reshape(xsize, 1) - ylast = YY[:, -1].reshape(xsize, 1) - xfirst = XX[:, 0].reshape(xsize, 1) - xlast = XX[:, -1].reshape(xsize, 1) - s = (yfirst - YY) * (xlast - xfirst) - (xfirst - XX) * (ylast - yfirst) - L = np.sqrt((xlast - xfirst) ** 2 + (ylast - yfirst) ** 2).ravel() - dist = np.add.reduce(([(abs(s)[i] / L[i]) for i in range(xsize)]), -1) - x, y, ind = self.get_label_coords(dist, XX, YY, ysize, labelwidth) - - # There must be a more efficient way... - lc = [tuple(l) for l in linecontour] - dind = lc.index((x, y)) - - return x, y, dind - -def too_close(self, x, y, lw): - "Return *True* if a label is already near this location." - - global ax - - # SB: check if the label is close to a point - all_points = [ - (data['observed_allowed_x'], data['observed_allowed_y']), - (data['observed_excluded_x'], data['observed_excluded_y']), - (data['expected_allowed_x'], data['expected_allowed_y']), - (data['expected_excluded_x'], data['expected_excluded_y']) - ] - - t = ax.transData - - for points in all_points: - for loc in zip(*points): - loc = t.transform(loc) - d = np.sqrt((x - loc[0]) ** 2 + (y - loc[1]) ** 2) - if d < 1 * lw: - return True - - return False - -# Change the two matplotlib fuctions to ours -mcontour.ContourLabeler.locate_label = locate_label -mcontour.ContourLabeler.too_close = too_close - -def getHalfDiamondPath(invert=False): - t = mtransforms.Affine2D().translate(-0.5, -0.5).rotate_deg(45).scale(1.1, 1.2) - - # Half square - vertices = [ - [0.0, 0.0], [1.0, 0.0], - [1.0, 0.5], [0.0, 0.5], - [0.0, 0.0] - ] - - codes = [ - mpath.Path.MOVETO, mpath.Path.LINETO, - mpath.Path.LINETO, mpath.Path.LINETO, - mpath.Path.CLOSEPOLY, - ] - - p = mpath.Path(vertices, codes) - - if invert: - t.rotate_deg(180) - - return t.transform_path(p) - -def getDiamondPath(): - t = mtransforms.Affine2D().translate(-0.5, -0.5).rotate_deg(45).scale(1.1, 1.2) - - # Full square - vertices = [ - [0.0, 0.0], [1.0, 0.0], - [1.0, 1.0], [0.0, 1.0], - [0.0, 0.0] - ] - - codes = [ - mpath.Path.MOVETO, mpath.Path.LINETO, - mpath.Path.LINETO, mpath.Path.LINETO, - mpath.Path.CLOSEPOLY, - ] - - p = mpath.Path(vertices, codes) - - return t.transform_path(p) - - -# Options - -parser = argparse.ArgumentParser(description='Draw comparison of expected limits for all clusters & MVA') -parser.add_argument('input', action='store', type=str, help='JSON file containing the limits for all the points') -parser.add_argument('-o', '--output', action='store', type=str, help='Output directory', required=True) -parser.add_argument('-u', '--unblind', action='store_true', dest='unblind', help='If set, draw also observed upper limits') -parser.add_argument('-r', '--rescale-to-hh-br', action='store_true', dest='rescale_to_hh', help='If set, limits are rescaled to the HH BR') -parser.add_argument('--no-latex', action='store_true', dest='no_latex', help='Do not create LaTeX table of limits') - -parser.add_argument('x', action='store', type=str, help='X parameter') -parser.add_argument('y', action='store', type=str, help='Y parameter') - -parser.add_argument('--lambda', action='store', type=float, dest='kl', default=1, help='default value for k_l') -parser.add_argument('--yt', action='store', type=float, dest='yt', default=1, help='default value for k_t') -parser.add_argument('--c2', action='store', type=float, dest='c2', default=0, help='default value for c2') -parser.add_argument('--cg', action='store', type=float, dest='cg', default=0, help='default value for cg') -parser.add_argument('--c2g', action='store', type=float, dest='c2g', default=0, help='default value for c2g') - -parser.add_argument('--pdf', action='store_true', dest='pdf', default=False, help='Make PDF images as well') - -options = parser.parse_args() - -limits = None -with open(options.input) as f: - limits = json.load(f) - -parameters = ['lambda', 'yt', 'c2', 'cg', 'c2g'] - -default_values = { - "lambda": 1, - "yt": 1, - "c2": 0, - "cg": 0, - "c2g": 0 - } - -parameter_values = { - 'lambda': options.kl, - 'yt': options.yt, - 'c2': options.c2, - 'cg': options.cg, - 'c2g': options.c2g - } - -parameter_position = { - 'lambda': 0, - 'yt': 1, - 'c2': 2, - 'cg': 3, - 'c2g': 4 - } - -parameter_legend = { - 'lambda': r'\kappa_\lambda', - 'yt': r'\kappa_t', - 'c2': r'c_2', - 'cg': r'c_g', - 'c2g': r'c_{2g}' - } - -if not options.x in parameters: - raise Exception("Invalid X parameter") - -if not options.y in parameters: - raise Exception("Invalid Y parameter") - -fixed_parameters = parameters[:] -fixed_parameters.remove(options.x) -fixed_parameters.remove(options.y) - -def filterPoints(x, filt=None): - global fixed_parameters, parameter_values - - for p in fixed_parameters: - if x[p] != parameter_values[p]: - return False - - return True - -points = pg.getPoints(filterPoints) - -print points - -br = 0.26 / 100. - -data = {} -has_SM = False -sm_observed_excluded = False -sm_expected_excluded = False - -for point in points: - - # print("Working on point %d" % point) - - is_SM = False - if point == 324: - has_SM = True - is_SM = True - - all_x = data.setdefault('all_x', []) - all_y = data.setdefault('all_y', []) - - observed_allowed_x = data.setdefault('observed_allowed_x', []) - observed_allowed_y = data.setdefault('observed_allowed_y', []) - expected_allowed_x = data.setdefault('expected_allowed_x', []) - expected_allowed_y = data.setdefault('expected_allowed_y', []) - - observed_excluded_x = data.setdefault('observed_excluded_x', []) - observed_excluded_y = data.setdefault('observed_excluded_y', []) - expected_excluded_x = data.setdefault('expected_excluded_x', []) - expected_excluded_y = data.setdefault('expected_excluded_y', []) - - expected = data.setdefault('expected', []) - # Index 0 is DOWN error, index 1 is UP error - one_sigma = data.setdefault('one_sigma', [[], []]) - two_sigma = data.setdefault('two_sigma', [[], []]) - observed = data.setdefault('observed', []) - - if not str(point) in limits: - continue - - params = pg.getParametersFromPoint(point) - - point = str(point) - - expected.append(limits[point]['expected']) - observed.append(limits[point].get('observed', 0)) - - # UP error - one_sigma[1].append(limits[point]['one_sigma'][1]) - # DOWN error - one_sigma[0].append(limits[point]['one_sigma'][0]) - - # UP error - two_sigma[1].append(limits[point]['two_sigma'][1]) - two_sigma[0].append(limits[point]['two_sigma'][0]) - - x_value = params[parameter_position[options.x]] - y_value = params[parameter_position[options.y]] - - xs, down, up = pg.getCrossSectionForParameters(*params) - if is_SM: - if observed[-1] < (xs * br) : - sm_observed_excluded = True - - if expected[-1] < (xs * br) : - sm_expected_excluded = True - - else: - if observed[-1] < (xs * br) : - observed_excluded_x.append(x_value) - observed_excluded_y.append(y_value) - else: - observed_allowed_x.append(x_value) - observed_allowed_y.append(y_value) - - if expected[-1] < (xs * br) : - expected_excluded_x.append(x_value) - expected_excluded_y.append(y_value) - else: - expected_allowed_x.append(x_value) - expected_allowed_y.append(y_value) - - all_x.append(x_value) - all_y.append(y_value) - -data['expected'] = np.asarray(data['expected']) -data['observed'] = np.asarray(data['observed']) -data['one_sigma'] = np.asarray(data['one_sigma']) -data['two_sigma'] = np.asarray(data['two_sigma']) - -data['observed_allowed_x'] = np.asarray(data['observed_allowed_x']) -data['observed_allowed_y'] = np.asarray(data['observed_allowed_y']) -data['expected_allowed_x'] = np.asarray(data['expected_allowed_x']) -data['expected_allowed_y'] = np.asarray(data['expected_allowed_y']) -data['observed_excluded_x'] = np.asarray(data['observed_excluded_x']) -data['observed_excluded_y'] = np.asarray(data['observed_excluded_y']) -data['expected_excluded_x'] = np.asarray(data['expected_excluded_x']) -data['expected_excluded_y'] = np.asarray(data['expected_excluded_y']) - -if options.rescale_to_hh: - data['expected'] /= br - data['observed'] /= br - data['one_sigma'] /= br - data['two_sigma'] /= br - -# CMSStyle.changeFont() - -# Create a figure instance -fig = plt.figure(1, figsize=(7, 7), dpi=80) - -# Create an axes instance -ax = fig.add_subplot(111) - -ax.set_ylabel('$%s$' % parameter_legend[options.y], fontsize='x-large', y=0.85) -ax.set_xlabel('$%s$' % parameter_legend[options.x], fontsize='x-large', x=0.85, labelpad=-2) -ax.margins(0.1, 0.1) - -fig.tight_layout() - -# ax.set_autoscale_on(False) - -# Create isoline of cross-sections - -xmin, xmax = min(data['all_x']), max(data['all_x']) -# padding = (xmax - xmin) * 0.1 -# xmin -= padding -# xmax += padding - -ymin, ymax = min(data['all_y']), max(data['all_y']) -# padding = (ymax - ymin) * 0.1 -# ymin -= padding -# ymax += padding - -xaxis = np.linspace(xmin, xmax, 100) -yaxis = np.linspace(ymin, ymax, 100) -x, y = np.meshgrid(xaxis, yaxis) - -params = [parameter_values['lambda'], parameter_values['yt'], parameter_values['c2'], parameter_values['cg'], parameter_values['c2g']] - -params[parameter_position[options.x]] = x -params[parameter_position[options.y]] = y - -z = pg.getCrossSectionForParameters(*params) - -isolines = np.array([1, 5, 10, 25, 50, 75, 100, 150, 200, 500]) - -if options.x == "lambda" and options.y == "yt" and options.c2 == -3: - isolines = np.array([10, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400]) - -if options.rescale_to_hh: - isolines *= 100 - -iso = ax.contour(x, y, z[0] * br if not options.rescale_to_hh else z[0], levels=isolines, colors='gray', linestyles='dashdot') - -# ax.grid() - -angle = 45 -theta1 = angle -theta2 = angle + 180 - -expected_markers = mpath.Path.wedge(theta1, theta2) -observed_markers = mpath.Path.wedge(theta2, theta1) - -expected_sm_marker = getHalfDiamondPath(True) -observed_sm_marker = getHalfDiamondPath() - -excluded_color = '#8E2800' -allowed_color = '#468966' - -markersize = 10 - -if mpl.__version__ == '1.2.1': - # Older version of matplotlib have a bug when using custom Path as marker. The size of the symbol is twice larger - markersize /= 2 - -# Allowed -ax.plot(data['observed_allowed_x'], data['observed_allowed_y'], ls='', lw=0, marker=observed_markers, - ms=markersize, mew=1, mec=allowed_color, mfc='none', zorder=100, label='Allowed') -if has_SM and not sm_observed_excluded: - ax.plot(default_values[options.x], default_values[options.y], ls='', lw=0, marker=observed_sm_marker, - ms=markersize*1.3, mew=2, mec=allowed_color, mfc='none', zorder=100, label='Allowed') -ax.plot(data['expected_allowed_x'], data['expected_allowed_y'], ls='', lw=0, marker=expected_markers, - ms=markersize, mew=1, mec=allowed_color, mfc='none', zorder=100, label='Allowed') -if has_SM and not sm_expected_excluded: - ax.plot(default_values[options.x], default_values[options.y], ls='', lw=0, marker=expected_sm_marker, - ms=markersize*1.15, mew=2, mec=allowed_color, mfc='none', zorder=100, label='Allowed') - -# Excluded -ax.plot(data['observed_excluded_x'], data['observed_excluded_y'], ls='', ms=markersize, lw=0, - marker=observed_markers, color=excluded_color, mec=excluded_color, mew=1, zorder=100, label='Excluded (95% CL)') -if has_SM and sm_observed_excluded: - ax.plot(default_values[options.x], default_values[options.y], ls='', ms=markersize*1.15, lw=0, - marker=observed_sm_marker, color=excluded_color, mew=2, mec=excluded_color, zorder=100) -ax.plot(data['expected_excluded_x'], data['expected_excluded_y'], ls='', ms=markersize, lw=0, - marker=expected_markers, color=excluded_color, mec=excluded_color, mew=1, zorder=100, label='Excluded (95% CL)') -if has_SM and sm_expected_excluded: - ax.plot(default_values[options.x], default_values[options.y], ls='', ms=markersize*1.15, lw=0, - marker=expected_sm_marker, color=excluded_color, mew=2, mec=excluded_color, zorder=100) - -# SM - -ax.clabel(iso, inline=1, fontsize='medium', fmt='%.0f fb') - -ax.minorticks_on() - -parameters_formatted_text = [] -for p in fixed_parameters: - parameter_value = parameter_values[p] - if parameter_value == default_values[p]: - parameter_value = parameter_legend[p] + '^{SM}' - parameters_formatted_text.append("${} = {}$".format(parameter_legend[p], parameter_value)) - -theory_text = ', '.join(parameters_formatted_text) - -#ax.text(0.080, 0.955, r"$pp \rightarrow hh \rightarrow b\bar{b}VV \rightarrow b\bar{b}l\nu l\bar{\nu}$", transform=ax.transAxes, ha='left', va='baseline') -ax.text(0.00, 1.03, r"CMS", transform=ax.transAxes, ha='left', va='baseline', size='xx-large') -ax.text(0.15, 1.03, r"$pp \rightarrow HH \rightarrow b\bar{b}\gamma\gamma$ "+theory_text, - transform=ax.transAxes, ha='left', va='center') -#ax.text(0.70, 1.03, theory_text, transform=ax.transAxes, ha='right', va='baseline') -ax.text(1.00, 1.03, '$36.5\,fb^{-1}$ (13 TeV)', transform=ax.transAxes, ha='right', va='baseline', size='large') - -# Legend - -fig.tight_layout() - -fig.subplots_adjust(bottom=0.14, top=0.93) - -allowed_expected_legend_marker = mlines.Line2D([], [], mec=allowed_color, marker=expected_markers, lw=0, mew=1, ms=markersize, mfc='none') -excluded_expected_legend_marker = mlines.Line2D([], [], color=excluded_color, mec=excluded_color, marker=expected_markers, lw=0, mew=1, ms=markersize) - -allowed_observed_legend_marker = mlines.Line2D([], [], mec=allowed_color, marker=observed_markers, lw=0, mew=1, ms=markersize, mfc='none') -excluded_observed_legend_marker = mlines.Line2D([], [], mfc=excluded_color, mec=excluded_color, marker=observed_markers, lw=0, mew=1, ms=markersize) - -handles = [EmptyHandle(), EmptyHandle()] -labels = ["Expected:", "Observed:"] - -handles += [allowed_expected_legend_marker, allowed_observed_legend_marker, excluded_expected_legend_marker, excluded_observed_legend_marker] -labels += ["allowed", "allowed", "excluded (95% CL)", "excluded (95% CL)"] - -if has_SM: - sm_legend_marker = mlines.Line2D([], [], mec='black', marker=getDiamondPath(), lw=0, mew=2, ms=markersize, mfc='none') - handles += [sm_legend_marker] - labels += ["SM"] -# else: - # handles += [EmptyHandle()] - # labels += [""] - -# handles += [EmptyHandle()] -# labels += ["(95% CL)"] - -handles += [mlines.Line2D([], [], ls='dashdot', marker=None, lw=1, color='gray')] -labels += ["Theory"] - -text_x_pos = 0.045 - -lgd = ax.legend(handles, labels, loc='upper left', bbox_to_anchor=(-0.04, -0.06), - frameon=False, numpoints=1, fontsize='medium', ncol=4, columnspacing=2, - handler_map={EmptyHandle: EmptyHandleHandler()}) - -# ax.text(text_x_pos, -0.072, theory_text, transform=ax.transAxes, ha='left') - -# CMSStyle.applyStyle(fig, ax, 2300) - -plot_name = os.path.dirname(options.input).replace('Cards/', '').replace('/', '_') + '_2d_%s_vs_%s_scan' % (options.x, options.y) - -names = [] -for p in fixed_parameters: - names.append('%s=%.1f' % (p, parameter_values[p])) - -plot_name += '_'+'_'.join([x.replace('.', 'p') for x in names]) - -if options.rescale_to_hh: - plot_name += '_rescaled_to_hh' - - -fig.savefig(os.path.join(options.output, plot_name + '.png')) -print("Plot saved as %r") % os.path.join(options.output, plot_name + '.png') -if options.pdf: - fig.savefig(os.path.join(options.output, plot_name + '.pdf')) - print("Plot saved as %r") % os.path.join(options.output, plot_name + '.pdf') - diff --git a/scripts/limitPlotter.py b/scripts/limitPlotter.py index 34e1f8e..746ac5f 100755 --- a/scripts/limitPlotter.py +++ b/scripts/limitPlotter.py @@ -8,7 +8,7 @@ __author__ = 'Andrey Pozdnyakov' import argparse -parser = argparse.ArgumentParser(description='Limit Tree maker') +parser = argparse.ArgumentParser(description='Limit plotting script') parser.add_argument('-b','--blind', dest="blind", action="store_true", default=False, help="Do not try to get observed limits.") parser.add_argument("-c", dest="combineOpt", type=int, default=1, @@ -28,6 +28,7 @@ import HiggsAnalysis.bbggLimits.ParametersGrid as pg import HiggsAnalysis.bbggLimits.TdrStyle as tdr +import HiggsAnalysis.bbggLimits.CMS_lumi as CMS_lumi gridMap = pg.loadMapping_() br = 0.26 / 100. @@ -143,7 +144,7 @@ def c2gCurve(x, par): cgPoints_2 = pg.getPoints(filterMyPoints, gridMap, filt) print 'Cg_2 points:\n', cgPoints_2 - gROOT.LoadMacro("./CMS_lumi.C") + #gROOT.LoadMacro("./CMS_lumi.C") tdr.setTDRStyle() tdrStyle.SetTitleSize(0.054, "Y") tdrStyle.SetTitleYOffset(1.1) @@ -235,7 +236,7 @@ def c2gCurve(x, par): xErr.append(0.5) else: - print 'Making limit plot for 0-1507 grid points' + print 'Making limit plot for 0-1518 grid points' for n in xrange(0,1519): @@ -328,6 +329,8 @@ def c2gCurve(x, par): exp1SigHiErr_Array = np.array([b-a for a,b in zip(expMean,exp1SigHi)]) exp2SigHiErr_Array = np.array([b-a for a,b in zip(expMean,exp2SigHi)]) + print expMean + mg = TMultiGraph() mg.SetTitle('') @@ -475,7 +478,7 @@ def c2gCurve(x, par): mg.GetXaxis().SetLimits(-1.3, 1.3) mg.GetYaxis().SetTitle('#sigma(pp #rightarrow HH) #times B(HH #rightarrow bb#gamma#gamma)_{95% CL} (fb)') - mg.SetMaximum(12) + mg.SetMaximum(11) gPad.RedrawAxis() @@ -523,7 +526,7 @@ def c2gCurve(x, par): gPad.SetLogy() - CMS_lumi(c1, 4, 11, "") + CMS_lumi.CMS_lumi(c1, 4, 11) ext = ['.png'] if opt.pdf: ext.append('.pdf') diff --git a/scripts/makeAllTrees.py b/scripts/makeAllTrees.py index 4ddad1f..e3dbcbd 100755 --- a/scripts/makeAllTrees.py +++ b/scripts/makeAllTrees.py @@ -65,7 +65,7 @@ # APZ trees: SignalFiles = "/output_GluGluToHHTo2B2G_node_THENODE_13TeV-madgraph.root" if opt.signalDir is None: - Signals = "/afs/cern.ch/user/a/andrey/work/hh/CMSSW_8_0_8_patch1/src/APZ/fgg-ana/NotATestNov12/" + SignalFiles + Signals = "root://eoscms//eos/cms/store/group/phys_higgs/resonant_HH/RunII/FlatTrees/2016/May2_Mjj70to190_NewCatMVA/EGML_Signal_GEN/Hadd/" + SignalFiles else: Signals = opt.signalDir + SignalFiles @@ -73,14 +73,10 @@ nodes = SMHiggsSamples.SMHiggsNodes Signals = opt.signalDir + '/THENODE' - # bbggTools trees: - #Signals = "/afs/cern.ch/user/a/andrey/work/hh/CMSSW_8_0_8_patch1/src/flashgg/bbggTools/test/RunJobs/NonResAll/output_GluGluToHHTo2B2G_node_THENODE_13TeV-madgraph_0.root" - #Signals = "root://eoscms//eos/cms/store/user/rateixei/HHbbgg/FlatTrees/ICHEP_Regressed4b/output_GluGluToHHTo2B2G_node_THENODE_13TeV-madgraph.root" - #Signals = "root://eoscms//eos/cms/store/user/rateixei/HHbbgg/FlatTrees/ICHEP_Regressed4b/output_GluGluToHHTo2B2G_node_THENODE_13TeV-madgraph.root" DataFiles = "/DoubleEG.root" if opt.dataDir is None: - Data = "root://eoscms//eos/cms/store/user/rateixei/HHbbgg/FlatTrees/ICHEP_Regressed4b/DoubleEG.root" + Data = "root://eoscms//eos/cms/store/group/phys_higgs/resonant_HH/RunII/FlatTrees/2016/May2_Mjj70to190_NewCatMVA/EGML_Data_Mjj70_NewMVA/Hadd/DoubleEG.root" else: Data = opt.dataDir + DataFiles @@ -112,6 +108,9 @@ if opt.doSMHiggs: sigScale = float(opt.lumi)*float(MM[2])/float(MM[1]) + # Temporary: + #if 'bb' not in MM: continue + print "DOING LowMassCat Signal, node ", i if opt.NRW: @@ -146,8 +145,12 @@ elif 'res' in opt.x: masses = { - 'Radion' : [[250,49800],[260,50000],[270,48400],[280,50000],[300,49200],[320,50000],[340,50000],[350,50000],[400,50000],[450,50000],[500,49200],[550,50000],[600,50000],[650,50000],[700,50000],[750,50000],[800,50000],[900,50000]], - 'BulkGraviton' : [[250,50000], [260,50000], [270,50000], [280,49600], [300,50000], [320,50000], [340,50000], [350,50000], [400,50000], [450,50000], [500,50000], [550,50000], [600,50000], [650,50000], [700,49200], [750,50000], [800,49800], [900,50000], [1000,50000]] + 'Radion' : [[250,49800],[260,50000],[270,48400],[280,50000],[300,49200],[320,50000],[340,50000],[350,50000], + [400,50000],[450,50000],[500,49200],[550,50000],[600,50000],[650,50000],[700,50000],[750,50000], + [800,50000],[900,50000]], + 'BulkGraviton' : [[250,50000], [260,50000], [270,50000], [280,49600], [300,50000], [320,50000], [340,50000], [350,50000], + [400,50000], [450,50000], [500,50000], [550,50000], [600,50000], [650,50000], [700,49200], [750,50000], + [800,49800], [900,50000], [1000,50000]] } # APZ trees: @@ -160,7 +163,7 @@ DataFiles = "/DoubleEG.root" if opt.dataDir is None: - Data = "root://eoscms//eos/cms/store/user/rateixei/HHbbgg/FlatTrees/ICHEP_Regressed4b/DoubleEG.root" + Data = "root://eoscms//eos/cms/store/group/phys_higgs/resonant_HH/RunII/FlatTrees/2016/May2_Mjj70to190_NewCatMVA/EGML_Data_Mjj70_NewMVA/Hadd/DoubleEG.root" else: Data = opt.dataDir + DataFiles @@ -173,8 +176,8 @@ catScheme = " --doCatMVA --MVAHMC0 " + str(opt.MVAHMC0) + " --MVAHMC1 " + str(opt.MVAHMC1) + " --MVALMC0 " + str(opt.MVALMC0)+ " --MVALMC1 " + str(opt.MVALMC1)+ " " catScheme += ' --LMLJBTC ' + str(opt.LMLJBTC) + ' --HMLJBTC ' + str(opt.HMLJBTC) + ' --LMSJBTC ' + str(opt.LMSJBTC) + ' --HMSJBTC ' + str(opt.HMSJBTC) + ' ' - postFix = " --isRes --MX --tilt " + catScheme+ " --btagTight 0.9535 --btagMedium 0.8484 --btagLoose 0.5426 --massThreshold " + str(opt.massNR) + " " -# SFs = " --bVariation 0 --phoVariation 0" + postFix = " --isRes --MX " + catScheme+ " --btagTight 0.9535 --btagMedium 0.8484 --btagLoose 0.5426 --massThreshold " + str(opt.massNR) + " " + # SFs = " --bVariation 0 --phoVariation 0" SFs = " --bVariation 0 --phoVariation 0 --bDiffVariation " + opt.btagdiffvar + ' ' directory = dirPrefix + opt.resType diff --git a/scripts/pyLimitTreeMaker.py b/scripts/pyLimitTreeMaker.py index 7d9c11e..abd5916 100755 --- a/scripts/pyLimitTreeMaker.py +++ b/scripts/pyLimitTreeMaker.py @@ -23,8 +23,6 @@ help="Use Mtot_KF to cut on mass window") parser.add_argument('--MX', dest="MX", action="store_true", default=False, help="Use MX to cut on mass window") -parser.add_argument('-t', '--tilt', dest="tilt", action="store_true", default=False, - help="Select tilted mass window") #normalization parser.add_argument('-s', '--scale', dest="scale", type=float, default=1, help="Normalization (lumi*xsec/totEvs), 1 for data") @@ -127,15 +125,14 @@ def setAndLoop(fname, options, outFile): LTM = bbggLTMaker(tr, options.isres) -#mx usage + # mx usage LTM.SetMax( options.mtotMax ) LTM.SetMin( options.mtotMin ) LTM.IsMX( options.MX ) LTM.IsKinFit( options.KF ) - LTM.SetTilt( options.tilt ) -#normalization + # normalization LTM.SetNormalization( options.scale, options.NRscale ) -#categorization + # categorization LTM.DoNoCat( options.doNoCat ) LTM.DoCatNonRes( options.doCatNonRes ) LTM.DoCatHighMass( options.doCatHighMass ) diff --git a/scripts/pyLimits.py b/scripts/pyLimits.py index d4dc158..4033f72 100755 --- a/scripts/pyLimits.py +++ b/scripts/pyLimits.py @@ -5,15 +5,16 @@ import logging from shutil import copy from pprint import pformat -# import pebble as pb from multiprocessing import Pool, TimeoutError, current_process from HiggsAnalysis.bbggLimits.LimitsUtil import * - -gROOT.SetBatch() - +import getpass +__username__ = getpass.getuser() __author__ = 'Rafael Teixeira de Lima & Andrey Pozdnyakov' + __BAD__ = 666 +gROOT.SetBatch() + import argparse def parseNumList(string): @@ -98,7 +99,7 @@ def parseNumList(string): if __name__ == "__main__": print "This is the __main__ part" - gSystem.Load('libHiggsAnalysisbbggLimits') + # gSystem.Load('libHiggsAnalysisbbggLimits') #workingPath = os.getcwd() # parentDir = os.path.abspath(os.path.join(workingPath, os.pardir)) @@ -109,13 +110,13 @@ def parseNumList(string): if opt.verb>1: print '\t Input JSON config file:' - print json.dumps(Params, sort_keys=True,indent=4) + print json.dumps(Params, sort_keys=True, indent=4) if opt.outDir: - baseFolder=opt.outDir+"_v"+str(Params['other']["version"]) + baseFolder=opt.outDir else: - baseFolder="./bbggToolsResults_v"+str(Params['other']["version"]) + baseFolder="./bbggToolsResults" createDir(baseFolder, over=opt.overwrite) @@ -134,8 +135,8 @@ def parseNumList(string): mainLog.info(pformat(opt)) - createDir('/tmp/PIDs/',mainLog,True) - createDir('/tmp/logs/',mainLog,True) + createDir('/tmp/'+__username__+'/PIDs/',mainLog,True) + createDir('/tmp/'+__username__+'/logs/',mainLog,True) res_Masses = [] if opt.mass!=None: @@ -160,7 +161,7 @@ def parseNumList(string): # Run on multiple cores: res_Nodes.append((n,pool.apply_async(runFullChain, args = (opt, Params, n,-1,str(opt.extraLabel))))) - # Use signle core: + # Use single core: #runFullChain(Params, NRnode=n) res_Points = [] @@ -171,27 +172,37 @@ def parseNumList(string): for p in listOfPoints: res_Points.append((str(p), pool.apply_async(runFullChain, args = (opt, Params, None,p,opt.extraLabel)))) + + res_ARW = [] + if opt.analyticalRW: + mainLog.debug('Running Analytical Reweighting to (kl, kt, c2, cg, c2g):\n'+ + pformat([opt.ARW_kl, opt.ARW_kt, opt.ARW_c2, opt.ARW_cg, opt.ARW_c2g])) + res_ARW.append(('ARW', pool.apply_async(runFullChain, args = (opt, Params, None, -1, opt.extraLabel)))) + + pool.close() - # APZ. The code below tryies to kill the processes which take too long. + # APZ. The code below tries to kill the processes which take too long. # This implementation is ugly. The better way to do this is to use pebble, # But it's only available in Python 3... # Useful posts: # [1] http://stackoverflow.com/questions/20055498/python-multiprocessing-pool-kill-specific-long-running-or-hung-process # [2] http://stackoverflow.com/questions/20991968/asynchronous-multiprocessing-with-a-worker-pool-in-python-how-to-keep-going-aft # [3] http://stackoverflow.com/questions/26063877/python-multiprocessing-module-join-processes-with-timeout + # Here I'm using a modified implementation of [1]: + # + # UPD 2017-Sep-27: the killing part is actually commented out now. It's not needed really. + # We just wait for the jobs to finish. - # Using a modified implementation of [1]: - - print "Running over:", myNodes + print "Running over:", res_Masses, res_Nodes, res_Points, res_ARW pCount=0 - totJobs = len(res_Nodes)+len(res_Points)+len(res_Masses) + totJobs = len(res_Nodes)+len(res_Points)+len(res_Masses)+len(res_ARW) badJobs = [] - for i, r in enumerate([res_Masses, res_Nodes, res_Points]): + for i, r in enumerate([res_Masses, res_Nodes, res_Points, res_ARW]): badJobs.append([]) #mainLog.debug('Type of r: %r, length of r: %r', i, len(r)) @@ -211,14 +222,18 @@ def parseNumList(string): except Exception as e: mainLog.warning("We have reached an exception related to %s" % (str(e))) mainLog.warning("%s is timed out! It's been %f sec that you're running, dear %s" % (j, time.time()-procCheckT, j)) + + """ mainLog.warning("That is too long... Because of that we've gotta kill you. Sorry.") # We know which process gave us an exception: it is "j" in "i", so let's kill it! # First, let's get the PID of that process: if i==0: - pidfile = '/tmp/PIDs/PoolWorker_Node_'+str(j)+'.pid' + pidfile = '/tmp/'+__username__+'/PIDs/PoolWorker_Mass_'+str(j)+'.pid' elif i==1: - pidfile = '/tmp/PIDs/PoolWorker_gridPoint_'+str(j)+'.pid' + pidfile = '/tmp/'+__username__+'/PIDs/PoolWorker_Node_'+str(j)+'.pid' + elif i==2: + pidfile = '/tmp/'+__username__+'/PIDs/PoolWorker_gridPoint_'+str(j)+'.pid' PID = None if os.path.isfile(pidfile): PID = str(open(pidfile).read()) @@ -244,8 +259,8 @@ def parseNumList(string): os.remove(pidfile) break - - mainLog.debug('Broke out of the while loop.. for '+pformat(r)) + """ + mainLog.debug('Broke out of the while loop.. for '+pformat(r)+' at '+str(i)) mainLog.debug('Broke out of the enumerate loop...') diff --git a/scripts/pyNonResLimits.py b/scripts/pyNonResLimits.py deleted file mode 100755 index eaca105..0000000 --- a/scripts/pyNonResLimits.py +++ /dev/null @@ -1,560 +0,0 @@ -#!/usr/bin/env python - -from ROOT import * -import os,sys,json,time,re -import logging -from shutil import copy -from pprint import pformat -# import pebble as pb -from multiprocessing import Pool, TimeoutError, current_process - -gROOT.SetBatch() - -__author__ = 'Andrey Pozdnyakov' -__BAD__ = 666 - -import argparse - -def parseNumList(string): - # This function is used to pass arguments like: - # --points 2,4 5-20, 60, 200-400 - # That it, it will parse all those combinations and create lists of points to run over - - # print 'Input string:',string - chunks = re.split('[,]', string) - chunks = filter(None, chunks) - mylist = [] - if len(chunks)==0: - return None - for ch in chunks: - # print '\t This chunk=', ch - try: - mylist.append(int(ch)) - # print "It's an int. Append it" - except ValueError: - # print 'It is not an int. Try a pattern: number1-number2' - m = re.match(r'\d*-\d*', ch) - if m: - # print 'Matched the chunk:', ch - start,end = m.group().split('-') - mylist.extend(range(int(start),int(end)+1)) - else: - raise argparse.ArgumentTypeError("'" + string + "' is not in acceptable format.") - # print mylist - return list(set(mylist)) - -parser = argparse.ArgumentParser(description='Limit Tree maker') -parser.add_argument('-f', '--inputFile', dest="fname", type=str, default=None, required=True, - help="Json config file") -parser.add_argument('-o', '--outDir', dest="outDir", type=str, default=None, - help="Output directory (will be created).") -parser.add_argument('--nodes', dest="nodes", default=None, type=str, nargs='+', - choices=['2','3','4','5','6','7','8','9','10','11','12','13','SM','box','all'], - help = "Choose the nodes to run") -parser.add_argument('--points', dest="points", default=None, type=parseNumList, nargs='+', - help = "Choose the points in the grid to run") -parser.add_argument('--overwrite', dest="overwrite", action="store_true", default=False, - help="Overwrite the results into the same directory") -parser.add_argument("-v", dest="verb", type=int, default=0, - help="Verbosity level: 0 - Minimal or no messages; 1 - INFO; 2 - DEBUG; 3 - Go crazy") -parser.add_argument('-j', '--ncpu',dest="ncpu", type=int, default=2, - help="Number of cores to run on.") -parser.add_argument('-t', '--timeout',dest="timeout", type=int, default=None, - help="Per job timeout (in seconds) for multiprocessing. Jobs will be killed if run longer than this.") - -opt = parser.parse_args() -print opt -# opt.func() -# parser.print_help() - -if opt.verb==0: - logLvl = logging.ERROR -elif opt.verb==1: - logLvl = logging.INFO -else: - logLvl = logging.DEBUG - -if opt.verb < 3: - gROOT.ProcessLine("gErrorIgnoreLevel = 1001;") - RooMsgService.instance().setGlobalKillBelow(RooFit.FATAL) - RooMsgService.instance().setSilentMode(True) - - -begin = time.time() - -def createDir(myDir, log=None, over=True): - if log!=None: - log.info('Creating a new directory: %s', myDir) - if os.path.exists(myDir): - if log!=None: - log.warning("\t This directory already exists: %s", myDir) - if over: - # Overwrite it... - if log!=None: - log.warning("But we will continue anyway (I will --overwrite it!)") - else: - if log!=None: - log.error(' And so I exit this place...') - print 'The directory exist and we exit. Dir = ', myDir - sys.exit(1) - else: - try: os.makedirs(myDir) - except OSError: - if os.path.isdir(myDir): pass - else: raise - -def printTime(t1, t2, log): - tNew = time.time() - log.debug('Time since start of worker: %.2f sec; since previous point: %.2f sec' %(tNew-t2,tNew-t1)) - return tNew - -def runCombine(inDir, doBlind, log, combineOpt = 1, Label = None): - log.info('Running combine tool. Dir: %s Blinded: %r', inDir, doBlind) - log.debug('inDir should be the immediate directory where the card is located') - - if doBlind and combineOpt!=3: - # In HybridNew this option does not work - blinded = "--run blind" - else: - blinded = '' - - - if combineOpt==1: - combineMethod = 'Asymptotic --X-rtd ADDNLL_CBNLL=0' - # combineMethod = 'Asymptotic' - elif combineOpt==2: - combineMethod = 'Asymptotic --X-rtd TMCSO_AdaptivePseudoAsimov=50' - elif combineOpt==3: - combineMethod = 'HybridNew' - else: - log.error('This option is not supported: %r', combineOpt) - return __BAD__ - - - cardName = inDir+"/hhbbgg_13TeV_DataCard.txt" - resFile = inDir+"/result_"+str(combineOpt)+".log" - - - command1 = ' '.join(['combine -M', combineMethod,'-m 125 -n',Label,blinded,cardName,">",resFile,"2>&1"]) - log.info('Combine command we run:\n%s', command1) - - combExitCode = os.system(command1) - - if combineOpt in [1,2]: - fName = 'higgsCombine'+Label+'.Asymptotic.mH125.root' - elif combineOpt in [3]: - fName = 'higgsCombine'+Label+'.HybridNew.mH125.root' - - outDir = inDir - os.rename(fName, outDir+'/'+fName.replace('.root', '_%i.root'%combineOpt)) - - return combExitCode - - -def runFullChain(Params, NRnode=None, NRgridPoint=-1): - #print 'Running: ', sys._getframe().f_code.co_name, " Node=",NRnode - # print sys._getframe().f_code - PID = os.getpid() - - if NRnode!=None and NRgridPoint!=-1: - print 'WARning: cannot have both the Node and grid Point. Chose one and try again' - return __BAD__ - elif NRnode!=None: - Label = "_Node_"+str(NRnode) - elif NRgridPoint!=-1: - Label = "_gridPoint_"+str(NRgridPoint) - else: - print 'WARning: must provide one of these: NRnode or NRgridPoint' - return __BAD__ - - # Create PID file to track the job: - pidfile = "/tmp/PIDs/PoolWorker"+Label+".pid" - file(pidfile, 'w').write(str(PID)) - - procName = current_process().name - try: - logging.basicConfig(level=logLvl, - format='%(asctime)s PID:%(process)d %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename='/tmp/logs/processLog_'+str(procName)+'.log', - filemode='w') - except: - print 'I got excepted!' - return __BAD__ - - procLog = logging.getLogger('Process.Log') - - procLog.info('\n\n New process Log started. PID = %d, job label: %r\n', PID, Label) - procLog.info("This log filename = "+logging.getLoggerClass().root.handlers[0].baseFilename) - procLog.info('Node=%r gridPoint=%r PID=%r \n Options: %s',NRnode, NRgridPoint, PID, pformat(opt)) - - start = time.time() - - LTDir_type = os.getenv("CMSSW_BASE")+Params['LTDIR'] - signalTypes = Params['signal']['types'] - signalModelCard = os.getenv("CMSSW_BASE")+Params['signal']['signalModelCard'] - - lumi = Params['other']["integratedLumi"]; - energy = str(Params['other']["energy"]) - mass = Params['other']["higgsMass"] - addHiggs = Params['other']["addHiggs"] - doBlinding = Params['other']["doBlinding"] - doBands = Params['other']["doBands"] - NCAT = Params['other']["ncat"] - doBrazilianFlag = Params['other']["doBrazilianFlag"] - - if NCAT > 3: - procLog.error("Error NCAT>3!") - return __BAD__ - - doCombine = Params['other']["runCombine"] - useSigTheoryUnc = Params['other']["useSigTheoryUnc"] - analysisType = Params['other']["analysisType"] - HH = Params['other']["HH"] - base = Params['other']["base"] - low = Params['other']["low"] - obs = Params['other']["obs"] - twotag=Params['other']["twotag"] - - dataName = Params['data']['name'] - - sigCat = 0 - if NRnode==None: - sigCat = -1 - elif NRnode == 'SM': - sigCat = 0 - elif NRnode == 'box': - sigCat = 1 - else: - sigCat = int(NRnode) - - - if opt.outDir: - baseFolder="./"+opt.outDir+"_v"+str(Params['other']["version"]) - else: - baseFolder="./bbggToolsResults_v"+str(Params['other']["version"]) - - - massCuts = [Params['other']["minMggMassFit"], Params['other']["maxMggMassFit"], - Params['other']["minMjjMassFit"], Params['other']["maxMjjMassFit"], - Params['other']["minSigFitMgg"], Params['other']["maxSigFitMgg"], - Params['other']["minSigFitMjj"], Params['other']["maxSigFitMjj"], - Params['other']["minHigMggFit"], Params['other']["maxHigMggFit"], - Params['other']["minHigMjjFit"], Params['other']["maxHigMjjFit"]] - - # For now the mass cuts are all the same, but can be changed in future. - # ParamsForFits = {'SM': massCuts, 'box': massCuts} - - NonResSignalFile = "/LT_output_GluGluToHHTo2B2G_node_"+str(NRnode)+"_13TeV-madgraph.root" - - if NRgridPoint >= 0: - NonResSignalFile = "/LT_NR_Nodes_2to13_merged.root" - - procLog.debug('%s, %s', NonResSignalFile, pformat(signalTypes)) - - - for t in signalTypes: - newFolder = baseFolder+ str('/'+t+Label) - procLog.info('Type = %s, %s', t, newFolder) - - createDir(newFolder,procLog) - - HLFactoryname= str(t+Label) - hlf = RooStats.HLFactory(HLFactoryname, signalModelCard, False) - w = hlf.GetWs() - - theFitter = bbgg2DFitter() - theStyle = theFitter.style() - gROOT.SetStyle('hggPaperStyle') - - theFitter.Initialize( w, sigCat, lumi, newFolder, energy, doBlinding, NCAT, addHiggs, - massCuts[0],massCuts[1],massCuts[2], - massCuts[3],massCuts[4],massCuts[5], - massCuts[6],massCuts[7],massCuts[8], - massCuts[9],massCuts[10],massCuts[11], NRgridPoint, - logging.getLoggerClass().root.handlers[0].baseFilename+'.bbgg2D') - - theFitter.SetVerbosityLevel(opt.verb) - LTDir = LTDir_type.replace('TYPE', t) - mass = 125.0 - - openStatus = theFitter.AddSigData( mass, str(LTDir+NonResSignalFile)) - if openStatus==-1: - procLog.error('There is a problem with openStatus') - return __BAD__ - procLog.info("\t SIGNAL ADDED. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p1 = printTime(start, start, procLog) - - createDir(newFolder+'/workspaces',procLog) - createDir(newFolder+'/datacards',procLog) - - theFitter.SigModelFit( mass) - procLog.info("\t SIGNAL FITTED. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p2 = printTime(p1,start, procLog) - - fileBaseName = "hhbbgg.mH"+str(mass)[0:3]+"_13TeV" - theFitter.MakeSigWS( fileBaseName) - procLog.info("\t SIGNAL'S WORKSPACE DONE. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p3 = printTime(p2,start,procLog) - - theFitter.MakePlots( mass) - procLog.info("\t SIGNAL'S PLOT DONE. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p4 = printTime(p3,start,procLog) - - if addHiggs: - procLog.debug('Here will add SM Higgs contributions') - # theFitter.AddHigData( mass,direc,1) - - ddata = str(LTDir + '/LT_'+dataName+'.root') - - theFitter.AddBkgData(ddata) - procLog.info("\t BKG ADDED. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p4 = printTime(p3,start, procLog) - - if opt.verb>1: - theFitter.PrintWorkspace(); - - fitresults = theFitter.BkgModelFit( doBands, addHiggs) - procLog.info("\t BKG FITTED. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p5 = printTime(p4,start,procLog) - if fitresults==None: - procLog.error("PROBLEM with fitresults !!") - return __BAD__ - - if opt.verb>1: - fitresults.Print() - - wsFileBkgName = "hhbbgg.inputbkg_13TeV" - theFitter.MakeBkgWS( wsFileBkgName); - procLog.info("\t BKG'S WORKSPACE DONE. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p6 = printTime(p5,start,procLog) - - # This is making cards ala 8 TeV. We don't need this for now - #theFitter.MakeDataCard( fileBaseName, wsFileBkgName, useSigTheoryUnc) - #print "\t 8TeV DATACARD DONE" - - sigExp = [] - bkgObs = [] - for cc in xrange(NCAT): - sigExp.append(-1) - bkgObs.append(-1) - - sigExpStr = '' - bkgObsStr = '' - for cc in xrange(NCAT): - sigExp[cc] = theFitter.GetSigExpectedCats(cc); - if not doBlinding: - bkgObs[cc] = theFitter.GetObservedCats(cc); - - sigExpStr += "%f" % sigExp[cc] - bkgObsStr += "%f" % bkgObs[cc] - if cc < NCAT-1: - sigExpStr += "," - bkgObsStr += "," - - # TODO: This script needs to be included as a py function: - DCcommand = "python LimitSetting/scripts/DataCardMaker.py -f " + str(newFolder) + str(" -n %d " % NCAT) + "-s " + sigExpStr + " -o " + bkgObsStr; - procLog.debug(DCcommand) - os.system(DCcommand) - procLog.info("\t DATACARD DONE. Node=%r, GridPoint=%r, type=%r", NRnode,NRgridPoint,t) - if opt.verb>0: p7 = printTime(p6,start,procLog) - - # End of loop over Types - ## <-- indent - - # Here we shall merge datacars of all categories (in this case two) - cardsToMerge = '' - for t in signalTypes: - cardsToMerge += baseFolder+'/'+t+Label+'/datacards/hhbbgg_13TeV_DataCard.txt ' - - newDir = baseFolder+'/CombinedCard'+Label - createDir(newDir,procLog) - - combCard = newDir+'/hhbbgg_13TeV_DataCard.txt' - os.system("combineCards.py "+ cardsToMerge + " > " + combCard+' ') - - # Now we actually need to fix the combined card - for t in signalTypes: - strReplace = baseFolder+'/'+t+Label+'/datacards/' - os.system("sed -i 's|"+strReplace+"./|./|g' "+combCard) - - if doCombine: - combineOpt = Params['other']['combineOption'] - for method in [1,2,3]: - # If options 1,2,3 are provided - run the corresponding limits: - # 1 - asymptotic, 2 - asymptotoc with adaptive azimov option; 3 - hybridnew - # If combineOpt==4: run all of them at once - if combineOpt!=4 and method!=combineOpt: continue - try: - combStatus = runCombine(newDir, doBlinding, procLog, method, Label=Label) - except: - return __BAD__ - procLog.info("\t COMBINE with Option=%r is DONE. Node=%r, GridPoint=%r, type=%r \n \t Status = %r", - method, NRnode,NRgridPoint,t, combStatus) - if combStatus!=0: - procLog.error('Combine failed...') - # return __BAD__ - - if opt.verb>0: p8 = printTime(p7,start,procLog) - - os.remove(pidfile) - - # procLog.handlers = [] - - procLog.info('This process has ended. Label=%r', Label) - return 42 - -if __name__ == "__main__": - print "This is the __main__ part" - - gSystem.Load('libHiggsAnalysisbbggLimits') - - #workingPath = os.getcwd() - # parentDir = os.path.abspath(os.path.join(workingPath, os.pardir)) - #if opt.verb: print workingPath - - with open(opt.fname, 'r') as fp: - Params = json.load(fp) - - if opt.verb>1: - print '\t Input JSON config file:' - print json.dumps(Params, sort_keys=True,indent=4) - - - nodes = Params['signal']['nodes'] - - if opt.outDir: - baseFolder=opt.outDir+"_v"+str(Params['other']["version"]) - else: - baseFolder="./bbggToolsResults_v"+str(Params['other']["version"]) - - createDir(baseFolder, over=opt.overwrite) - - copy(opt.fname, baseFolder) - - pool = Pool(processes=opt.ncpu) - - logging.basicConfig(level=logLvl, - format='%(asctime)s PID:%(process)d %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename=baseFolder+'/mainLog_'+time.strftime("%Y%m%d-%H%M%S")+'.log', - filemode='w') - - mainLog = logging.getLogger('Main.Log') - mainLog.info('Main Log started') - - mainLog.info(pformat(opt)) - - createDir('/tmp/PIDs/',mainLog,True) - createDir('/tmp/logs/',mainLog,True) - - res_Nodes = [] - if opt.nodes!=None: - - mainLog.info('Running over nodes:\n'+pformat(opt.nodes)) - if 'all' in opt.nodes: - myNodes=['SM','box','2','3','4','5','6','7','8','9','10','11','12','13'] - else: - myNodes = opt.nodes - - for n in myNodes: - #for n in ['2','SM']: - # Run on multiple cores: - res_Nodes.append((n,pool.apply_async(runFullChain, args = (Params, n,)))) - - # Use signle core: - #runFullChain(Params, NRnode=n) - - - res_Points = [] - if opt.points!=None: - listOfPoints = list(set([item for sublist in opt.points for item in sublist])) - - mainLog.debug('Running over 5D space points:\n'+pformat(opt.points)) - for p in listOfPoints: - res_Points.append((str(p), pool.apply_async(runFullChain, args = (Params, None,p,)))) - - pool.close() - - - # APZ. The code below tryies to kill the processes which take too long. - # This implementation is ugly. The better way to do this is to use pebble, - # But it's only available in Python 3... - # Useful posts: - # [1] http://stackoverflow.com/questions/20055498/python-multiprocessing-pool-kill-specific-long-running-or-hung-process - # [2] http://stackoverflow.com/questions/20991968/asynchronous-multiprocessing-with-a-worker-pool-in-python-how-to-keep-going-aft - # [3] http://stackoverflow.com/questions/26063877/python-multiprocessing-module-join-processes-with-timeout - - - # Using a modified implementation of [1]: - - pCount=0 - totJobs = len(res_Nodes)+len(res_Points) - - badJobs = [] - for i, r in enumerate([res_Nodes, res_Points]): - badJobs.append([]) - - #mainLog.debug('Type of r: %r, length of r: %r', i, len(r)) - - while r: - sys.stdout.write("\r Progress: %.1f%%\n" % (float(pCount)*100/totJobs)) - sys.stdout.flush() - pCount+=1 - - try: - j, res = r.pop(0) - procCheckT = time.time() - procRes = res.get(opt.timeout) - mainLog.info('%d Job %s has been finished. Was waiting only for %f Seconds.' % (procRes, j, time.time()-procCheckT)) - - except Exception as e: - mainLog.warning(str(e)) - mainLog.warning("%s is timed out! It's been %f sec that you're running, dear %s" % (j, time.time()-procCheckT, j)) - mainLog.warning("That is too long... Because of that we've gotta kill you. Sorry.") - - # We know which process gave us an exception: it is "j" in "i", so let's kill it! - # First, let's get the PID of that process: - if i==0: - pidfile = '/tmp/PIDs/PoolWorker_Node_'+str(j)+'.pid' - elif i==1: - pidfile = '/tmp/PIDs/PoolWorker_gridPoint_'+str(j)+'.pid' - PID = None - if os.path.isfile(pidfile): - PID = str(open(pidfile).read()) - - for p in pool._pool: - # Here we loop over all running processes and check if PID matches with the one who's overtime: - # print p, p.pid - if str(p.pid)==PID: - mainLog.debug('Found it still running indeed! :: %r, %r, %r %r', p, p.pid, p.is_alive(), p.exitcode) - - # We can also double-check how long it's been running with system 'ps' command:" - # tt = str(subprocess.check_output('ps -p "'+str(p.pid)+'" o etimes=', shell=True)).strip() - # print 'Run time from OS (may be way off the real time..) = ', tt - - # Now, KILL the m*$@r: - p.terminate() - pool._pool.remove(p) - pool._repopulate_pool() - - badJobs[i].append(j) - - mainLog.debug('Here you go, %s, pid=%d, you have been served.', p.name, p.pid) - - os.remove(pidfile) - break - - mainLog.debug('Broke out of the while loop.. for '+pformat(r)) - mainLog.debug('Broke out of the enumerate loop...') - - - pool.terminate() - pool.join() - - mainLog.info('Bad jobs:'+ pformat(badJobs)) - - end = time.time() - mainLog.info('\t Total Time: %.2f'%(end-begin)) - - mainLog.info('My Main Log Finished') diff --git a/setup_for_2Dlimits.sh b/setup_for_2Dlimits.sh deleted file mode 100644 index 763d3b9..0000000 --- a/setup_for_2Dlimits.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash - -# This script will install extra packages needed for 2D limit plot: -# --> draw2DScan.py <-- -# -# The script will install additional python packages needed. -# -# NOTE: after the installation you may still need to set paths manually: -# -# export PATH=$PWD/python_packages/bin:$PATH -# export PYTHONPATH=$PWD/python_packages/lib/python2.7/site-packages:$PYTHONPATH -# - -function setup_env { - export PATH=$PWD/python_packages/bin:$PATH - export PYTHONPATH=$PWD/python_packages/lib/python2.7/site-packages:$PYTHONPATH -} - -if [ ! -d python_packages ]; then - echo "Installing needed python packages..." - - mkdir python_packages - - prefix=$PWD/python_packages - - curl -O https://bootstrap.pypa.io/get-pip.py - python get-pip.py --prefix=$prefix - rm get-pip.py - - setup_env - - # Install numpy - pip install numpy --prefix=$prefix - pip install python-dateutil --prefix=$prefix - pip install matplotlib --prefix=$prefix --global-option=build_ext --global-option="-L$(python2.7-config --prefix)/lib" - pip install six --prefix=$prefix --global-option=build_ext --global-option="-L$(python2.7-config --prefix)/lib" -else - setup_env -fi \ No newline at end of file diff --git a/src/BrazilianFlag.cc b/src/BrazilianFlag.cc deleted file mode 100644 index 91c2c3b..0000000 --- a/src/BrazilianFlag.cc +++ /dev/null @@ -1,979 +0,0 @@ -#include -#include -#include "TH1F.h" -#include "TROOT.h" -#include "TStyle.h" -#include "TLegend.h" -#include "TNtuple.h" -#include -#include -#include "TFile.h" -#include "TPaveText.h" -#include "TMultiGraph.h" -#include "TLine.h" -#include "TCanvas.h" -#include "TGraphErrors.h" -#include "TLine.h" -#include "boost/filesystem.hpp" -#include "boost/regex.hpp" -#include "HiggsAnalysis/bbggLimits/interface/Colors.h" -double br=0; -float x01=0; -float y01=0; -float z01=0; -using namespace std; -bool PrintRadion13TeV=true; -TStyle* CreateStyle(std::string name1,std::string name2) -{ - TStyle *defaultStyle = new TStyle(name1.c_str(),name2.c_str()); - // defaultStyle->SetOptStat(0000); - // defaultStyle->SetOptFit(000); - // defaultStyle->SetPalette(1); - /////// pad //////////// - defaultStyle->SetPadBorderMode(1); - defaultStyle->SetPadBorderSize(1); - defaultStyle->SetPadColor(0); - defaultStyle->SetPadTopMargin(0.08); - defaultStyle->SetPadBottomMargin(0.13); - defaultStyle->SetPadLeftMargin(0.15); - defaultStyle->SetPadRightMargin(0.02); - /////// canvas ///////// - defaultStyle->SetCanvasBorderMode(0); - defaultStyle->SetCanvasColor(0); - // defaultStyle->SetCanvasDefH(600); - // defaultStyle->SetCanvasDefW(600); - /////// frame ////////// - defaultStyle->SetFrameBorderMode(0); - defaultStyle->SetFrameBorderSize(1); - defaultStyle->SetFrameFillColor(0); - defaultStyle->SetFrameLineColor(1); - /////// label ////////// - // defaultStyle->SetLabelOffset(0.005,"XY"); - // defaultStyle->SetLabelSize(0.05,"XY"); - defaultStyle->SetLabelFont(42,"XY"); - /////// title ////////// - // defaultStyle->SetTitleOffset(1.1,"X"); - // defaultStyle->SetTitleSize(0.01,"X"); - // defaultStyle->SetTitleOffset(1.25,"Y"); - // defaultStyle->SetTitleSize(0.05,"Y"); - defaultStyle->SetTitleFont(42, "XYZ"); - /////// various //////// - defaultStyle->SetNdivisions(303,"Y"); - //defaultStyle->SetTitleFillStyle(10, "Z"); - - // defaultStyle->SetLegendBorderSize(0); // For the axis titles: - - // defaultStyle->SetTitleColor(1, "XYZ"); - // defaultStyle->SetTitleFont(42, "XYZ"); - // defaultStyle->SetTitleSize(0.06, "XYZ"); - - // defaultStyle->SetTitleYSize(Float_t size = 0.02); - //defaultStyle->SetTitleXOffset(0.9); - //defaultStyle->SetTitleYOffset(1.05); - // defaultStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset - - // For the axis labels: - defaultStyle->SetLabelColor(1, "XYZ"); - defaultStyle->SetLabelFont(42, "XYZ"); - // defaultStyle->SetLabelOffset(0.007, "XYZ"); - defaultStyle->SetLabelSize(0.04, "XYZ"); - - // For the axis: - // defaultStyle->SetAxisColor(1, "XYZ"); - defaultStyle->SetStripDecimals(kTRUE); - defaultStyle->SetTickLength(0.03, "XYZ"); - defaultStyle->SetNdivisions(510, "XYZ"); - // defaultStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame - // defaultStyle->SetPadTickY(1); - defaultStyle->cd(); - return defaultStyle; -} - -void BrazilianFlag(std::string path_dir,bool HH,bool base,bool low,bool obs,bool twobtag,std::string energy, float lumi) -{ - std::cout<radMASS; - std::vectordirs; - boost::filesystem::path dir(path_dir); - if(boost::filesystem::is_directory(path_dir)==false) - { - std::cout<status())) - { - std::string folder_name=itr->path().filename().string(); - - const char * pattern = "\\d+"; - boost::regex re(pattern); - boost::sregex_iterator it(folder_name.begin(), folder_name.end(), re); - boost::sregex_iterator end; - std::vectornumber; - for( ; it != end; ++it) - { - number.push_back(it->str()); - } - if(number.size()!=0) - { - radMASS.push_back(std::stod(number[0])); - dirs.push_back(path_dir+"/"+folder_name+"/combine/higgsCombineTest.Asymptotic.mH125_m"+number[0]); - } - } - - } - std::string name1="defaultStyle"; - std::string name2="Default Style"; - TStyle *defaultStyle=CreateStyle(name1,name2); - /*bool HH=false; - bool base = true; - bool low=false; - bool obs=false;//radlim${radion[$j]}_CSV - bool twobtag=false; - int combo = 0; - if (combo == 0) HH=0, low=0, twobtag=0; - if (combo == 1) HH=0, low=1, twobtag=1; - if (combo == 2) HH=0, low=1, twobtag=0; - if (combo == 3) HH=1, low=0, twobtag=0; - if (combo == 4) HH=1, low=1, twobtag=1; - if (combo == 5) HH=1, low=1, twobtag=0;*/ - // TLegend *leg = new TLegend(0.65,0.5,0.99,0.94); - TLegend *leg = new TLegend(0.23,0.65,0.45,0.92); - if (low) leg = new TLegend(0.23,0.69,0.45,0.92); - leg->SetFillColor(kWhite); - leg->SetFillStyle(0); - leg->SetBorderSize(0); - leg->SetTextSize(0.037); - - TLegend *leg1 = new TLegend(0.55,0.65,0.99,0.86); - leg1->SetFillColor(kWhite); - leg1->SetFillStyle(0); - leg1->SetBorderSize(0); - leg1->SetTextSize(0.036); - - //std::vectorradMASS{{260,270,280,290,300,310,320,330,340,350,360,370,380,390,400,410,420,430,440,450,400,450,500,550,600,650,700,800,900,1000,1100}}; - //std::vectorradMASS2{{260,270,300,350,400}}; - //std::vectorradMASS3{{260,270,300,350,400}}; - //radMASS={260,270,300,350,400}; - std::vectorradCX(int(radMASS.size()),1.0); - //std::vectorradCX2(int(radMASS2.size()),1.0); - //std::vectorradCX3(int(radMASS3.size()),1.0); - if(!HH) br=1;//1./(0.577*0.00228); - if(HH) br=1./(2*0.577*0.00228); // HH - ////////////////////////////////////////// - // draw the radion line // MR rad_CX(fb) grav_CX(fb) - //ntuple = new TNtuple("ntuple","NTUPLE","x:y:z"); - TNtuple *ntuple = new TNtuple("ntuple","NTUPLE","x:y"); - //float x0,y0,z0; - std::string line=""; - std::string line_bfhh=""; - //char line[127], line_bfhh[127]; - std::ifstream fp("CX_radion_for_paper.data"); - std::ifstream fp_bfhh("CX_radion_for_paper_BFHH.data"); - while(getline(fp,line)&&getline(fp_bfhh,line_bfhh)) - { - sscanf(&line[0],"%f %f",&x01,&y01); - sscanf(&line_bfhh[0],"%f %f",&x01,&z01); - printf("x0=%f, y0=%f, z0=%f\n",x01,y01,z01); - ntuple->Fill(x01,y01*z01); - } - std::cout<GetNvar()<<" "<GetVar1()<GetVar2()<Fill(x01,y01); - //cout<Fill(x0,y0); - } - std::cout<GetNvar()<<" "<GetVar1()<GetVar2()<Fill(x01,y01); - //cout<Fill(x0,y0); - } - std::cout<GetNvar()<<" "<GetVar1()<GetVar2()<Mass{"260","270","280","290","300","310","320","330","340","350","360","370","380","390","400","410","420","430","440","450"};//,"400","450","500","550","600","650","700","800","900","1000","1100"}; - //Mass={"260","270","300","350","400"}; - //std::vectorMass2{"260","270","300","350","400"}; - //std::vectorMass3{"260","270","300","350","400"}; - std::vectorTFileVec; - std::vectorTTrees; - //std::vectorTFileVec2; - //std::vectorTTrees2; - //std::vectorTFileVec3; - //std::vectorTTrees3; - TBranch *b_limit=nullptr; - //TBranch *b_limit2=nullptr; - //TBranch *b_limit3=nullptr; - Double_t limit=0; - //Double_t limit2=0; - //Double_t limit3=0; - std::vector>rad(6,std::vector(int(radMASS.size()),0)); - //std::vector>rad2(6,std::vector(int(Mass2.size()))); - //std::vector>rad3(6,std::vector(int(Mass3.size()))); - TFile *file=nullptr; - for(unsigned int i =0;i!=radMASS.size();++i) - { - std::string name=dirs[i];//path+radMASS[i]+path2+radMASS[i]; - //if(i<20) - //{ - //if (twobtag==false) name+="_onecatnohiggs.root"; - /*else*/ name+="_higgs.root"; - //} - //std::cout<IsOpen())) - { - std::cout<<"File : "<Get("limit;1")); - TTrees[i]->SetMakeClass(1); - TTrees[i]->SetBranchAddress("limit", &limit, &b_limit); - for (int k = 0; k<6; k++) - { - TTrees[i]->GetTree()->GetEntry(k); - rad[k][i]=limit*radCX[i]*br; - std::cout <<"MX = "<< radMASS[i]<<" centrality "<< i<<" limit = " << limit << std::endl; - } - } - /*for(unsigned int i =0;i!=Mass2.size();++i) - { - std::string name=pathh+Mass2[i]+path2+Mass2[i]; - std::cout<IsOpen()))std::exit(-1); - TFileVec2.push_back(file); - TTrees2.push_back((TTree*)TFileVec2[i]->Get("limit;1")); - TTrees2[i]->SetMakeClass(1); - TTrees2[i]->SetBranchAddress("limit", &limit2, &b_limit2); - for (int k = 0; k<6; k++) - { - TTrees2[i]->GetTree()->GetEntry(k); - rad2[k][i]=limit2*radCX2[i]*br; - std::cout <<"MX = "<< radMASS2[i]<<" centrality "<< i<<" limit = " << limit2 << std::endl; - } - }*/ - /*for(unsigned int i =0;i!=Mass3.size();++i) - { - std::string name=pathhh+Mass3[i]+path2+Mass3[i]; - std::cout<IsOpen()))std::exit(-1); - TFileVec3.push_back(file); - TTrees3.push_back((TTree*)TFileVec3[i]->Get("limit;1")); - TTrees3[i]->SetMakeClass(1); - TTrees3[i]->SetBranchAddress("limit", &limit3, &b_limit3); - for (int k = 0; k<6; k++) - { - TTrees3[i]->GetTree()->GetEntry(k); - rad3[k][i]=limit3*radCX3[i]*br; - std::cout <<"MX = "<< radMASS3[i]<<" centrality "<< i<<" limit = " << limit3 << std::endl; - } - }*/ - delete file; - TPaveText *pt = new TPaveText(0.15,0.93,0.95,0.97, "brNDC"); - // pt->SetName("title"); - pt->SetBorderSize(0); - pt->SetFillColor(0); - // pt->SetShadowColor(kWhite); - if (!HH) pt->AddText(TString::Format("CMS L = %.2f fb^{-1} #sqrt{s} = %s",lumi,energy.c_str())); - else pt->AddText(TString::Format("CMS (Unpublished) L = %.2f fb^{-1} #sqrt{s} = %s",lumi,energy.c_str())); - pt->SetTextSize(0.04); - TPaveText *Purity = new TPaveText(0.78,0.53,0.88,0.58, "brNDC"); - // pt->SetName("title"); - Purity->SetBorderSize(0); - Purity->SetFillColor(0); - // pt->SetShadowColor(kWhite); - if(twobtag) Purity->AddText("High Purity"); - else Purity->AddText("High+Medium Purity"); - Purity->SetTextSize(0.04); - Purity->SetTextColor(kBlue); - - TPaveText *BF = new TPaveText(0.74,0.60,0.88,0.63, "brNDC"); - // pt->SetName("title"); - BF->SetBorderSize(0); - BF->SetFillColor(0); - // pt->SetShadowColor(kWhite); - BF->AddText("X #rightarrow HH #rightarrow #gamma#gammab#bar{b}"); - BF->SetTextSize(0.04); - BF->SetTextColor(kBlue); - - // TPaveText *BF = new TPaveText(0.7,0.93,0.8,0.99, "brNDC"); - // pt->SetName("title"); - //pt->SetBorderSize(0); - //pt->SetFillColor(0); - // pt->SetShadowColor(kWhite); - //pt->AddText("CMS Preliminary L = 19.7 fb^{-1} #sqrt{s} = 8 TeV"); - //pt->SetTextSize(0.04); - - // we do a plot r*MR - TMultiGraph *mg = new TMultiGraph(); - if(!HH) mg->SetMinimum(0.01); - if(!HH && low) mg->SetMinimum(0); - if(HH) mg->SetMinimum(10); // HH - if(HH && low) mg->SetMinimum(0); // HH 1000000 - if(HH && low) mg->SetMaximum(5200); // HH 1000000 - if(!HH && low) mg->SetMaximum(39.99); // 10000 - if(HH && !low) mg->SetMaximum(200000); // HH - if(!HH && !low) mg->SetMaximum(600); // - if(!HH && !low) mg->SetMaximum(40); - - TLine* T = new TLine(400, 0.01, 400, 1); - T->SetLineStyle(2); - // if(!HH && twobtag) {mg->SetTitle("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)*2*BR(#gamma #gamma)*BR(bb) (fb)}}{#scale[0.8]{CMS preliminary 19.7/fb - 2 btag only }}"); - // TText *text = pt->AddText("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)*2*BR(#gamma #gamma)*BR(bb) (fb)}}{#scale[0.8]{CMS preliminary 19.7/fb - 2 btag only}}"); - // } - // if(!HH && !twobtag) {mg->SetTitle("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)*2*BR(#gamma #gamma)*BR(bb) (fb)}}{#scale[0.8]{CMS preliminary 19.7/fb }}"); - // TText *text = pt->AddText("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)*2*BR(#gamma #gamma)*BR(bb) (fb)}}{#scale[0.8]{CMS preliminary 19.7/fb }}"); - // } - - //// mg->SetTitle("CMS Preliminary L = 19.7 fb^{-1} #sqrt{s} = 8 TeV; M_{X} (GeV); #sigma(pp -> X)*BR(X -> HH -> #gamma #gamma bb) (fb)"); - if (!HH) mg->SetTitle("; m_{X} (GeV); #sigma(pp #rightarrow X) #times BR(X #rightarrow HH #rightarrow #gamma#gammab#bar{b}) (fb)"); - if (HH) mg->SetTitle("; m_{X} (GeV); #sigma(pp #rightarrow X) #times BR(X #rightarrow HH) (fb)"); - - - // if(HH) {mg->SetTitle("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)(fb) - SM Higgs BR}}{#scale[0.8]{CMS preliminary 19.7/fb }}"); - // TText *text = pt->AddText("#splitline{#scale[1.0]{#sigma(pp -> X)*BR(HH)*2*BR(#gamma #gamma)*BR(bb) (fb)}}{#scale[0.8]{CMS preliminary 19.7/fb }}"); - //} - //if(HH) mg->SetTitle("Radion > HH > #gamma #gamma bb~"); - // float radMASS[nmass]={300,500,700,1000}; - TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); - int nmax=0; - //int nmax2=0; - //int nmax3=0; - if(low) - { - if(radMASS.size()<5) nmax= radMASS.size();//nmass;//nmass - else nmax=5; - } - if(!low) - { - nmax= radMASS.size();//nmass - // nmax2= Mass2.size();//nmass - // nmax3= Mass3.size(); - } - Double_t yobs[nmax], y2up[nmax], y1up[nmax], y1down[nmax], y2down[nmax], ymean[nmax]; - for(int i=0;i!=nmax;++i) - { - yobs[i]=0; - y2up[i]=0; - y1up[i]=0; - y1down[i]=0; - y2down[i]=0; - ymean[i]=0; - } - //Double_t yobs2[nmax2], y2up2[nmax2], y1up2[nmax2], y1down2[nmax2], y2down2[nmax2], ymean2[nmax2]; - //Double_t yobs3[nmax3], y2up3[nmax3], y1up3[nmax3], y1down3[nmax3], y2down3[nmax3], ymean3[nmax3]; - // - - c1->cd(); - pt->Draw(); - - if(low) c1->SetLogy(0); - if(!low) c1->SetLogy(1); - c1->SetLogy(0); - //c1->SetGrid(); - - // if(HH) ntuple->Draw("y*(9/1)*0.25 : x"); - // if(!HH) ntuple->Draw("y*0.25*0.577*0.00228*2*9 : x"); - - if(HH) ntuple->Draw("y*9 : x"); - if(!HH) ntuple->Draw("y*0.577*0.00228*2*9 : x"); - TGraphErrors *radion10 = new TGraphErrors(ntuple->GetSelectedRows(), ntuple->GetV2(), ntuple->GetV1()); - radion10->SetLineColor(kRed); - radion10->SetLineWidth(3); - if(HH) ntuple->Draw("y : x"); - if(!HH) ntuple->Draw("y*0.577*0.00228*2 : x"); - TGraphErrors *radion = new TGraphErrors(ntuple->GetSelectedRows(), ntuple->GetV2(), ntuple->GetV1());//point,radionx,radiony); - radion->SetLineWidth(3); - TGraphErrors *rsgrav =nullptr; - TGraphErrors *bulk3=nullptr; - if(base) - { - // RS graviton lambda =1 - - if(HH) ntupleg->Draw("y : x"); - if(HH) ntuplegrs->Draw("y : x"); - if(!HH) ntuplegrs->Draw("y*0.577*0.00228*2 : x"); - rsgrav = new TGraphErrors(ntuplegrs->GetSelectedRows(), ntuplegrs->GetV2(), ntuplegrs->GetV1()); - rsgrav->SetLineColor(kRed); - rsgrav->SetLineWidth(3); - rsgrav->SetLineStyle(2); - // bulk graviton - if(HH) ntupleg->Draw("y : x"); - if(!HH) ntupleg->Draw("y*0.577*0.00228*2 : x"); - bulk3 = new TGraphErrors(ntupleg->GetSelectedRows(), ntupleg->GetV2(), ntupleg->GetV1());// - bulk3->SetLineColor(kBlack); - bulk3->SetLineWidth(3); - bulk3->SetLineStyle(2); - } //if base plt graviton - c1->Clear(); - for (Int_t i=0;iSetMarkerStyle(kFullDotLarge); - grobs->SetMarkerColor(kBlue); - grobs->SetLineColor(kBlue); - grobs->SetLineWidth(2); - grobs->SetLineStyle(2); - - TGraphErrors *grmean = new TGraphErrors(1); - grmean->SetLineColor(1); - grmean->SetLineWidth(3); - grmean->SetLineStyle(3); - grmean->SetMarkerSize(0); - for(int j=0;jSetPoint(j, radMASS[j], yobs[j]); - grmean->SetPoint(j, radMASS[j], ymean[j]); - } - - // TGraphErrors *grobs2 = new TGraphErrors(1); - // grobs2->SetMarkerStyle(kStar); - // grobs2->SetMarkerColor(kBlue); - // grobs2->SetLineColor(kBlue); - // grobs2->SetLineWidth(2); - // grobs2->SetLineStyle(2); - // - // TGraphErrors *grmean2 = new TGraphErrors(1); - // grmean2->SetLineColor(kBlue); - // grmean2->SetMarkerStyle(kStar); - // grmean2->SetLineWidth(3); - // grmean2->SetLineStyle(3); - // grmean2->SetMarkerSize(0.01); - - // TGraphErrors *grgreen2 = new TGraphErrors(1); - // grgreen2->SetLineColor(kGreen); - // grgreen2->SetMarkerStyle(kStar); - // grgreen2->SetLineWidth(3); - // grgreen2->SetLineStyle(3); - // grgreen2->SetMarkerSize(1); - // grgreen2->SetMarkerColor(kOrange+10); - - // TGraphErrors *gryellow2 = new TGraphErrors(1); - // gryellow2->SetLineColor(kRed); - // gryellow2->SetMarkerStyle(kStar); - // gryellow2->SetLineWidth(3); - // gryellow2->SetLineStyle(3); - // gryellow2->SetMarkerSize(1); - // gryellow2->SetMarkerColor(kGreen); - - - - // TGraphErrors *grgreen3 = new TGraphErrors(1); - // grgreen3->SetLineColor(kGreen); - // grgreen3->SetMarkerStyle(kStar); - // grgreen3->SetLineWidth(3); - // grgreen3->SetLineStyle(3); - // grgreen3->SetMarkerSize(1); - // grgreen3->SetMarkerColor(kOrange+10); - - //TGraphErrors *gryellow3 = new TGraphErrors(1); - // gryellow3->SetLineColor(kRed); - // gryellow3->SetMarkerStyle(kStar); - //gryellow3->SetLineWidth(3); - // gryellow3->SetLineStyle(3); - // gryellow3->SetMarkerSize(1); - // gryellow3->SetMarkerColor(kGreen); - - - - - - - - - - - - - - - - - - - - - - //TGraphErrors *grobs3 = new TGraphErrors(1); - // grobs3->SetMarkerStyle(kFullSquare); - // grobs3->SetMarkerColor(kBlue); - // grobs3->SetLineColor(kBlue); - // grobs3->SetLineWidth(2); - // grobs3->SetLineStyle(2); - - // TGraphErrors *grmean3 = new TGraphErrors(1); - // grmean3->SetLineColor(kMagenta); - // grmean3->SetMarkerStyle(22); - // grmean3->SetMarkerColor(kMagenta); - // grmean3->SetLineWidth(3); - // grmean3->SetLineStyle(3); - // grmean3->SetMarkerSize(1); - - // TGraphErrors *grgreen4 = new TGraphErrors(1); - // grgreen4->SetLineColor(kGreen); - // grgreen4->SetMarkerStyle(kFullSquare); - // grgreen4->SetLineWidth(3); - // grgreen4->SetLineStyle(3); - // grgreen4->SetMarkerSize(1); - // grgreen4->SetMarkerColor(kOrange+2); - - /// TGraphErrors *gryellow4 = new TGraphErrors(1); - //gryellow4->SetLineColor(kRed); - //gryellow4->SetMarkerStyle(kFullSquare); - //gryellow4->SetLineWidth(3); - // gryellow4->SetLineStyle(3); - //gryellow4->SetMarkerSize(1); - //gryellow4->SetMarkerColor(kGreen+2); - - - - // TGraphErrors *grgreen5 = new TGraphErrors(1); - // grgreen5->SetLineColor(kGreen); - // grgreen5->SetMarkerStyle(kFullSquare); - //grgreen5->SetLineWidth(3); - //grgreen5->SetLineStyle(3); - // grgreen5->SetMarkerSize(1); - //grgreen5->SetMarkerColor(kOrange+2); - - // TGraphErrors *gryellow5 = new TGraphErrors(1); - // gryellow5->SetLineColor(kRed); - // gryellow5->SetMarkerStyle(kFullSquare); - /// gryellow5->SetLineWidth(3); - // gryellow5->SetLineStyle(3); - // gryellow5->SetMarkerSize(1); - // gryellow5->SetMarkerColor(kGreen+2); - - - - - - - - - - - /* for(int j=0;jSetPoint(j, radMASS2[j], yobs2[j]); - grmean2->SetPoint(j, radMASS2[j], ymean2[j]); - grgreen2->SetPoint(j,radMASS2[j],y2up2[j]); - grgreen3->SetPoint(j,radMASS2[j],y2down2[j]); - gryellow2->SetPoint(j,radMASS2[j],y1up2[j]); - gryellow3->SetPoint(j,radMASS2[j],y1down2[j]); - }*/ - /* for(int j=0;jSetPoint(j, radMASS3[j], yobs3[j]); - grmean3->SetPoint(j, radMASS3[j], ymean3[j]); - grgreen4->SetPoint(j,radMASS3[j],y2up3[j]); - grgreen5->SetPoint(j,radMASS3[j],y2down3[j]); - gryellow4->SetPoint(j,radMASS3[j],y1up3[j]); - gryellow5->SetPoint(j,radMASS3[j],y1down3[j]); - }*/ - mg->Add(grmean,"L*");//->Draw("same,AC*"); - if(obs) mg->Add(grobs,"L,P");//->Draw("AC*"); - - - - mg->Draw("AP"); - mg->GetXaxis()->SetRangeUser(100,1400); - mg->GetYaxis()->SetTitleSize(0.05); - mg->GetXaxis()->SetTitleSize(0.042); - mg->GetYaxis()->SetLabelSize(0.05); - mg->GetYaxis()->SetTitleOffset(1.3); - mg->GetYaxis()->CenterTitle(true); - mg->GetXaxis()->SetTitleOffset(1.01); - mg->GetXaxis()->CenterTitle(true); - // histo to shade - int n=nmax; - TGraph *grgreen = new TGraph(2*n); - TGraph *gryellow = new TGraph(2*n); - for (int i=0;iSetPoint(i,radMASS[i],y2up[i]); - grgreen->SetPoint(n+i,radMASS[n-i-1],y2down[n-i-1]); - // - gryellow->SetPoint(i,radMASS[i],y1up[i]); - gryellow->SetPoint(n+i,radMASS[n-i-1],y1down[n-i-1]); - - std::cout<<" observed "<SetPoint(i,radMASS2[i],y2up2[i]); - grgreen2->SetPoint(n+i,radMASS2[i],y2down2[i]); - // - gryellow2->SetPoint(i,radMASS2[i],y1up2[i]); - gryellow2->SetPoint(i,radMASS2[i],y1down2[i]); - - std::cout<<" observed "<SetMarkerSize(0.00001); - grgreen->SetMarkerColor(kOrange); - grgreen->SetLineColor(kOrange); - grgreen->SetFillColor(kOrange); - grgreen->Draw("f"); - gryellow->SetFillColor(kGreen+2); - gryellow->SetLineColor(kGreen+2); - gryellow->SetMarkerColor(kGreen+2); - gryellow->SetMarkerSize(0.00001); - gryellow->Draw("f"); - grmean->Draw("L,same"); - - -/* - grgreen2->SetMarkerSize(0.00001); - grgreen2->SetMarkerColor(kRed); - grgreen2->SetMarkerStyle(kStar); - grgreen2->SetLineColor(kRed); - grgreen2->SetFillColor(kRed);*/ - //grgreen2->Draw("*,same"); - //grgreen3->Draw("*,same"); - //grgreen4->Draw("*,same"); - //grgreen5->Draw("*,same"); - /*gryellow2->SetFillColor(kBlue+2); - gryellow2->SetMarkerStyle(kStar); - gryellow2->SetLineColor(kBlue+2); - gryellow2->SetMarkerColor(kBlue+2); - gryellow2->SetMarkerSize(0.00001);*/ - - //gryellow2->Draw("*,same"); - //gryellow3->Draw("*,same"); - //gryellow4->Draw("*,same"); - //gryellow5->Draw("*,same"); - //grmean2->SetMarkerStyle(kStar); - // grmean2->SetMarkerStyle(kBlue); - // grmean2->Draw("*,same"); - // grmean3->Draw("P,same"); - //grobs3->Draw("*,same"); - //grmean2->SetMarkerSize(1); - if(obs) grobs->Draw("L,P,E,same"); - - ///////////////////////////////////////////////////////////// - // cross checks - TGraphErrors *gcheck1=nullptr; - TGraphErrors *gcheck2=nullptr; - TGraphErrors *gcheck4=nullptr; - TGraphErrors *gcheck7=nullptr; - if(!HH) - { - int check1mass[3] = {400,450,500}; - Double_t check1limit[3]={1.66,1.25,0.96}; - gcheck1 = new TGraphErrors(1); - gcheck1->SetMarkerStyle(kFullDotLarge); - gcheck1->SetLineColor(kRed+2); - gcheck1->SetMarkerColor(kRed+2); - gcheck1->SetLineWidth(3); - - for(int j=0;j<3;j++) gcheck1->SetPoint(j, check1mass[j], check1limit[j]*br); - if(low && !base)gcheck1->Draw("L,P"); - // sidebands - int check2mass[5] = {270,300,350,400,450}; - Double_t check2limit[5]={2.49, 2.63, 1.96, 1.37, 1.09}; - gcheck2 = new TGraphErrors(1); - gcheck2->SetMarkerStyle(kFullDotLarge); - gcheck2->SetLineColor(kRed-7); - gcheck2->SetMarkerColor(kRed-7); - gcheck2->SetLineWidth(3); - for(int j=0;j<5;j++) gcheck2->SetPoint(j, check2mass[j], check2limit[j]*br); - if(low && !base)gcheck2->Draw("L,P"); - // - int check4mass[11] = {400,450,500,550,600,650,700,800,900,1000,1100}; - Double_t check4limit[11]={2.65,1.88,1.14,1.13,0.93,0.82,0.76,0.68,0.68,0.74,0.93}; - gcheck4 = new TGraphErrors(1); - gcheck4->SetMarkerStyle(kFullDotLarge); - gcheck4->SetLineColor(kViolet); - gcheck4->SetMarkerColor(kViolet); - gcheck4->SetLineWidth(3); - for(int j=0;j<11;j++) gcheck4->SetPoint(j, check4mass[j], check4limit[j]*br); - if(!low && !base) gcheck4->Draw("L,P"); - // - // - int check7mass[11] = {400,450,500,550,600,650,700,800,900,1000,1100}; // 4body wo/ kinfit - Double_t check7limit[11]={2.90,2.46,2.29,1.63,1.40,1.16,1.11,0.75,0.68,0.67,0.74 }; - gcheck7 = new TGraphErrors(1); - gcheck7->SetMarkerStyle(kFullDotLarge); - gcheck7->SetLineColor(kRed+3); - gcheck7->SetMarkerColor(kRed+3); - gcheck7->SetLineWidth(3); - for(int j=0;j<11;j++) gcheck7->SetPoint(j, check7mass[j], check7limit[j]*br); - if(!low && !base) gcheck7->Draw("L,P"); - } // close cross checks - - ////////////////////////////////////////////////////////////////////// - // 2btag wo higgs - int check3mass[6] = {270,300,350,400,450,500}; - Double_t check3limit[6]={2.85,3.14,2.71,2.01,1.53,1.22}; - TGraphErrors *gcheck3 = new TGraphErrors(1); - gcheck3->SetMarkerStyle(kFullDotLarge); - gcheck3->SetLineColor(kCyan); - gcheck3->SetMarkerColor(kCyan); - gcheck3->SetLineWidth(3); - - for(int j=0;j<3;j++) gcheck3->SetPoint(j, check3mass[j], check3limit[j]*br); - - // 2btag w higgs - int check5mass[6] = {270,300,350,400,450,500}; - Double_t check5limit[6]={3.1406,3.6094,2.7266,2.3359,1.7734,1.3945}; - TGraphErrors *gcheck5 = new TGraphErrors(1); - gcheck5->SetMarkerStyle(kFullDotLarge); - gcheck5->SetLineColor(kMagenta); - gcheck5->SetMarkerColor(kMagenta); - gcheck5->SetLineWidth(3); - for(int j=0;j<6;j++) gcheck5->SetPoint(j, check5mass[j], check5limit[j]*br); - if(!low && !base) gcheck5->Draw("L,P"); - // wo higgs - int check6mass[6] = {270,300,350,400,450,500}; - Double_t check6limit[6]={3.1406,3.6094,2.7266,2.3359,1.7734,1.3945}; - TGraphErrors *gcheck6 = new TGraphErrors(1); - gcheck6->SetMarkerStyle(kFullDotLarge); - gcheck6->SetLineColor(kBlue); - gcheck6->SetMarkerColor(kBlue); - gcheck6->SetLineWidth(3); - for(int j=0;j<3;j++) gcheck6->SetPoint(j, check6mass[j], check6limit[j]*br); - /////////////////////////////////////////// - radion->Draw("L,same"); - if(!low) radion10->Draw("L,same"); - if(base) rsgrav->Draw("L,same"); - if(base && !low) bulk3->Draw("L,same"); - - if(base) leg->SetHeader("WED: kl = 35, k/Mpl = 0.2, elementary top, no r/H mixing"); - - if(obs) leg1->AddEntry(grobs, "Observed 95% upper limit", "L,P"); - if(!base && low) {leg1->AddEntry(grmean, "Expected (m#gamma #gamma fit w/ Higgs)", "L"); } - else leg1->AddEntry(grmean, "Expected 95% upper limit", "L"); - - leg1->AddEntry(gryellow, "Expected limit #pm 1 #sigma", "f"); - leg1->AddEntry(grgreen, "Expected limit #pm 2 #sigma", "f"); - leg->AddEntry(radion, "radion (#Lambda_{R} = 3 TeV)", "L"); -// if(!low) leg->AddEntry(radion10, "radion (#Lambda_{R} = 1 TeV)", "L"); -// if(base) leg->AddEntry(rsgrav, "RS1 KK-graviton ", "L"); -// if(base && !low) leg->AddEntry(bulk3, "Bulk KK-graviton ", "L"); - - - if(!base) - { - if(low) leg->AddEntry(gcheck1, "m#gamma #gamma fit (w/ higgs)", "LP"); - if(!low)leg->AddEntry(gcheck4, " 4 body fit - 2 btag only (w/ kinfit)", "LP"); - if(!low )leg->AddEntry(gcheck7, " 4 body fit - wo/ kinfit ", "LP"); - if(!low)leg->AddEntry(gcheck5, "m#gamma #gamma fit - 2 btag only (wo/ Higgs)", "LP"); - if(low)leg->AddEntry(gcheck2, "#gamma #gamma Sidebands (stat only)", "LP"); - } - leg->Draw(); - leg1->Draw(); - pt->Draw(); - if (!low) T->Draw(); - if (twobtag) Purity->Draw(); - if (HH) BF->Draw(); - - if( !base) - { - TLine l(400,0.01,400,4.6); - l.Draw(); - } - c1->Update(); - std::string folderr=path_dir+"/BrazilianFlag"; - std::string name="/WP4_cutbased"; - if(HH)name+="_HH"; - if(low)name+="_low"; - if(base)name+="_base"; - if(twobtag)name+="_onecat"; - boost::filesystem::create_directory(folderr); - folderr+=name; - - - TGraph* ThisIsRadion; - if(PrintRadion13TeV){ - Double_t RadToHH[] = {2238.55, 2376.22, 2104.53, 1804.82, 1540.86, 1154.92, 896.161, 733.914, 495.567, 362.581, 277.513, 219.251, 177.292, 146.142, 122.775, 104.76 , 90.6293, 79.4959}; - Double_t RadTobbgg[18]; - for ( int mm = 0; mm < 18; mm++){ - RadTobbgg[mm] = RadToHH[mm]*2.6e-03; - } - - Double_t RadMasses[] = {260, 280, 300, 320, 340, 360, 380, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900}; - - ThisIsRadion = new TGraph(18, RadMasses, RadTobbgg); - c1->cd(); - ThisIsRadion->Draw("Csame"); - ThisIsRadion->SetLineWidth(3); - ThisIsRadion->SetLineColor(1); - c1->Update(); - } - - c1->SaveAs((folderr+".png").c_str()); - c1->SaveAs((folderr+".pdf").c_str()); - c1->SaveAs((folderr+".root").c_str()); - - mg->SetMaximum(200); - mg->SetMinimum(0.01); - c1->SetLogy(); - c1->Update(); - c1->SaveAs((folderr+"LOG.png").c_str()); - c1->SaveAs((folderr+"LOG.pdf").c_str()); - - //if(HH && low ) c1->SaveAs("/WP4_cutbased_HH_low.png"); // HH - //if(HH && low ) c1->SaveAs("/WP4_cutbased_HH_low.pdf"); // HH -// if(HH && low ) c1->SaveAs("/WP4_cutbased_HH_low.root"); // HH - // if(!HH && low && !base) c1->SaveAs("/WP4_cutbased_low.png"); - // if(!HH && low && !base) c1->SaveAs("/WP4_cutbased_low.pdf"); - // if(!HH && low && !base) c1->SaveAs("/WP4_cutbased_low.root"); - //if(HH && !low ) c1->SaveAs("/WP4_cutbased_HH.png"); // HH - // if(HH && !low ) c1->SaveAs("/WP4_cutbased_HH.pdf"); // HH -//if(HH && !low ) c1->SaveAs("/WP4_cutbased_HH.root"); // HH - //if(!HH && !low && !base) c1->SaveAs("/WP4_cutbased.png"); - //if(!HH && !low && !base) c1->SaveAs("/WP4_cutbased.pdf"); - //if(!HH && !low && !base) c1->SaveAs("/WP4_cutbased.root"); - // - //if(!HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_base_onecat.png"); // HH - //if(!HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_base_onecat.pdf"); // HH - // if(!HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_base_onecat.root"); // HH - - // if(HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_HH_onecat.png"); // HH - // if(HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_HH_onecat.pdf"); // HH - // if(HH && low && base && twobtag) c1->SaveAs("/WP4_cutbased_low_HH_onecat.root"); // HH - // if(!HH && low && base && !twobtag) c1->SaveAs("/WP4_cutbased_low_base.png"); // HH - // if(!HH && low && base && !twobtag) c1->SaveAs("/WP4_cutbased_low_base.pdf"); // HH - // if(!HH && low && base && !twobtag) c1->SaveAs("/WP4_cutbased_low_base.root"); // HH - // if(!HH && !low && base) c1->SaveAs("/WP4_cutbased_base.png"); - // if(!HH && !low && base) c1->SaveAs("/WP4_cutbased_base.pdf"); - // if(!HH && !low && base) c1->SaveAs("/WP4_cutbased_base.root"); - //return c1; - - delete defaultStyle; - /*delete leg; - delete leg1; - delete ntuple; - delete ntupleg; - delete ntuplegrs; - delete pt; - delete Purity; - delete BF; - delete mg; - delete T; - delete c1; - delete radion10; - delete radion; - delete rsgrav; - delete bulk3; - delete grobs; - delete grgreen; - delete gryellow; - delete gcheck1; - delete gcheck2; - delete gcheck4; - delete gcheck7; - delete gcheck3; - delete gcheck5;*/ - //for(unsigned int i=0;i!=TTrees.size();++i) delete TTrees[i]; - //for(unsigned int i=0;i!=TFileVec.size();++i)delete TFileVec[i]; -} diff --git a/src/Linkdef.h b/src/Linkdef.h index 992a082..7336de5 100644 --- a/src/Linkdef.h +++ b/src/Linkdef.h @@ -1,9 +1,7 @@ #include "HiggsAnalysis/bbggLimits/interface/bbggLTMaker.h" #include "HiggsAnalysis/bbggLimits/interface/bbgg2DFitter.h" -//#include "HiggsAnalysis/bbggLimits/interface/bbggHighMassFitter.h" #ifdef _CINT_ #pragma link C++ class bbggLTMaker; #pragma link C++ class bbgg2DFitter; -//#pragma link C++ class bbggHighMassFitter; #endif diff --git a/src/bbgg2DFitter.cc b/src/bbgg2DFitter.cc index c5bffc1..16ee9d5 100644 --- a/src/bbgg2DFitter.cc +++ b/src/bbgg2DFitter.cc @@ -1,7 +1,7 @@ #define bbgg2DFitter_cxx #include "HiggsAnalysis/bbggLimits/interface/bbgg2DFitter.h" #include "HiggsAnalysis/bbggLimits/interface/bbggFittingTools.h" -#include "HiggsAnalysis/bbggLimits/interface/Colors.h" +//#include "HiggsAnalysis/bbggLimits/interface/Colors.h" #include "HiggsAnalysis/CombinedLimit/interface/RooMultiPdf.h" #include "HiggsAnalysis/CombinedLimit/interface/HZZ2L2QRooPdfs.h" //Boost @@ -161,7 +161,7 @@ void bbgg2DFitter::Initialize(RooWorkspace* workspace, Int_t SigMass, float Lumi <<"\n "<defineType("cat4_0",0); cut_based_ct->defineType("cat4_1",1); cut_based_ct->defineType("cat4_2",2); @@ -204,12 +212,15 @@ RooArgSet* bbgg2DFitter::defineVariables() int bbgg2DFitter::AddSigData(float mass, TString signalfile) { - TFile sigFile(signalfile); - bool opened=sigFile.IsOpen(); + if (_verbLvl>1) std::cout << "================= Add Signal========================== " << _wName.c_str() << " " << _doARW << " " << _nonResWeightIndex << std::endl; + if (_verbLvl>1) std::cout << " File to open:"<IsOpen(); if(opened==false) return -1; - TTree* sigTree = (TTree*)sigFile.Get("TCVARS"); - - if (_verbLvl>1) std::cout << "================= Add Signal============================== " << _wName.c_str() << " " << _doARW << " " << _nonResWeightIndex << std::endl; + if (_verbLvl>1) std::cout << " TFile opened:"<Get("TCVARS"); + //Luminosity RooRealVar lumi("lumi","lumi", _lumi); _w->import(lumi); @@ -305,7 +316,13 @@ int bbgg2DFitter::AddSigData(float mass, TString signalfile) std::vector bbgg2DFitter::AddHigData(float mass, TString signalfile, int higgschannel, TString higName) { - RooArgSet* ntplVars = defineVariables(); + if (_verbLvl>1) { + std::cout << "================= Adding Single Higgs ==========================" <Branch("mjj", &o_bbMass, "o_bbMass/D"); outTree->Branch("mgg", &o_ggMass, "o_ggMass/D"); outTree->Branch("mtot", &o_bbggMass, "o_bbggMass/D"); // - outTree->Branch("btmap", &btmap); + //outTree->Branch("btmap", &btmap); outTree->Branch("jet1PT", &jet1PT, "jet1PT/D"); outTree->Branch("jet2PT", &jet2PT, "jet2PT/D"); outTree->Branch("jet1ETA", &jet1ETA, "jet1ETA/D"); @@ -97,25 +96,35 @@ void bbggLTMaker::Loop() } // Now get the Histograms for re-weighting from the root file. - // Note that the following file is not committed to git (it's too large). - // Get it from /afs/cern.ch/user/a/andrey/public/HH/weights_v1_1507_points.root - // and copy in your working directory: - TString fileNameWei = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/weights_v1_1507_points.root"); + TString fileNameWei = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/data/weights_v1_1507_points.root"); NRwFile = new TFile(fileNameWei, "OPEN"); - - if (NRwFile->IsZombie()){ - cout<<" Input file does not exist!"<IsZombie() || NRwFile2->IsZombie()){ + cout<<" Input file for Non-Res weights does not exist!"<Print(); - + NRwFile2->Print(); + TList *histList = NRwFile->GetListOfKeys(); - for (UInt_t n=0; nContains(Form("point_%i_weights",n))) NR_Wei_Hists[n] = (TH2F*)NRwFile->Get(Form("point_%i_weights",n)); else cout<<"This one does not existe pas: "<GetListOfKeys(); + for (UInt_t n=0; n<12; n++){ + if (histList2->Contains(Form("point_%i_weights",n))) + NR_Wei_Hists[1507+n] = (TH2F*)NRwFile2->Get(Form("point_%i_weights",n)); + else + cout<<"This one does not existe pas: "<<1507+n<GetEntriesFast(); @@ -135,10 +144,10 @@ void bbggLTMaker::Loop() } if(phoVariation > -100){ -// TString phoSFID_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/mvaIDsf.root"); + // TString phoSFID_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/mvaIDsf.root"); TString phoSFID_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/egammaEffi.txt_EGM2D.root"); cout << "phoSFsID file: " << phoSFID_file << endl; -// TString phoSFeveto_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/csevsf.root"); + // TString phoSFeveto_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/csevsf.root"); TString phoSFeveto_file = TString(std::getenv("CMSSW_BASE")) + TString("/src/HiggsAnalysis/bbggLimits/Weights/MVAID/ScalingFactors_80X_Summer16.root"); cout << "phoSFsEV file: " << phoSFeveto_file << endl; bbggLTMaker::SetupPhotonSF( phoSFID_file, phoSFeveto_file); @@ -210,25 +219,11 @@ void bbggLTMaker::Loop() if(doKinFit) o_bbggMass = diHiggsCandidate_KF->M(); if(doMX) - o_bbggMass = diHiggsCandidate->M() - dijetCandidate->M() + 125.; + o_bbggMass = diHiggsCandidate->M() - dijetCandidate->M() - diphotonCandidate->M() + 250.; //mtot cut - bool passedMassCut = 1; - - if(o_bbggMass < mtotMin || o_bbggMass > mtotMax) - passedMassCut = 0; - - if(tilt){ - passedMassCut = 1; - if( (o_bbggMass-o_ggMass) > mtotMax - 125.) - passedMassCut = 0; - if( (o_bbggMass-o_ggMass) < mtotMin - 125.) - passedMassCut = 0; - } - - if(passedMassCut == 0) - continue; - + if(o_bbggMass < mtotMin || o_bbggMass > mtotMax) continue; + bool isInterestingRegion = 1; if(isSignal){ if(photonCR==0 && photonCRNormToSig==0) isInterestingRegion = 1; @@ -394,12 +389,15 @@ void bbggLTMaker::Loop() o_NRWeights[n] = 1; } else { - //Check if histogram exist - UInt_t binNum = NR_Wei_Hists[n]->FindBin(gen_mHH, fabs(gen_cosTheta)); - o_NRWeights[n] = NR_Wei_Hists[n]->GetBinContent(binNum); - // Just print out for one n: - if (DEBUG && n==100 && jentry%1000 == 0) - cout< -