From 82b3eca7c31e0fe3adb220e8a9f69b4af97785be Mon Sep 17 00:00:00 2001 From: Paul Krueper Date: Mon, 14 Jul 2025 02:54:26 +0200 Subject: [PATCH 1/2] push test changes --- Background/config_tutorial.py | 2 +- .../inputs_tutorial_profile1D_syst.json | 6 + Combine/models.py | 137 +++++++++++++++++- Datacard/makeYields.py | 28 +++- Datacard/tools/XSBR.py | 129 ++++++++++++++++- Plots/makeMultipdfPlot.py | 2 +- Signal/RunPlotter.py | 6 +- Signal/RunSignalScripts.py | 5 +- Signal/config_STXS_2022postEE.py | 29 ++++ Signal/config_STXS_2022preEE.py | 29 ++++ Signal/config_STXS_2023postBPix.py | 29 ++++ Signal/config_STXS_2023preBPix.py | 29 ++++ Signal/scripts/fTest.py | 111 +++++++------- Signal/scripts/signalFit.py | 15 +- Signal/tools/XSBRMap.py | 129 +++++++++++++++++ Signal/tools/plottingTools.py | 12 +- Signal/tools/replacementMap.py | 50 +++++++ Signal/tools/submissionTools.py | 20 +-- tools/commonObjects.py | 10 +- tools/commonTools.py | 5 +- 20 files changed, 684 insertions(+), 99 deletions(-) create mode 100644 Signal/config_STXS_2022postEE.py create mode 100644 Signal/config_STXS_2022preEE.py create mode 100644 Signal/config_STXS_2023postBPix.py create mode 100644 Signal/config_STXS_2023preBPix.py diff --git a/Background/config_tutorial.py b/Background/config_tutorial.py index 91f4e9a1f..0d88b6511 100644 --- a/Background/config_tutorial.py +++ b/Background/config_tutorial.py @@ -3,7 +3,7 @@ backgroundScriptCfg = { # Setup - 'inputWS':"/eos/user/p/pkrueper/STXS3_2025/src/run3hggstxs/classification/multiclassifier_extended_eval17marchon30may_176_finalfits/data/root/Data/ws/allData_data.root", # location of 'allData.root' file + 'inputWS':"/eos/user/p/pkrueper/STXS_test/run3hggstxs/toms_12julybetterprototype/data/root/Data/ws/allData_data.root", # location of 'allData.root' file 'cats':'auto', # auto: automatically inferred from input ws 'catOffset':0, # add offset to category numbers (useful for categories from different allData.root files) 'ext':'STXS0', # extension to add to output directory diff --git a/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json b/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json index de3e28466..26d6e6349 100644 --- a/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json +++ b/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json @@ -13,6 +13,12 @@ "fit_opts":"--saveInactivePOI 1 --setParameterRanges r_ggH=0,3:r_VBF=0,5 --saveSpecifiedNuis all --freezeParameters MH" }, "mu_STXS0":{ + "pois":"r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", + "fits":"profile1D:statonly:r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", + "points":"40:40", + "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H=1,r_QQ2HQQ=1,r_WH2HLNU=1,r_ZH2HLL=1,r_TTH=1,r_TH=1 --setParameterRanges r_GG2H=0,3:r_QQ2HQQ=0,3:r_WH2HLNU=0,3:r_ZH2HLL=0,3:r_TTH=0,3:r_TH=0,3 --saveSpecifiedNuis all --freezeParameters MH" + }, + "mu_STXS0_old":{ "pois":"r_gghtruth,r_tthtruth,r_thtruth,r_whltruth,r_zhltruth,r_vbftruth", "fits":"profile1D:statonly:r_gghtruth,r_tthtruth,r_thtruth,r_whltruth,r_zhltruth,r_vbftruth", "points":"40:40", diff --git a/Combine/models.py b/Combine/models.py index fb19c982c..82b6caa0d 100644 --- a/Combine/models.py +++ b/Combine/models.py @@ -4,7 +4,25 @@ "mu_STXS":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ --PO \"map=.*/gghtruth.*:r_gghtruth[1,0,3]\" --PO \"map=.*/tthtruth.*:r_tthtruth[1,0,3]\" --PO \"map=.*/thtruth.*:r_thtruth[1,0,3]\" --PO \"map=.*/whltruth.*:r_whltruth[1,0,3]\" --PO \"map=.*/zhltruth.*:r_zhltruth[1,0,3]\" --PO \"map=.*/vbftruth.*:r_vbftruth[1,0,3]\" --PO \"map=.*/vhqtruth.*:r_vbftruth[1,0,3]\" --PO \"map=.*/ggzhtruth.*:r_zhltruth[1,0,3]\" --PO \"map=.*/bbhtruth.*:r_gghtruth[1,0,3]\"", - "mu_STXS0":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ + "mu_STXS0":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ +--PO \"map=.*/GG2H.*:r_GG2H[1,0,3]\" \ +--PO \"map=.*/GG2HQQ.*:r_GG2H[1,0,3]\" \ +--PO \"map=.*/BBH.*:r_GG2H[1,0,3]\" \ +--PO \"map=.*/VBF.*:r_QQ2HQQ[1,0,3]\" \ +--PO \"map=.*/WPLUSH2HQQ.*:r_QQ2HQQ[1,0,3]\" \ +--PO \"map=.*/WMINUSH2HQQ.*:r_QQ2HQQ[1,0,3]\" \ +--PO \"map=.*/ZH2HQQ.*:r_QQ2HQQ[1,0,3]\" \ +--PO \"map=.*/WPLUSH2HLNU.*:r_WH2HLNU[1,0,3]\" \ +--PO \"map=.*/WMINUSH2HLNU.*:r_WH2HLNU[1,0,3]\" \ +--PO \"map=.*/ZH2HLL.*:r_ZH2HLL[1,0,3]\" \ +--PO \"map=.*/ZH2HNUNU.*:r_ZH2HLL[1,0,3]\" \ +--PO \"map=.*/GG2HLL.*:r_ZH2HLL[1,0,3]\" \ +--PO \"map=.*/GG2HNUNU.*:r_ZH2HLL[1,0,3]\" \ +--PO \"map=.*/TTH.*:r_TTH[1,0,3]\" \ +--PO \"map=.*/THQ.*:r_TH[1,0,3]\" \ +--PO \"map=.*/THW.*:r_TH[1,0,3]\" ", + + "mu_STXS0_old":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ --PO \"map=.*/GG2H__preEE.*:r_gghtruth[1,0,3]\" \ --PO \"map=.*/GG2H_FWDH_preEE.*:r_gghtruth[1,0,3]\" \ --PO \"map=.*/TTH__preEE.*:r_tthtruth[1,0,3]\" \ @@ -35,6 +53,123 @@ --PO \"map=.*/GG2HQQ_FWDH_preEE.*:r_gghtruth[1,0,3]\" \ --PO \"map=.*/BBH__preEE.*:r_gghtruth[1,0,3]\"", +"mu_STXS1P2_PROTO":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ +--PO \"map=.*/GG2H_PTH_200_300.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2H_PTH_300_450.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2H_PTH_450_650.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2H_PTH_GT650.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2H_0J_PTH_0_10.*:r_GG2H_0J_PTH_0_10[1,0,8]\" \ +--PO \"map=.*/GG2H_0J_PTH_GT10.*:r_GG2H_0J_PTH_GT10[1,0,8]\" \ +--PO \"map=.*/GG2H_1J_PTH_0_60.*:r_GG2H_1J_PTH_0_60[1,0,8]\" \ +--PO \"map=.*/GG2H_1J_PTH_60_120.*:r_GG2H_1J_PTH_60_120[1,0,8]\" \ +--PO \"map=.*/GG2H_1J_PTH_120_200.*:r_GG2H_1J_PTH_120_200[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_0_350_PTH_0_60.*:r_GG2H_GE2J_MJJ_0_350_PTH_0_60[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_0_350_PTH_60_120.*:r_GG2H_GE2J_MJJ_0_350_PTH_60_120[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_0_350_PTH_120_200.*:r_GG2H_GE2J_MJJ_0_350_PTH_120_200[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/BBH_FID.*:r_GG2H_0J_PTH_GT10[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_PTH_200_300.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_PTH_300_450.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_PTH_450_650.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_PTH_GT650.*:r_GG2H_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_0J_PTH_0_10.*:r_GG2H_0J_PTH_0_10[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_0J_PTH_GT10.*:r_GG2H_0J_PTH_GT10[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_1J_PTH_0_60.*:r_GG2H_1J_PTH_0_60[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_1J_PTH_60_120.*:r_GG2H_1J_PTH_60_120[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_1J_PTH_120_200.*:r_GG2H_1J_PTH_120_200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_0_350_PTH_0_60.*:r_GG2H_GE2J_MJJ_0_350_PTH_0_60[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_0_350_PTH_60_120.*:r_GG2H_GE2J_MJJ_0_350_PTH_60_120[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_0_350_PTH_120_200.*:r_GG2H_GE2J_MJJ_0_350_PTH_120_200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_GG2H_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/VBF_0J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/VBF_1J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_0_60.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_60_120.*:r_QQ2HQQ_GE2J_MJJ_60_120[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_120_350.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_GT350_PTH_GT200.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/TTH_PTH_0_60.*:r_TTH_PTH_0_120[1,0,8]\" \ +--PO \"map=.*/TTH_PTH_60_120.*:r_TTH_PTH_0_120[1,0,8]\" \ +--PO \"map=.*/TTH_PTH_120_200.*:r_TTH_PTH_GT120[1,0,8]\" \ +--PO \"map=.*/TTH_PTH_200_300.*:r_TTH_PTH_GT120[1,0,8]\" \ +--PO \"map=.*/TTH_PTH_GT300.*:r_TTH_PTH_GT120[1,0,8]\" \ +--PO \"map=.*/THQ_FID.*:r_TH[1,0,8]\" \ +--PO \"map=.*/THW_FID.*:r_TH[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_0J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_1J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_0_60.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_60_120.*:r_QQ2HQQ_GE2J_MJJ_60_120[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_120_350.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HLNU_PTV_0_75.*:r_WH2HLNU_PTV_0_150[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HLNU_PTV_75_150.*:r_WH2HLNU_PTV_0_150[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HLNU_PTV_150_250_0J.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HLNU_PTV_150_250_GE1J.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/WMINUSH2HLNU_PTV_GT250.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_0J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_1J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_0_60.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_60_120.*:r_QQ2HQQ_GE2J_MJJ_60_120[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_120_350.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HLNU_PTV_0_75.*:r_WH2HLNU_PTV_0_150[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HLNU_PTV_75_150.*:r_WH2HLNU_PTV_0_150[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HLNU_PTV_150_250_0J.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HLNU_PTV_150_250_GE1J.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/WPLUSH2HLNU_PTV_GT250.*:r_WH2HLNU_PTV_GT150[1,0,8]\" \ +--PO \"map=.*/ZH2HLL_PTV_0_75.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HLL_PTV_75_150.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HLL_PTV_150_250_0J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HLL_PTV_150_250_GE1J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HLL_PTV_GT250.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HNUNU_PTV_0_75.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HNUNU_PTV_75_150.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HNUNU_PTV_150_250_0J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HNUNU_PTV_150_250_GE1J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HNUNU_PTV_GT250.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_0J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_1J.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_0_60.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_60_120.*:r_QQ2HQQ_GE2J_MJJ_60_120[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_120_350.*:r_QQ2HQQ_REST[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25.*:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200[1,0,8]\" \ +--PO \"map=.*/GG2HLL_PTV_0_75.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HLL_PTV_75_150.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HLL_PTV_150_250_0J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HLL_PTV_150_250_GE1J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HLL_PTV_GT250.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HNUNU_PTV_0_75.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HNUNU_PTV_75_150.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HNUNU_PTV_150_250_0J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HNUNU_PTV_150_250_GE1J.*:r_ZH2HLL[1,0,8]\" \ +--PO \"map=.*/GG2HNUNU_PTV_GT250.*:r_ZH2HLL[1,0,8]\" ", + + + + + + "mu_gghtruth":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \ --PO \"map=.*/gghtruth.*:r_gghtruth[1,0,3]\"", diff --git a/Datacard/makeYields.py b/Datacard/makeYields.py index 05e70cef2..8e3b0c9aa 100644 --- a/Datacard/makeYields.py +++ b/Datacard/makeYields.py @@ -63,16 +63,28 @@ def get_options(): for y,iWSDir in inputWSDirMap.items(): WSFileNames = extractWSFileNames(iWSDir) procsMap[y] = extractListOfProcs(WSFileNames) + # Require common procs for each year - for i,iy in enumerate(years): - for j,jy in enumerate(years): - if j > i: - if set(procsMap[iy].split(",")) != set(procsMap[jy].split(",")): - print(" --> [ERROR] Mis-match in list of process for %s and %s. Intersection = %s"%(iy,jy,(set(procsMap[jy]).symmetric_difference(set(procsMap[iy]))))) - leave() + # for i,iy in enumerate(years): + # for j,jy in enumerate(years): + # if j > i: + # if set(procsMap[iy].split(",")) != set(procsMap[jy].split(",")): + # print(" --> [ERROR] Mis-match in list of process for %s and %s. Intersection = %s"%(iy,jy,(set(procsMap[jy]).symmetric_difference(set(procsMap[iy]))))) + # leave() # Define list of procs (alphabetically ordered) procs = procsMap[years[0]].split(",") + + else: procs = opt.procs.split(",") +procs.remove('ZH2HQQ_FWDH') +procs.remove('WMINUSH2HQQ_FWDH') + +procs.remove('GG2HNUNU_FWDH') +procs.remove('WPLUSH2HLNU_PTV_150_250_0J') +procs.remove('GG2HQQ_PTH_200_300') +procs.remove('GG2HQQ_PTH_GT650') +procs.remove('THW_FWDH') +procs.remove('ZH2HNUNU_FWDH') procs.sort() # Initiate pandas dataframe @@ -92,7 +104,7 @@ def get_options(): # Mapping to STXS definition here _procOriginal = proc - _proc = proc #"%s_%s_%s"%(procToDatacardName(proc),year,decayMode) + _proc = "%s_%s_%s"%(proc,year,decayMode) _proc_s0 = proc print(proc) @@ -102,7 +114,7 @@ def get_options(): # Input flashgg ws _inputWSFile = glob.glob("%s/*M%s*_%s.root"%(inputWSDirMap[year],opt.mass,proc))[0] - _nominalDataName = "%s_%s_%s_%s"%(_proc_s0,opt.mass,sqrts__,opt.cat) + _nominalDataName = "%s_%s_hgg_%s_%s_%s"%(_proc_s0,year, opt.mass,sqrts__,opt.cat) print(_nominalDataName) # If opt.skipZeroes check nominal yield if 0 then do not add diff --git a/Datacard/tools/XSBR.py b/Datacard/tools/XSBR.py index 75e0063f9..51240d227 100644 --- a/Datacard/tools/XSBR.py +++ b/Datacard/tools/XSBR.py @@ -187,7 +187,134 @@ XSBRMap['Run3STXS']['GG2HQQ__preEE'] = {'mode':'constant', 'factor':0.04776} XSBRMap['Run3STXS']['GG2HQQ_FWDH_preEE'] = {'mode':'constant', 'factor':0.04776} - +XSBRMap['Run3STXS12'] = od() +XSBRMap['Run3STXS12']['decay'] = {'mode':'hgg'} +XSBRMap['Run3STXS12'][f'GG2H_FWDH'] = {'mode':'constant', 'factor':4.452454062335999} +XSBRMap['Run3STXS12'][f'GG2H_PTH_200_300'] = {'mode':'constant', 'factor':0.742248611739905} +XSBRMap['Run3STXS12'][f'GG2H_PTH_300_450'] = {'mode':'constant', 'factor':0.2569282211079247} +XSBRMap['Run3STXS12'][f'GG2H_PTH_450_650'] = {'mode':'constant', 'factor':0.06558103324171183} +XSBRMap['Run3STXS12'][f'GG2H_PTH_GT650'] = {'mode':'constant', 'factor':0.01743293292022304} +XSBRMap['Run3STXS12'][f'GG2H_0J_PTH_0_10'] = {'mode':'constant', 'factor':7.206649791438642} +XSBRMap['Run3STXS12'][f'GG2H_0J_PTH_GT10'] = {'mode':'constant', 'factor':20.233408719041858} +XSBRMap['Run3STXS12'][f'GG2H_1J_PTH_0_60'] = {'mode':'constant', 'factor':7.280220917066073} +XSBRMap['Run3STXS12'][f'GG2H_1J_PTH_60_120'] = {'mode':'constant', 'factor':5.2482466089417406} +XSBRMap['Run3STXS12'][f'GG2H_1J_PTH_120_200'] = {'mode':'constant', 'factor':1.0927750903729103} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_0_60'] = {'mode':'constant', 'factor':1.3729472392221491} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_60_120'] = {'mode':'constant', 'factor':2.0168242375363197} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_120_200'] = {'mode':'constant', 'factor':1.1550355486583803} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.3357914908587647} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.4204657285709297} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.15305699585548868} +XSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.17993277109097414} +XSBRMap['Run3STXS12'][f'VBF_FWDH'] = {'mode':'constant', 'factor':0.30906179249042953} +XSBRMap['Run3STXS12'][f'VBF_0J'] = {'mode':'constant', 'factor':0.26020084849442665} +XSBRMap['Run3STXS12'][f'VBF_1J'] = {'mode':'constant', 'factor':1.3366618521641214} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.04421373111576067} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.07348686900193459} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.4391839200979416} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.17559539236044044} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.48873978595619433} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.09290095216557219} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.6751497526714281} +XSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.18280510348175089} +XSBRMap['Run3STXS12'][f'TTH_FWDH'] = {'mode':'constant', 'factor':0.008193101006813874} +XSBRMap['Run3STXS12'][f'TTH_PTH_0_60'] = {'mode':'constant', 'factor':0.13270203375560813} +XSBRMap['Run3STXS12'][f'TTH_PTH_60_120'] = {'mode':'constant', 'factor':0.19548557858751595} +XSBRMap['Run3STXS12'][f'TTH_PTH_120_200'] = {'mode':'constant', 'factor':0.14493627062366152} +XSBRMap['Run3STXS12'][f'TTH_PTH_200_300'] = {'mode':'constant', 'factor':0.060344762800465024} +XSBRMap['Run3STXS12'][f'TTH_PTH_GT300'] = {'mode':'constant', 'factor':0.028338253225935466} +XSBRMap['Run3STXS12'][f'THQ_FWDH'] = {'mode':'constant', 'factor':0.009592165219271682} +XSBRMap['Run3STXS12'][f'THQ_FID'] = {'mode':'constant', 'factor':0.07709583478072832} +XSBRMap['Run3STXS12'][f'THW_FWDH'] = {'mode':'constant', 'factor':0.00013857882426542638} +XSBRMap['Run3STXS12'][f'THW_FID'] = {'mode':'constant', 'factor':0.017061421175734573} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.035634993187838505} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_0J'] = {'mode':'constant', 'factor':0.0230882929447906} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_1J'] = {'mode':'constant', 'factor':0.12418993397250003} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.012453418359100773} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.11855062961509753} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.05446645981119059} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.0028794456254774355} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0015847700440967524} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.007734490737356786} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00021268388547402065} +XSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0018914518170770201} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_FWDH'] = {'mode':'constant', 'factor':0.01795261149324277} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_0_75'] = {'mode':'constant', 'factor':0.09065147992552919} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_75_150'] = {'mode':'constant', 'factor':0.05482069590239782} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.009259064032410894} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.007431724739152518} +XSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_GT250'] = {'mode':'constant', 'factor':0.00484108390726685} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0906592652504524} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_0J'] = {'mode':'constant', 'factor':0.030613171988068913} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_1J'] = {'mode':'constant', 'factor':0.17810094812040317} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.01853026125408403} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.1792122237603338} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.0791611678989454} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.005422462430148131} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0022322199352340943} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.012062111003472974} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00044112610965828334} +XSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0027725322491988997} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_FWDH'] = {'mode':'constant', 'factor':0.04494315480687072} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_0_75'] = {'mode':'constant', 'factor':0.12501363463592902} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_75_150'] = {'mode':'constant', 'factor':0.08334789328833658} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.014848185489994519} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.012031094523527507} +XSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_GT250'] = {'mode':'constant', 'factor':0.009419657255341643} +XSBRMap['Run3STXS12'][f'ZH2HLL_FWDH'] = {'mode':'constant', 'factor':0.01138343980399486} +XSBRMap['Run3STXS12'][f'ZH2HLL_PTV_0_75'] = {'mode':'constant', 'factor':0.04321766588424201} +XSBRMap['Run3STXS12'][f'ZH2HLL_PTV_75_150'] = {'mode':'constant', 'factor':0.02886382437553178} +XSBRMap['Run3STXS12'][f'ZH2HLL_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.005035555083396863} +XSBRMap['Run3STXS12'][f'ZH2HLL_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.003983460461075898} +XSBRMap['Run3STXS12'][f'ZH2HLL_PTV_GT250'] = {'mode':'constant', 'factor':0.0028254129917586047} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_FWDH'] = {'mode':'constant', 'factor':0.02242173191744918} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_0_75'] = {'mode':'constant', 'factor':0.08630362472185986} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_75_150'] = {'mode':'constant', 'factor':0.05716309595379858} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.00949898877893254} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.00827070284676212} +XSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_GT250'] = {'mode':'constant', 'factor':0.005041855781197736} +XSBRMap['Run3STXS12'][f'ZH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0788416608697549} +XSBRMap['Run3STXS12'][f'ZH2HQQ_0J'] = {'mode':'constant', 'factor':0.028075516770689216} +XSBRMap['Run3STXS12'][f'ZH2HQQ_1J'] = {'mode':'constant', 'factor':0.1886563596888995} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.01805988693533062} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.226734275909364} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.0933424920454782} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.005517196244158761} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.002513830395119137} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.014275910673316648} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.003585516057158526} +XSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0002778444107304571} +XSBRMap['Run3STXS12'][f'BBH_FWDH'] = {'mode':'constant', 'factor':0.029056625407216003} +XSBRMap['Run3STXS12'][f'BBH_FID'] = {'mode':'constant', 'factor':0.49754337459278397} +XSBRMap['Run3STXS12'][f'GG2HLL_FWDH'] = {'mode':'constant', 'factor':0.00021055705991034662} +XSBRMap['Run3STXS12'][f'GG2HLL_PTV_0_75'] = {'mode':'constant', 'factor':0.0010908131720775646} +XSBRMap['Run3STXS12'][f'GG2HLL_PTV_75_150'] = {'mode':'constant', 'factor':0.003007009971313092} +XSBRMap['Run3STXS12'][f'GG2HLL_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.0006337129488545543} +XSBRMap['Run3STXS12'][f'GG2HLL_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.0014023100563868667} +XSBRMap['Run3STXS12'][f'GG2HLL_PTV_GT250'] = {'mode':'constant', 'factor':0.0004935967914575765} +XSBRMap['Run3STXS12'][f'GG2HNUNU_FWDH'] = {'mode':'constant', 'factor':0.000410673439433009} +XSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_0_75'] = {'mode':'constant', 'factor':0.0021777756372606716} +XSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_75_150'] = {'mode':'constant', 'factor':0.005945214287566574} +XSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.0012752490973046416} +XSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.002738493115937783} +XSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_GT250'] = {'mode':'constant', 'factor':0.0009625944224973184} +XSBRMap['Run3STXS12'][f'GG2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0014452873646897814} +XSBRMap['Run3STXS12'][f'GG2HQQ_PTH_200_300'] = {'mode':'constant', 'factor':0.006557575799101074} +XSBRMap['Run3STXS12'][f'GG2HQQ_PTH_300_450'] = {'mode':'constant', 'factor':0.0015724100341308021} +XSBRMap['Run3STXS12'][f'GG2HQQ_PTH_450_650'] = {'mode':'constant', 'factor':0.0001750381871262402} +XSBRMap['Run3STXS12'][f'GG2HQQ_PTH_GT650'] = {'mode':'constant', 'factor':9.778669557475902e-06} +XSBRMap['Run3STXS12'][f'GG2HQQ_0J_PTH_0_10'] = {'mode':'constant', 'factor':3.911467822990361e-06} +XSBRMap['Run3STXS12'][f'GG2HQQ_0J_PTH_GT10'] = {'mode':'constant', 'factor':0.00013592350684891506} +XSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_0_60'] = {'mode':'constant', 'factor':0.0009690661490510189} +XSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_60_120'] = {'mode':'constant', 'factor':0.002590369528921779} +XSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_120_200'] = {'mode':'constant', 'factor':0.001769939204235089} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60'] = {'mode':'constant', 'factor':0.002805500355415061} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120'] = {'mode':'constant', 'factor':0.009619277192503507} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200'] = {'mode':'constant', 'factor':0.01434824186830087} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0005720521773020264} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.003870397437465442} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00017894965699665207} +XSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0011362814005312783} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Functions for loading XS*BR below diff --git a/Plots/makeMultipdfPlot.py b/Plots/makeMultipdfPlot.py index 09d06de1e..a87f24a0b 100644 --- a/Plots/makeMultipdfPlot.py +++ b/Plots/makeMultipdfPlot.py @@ -248,7 +248,7 @@ def LoadTranslations(jsonfilename): lat1.SetTextAlign(31) lat1.SetNDC() lat1.SetTextSize(0.06) -#lat1.DrawLatex(0.9,0.92,"137 fb^{-1} (13 TeV)") +lat1.DrawLatex(0.9,0.92,"61.9 fb^{-1} (13.6 TeV)") pad2.cd() h_axes_ratio = hists_ratio['data'].Clone() diff --git a/Signal/RunPlotter.py b/Signal/RunPlotter.py index 70ebff4ba..01db85f99 100644 --- a/Signal/RunPlotter.py +++ b/Signal/RunPlotter.py @@ -100,15 +100,13 @@ def get_options(): # Iterate over norms: extract total category norm catNorm = 0 for k, norm in norms.items(): - year = k.split("__")[-1] - proc = "_".join(k.split("_")[:3]) + proc, year = k.split("__") w.var("IntLumi").setVal(lumiScaleFactor*lumiMap[year]) catNorm += norm.getVal() # Iterate over norms and extract data sets + pdfs for k, norm in norms.items(): - year = k.split("__")[-1] - proc = "_".join(k.split("_")[:3]) + proc, year = k.split("__") _id = "%s_%s_%s_%s"%(proc,year,cat,sqrts__) w.var("IntLumi").setVal(lumiScaleFactor*lumiMap[year]) diff --git a/Signal/RunSignalScripts.py b/Signal/RunSignalScripts.py index 3dfea7359..f859e8351 100644 --- a/Signal/RunSignalScripts.py +++ b/Signal/RunSignalScripts.py @@ -25,7 +25,7 @@ def get_options(): print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUNNING SIGNAL SCRIPTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") def leave(): print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUNNING SIGNAL SCRIPTS (END) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") - exit(0) + # exit(0) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Extract options from config file: @@ -136,6 +136,9 @@ def leave(): # Make directory to store job scripts and output if not os.path.isdir("%s/outdir_%s"%(swd__,options['ext'])): os.system("mkdir %s/outdir_%s"%(swd__,options['ext'])) + + +print(str(options)+"heee") # Write submission files: style depends on batch system writeSubFiles(options) print(" --> Finished writing submission scripts") diff --git a/Signal/config_STXS_2022postEE.py b/Signal/config_STXS_2022postEE.py new file mode 100644 index 000000000..b8eeaa700 --- /dev/null +++ b/Signal/config_STXS_2022postEE.py @@ -0,0 +1,29 @@ +# Config file: options for signal fitting + +_year = 'postEE' + +signalScriptCfg = { + + # Setup + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/postEE', + 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2HQQ_FWDH', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'cats':'auto', # if auto: inferred automatically from (0) workspace + 'ext':'Run3STXS_%s'%_year, + 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) + 'year':'%s'%_year, # Use 'combined' if merging all years: not recommended + # tbc + + + 'massPoints':'125', + + #Photon shape systematics + 'scales':'', # separate nuisance per year + 'scalesCorr':'', # correlated across years + 'scalesGlobal':'', # affect all processes equally, correlated across years + 'smears':'', # separate nuisance per year + + # Job submission options + 'batch':'condor', # ['condor','SGE','IC','local'] + 'queue':'espresso', + +} \ No newline at end of file diff --git a/Signal/config_STXS_2022preEE.py b/Signal/config_STXS_2022preEE.py new file mode 100644 index 000000000..579d6f736 --- /dev/null +++ b/Signal/config_STXS_2022preEE.py @@ -0,0 +1,29 @@ +# Config file: options for signal fitting + +_year = 'preEE' + +signalScriptCfg = { + + # Setup + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/preEE', + 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'cats':'auto', # if auto: inferred automatically from (0) workspace + 'ext':'Run3STXS_%s'%_year, + 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) + 'year':'%s'%_year, # Use 'combined' if merging all years: not recommended + # tbc + + + 'massPoints':'125', + + #Photon shape systematics + 'scales':'', # separate nuisance per year + 'scalesCorr':'', # correlated across years + 'scalesGlobal':'', # affect all processes equally, correlated across years + 'smears':'', # separate nuisance per year + + # Job submission options + 'batch':'condor', # ['condor','SGE','IC','local'] + 'queue':'espresso', + +} diff --git a/Signal/config_STXS_2023postBPix.py b/Signal/config_STXS_2023postBPix.py new file mode 100644 index 000000000..6e20286f0 --- /dev/null +++ b/Signal/config_STXS_2023postBPix.py @@ -0,0 +1,29 @@ +# Config file: options for signal fitting + +_year = 'postBPix' + +signalScriptCfg = { + + # Setup + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/postBPix', + 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'cats':'auto', # if auto: inferred automatically from (0) workspace + 'ext':'Run3STXS_%s'%_year, + 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) + 'year':'%s'%_year, # Use 'combined' if merging all years: not recommended + # tbc + + + 'massPoints':'125', + + #Photon shape systematics + 'scales':'', # separate nuisance per year + 'scalesCorr':'', # correlated across years + 'scalesGlobal':'', # affect all processes equally, correlated across years + 'smears':'', # separate nuisance per year + + # Job submission options + 'batch':'condor', # ['condor','SGE','IC','local'] + 'queue':'espresso', + +} \ No newline at end of file diff --git a/Signal/config_STXS_2023preBPix.py b/Signal/config_STXS_2023preBPix.py new file mode 100644 index 000000000..1042fca0e --- /dev/null +++ b/Signal/config_STXS_2023preBPix.py @@ -0,0 +1,29 @@ +# Config file: options for signal fitting + +_year = 'preBPix' + +signalScriptCfg = { + + # Setup + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/preBPix', + 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2HQQ_FWDH', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'cats':'auto', # if auto: inferred automatically from (0) workspace + 'ext':'Run3STXS_%s'%_year, + 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) + 'year':'%s'%_year, # Use 'combined' if merging all years: not recommended + # tbc + + + 'massPoints':'125', + + #Photon shape systematics + 'scales':'', # separate nuisance per year + 'scalesCorr':'', # correlated across years + 'scalesGlobal':'', # affect all processes equally, correlated across years + 'smears':'', # separate nuisance per year + + # Job submission options + 'batch':'condor', # ['condor','SGE','IC','local'] + 'queue':'espresso', + +} \ No newline at end of file diff --git a/Signal/scripts/fTest.py b/Signal/scripts/fTest.py index e13fe2674..b2eedc725 100644 --- a/Signal/scripts/fTest.py +++ b/Signal/scripts/fTest.py @@ -23,7 +23,7 @@ def leave(): print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG SIGNAL FTEST (END) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") - exit(0) + # exit(0) def get_options(): parser = OptionParser() @@ -39,6 +39,7 @@ def get_options(): parser.add_option('--threshold', dest='threshold', default=30, type='int', help="Threshold number of events") parser.add_option('--nGaussMax', dest='nGaussMax', default=5, type='int', help="Max number of gaussians to test") parser.add_option('--skipWV', dest='skipWV', default=False, action="store_true", help="Skip processing of WV case") + parser.add_option('--year') # Minimizer options parser.add_option('--minimizerMethod', dest='minimizerMethod', default='TNC', help="(Scipy) Minimizer method") parser.add_option('--minimizerTolerance', dest='minimizerTolerance', default=1e-8, type='float', help="(Scipy) Minimizer toleranve") @@ -73,7 +74,7 @@ def get_options(): f = ROOT.TFile(WSFileName,"read") inputWS = f.Get(inputWSName__) try: - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(proc,opt.mass,sqrts__,opt.cat)),aset) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(proc,opt.year,opt.mass,sqrts__,opt.cat)),aset) df.loc[len(df)] = [proc,d.sumEntries(),1,1] except TypeError: df.loc[len(df)] = [proc,0,1,1] @@ -86,71 +87,71 @@ def get_options(): for pidx, proc in enumerate(procsToFTest): print("\n --> Process (%g): %s"%(pidx,proc)) - try: + # Split dataset to RV/WV: ssf requires input as dict (with mass point as key) - datasets_RV, datasets_WV = od(), od() - WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,opt.mass,proc))[0] - f = ROOT.TFile(WSFileName,"read") - inputWS = f.Get(inputWSName__) - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(proc,opt.mass,sqrts__,opt.cat)),aset) - datasets_RV[opt.mass] = splitRVWV(d,aset,mode="RV") - datasets_WV[opt.mass] = splitRVWV(d,aset,mode="WV") + datasets_RV, datasets_WV = od(), od() + WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,opt.mass,proc))[0] + f = ROOT.TFile(WSFileName,"read") + inputWS = f.Get(inputWSName__) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(proc,opt.year,opt.mass,sqrts__,opt.cat)),aset) + datasets_RV[opt.mass] = splitRVWV(d,aset,mode="RV") + datasets_WV[opt.mass] = splitRVWV(d,aset,mode="WV") # Run fTest: RV - # If numEntries below threshold then keep as n = 1 - if datasets_RV[opt.mass].numEntries() < opt.threshold: continue - else: - ssfs = od() - min_reduced_chi2, nGauss_opt = 999, 1 - for nGauss in range(1,opt.nGaussMax+1): - k = "nGauss_%g"%nGauss - ssf = SimultaneousFit("fTest_RV_%g"%nGauss,proc,opt.cat,datasets_RV,xvar.Clone(),MH,MHLow,MHHigh,opt.mass,opt.nBins,0,opt.minimizerMethod,opt.minimizerTolerance,verbose=False) - ssf.buildNGaussians(nGauss) - ssf.runFit() - ssf.buildSplines() - if ssf.Ndof >= 1: - ssfs[k] = ssf - if ssfs[k].getReducedChi2() < min_reduced_chi2: - min_reduced_chi2 = ssfs[k].getReducedChi2() - nGauss_opt = nGauss - print(" * (%s,%s,RV): nGauss = %g, chi^2/n(dof) = %.4f"%(proc,opt.cat,nGauss,ssfs[k].getReducedChi2())) + # If numEntries below threshold then keep as n = 1 + if datasets_RV[opt.mass].numEntries() < opt.threshold: continue + else: + ssfs = od() + min_reduced_chi2, nGauss_opt = 999, 1 + for nGauss in range(1,opt.nGaussMax+1): + k = "nGauss_%g"%nGauss + ssf = SimultaneousFit("fTest_RV_%g"%nGauss,proc,opt.cat,datasets_RV,xvar.Clone(),MH,MHLow,MHHigh,opt.mass,opt.nBins,0,opt.minimizerMethod,opt.minimizerTolerance,verbose=False) + ssf.buildNGaussians(nGauss) + ssf.runFit() + ssf.buildSplines() + if ssf.Ndof >= 1: + ssfs[k] = ssf + if ssfs[k].getReducedChi2() < min_reduced_chi2: + min_reduced_chi2 = ssfs[k].getReducedChi2() + nGauss_opt = nGauss + print(" * (%s,%s,RV): nGauss = %g, chi^2/n(dof) = %.4f"%(proc,opt.cat,nGauss,ssfs[k].getReducedChi2())) # Set optimum - df.loc[df['proc']==proc,'nRV'] = nGauss_opt + df.loc[df['proc']==proc,'nRV'] = nGauss_opt # Make plots - if( opt.doPlots )&( len(ssfs.keys())!=0 ): - plotFTest(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="RV",_proc=proc,_cat=opt.cat,_mass=opt.mass) - plotFTestResults(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="RV",_proc=proc,_cat=opt.cat,_mass=opt.mass) + if( opt.doPlots )&( len(ssfs.keys())!=0 ): + plotFTest(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="RV",_proc=proc,_cat=opt.cat,_mass=opt.mass) + plotFTestResults(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="RV",_proc=proc,_cat=opt.cat,_mass=opt.mass) # Run fTest: WV # If numEntries below threshold then keep as n = 1 - if( datasets_WV[opt.mass].numEntries() < opt.threshold )|( opt.skipWV ): continue - else: - ssfs = od() - min_reduced_chi2, nGauss_opt = 999, 1 - for nGauss in range(1,opt.nGaussMax+1): - k = "nGauss_%g"%nGauss - ssf = SimultaneousFit("fTest_WV_%g"%nGauss,proc,opt.cat,datasets_WV,xvar.Clone(),MH,MHLow,MHHigh,opt.mass,opt.nBins,0,opt.minimizerMethod,opt.minimizerTolerance,verbose=False) - ssf.buildNGaussians(nGauss) - ssf.runFit() - ssf.buildSplines() - if ssf.Ndof >= 1: - ssfs[k] = ssf - if ssfs[k].getReducedChi2() < min_reduced_chi2: - min_reduced_chi2 = ssfs[k].getReducedChi2() - nGauss_opt = nGauss - print(" * (%s,%s,WV): nGauss = %g, chi^2/n(dof) = %.4f"%(proc,opt.cat,nGauss,ssfs[k].getReducedChi2())) + if( datasets_WV[opt.mass].numEntries() < opt.threshold )|( opt.skipWV ): continue + else: + ssfs = od() + min_reduced_chi2, nGauss_opt = 999, 1 + for nGauss in range(1,opt.nGaussMax+1): + k = "nGauss_%g"%nGauss + ssf = SimultaneousFit("fTest_WV_%g"%nGauss,proc,opt.cat,datasets_WV,xvar.Clone(),MH,MHLow,MHHigh,opt.mass,opt.nBins,0,opt.minimizerMethod,opt.minimizerTolerance,verbose=False) + ssf.buildNGaussians(nGauss) + ssf.runFit() + ssf.buildSplines() + if ssf.Ndof >= 1: + ssfs[k] = ssf + if ssfs[k].getReducedChi2() < min_reduced_chi2: + min_reduced_chi2 = ssfs[k].getReducedChi2() + nGauss_opt = nGauss + print(" * (%s,%s,WV): nGauss = %g, chi^2/n(dof) = %.4f"%(proc,opt.cat,nGauss,ssfs[k].getReducedChi2())) # Set optimum - df.loc[df['proc']==proc,'nWV'] = nGauss_opt + df.loc[df['proc']==proc,'nWV'] = nGauss_opt # Make plots - if( opt.doPlots )&( len(ssfs.keys())!=0 ): - plotFTest(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="WV",_proc=proc,_cat=opt.cat,_mass=opt.mass) - plotFTestResults(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="WV",_proc=proc,_cat=opt.cat,_mass=opt.mass) + if( opt.doPlots )&( len(ssfs.keys())!=0 ): + plotFTest(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="WV",_proc=proc,_cat=opt.cat,_mass=opt.mass) + plotFTestResults(ssfs,_opt=nGauss_opt,_outdir="%s/outdir_%s/fTest/Plots"%(swd__,opt.ext),_extension="WV",_proc=proc,_cat=opt.cat,_mass=opt.mass) # Close ROOT file - inputWS.Delete() - f.Close() - except TypeError: - print(f"{proc} in {opt.cat} failed") + inputWS.Delete() + f.Close() + # except TypeError: + # print(f"{proc} in {opt.cat} failed") # Make output if not os.path.isdir("%s/outdir_%s/fTest/json"%(swd__,opt.ext)): os.system("mkdir %s/outdir_%s/fTest/json"%(swd__,opt.ext)) ff = open("%s/outdir_%s/fTest/json/nGauss_%s.json"%(swd__,opt.ext,opt.cat),"w") diff --git a/Signal/scripts/signalFit.py b/Signal/scripts/signalFit.py index 819334423..ec8bcdb2b 100644 --- a/Signal/scripts/signalFit.py +++ b/Signal/scripts/signalFit.py @@ -25,7 +25,7 @@ print(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG SIGNAL FITTER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") def leave(): print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG SIGNAL FITTER (END) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") - exit() + # exit() def get_options(): parser = OptionParser() @@ -44,6 +44,7 @@ def get_options(): parser.add_option("--useDiagonalProcForShape", dest='useDiagonalProcForShape', default=False, action="store_true", help="Use shape of diagonal process, keeping normalisation (requires diagonal mapping produced by getDiagProc script)") parser.add_option('--skipVertexScenarioSplit', dest='skipVertexScenarioSplit', default=True, action="store_true", help="Skip vertex scenario split") parser.add_option('--skipZeroes', dest='skipZeroes', default=False, action="store_true", help="Skip proc x cat is numEntries = 0., or sumEntries < 0.") + parser.add_option('--era') # For systematics parser.add_option('--skipSystematics', dest='skipSystematics', default=True, action="store_true", help="Skip shape systematics in signal model") parser.add_option('--useDiagonalProcForSyst', dest='useDiagonalProcForSyst', default=False, action="store_true", help="Use diagonal process for systematics (requires diagonal mapping produced by getDiagProc script)") @@ -107,10 +108,10 @@ def get_options(): WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,MHNominal,opt.proc))[0] f = ROOT.TFile(WSFileName,"read") inputWS = f.Get(inputWSName__) - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(opt.proc,MHNominal,sqrts__,opt.cat)),aset) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(opt.proc,opt.year,MHNominal,sqrts__,opt.cat)),aset) if( d.numEntries() == 0. )|( d.sumEntries <= 0. ): print(" --> (%s,%s) has zero events. Will not construct signal model"%(opt.proc,opt.cat)) - exit() + # exit() inputWS.Delete() f.Close() @@ -153,7 +154,7 @@ def get_options(): WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,mp,procRVFit))[0] f = ROOT.TFile(WSFileName,"read") inputWS = f.Get(inputWSName__) - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procRVFit,mp,sqrts__,catRVFit)),aset) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(procRVFit,opt.year,mp,sqrts__,catRVFit)),aset) nominalDatasets[mp] = d.Clone() if opt.skipVertexScenarioSplit: datasetRVForFit[mp] = d else: datasetRVForFit[mp] = splitRVWV(d,aset,mode="RV") @@ -165,10 +166,10 @@ def get_options(): nominal_numEntries = datasetRVForFit[MHNominal].numEntries() procReplacementFit, catReplacementFit = rMap['procRVMap'][opt.cat], rMap['catRVMap'][opt.cat] for mp in opt.massPoints.split(","): - WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,mp,procReplacementFit))[0] + WSFileName = glob.glob("%s/output*M%s*%s*.root"%(opt.inputWSDir,mp,procReplacementFit))[0] f = ROOT.TFile(WSFileName,"read") inputWS = f.Get(inputWSName__) - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procReplacementFit,mp,sqrts__,catReplacementFit)),aset) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(procReplacementFit,opt.year,mp,sqrts__,catReplacementFit)),aset) if opt.skipVertexScenarioSplit: datasetRVForFit[mp] = d else: datasetRVForFit[mp] = splitRVWV(d,aset,mode="RV") inputWS.Delete() @@ -207,7 +208,7 @@ def get_options(): WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,mp,procWVFit))[0] f = ROOT.TFile(WSFileName,"read") inputWS = f.Get(inputWSName__) - d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procWVFit,mp,sqrts__,catWVFit)),aset) + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(procWVFit,opt.proc,opt.year,mp,sqrts__,catWVFit)),aset) datasetWVForFit[mp] = splitRVWV(d,aset,mode="WV") inputWS.Delete() f.Close() diff --git a/Signal/tools/XSBRMap.py b/Signal/tools/XSBRMap.py index 27b9e6953..937cad84b 100644 --- a/Signal/tools/XSBRMap.py +++ b/Signal/tools/XSBRMap.py @@ -79,8 +79,137 @@ globalXSBRMap['Run3STXS0']['GG2HQQ__preEE'] = {'mode':'constant', 'factor':0.04776} globalXSBRMap['Run3STXS0']['GG2HQQ_FWDH_preEE'] = {'mode':'constant', 'factor':0.04776} +globalXSBRMap['Run3STXS12'] = od() +globalXSBRMap['Run3STXS12']['decay'] = {'mode':'hgg'} +globalXSBRMap['Run3STXS12'][f'GG2H_FWDH'] = {'mode':'constant', 'factor':4.452454062335999} +globalXSBRMap['Run3STXS12'][f'GG2H_PTH_200_300'] = {'mode':'constant', 'factor':0.742248611739905} +globalXSBRMap['Run3STXS12'][f'GG2H_PTH_300_450'] = {'mode':'constant', 'factor':0.2569282211079247} +globalXSBRMap['Run3STXS12'][f'GG2H_PTH_450_650'] = {'mode':'constant', 'factor':0.06558103324171183} +globalXSBRMap['Run3STXS12'][f'GG2H_PTH_GT650'] = {'mode':'constant', 'factor':0.01743293292022304} +globalXSBRMap['Run3STXS12'][f'GG2H_0J_PTH_0_10'] = {'mode':'constant', 'factor':7.206649791438642} +globalXSBRMap['Run3STXS12'][f'GG2H_0J_PTH_GT10'] = {'mode':'constant', 'factor':20.233408719041858} +globalXSBRMap['Run3STXS12'][f'GG2H_1J_PTH_0_60'] = {'mode':'constant', 'factor':7.280220917066073} +globalXSBRMap['Run3STXS12'][f'GG2H_1J_PTH_60_120'] = {'mode':'constant', 'factor':5.2482466089417406} +globalXSBRMap['Run3STXS12'][f'GG2H_1J_PTH_120_200'] = {'mode':'constant', 'factor':1.0927750903729103} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_0_60'] = {'mode':'constant', 'factor':1.3729472392221491} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_60_120'] = {'mode':'constant', 'factor':2.0168242375363197} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_0_350_PTH_120_200'] = {'mode':'constant', 'factor':1.1550355486583803} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.3357914908587647} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.4204657285709297} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.15305699585548868} +globalXSBRMap['Run3STXS12'][f'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.17993277109097414} +globalXSBRMap['Run3STXS12'][f'VBF_FWDH'] = {'mode':'constant', 'factor':0.30906179249042953} +globalXSBRMap['Run3STXS12'][f'VBF_0J'] = {'mode':'constant', 'factor':0.26020084849442665} +globalXSBRMap['Run3STXS12'][f'VBF_1J'] = {'mode':'constant', 'factor':1.3366618521641214} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.04421373111576067} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.07348686900193459} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.4391839200979416} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.17559539236044044} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.48873978595619433} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.09290095216557219} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.6751497526714281} +globalXSBRMap['Run3STXS12'][f'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.18280510348175089} +globalXSBRMap['Run3STXS12'][f'TTH_FWDH'] = {'mode':'constant', 'factor':0.008193101006813874} +globalXSBRMap['Run3STXS12'][f'TTH_PTH_0_60'] = {'mode':'constant', 'factor':0.13270203375560813} +globalXSBRMap['Run3STXS12'][f'TTH_PTH_60_120'] = {'mode':'constant', 'factor':0.19548557858751595} +globalXSBRMap['Run3STXS12'][f'TTH_PTH_120_200'] = {'mode':'constant', 'factor':0.14493627062366152} +globalXSBRMap['Run3STXS12'][f'TTH_PTH_200_300'] = {'mode':'constant', 'factor':0.060344762800465024} +globalXSBRMap['Run3STXS12'][f'TTH_PTH_GT300'] = {'mode':'constant', 'factor':0.028338253225935466} +globalXSBRMap['Run3STXS12'][f'THQ_FWDH'] = {'mode':'constant', 'factor':0.009592165219271682} +globalXSBRMap['Run3STXS12'][f'THQ_FID'] = {'mode':'constant', 'factor':0.07709583478072832} +globalXSBRMap['Run3STXS12'][f'THW_FWDH'] = {'mode':'constant', 'factor':0.00013857882426542638} +globalXSBRMap['Run3STXS12'][f'THW_FID'] = {'mode':'constant', 'factor':0.017061421175734573} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.035634993187838505} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_0J'] = {'mode':'constant', 'factor':0.0230882929447906} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_1J'] = {'mode':'constant', 'factor':0.12418993397250003} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.012453418359100773} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.11855062961509753} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.05446645981119059} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.0028794456254774355} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0015847700440967524} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.007734490737356786} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00021268388547402065} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0018914518170770201} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_FWDH'] = {'mode':'constant', 'factor':0.01795261149324277} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_0_75'] = {'mode':'constant', 'factor':0.09065147992552919} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_75_150'] = {'mode':'constant', 'factor':0.05482069590239782} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.009259064032410894} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.007431724739152518} +globalXSBRMap['Run3STXS12'][f'WMINUSH2HLNU_PTV_GT250'] = {'mode':'constant', 'factor':0.00484108390726685} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0906592652504524} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_0J'] = {'mode':'constant', 'factor':0.030613171988068913} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_1J'] = {'mode':'constant', 'factor':0.17810094812040317} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.01853026125408403} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.1792122237603338} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.0791611678989454} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.005422462430148131} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0022322199352340943} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.012062111003472974} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00044112610965828334} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0027725322491988997} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_FWDH'] = {'mode':'constant', 'factor':0.04494315480687072} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_0_75'] = {'mode':'constant', 'factor':0.12501363463592902} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_75_150'] = {'mode':'constant', 'factor':0.08334789328833658} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.014848185489994519} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.012031094523527507} +globalXSBRMap['Run3STXS12'][f'WPLUSH2HLNU_PTV_GT250'] = {'mode':'constant', 'factor':0.009419657255341643} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_FWDH'] = {'mode':'constant', 'factor':0.01138343980399486} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_PTV_0_75'] = {'mode':'constant', 'factor':0.04321766588424201} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_PTV_75_150'] = {'mode':'constant', 'factor':0.02886382437553178} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.005035555083396863} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.003983460461075898} +globalXSBRMap['Run3STXS12'][f'ZH2HLL_PTV_GT250'] = {'mode':'constant', 'factor':0.0028254129917586047} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_FWDH'] = {'mode':'constant', 'factor':0.02242173191744918} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_0_75'] = {'mode':'constant', 'factor':0.08630362472185986} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_75_150'] = {'mode':'constant', 'factor':0.05716309595379858} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.00949898877893254} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.00827070284676212} +globalXSBRMap['Run3STXS12'][f'ZH2HNUNU_PTV_GT250'] = {'mode':'constant', 'factor':0.005041855781197736} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0788416608697549} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_0J'] = {'mode':'constant', 'factor':0.028075516770689216} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_1J'] = {'mode':'constant', 'factor':0.1886563596888995} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_0_60'] = {'mode':'constant', 'factor':0.01805988693533062} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_60_120'] = {'mode':'constant', 'factor':0.226734275909364} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_120_350'] = {'mode':'constant', 'factor':0.0933424920454782} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200'] = {'mode':'constant', 'factor':0.005517196244158761} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.002513830395119137} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.014275910673316648} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.003585516057158526} +globalXSBRMap['Run3STXS12'][f'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0002778444107304571} +globalXSBRMap['Run3STXS12'][f'BBH_FWDH'] = {'mode':'constant', 'factor':0.029056625407216003} +globalXSBRMap['Run3STXS12'][f'BBH_FID'] = {'mode':'constant', 'factor':0.49754337459278397} +globalXSBRMap['Run3STXS12'][f'GG2HLL_FWDH'] = {'mode':'constant', 'factor':0.00021055705991034662} +globalXSBRMap['Run3STXS12'][f'GG2HLL_PTV_0_75'] = {'mode':'constant', 'factor':0.0010908131720775646} +globalXSBRMap['Run3STXS12'][f'GG2HLL_PTV_75_150'] = {'mode':'constant', 'factor':0.003007009971313092} +globalXSBRMap['Run3STXS12'][f'GG2HLL_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.0006337129488545543} +globalXSBRMap['Run3STXS12'][f'GG2HLL_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.0014023100563868667} +globalXSBRMap['Run3STXS12'][f'GG2HLL_PTV_GT250'] = {'mode':'constant', 'factor':0.0004935967914575765} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_FWDH'] = {'mode':'constant', 'factor':0.000410673439433009} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_0_75'] = {'mode':'constant', 'factor':0.0021777756372606716} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_75_150'] = {'mode':'constant', 'factor':0.005945214287566574} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_150_250_0J'] = {'mode':'constant', 'factor':0.0012752490973046416} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_150_250_GE1J'] = {'mode':'constant', 'factor':0.002738493115937783} +globalXSBRMap['Run3STXS12'][f'GG2HNUNU_PTV_GT250'] = {'mode':'constant', 'factor':0.0009625944224973184} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_FWDH'] = {'mode':'constant', 'factor':0.0014452873646897814} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_PTH_200_300'] = {'mode':'constant', 'factor':0.006557575799101074} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_PTH_300_450'] = {'mode':'constant', 'factor':0.0015724100341308021} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_PTH_450_650'] = {'mode':'constant', 'factor':0.0001750381871262402} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_PTH_GT650'] = {'mode':'constant', 'factor':9.778669557475902e-06} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_0J_PTH_0_10'] = {'mode':'constant', 'factor':3.911467822990361e-06} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_0J_PTH_GT10'] = {'mode':'constant', 'factor':0.00013592350684891506} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_0_60'] = {'mode':'constant', 'factor':0.0009690661490510189} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_60_120'] = {'mode':'constant', 'factor':0.002590369528921779} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_1J_PTH_120_200'] = {'mode':'constant', 'factor':0.001769939204235089} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60'] = {'mode':'constant', 'factor':0.002805500355415061} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120'] = {'mode':'constant', 'factor':0.009619277192503507} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200'] = {'mode':'constant', 'factor':0.01434824186830087} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.0005720521773020264} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.003870397437465442} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25'] = {'mode':'constant', 'factor':0.00017894965699665207} +globalXSBRMap['Run3STXS12'][f'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] = {'mode':'constant', 'factor':0.0011362814005312783} + globalXSBRMap['tutorial'] = od() globalXSBRMap['tutorial']['decay'] = {'mode':'hgg'} diff --git a/Signal/tools/plottingTools.py b/Signal/tools/plottingTools.py index dc143c353..d6434a95d 100644 --- a/Signal/tools/plottingTools.py +++ b/Signal/tools/plottingTools.py @@ -403,11 +403,11 @@ def plotSplines(_finalModel,_outdir="./",_nominalMass='125',splinesToPlot=['xs', gr.SetMarkerColor(colorMap[x]) gr.SetMarkerStyle(20) gr.Draw("Same PL") - if x == "norm": leg.AddEntry(gr,"N_{exp}: @%s = %.2f"%(_nominalMass,xnom['norm'])) - if x == "xs": leg.AddEntry(gr,"#sigma: @%s = %.2f pb"%(_nominalMass,xnom['xs'])) - if x == "br": leg.AddEntry(gr,"#bf{#it{#Beta}}: @%s = %.2f%%"%(_nominalMass,100*xnom['br'])) - if x == "ea": leg.AddEntry(gr,"#epsilon x #it{#Alpha}: @%s = %.2f%%"%(_nominalMass,100*xnom['ea'])) - if x == "fracRV": leg.AddEntry(gr,"RV fraction: @%s = %.2f%%"%(_nominalMass,100*xnom['fracRV'])) + if x == "norm": leg.AddEntry(gr,"N_{exp}: @%s = %.3f"%(_nominalMass,xnom['norm'])) + if x == "xs": leg.AddEntry(gr,"#sigma: @%s = %.3f pb"%(_nominalMass,xnom['xs'])) + if x == "br": leg.AddEntry(gr,"#bf{#it{#Beta}}: @%s = %.3f%%"%(_nominalMass,100*xnom['br'])) + if x == "ea": leg.AddEntry(gr,"#epsilon x #it{#Alpha}: @%s = %.3f%%"%(_nominalMass,100*xnom['ea'])) + if x == "fracRV": leg.AddEntry(gr,"RV fraction: @%s = %.3f%%"%(_nominalMass,100*xnom['fracRV'])) leg.Draw("Same") grs['norm'].Draw("Same PL") # Add Latex @@ -424,7 +424,7 @@ def plotSplines(_finalModel,_outdir="./",_nominalMass='125',splinesToPlot=['xs', # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Function for plotting final signal model: neat def plotSignalModel(_hists,_opt,_outdir=".",offset=0.02): - colorMap = {'2016':38,'2017':30,'2018':46,'2022preEE':38,'2022postEE':30} + colorMap = {'2016':38,'2017':30,'2018':46,'preEE':38,'postEE':30,'postBPix':46,'preBPix':28} canv = ROOT.TCanvas("c","c",650,600) canv.SetBottomMargin(0.12) canv.SetLeftMargin(0.15) diff --git a/Signal/tools/replacementMap.py b/Signal/tools/replacementMap.py index deeb78cc4..9994bf427 100644 --- a/Signal/tools/replacementMap.py +++ b/Signal/tools/replacementMap.py @@ -68,6 +68,56 @@ +globalReplacementMap["Run3STXS12"]=od() +globalReplacementMap["Run3STXS12"]["procWV"]= "GG2H_0J_PTH_0_10" +globalReplacementMap["Run3STXS12"]["catWV"]= "RECO_ggH_0J_PTH_0_10" + +globalReplacementMap["Run3STXS12"]["procRVMap"]=od() +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_0J_PTH_0_10'] = 'GG2H_0J_PTH_0_10' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_0J_PTH_GT10_wbbH'] = 'GG2H_0J_PTH_GT10' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_1J_PTH_0_60'] = 'GG2H_1J_PTH_0_60' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_1J_PTH_60_120'] = 'GG2H_1J_PTH_60_120' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_1J_PTH_120_200'] = 'GG2H_1J_PTH_120_200' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_0_60'] = 'GG2H_GE2J_MJJ_0_350_PTH_0_60' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_60_120'] = 'GG2H_GE2J_MJJ_0_350_PTH_60_120' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_120_200'] = 'GG2H_GE2J_MJJ_0_350_PTH_120_200' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_GE2J_MJJ_GT350_PTH_0_200'] = 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ggH_PTH_GT200'] = 'GG2H_PTH_200_300' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_qqH_REST'] = 'VBF_GE2J_MJJ_0_60' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_qqH_GE2J_MJJ_60_120'] = 'VBF_GE2J_MJJ_60_120' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_qqH_GE2J_MJJ_GT350_PTH_0_200'] = 'VBF_GE2J_MJJ_120_350' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_qqH_GE2J_MJJ_GT350_PTH_GT200'] = 'VBF_GE2J_MJJ_GT350_PTH_GT200' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_WH_lep_PTV_0_150'] = 'WMINUSH2HLNU_PTV_0_75' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_WH_lep_PTV_GT150'] = 'WMINUSH2HLNU_PTV_150_250_0J' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ZH_lep'] = 'ZH2HLL_PTV_0_75' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ttH_PTH_0_120'] = 'TTH_PTH_0_60' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_ttH_PTH_GT120'] = 'TTH_PTH_120_200' +globalReplacementMap['Run3STXS12']['procRVMap']['RECO_tH'] = 'THQ_FID' + + +globalReplacementMap["Run3STXS12"]["catRVMap"]=od() +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_0J_PTH_0_10'] = 'RECO_ggH_0J_PTH_0_10' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_0J_PTH_GT10_wbbH'] = 'RECO_ggH_0J_PTH_GT10_wbbH' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_1J_PTH_0_60'] = 'RECO_ggH_1J_PTH_0_60' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_1J_PTH_60_120'] = 'RECO_ggH_1J_PTH_60_120' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_1J_PTH_120_200'] = 'RECO_ggH_1J_PTH_120_200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_0_60'] = 'RECO_ggH_GE2J_MJJ_0_350_PTH_0_60' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_60_120'] = 'RECO_ggH_GE2J_MJJ_0_350_PTH_60_120' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_GE2J_MJJ_0_350_PTH_120_200'] = 'RECO_ggH_GE2J_MJJ_0_350_PTH_120_200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_GE2J_MJJ_GT350_PTH_0_200'] = 'RECO_ggH_GE2J_MJJ_GT350_PTH_0_200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ggH_PTH_GT200'] = 'RECO_ggH_PTH_GT200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_qqH_REST'] = 'RECO_qqH_REST' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_qqH_GE2J_MJJ_60_120'] = 'RECO_qqH_GE2J_MJJ_60_120' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_qqH_GE2J_MJJ_GT350_PTH_0_200'] = 'RECO_qqH_GE2J_MJJ_GT350_PTH_0_200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_qqH_GE2J_MJJ_GT350_PTH_GT200'] = 'RECO_qqH_GE2J_MJJ_GT350_PTH_GT200' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_WH_lep_PTV_0_150'] = 'RECO_WH_lep_PTV_0_150' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_WH_lep_PTV_GT150'] = 'RECO_WH_lep_PTV_GT150' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ZH_lep'] = 'RECO_ZH_lep' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ttH_PTH_0_120'] = 'RECO_ttH_PTH_0_120' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_ttH_PTH_GT120'] = 'RECO_ttH_PTH_GT120' +globalReplacementMap['Run3STXS12']['catRVMap']['RECO_tH'] = 'RECO_tH' + + # Tutorial analysis globalReplacementMap['tutorial'] = od() # For WRONG VERTEX SCENARIO: diff --git a/Signal/tools/submissionTools.py b/Signal/tools/submissionTools.py index 8ec456133..cc18e5e0f 100644 --- a/Signal/tools/submissionTools.py +++ b/Signal/tools/submissionTools.py @@ -21,10 +21,11 @@ def writePreamble(_file): def writeCondorSub(_file,_exec,_queue,_nJobs,_jobOpts,doHoldOnFailure=True,doPeriodicRetry=True,dir="fTest"): _file.write("executable = %s.sh\n"%_exec) _file.write("arguments = $(ProcId)\n") - _file.write(f"output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/07_FinalFits/CMSSW_14_1_0_pre4/src/flashggFinalFit/Signal/outdir_tutorial_2022preEE/fTest/jobs/%s.$(ClusterId).$(ProcId).out\n"%_exec) - _file.write(f"error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/07_FinalFits/CMSSW_14_1_0_pre4/src/flashggFinalFit/Signal/outdir_tutorial_2022preEE/fTest/jobs/%s.$(ClusterId).$(ProcId).err\n\n"%_exec) - _file.write(f"output_destination = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/07_FinalFits/CMSSW_14_1_0_pre4/src/flashggFinalFit/Signal/outdir_tutorial_2022preEE/{dir}") - _file.write("transfer_output_files = \"\"") + _file.write(f"output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).out\n") + _file.write(f"error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).err\n") + _file.write(f"log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).log\n") + _file.write(f"output_destination = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/\n") + #_file.write("transfer_output_files = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/") if _jobOpts != '': _file.write("# User specified job options\n") for jo in _jobOpts.split(":"): _file.write("%s\n"%jo) @@ -63,9 +64,9 @@ def writeSubFiles(_opts): for cidx in range(_opts['nCats']): pcidx = pidx*_opts['nCats']+cidx p,c = _opts['procs'].split(",")[pidx], _opts['cats'].split(",")[cidx] - _f.write("if [ $1 -eq %g ]; then\n"%pcidx) + # _f.write("if [ $1 -eq %g ]; then\n"%pcidx) _f.write(" python3 %s/scripts/signalFit.py --inputWSDir %s --ext %s --proc %s --cat %s --year %s --analysis %s --massPoints %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s\n"%(swd__,_opts['inputWSDir'],_opts['ext'],p,c,_opts['year'],_opts['analysis'],_opts['massPoints'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) - _f.write("fi\n") + # _f.write("fi\n") # For looping over categories elif( _opts['mode'] == "signalFit" )&( _opts['groupSignalFitJobsByCat'] ): @@ -74,7 +75,7 @@ def writeSubFiles(_opts): _f.write("if [ $1 -eq %g ]; then\n"%cidx) for pidx in range(_opts['nProcs']): p = _opts['procs'].split(",")[pidx] - _f.write(" python3 %s/scripts/signalFit.py --inputWSDir %s --ext %s --proc %s --cat %s --year %s --analysis %s --massPoints %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s\n"%(swd__,_opts['inputWSDir'],_opts['ext'],p,c,_opts['year'],_opts['analysis'],_opts['massPoints'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) + _f.write(f" python3 %s/scripts/signalFit.py --inputWSDir %s --ext %s --proc %s --cat %s --year %s --analysis %s --massPoints %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s 2>&1 | tee logs/signalfit/log_ftest_{p}_{c}_{_opts['year']}.txt \n"%(swd__,_opts['inputWSDir'],_opts['ext'],p,c,_opts['year'],_opts['analysis'],_opts['massPoints'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) _f.write("fi\n") elif _opts['mode'] == "calcPhotonSyst": @@ -85,10 +86,11 @@ def writeSubFiles(_opts): _f.write("fi\n") elif _opts['mode'] == "fTest": + print(_opts['year']) for cidx in range(_opts['nCats']): c = _opts['cats'].split(",")[cidx] _f.write("if [ $1 -eq %g ]; then\n"%cidx) - _f.write(" python3 %s/scripts/fTest.py --cat %s --procs %s --ext %s --inputWSDir %s %s\n"%(swd__,c,_opts['procs'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) + _f.write(f" python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s 2>&1 | tee logs/ftest/log_ftest_{c}_{_opts['year']}.txt\n"%(swd__,c,_opts['procs'],_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) _f.write("fi\n") elif _opts['mode'] == "packageSignal": @@ -157,7 +159,7 @@ def writeSubFiles(_opts): c = _opts['cats'].split(",")[cidx] _f = open("%s/%s_%s.sh"%(_jobdir,_executable,c),"w") writePreamble(_f) - _f.write("python3 %s/scripts/fTest.py --cat %s --procs %s --ext %s --inputWSDir %s %s\n"%(swd__,c,_opts['procs'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) + _f.write("python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s\n"%(swd__,c,_opts['procs'],_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) _f.close() os.system("chmod 775 %s/%s_%s.sh"%(_jobdir,_executable,c)) diff --git a/tools/commonObjects.py b/tools/commonObjects.py index 0b5137b9b..8ae71e501 100644 --- a/tools/commonObjects.py +++ b/tools/commonObjects.py @@ -20,9 +20,13 @@ '2018':59.83, 'combined':137.65, 'merged':137.65, - '2022preEE':8.00, - '2022postEE':26.70 + 'preEE':7.98, + 'postEE':26.67, + 'preBPix':17.79, + 'postBPix':9.45 } + + # If using ReReco samples then switch to lumiMap below (missing data in 2018 EGamma data set) #lumiMap = {'2016':36.33, '2017':41.48, '2018':59.35, 'combined':137.17, 'merged':137.17} lumiScaleFactor = 1000. # Converting from pb to fb @@ -39,7 +43,7 @@ decayMode = 'hgg' # List of years -years_to_process = ['2016','2017','2018','2022preEE','2022postEE'] +years_to_process = ['2016','2017','2018','preEE','postEE','preBPix','postBPix'] # flashgg input WS objects inputWSName__ = "tagsDumper/cms_hgg_13TeV" diff --git a/tools/commonTools.py b/tools/commonTools.py index 46130df56..34e4d57ab 100644 --- a/tools/commonTools.py +++ b/tools/commonTools.py @@ -26,13 +26,14 @@ def extractListOfProcs( _listOfWSFileNames ): for fName in _listOfWSFileNames: p = fName.split("pythia8_")[1].split(".root")[0] if p not in procs: procs.append(p) + return ",".join(procs) def extractListOfCats( _listOfWSFileNames ): print(_listOfWSFileNames) - f0 = ROOT.TFile(_listOfWSFileNames[4]) #Note: This was [0], but not good, if the first file has only 5 instead of 6 RECOS clearly it will miss some RECOs + f0 = ROOT.TFile(_listOfWSFileNames[0]) #Note: This was [0], but not good, if the first file has only 5 instead of 6 RECOS clearly it will miss some RECOs print("A") - print(_listOfWSFileNames[1]) + print(_listOfWSFileNames[0]) print(f0.ls()) ws = f0.Get(inputWSName__) print("B") From c61e74391d03a5c3d9a5fad36301a46787421327 Mon Sep 17 00:00:00 2001 From: Paul Krueper Date: Mon, 2 Feb 2026 00:39:36 +0100 Subject: [PATCH 2/2] push everything from july 2025 to jan 2026 --- Background/config_tutorial.py | 4 +- Background/test/fTest.cpp | 6 +- Combine/RunFits.py | 7 +- .../inputs_tutorial_profile1D_syst.json | 30 +- Datacard/makeDatacard.py | 17 +- Datacard/makeYields.py | 130 ++-- Datacard/systematics.py | 148 ++-- Datacard/theory_uncertainties/thu_bbh.json | 4 +- Datacard/theory_uncertainties/thu_ggh.json | 34 +- .../theory_uncertainties/thu_ggh_stxs.json | 34 +- Datacard/theory_uncertainties/thu_ggzh.json | 58 +- .../thu_ggzhlep_stxs.json | 24 +- Datacard/theory_uncertainties/thu_qqh.json | 24 +- .../theory_uncertainties/thu_qqh_stxs.json | 198 ++++- Datacard/theory_uncertainties/thu_thq.json | 4 +- Datacard/theory_uncertainties/thu_thw.json | 4 +- Datacard/theory_uncertainties/thu_tth.json | 12 +- .../theory_uncertainties/thu_tth_stxs.json | 12 +- .../theory_uncertainties/thu_whlep_stxs.json | 54 +- .../theory_uncertainties/thu_zhlep_stxs.json | 55 +- Datacard/tools/calcSystematics.py | 27 +- Datacard/tools/writeToDatacard.py | 8 +- Plots/makeMultipdfPlot.py | 2 + Signal/check_alloutputs_exist.py | 42 ++ Signal/config_STXS_2022postEE.py | 13 +- Signal/config_STXS_2022preEE.py | 12 +- Signal/config_STXS_2023postBPix.py | 13 +- Signal/config_STXS_2023preBPix.py | 13 +- Signal/readout_sumw_inRooWSfile.py | 107 +++ Signal/scripts/calcPhotonSyst.py | 3 +- Signal/scripts/fTest.py | 30 +- Signal/scripts/signalFit.py | 7 +- Signal/tools/plottingTools.py | 37 +- Signal/tools/simultaneousFit.py | 2 +- Signal/tools/submissionTools.py | 38 +- Trees2WS/check_efficiencies_root.py | 73 ++ Trees2WS/compare_yields_TH.py | 38 + Trees2WS/config_tutorial.py | 15 +- Trees2WS/run_jobs/execution_postBPix.sh | 27 + Trees2WS/run_jobs/execution_postEE.sh | 28 + Trees2WS/run_jobs/execution_preBPix.sh | 27 + Trees2WS/run_jobs/execution_preEE.sh | 27 + Trees2WS/run_jobs/submission_postBPix.sub | 17 + Trees2WS/run_jobs/submission_postEE.sub | 17 + Trees2WS/run_jobs/submission_preBPix.sub | 17 + Trees2WS/run_jobs/submission_preEE.sub | 17 + Trees2WS/subm.sub | 17 + Trees2WS/trees.sh | 27 + Trees2WS/trees2ws.py | 707 +++++++++++------- Trees2WS/trees2ws_data.py | 308 ++++---- check_roows.py | 28 + run_workflow_standalone.sh | 0 tools/commonTools.py | 1 + 53 files changed, 1872 insertions(+), 732 deletions(-) create mode 100644 Signal/check_alloutputs_exist.py create mode 100644 Signal/readout_sumw_inRooWSfile.py create mode 100644 Trees2WS/check_efficiencies_root.py create mode 100644 Trees2WS/compare_yields_TH.py create mode 100644 Trees2WS/run_jobs/execution_postBPix.sh create mode 100755 Trees2WS/run_jobs/execution_postEE.sh create mode 100644 Trees2WS/run_jobs/execution_preBPix.sh create mode 100644 Trees2WS/run_jobs/execution_preEE.sh create mode 100644 Trees2WS/run_jobs/submission_postBPix.sub create mode 100644 Trees2WS/run_jobs/submission_postEE.sub create mode 100644 Trees2WS/run_jobs/submission_preBPix.sub create mode 100644 Trees2WS/run_jobs/submission_preEE.sub create mode 100644 Trees2WS/subm.sub create mode 100755 Trees2WS/trees.sh create mode 100644 check_roows.py create mode 100644 run_workflow_standalone.sh diff --git a/Background/config_tutorial.py b/Background/config_tutorial.py index 0d88b6511..741b50a4a 100644 --- a/Background/config_tutorial.py +++ b/Background/config_tutorial.py @@ -3,10 +3,10 @@ backgroundScriptCfg = { # Setup - 'inputWS':"/eos/user/p/pkrueper/STXS_test/run3hggstxs/toms_12julybetterprototype/data/root/Data/ws/allData_data.root", # location of 'allData.root' file + 'inputWS':"/eos/cms/store/group/phys_higgs/cmshgg/Run3HggSTXS_working/IA_nov2025/IA_corrected_5dec/data/ws_data/allData_data.root", # location of 'allData.root' file 'cats':'auto', # auto: automatically inferred from input ws 'catOffset':0, # add offset to category numbers (useful for categories from different allData.root files) - 'ext':'STXS0', # extension to add to output directory + 'ext':'STXS_12', # extension to add to output directory 'year':'combined', # Use combined when merging all years in category (for plots) # Job submission options diff --git a/Background/test/fTest.cpp b/Background/test/fTest.cpp index 7952489a8..24f432023 100644 --- a/Background/test/fTest.cpp +++ b/Background/test/fTest.cpp @@ -67,7 +67,7 @@ RooAbsPdf* getPdf(PdfModelBuilder &pdfsModel, string type, int order, const char if (type=="Bernstein") return pdfsModel.getBernstein(Form("%s_bern%d",ext,order),order); else if (type=="Chebychev") return pdfsModel.getChebychev(Form("%s_cheb%d",ext,order),order); else if (type=="Exponential") return pdfsModel.getExponentialSingle(Form("%s_exp%d",ext,order),order); - else if (type=="PowerLaw") return pdfsModel.getPowerLawSingle(Form("%s_pow%d",ext,order),order); + // else if (type=="PowerLaw") return pdfsModel.getPowerLawSingle(Form("%s_pow%d",ext,order),order); else if (type=="Laurent") return pdfsModel.getLaurentSeries(Form("%s_lau%d",ext,order),order); else { cerr << "[ERROR] -- getPdf() -- type " << type << " not recognised." << endl; @@ -484,7 +484,7 @@ void plot(RooRealVar *mass, map pdfs, RooDataSet *data, strin int col; if (i<=6) col=color[i]; else {col=kBlack; style++;} - it->second->plotOn(plot,LineColor(col),LineStyle(style));//,RooFit::NormRange("fitdata_1,fitdata_2")); + // it->second->plotOn(plot,LineColor(col),LineStyle(style));//,RooFit::NormRange("fitdata_1,fitdata_2")); TObject *pdfLeg = plot->getObject(int(plot->numItems()-1)); std::string ext = ""; if (bestFitPdf==i) ext=" (Best Fit Pdf) "; @@ -828,7 +828,7 @@ int main(int argc, char* argv[]){ while (prob<0.05 && order < 7){ //FIXME RooAbsPdf *bkgPdf = getPdf(pdfsModel,*funcType,order,Form("ftest_pdf_%d_%s",(cat+catOffset),ext.c_str())); - if ((!bkgPdf)){ + if ((!bkgPdf)||((*funcType=="PowerLaw")&&(order>1))){ // assume this order is not allowed order++; } diff --git a/Combine/RunFits.py b/Combine/RunFits.py index 12cba7fc4..cee7988f3 100644 --- a/Combine/RunFits.py +++ b/Combine/RunFits.py @@ -60,7 +60,7 @@ def getPdfIndicesFromJson(pdfjson): if opt.doCustomCrab: job_opts += " --custom-crab %s/src/flashggFinalFit/Combine/custom_crab.py"%os.environ['CMSSW_BASE'] job_opts += " --memory %s"%opt.crabMemory elif opt.batch == 'condor': - sub_opts = "--sub-opts=\'+JobFlavour = \"%s\""%opt.queue + sub_opts = "--sub-opts=\'+JobFlavour = \"%s\" \n transfer_output_files=\"\" "%opt.queue if opt.subOpts != "": sub_opts += "\n%s"%opt.subOpts sub_opts += "\'" job_opts = "--job-mode condor %s"%sub_opts @@ -73,6 +73,9 @@ def getPdfIndicesFromJson(pdfjson): print(" --> [ERROR] Batch mode (%s) not supported. Leaving"%opt.batch) leave() # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# job_opts+="\n transfer_output_files = \'\' " +print('now') +print(job_opts) # Make folder for running fits if does not exist if not os.path.isdir("runFits%s_%s"%(opt.ext,opt.mode)): os.system("mkdir runFits%s_%s"%(opt.ext,opt.mode)) @@ -163,7 +166,7 @@ def getPdfIndicesFromJson(pdfjson): # For 1D scan when profiling other pois elif _fit.split(":")[0] == "profile1D": for poi in _fitpois: - fitcmd = "cd runFits%s_%s; source /cvmfs/cms.cern.ch/crab3/crab.sh; combineTool.py --task-name %s_%s -M MultiDimFit -m %s %s --floatOtherPOIs 1 %s -n _%s_%s -P %s --algo grid --points %s --alignEdges 1 --split-points %s %s %s %s %s; cd .."%(opt.ext,opt.mode,_name,poi,opt.mass,d_opts,exp_opts,_name,poi,poi,_points.split(":")[0],_points.split(":")[1],_fit_opts,pdf_opts,common_opts,job_opts) + fitcmd = "cd runFits%s_%s; source /cvmfs/cms.cern.ch/crab3/crab.sh;combineTool.py --task-name %s_%s -M MultiDimFit -m %s %s --floatOtherPOIs 1 %s -n _%s_%s -P %s --algo grid --points %s --alignEdges 1 --split-points %s %s %s %s %s --pre-cmd \"source /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Combine/test_addition_combine.sh;\"; cd .."%(opt.ext,opt.mode,_name,poi,opt.mass,d_opts,exp_opts,_name,poi,poi,_points.split(":")[0],_points.split(":")[1],_fit_opts,pdf_opts,common_opts,job_opts) if(os.environ['PWD'].startswith("/eos"))&(opt.batch == "condor")&(not opt.dryRun): fitcmd = re.sub("; cd ..", " --dry-run; condor_submit -spool condor_%s_%s.sub; cd .."%(_name,poi), fitcmd) run(fitcmd) diff --git a/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json b/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json index 26d6e6349..d26041f4c 100644 --- a/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json +++ b/Combine/inputs_tutorial/inputs_tutorial_profile1D_syst.json @@ -1,9 +1,15 @@ { - "mu_inclusive":{ + "mu_inclusive_statonly":{ "pois":"r", "fits":"profile1D:statonly:r", "points":"20:10", - "fit_opts":"--setParameterRanges r=0,2 --saveSpecifiedNuis all --freezeParameters MH,lumiscale " + "fit_opts":"--setParameterRanges r=0,2 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale,allConstrainedNuisances" + }, + "mu_inclusive":{ + "pois":"r", + "fits":"profile1D:syst:r", + "points":"20:10", + "fit_opts":"--setParameterRanges r=0,2 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale " }, "mu_ggH_VBF":{ @@ -13,10 +19,28 @@ "fit_opts":"--saveInactivePOI 1 --setParameterRanges r_ggH=0,3:r_VBF=0,5 --saveSpecifiedNuis all --freezeParameters MH" }, "mu_STXS0":{ + "pois":"r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", + "fits":"profile1D:syst:r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", + "points":"40:40", + "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H=1,r_QQ2HQQ=1,r_WH2HLNU=1,r_ZH2HLL=1,r_TTH=1,r_TH=1 --setParameterRanges r_GG2H=0,3:r_QQ2HQQ=0,3:r_WH2HLNU=0,3:r_ZH2HLL=0,3:r_TTH=0,3:r_TH=0,3 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale" + }, + "mu_STXS0_statonly":{ "pois":"r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", "fits":"profile1D:statonly:r_GG2H,r_QQ2HQQ,r_WH2HLNU,r_ZH2HLL,r_TTH,r_TH", "points":"40:40", - "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H=1,r_QQ2HQQ=1,r_WH2HLNU=1,r_ZH2HLL=1,r_TTH=1,r_TH=1 --setParameterRanges r_GG2H=0,3:r_QQ2HQQ=0,3:r_WH2HLNU=0,3:r_ZH2HLL=0,3:r_TTH=0,3:r_TH=0,3 --saveSpecifiedNuis all --freezeParameters MH" + "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H=1,r_QQ2HQQ=1,r_WH2HLNU=1,r_ZH2HLL=1,r_TTH=1,r_TH=1 --setParameterRanges r_GG2H=0,3:r_QQ2HQQ=0,3:r_WH2HLNU=0,3:r_ZH2HLL=0,3:r_TTH=0,3:r_TH=0,3 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale,allConstrainedNuisances" + }, + "mu_STXS1P2_PROTO":{ + "pois":"r_GG2H_PTH_GT200,r_GG2H_0J_PTH_0_10,r_GG2H_0J_PTH_GT10,r_GG2H_1J_PTH_0_60,r_GG2H_1J_PTH_60_120,r_GG2H_1J_PTH_120_200,r_GG2H_GE2J_MJJ_0_350_PTH_0_60,r_GG2H_GE2J_MJJ_0_350_PTH_60_120,r_GG2H_GE2J_MJJ_0_350_PTH_120_200,r_GG2H_MJJ_GT350_PTH_0_200,r_QQ2HQQ_REST,r_QQ2HQQ_GE2J_MJJ_60_120,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200,r_TTH_PTH_0_120,r_TTH_PTH_GT120,r_TH,r_WH2HLNU_PTV_0_150,r_WH2HLNU_PTV_GT150,r_ZH2HLL", + "fits":"profile1D:syst:r_GG2H_PTH_GT200,r_GG2H_0J_PTH_0_10,r_GG2H_0J_PTH_GT10,r_GG2H_1J_PTH_0_60,r_GG2H_1J_PTH_60_120,r_GG2H_1J_PTH_120_200,r_GG2H_GE2J_MJJ_0_350_PTH_0_60,r_GG2H_GE2J_MJJ_0_350_PTH_60_120,r_GG2H_GE2J_MJJ_0_350_PTH_120_200,r_GG2H_MJJ_GT350_PTH_0_200,r_QQ2HQQ_REST,r_QQ2HQQ_GE2J_MJJ_60_120,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200,r_TTH_PTH_0_120,r_TTH_PTH_GT120,r_TH,r_WH2HLNU_PTV_0_150,r_WH2HLNU_PTV_GT150,r_ZH2HLL", + "points":"40:40", + "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H_PTH_GT200=1,r_GG2H_0J_PTH_0_10=1,r_GG2H_0J_PTH_GT10=1,r_GG2H_1J_PTH_0_60=1,r_GG2H_1J_PTH_60_120=1,r_GG2H_1J_PTH_120_200=1,r_GG2H_GE2J_MJJ_0_350_PTH_0_60=1,r_GG2H_GE2J_MJJ_0_350_PTH_60_120=1,r_GG2H_GE2J_MJJ_0_350_PTH_120_200=1,r_GG2H_MJJ_GT350_PTH_0_200=1,r_QQ2HQQ_REST=1,r_QQ2HQQ_GE2J_MJJ_60_120=1,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200=1,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200=1,r_TTH_PTH_0_120=1,r_TTH_PTH_GT120=1,r_TH=1,r_WH2HLNU_PTV_0_150=1,r_WH2HLNU_PTV_GT150=1,r_ZH2HLL=1 --setParameterRanges r_GG2H_PTH_GT200=0,3:r_GG2H_0J_PTH_0_10=0,3:r_GG2H_0J_PTH_GT10=0,3:r_GG2H_1J_PTH_0_60=0,3:r_GG2H_1J_PTH_60_120=0,3:r_GG2H_1J_PTH_120_200=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_0_60=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_60_120=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_120_200=0,3:r_GG2H_MJJ_GT350_PTH_0_200=0,3:r_QQ2HQQ_REST=0,3:r_QQ2HQQ_GE2J_MJJ_60_120=0,3:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200=0,3:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200=0,3:r_TTH_PTH_0_120=0,3:r_TTH_PTH_GT120=0,3:r_TH=0,3:r_WH2HLNU_PTV_0_150=0,3:r_WH2HLNU_PTV_GT150=0,3:r_ZH2HLL=0,3 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale" + }, + "mu_STXS1P2_PROTO_statonly":{ + "pois":"r_GG2H_PTH_GT200,r_GG2H_0J_PTH_0_10,r_GG2H_0J_PTH_GT10,r_GG2H_1J_PTH_0_60,r_GG2H_1J_PTH_60_120,r_GG2H_1J_PTH_120_200,r_GG2H_GE2J_MJJ_0_350_PTH_0_60,r_GG2H_GE2J_MJJ_0_350_PTH_60_120,r_GG2H_GE2J_MJJ_0_350_PTH_120_200,r_GG2H_MJJ_GT350_PTH_0_200,r_QQ2HQQ_REST,r_QQ2HQQ_GE2J_MJJ_60_120,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200,r_TTH_PTH_0_120,r_TTH_PTH_GT120,r_TH,r_WH2HLNU_PTV_0_150,r_WH2HLNU_PTV_GT150,r_ZH2HLL", + "fits":"profile1D:statonly:r_GG2H_PTH_GT200,r_GG2H_0J_PTH_0_10,r_GG2H_0J_PTH_GT10,r_GG2H_1J_PTH_0_60,r_GG2H_1J_PTH_60_120,r_GG2H_1J_PTH_120_200,r_GG2H_GE2J_MJJ_0_350_PTH_0_60,r_GG2H_GE2J_MJJ_0_350_PTH_60_120,r_GG2H_GE2J_MJJ_0_350_PTH_120_200,r_GG2H_MJJ_GT350_PTH_0_200,r_QQ2HQQ_REST,r_QQ2HQQ_GE2J_MJJ_60_120,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200,r_TTH_PTH_0_120,r_TTH_PTH_GT120,r_TH,r_WH2HLNU_PTV_0_150,r_WH2HLNU_PTV_GT150,r_ZH2HLL", + "points":"40:40", + "fit_opts":"--saveInactivePOI 1 --setParameters r_GG2H_PTH_GT200=1,r_GG2H_0J_PTH_0_10=1,r_GG2H_0J_PTH_GT10=1,r_GG2H_1J_PTH_0_60=1,r_GG2H_1J_PTH_60_120=1,r_GG2H_1J_PTH_120_200=1,r_GG2H_GE2J_MJJ_0_350_PTH_0_60=1,r_GG2H_GE2J_MJJ_0_350_PTH_60_120=1,r_GG2H_GE2J_MJJ_0_350_PTH_120_200=1,r_GG2H_MJJ_GT350_PTH_0_200=1,r_QQ2HQQ_REST=1,r_QQ2HQQ_GE2J_MJJ_60_120=1,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200=1,r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200=1,r_TTH_PTH_0_120=1,r_TTH_PTH_GT120=1,r_TH=1,r_WH2HLNU_PTV_0_150=1,r_WH2HLNU_PTV_GT150=1,r_ZH2HLL=1 --setParameterRanges r_GG2H_PTH_GT200=0,3:r_GG2H_0J_PTH_0_10=0,3:r_GG2H_0J_PTH_GT10=0,3:r_GG2H_1J_PTH_0_60=0,3:r_GG2H_1J_PTH_60_120=0,3:r_GG2H_1J_PTH_120_200=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_0_60=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_60_120=0,3:r_GG2H_GE2J_MJJ_0_350_PTH_120_200=0,3:r_GG2H_MJJ_GT350_PTH_0_200=0,3:r_QQ2HQQ_REST=0,3:r_QQ2HQQ_GE2J_MJJ_60_120=0,3:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_GT200=0,3:r_QQ2HQQ_GE2J_MJJ_GT350_PTH_0_200=0,3:r_TTH_PTH_0_120=0,3:r_TTH_PTH_GT120=0,3:r_TH=0,3:r_WH2HLNU_PTV_0_150=0,3:r_WH2HLNU_PTV_GT150=0,3:r_ZH2HLL=0,3 --saveSpecifiedNuis all --freezeParameters MH,thQ_scale,thW_scale,allConstrainedNuisances" }, "mu_STXS0_old":{ "pois":"r_gghtruth,r_tthtruth,r_thtruth,r_whltruth,r_zhltruth,r_vbftruth", diff --git a/Datacard/makeDatacard.py b/Datacard/makeDatacard.py index 0249e5a48..78cab97c7 100644 --- a/Datacard/makeDatacard.py +++ b/Datacard/makeDatacard.py @@ -82,13 +82,23 @@ def leave(): # Add constant systematics to dataFrame for s in experimental_systematics: if s['type'] == 'constant': data = addConstantSyst(data,s,opt) + print('before') + for i in data.columns: + print(i) data = experimentalSystFactory(data, experimental_systematics, experimentalFactoryType, opt ) - + print('after') + for i in data.columns: + print(i) # Theory: print(" --> Adding theory systematics variations to dataFrame") # Add constant systematics to dataFrame for s in theory_systematics: - if s['type'] == 'constant': data = addConstantSyst(data,s,opt) + if s['type'] == 'constant': + data = addConstantSyst(data,s,opt) + print('theory') + print(data) + print(data.columns) + # Theory factory: group scale weights after calculation in relevant grouping scheme data = theorySystFactory(data, theory_systematics, theoryFactoryType, opt, stxsMergeScheme=STXSMergingScheme) #data, theory_systematics = groupSystematics(data, theory_systematics, opt, prefix="scaleWeight", groupings=[[1,2],[3,6],[4,8]], stxsMergeScheme=STXSMergingScheme) @@ -127,6 +137,8 @@ def leave(): # Set prune = 1 if < threshold of total cat yield mask = (data['true_yield'] Using nominal yield of process (sumEntries) for pruning") @@ -156,6 +168,7 @@ def leave(): print(" ..........................................................................................") fdataName = "%s.txt"%opt.output print(" --> Writing to datacard file: %s"%fdataName) +# print(data.weight_DummyDown_yield) from tools.writeToDatacard import writePreamble, writeProcesses, writeSystematic, writeMCStatUncertainty, writePdfIndex, writeBreak fdata = open(fdataName,"w") if not writePreamble(fdata,opt): diff --git a/Datacard/makeYields.py b/Datacard/makeYields.py index 8e3b0c9aa..9ec4b29a3 100644 --- a/Datacard/makeYields.py +++ b/Datacard/makeYields.py @@ -76,15 +76,16 @@ def get_options(): else: procs = opt.procs.split(",") -procs.remove('ZH2HQQ_FWDH') -procs.remove('WMINUSH2HQQ_FWDH') - -procs.remove('GG2HNUNU_FWDH') -procs.remove('WPLUSH2HLNU_PTV_150_250_0J') -procs.remove('GG2HQQ_PTH_200_300') -procs.remove('GG2HQQ_PTH_GT650') -procs.remove('THW_FWDH') -procs.remove('ZH2HNUNU_FWDH') +# procs.remove('ZH2HQQ_FWDH') +# procs.remove('WMINUSH2HQQ_FWDH') + +# procs.remove('GG2HNUNU_FWDH') +# # procs.remove('WPLUSH2HLNU_PTV_150_250_0J') +# procs.remove('GG2HQQ_PTH_200_300') +# procs.remove('GG2HQQ_PTH_GT650') +# procs.remove('THW_FWDH') +# # procs.remove('GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25') +# procs.remove('ZH2HNUNU_FWDH') procs.sort() # Initiate pandas dataframe @@ -97,49 +98,52 @@ def get_options(): # Signal processes for year in years: - for proc in procs: - - # Identifier - _id = "%s_%s_%s_%s"%(proc,year,opt.cat,sqrts__) - - # Mapping to STXS definition here - _procOriginal = proc - _proc = "%s_%s_%s"%(proc,year,decayMode) - _proc_s0 = proc - print(proc) - - # Define category: add year tag if not merging - if opt.mergeYears: _cat = opt.cat - else: _cat = "%s_%s"%(opt.cat,year) - - # Input flashgg ws - _inputWSFile = glob.glob("%s/*M%s*_%s.root"%(inputWSDirMap[year],opt.mass,proc))[0] - _nominalDataName = "%s_%s_hgg_%s_%s_%s"%(_proc_s0,year, opt.mass,sqrts__,opt.cat) - print(_nominalDataName) - - # If opt.skipZeroes check nominal yield if 0 then do not add - skipProc = False - if opt.skipZeroes: - f = ROOT.TFile(_inputWSFile) - w = f.Get(inputWSName__) - sumw = w.data(_nominalDataName).sumEntries() - if sumw == 0.: skipProc = True - w.Delete() - f.Close() - if skipProc: continue - - # Input model ws - if opt.cat == "NOTAG": _modelWSFile, _model = '-', '-' - else: - _modelWSFile = "%s/CMS-HGG_sigfit_%s_%s.root"%(opt.sigModelWSDir,opt.sigModelExt,_cat) - _model = "%s_%s:%s_%s"%(outputWSName__,sqrts__,outputWSObjectTitle__,_id) - - # Extract rate from lumi - _rate = float(lumiMap[year])*1000 - - # Add signal process to dataFrame: - print(" --> Adding to dataFrame: (proc,cat) = (%s,%s)"%(_proc,_cat)) - data.loc[len(data)] = [year,'sig',_procOriginal,_proc,_proc_s0,_cat,_inputWSFile,_nominalDataName,_modelWSFile,_model,_rate] + for proc in procsMap[year].split(","): + if proc not in ['GG2HNUNU_FWDH','ZH2HQQ_FWDH','TTH_FWDH','GG2HLL_FWDH']:#,'GG2HQQ_PTH_200_300','GG2HQQ_PTH_GT650','TTH_FWDH','ZH2HNUNU_FWDH','GG2HLL_FWDH','GG2HLL_PTV_150_250_0J_','GG2HLL_PTV_150_250_0J','GG2HLL_PTV_150_250_GE1J','GG2HLL_PTV_GT250','GG2HNUNU_PTV_150_250_0J','GG2HNUNU_PTV_150_250_GE1J','GG2HNUNU_PTV_GT250']: + print(proc) + # Identifier + _id = "%s_%s_%s_%s"%(proc,year,opt.cat,sqrts__) + + # Mapping to STXS definition here + _procOriginal = proc + _proc = "%s_%s_%s"%(proc,year,decayMode) + _proc_s0 = proc + # print(proc) + + # Define category: add year tag if not merging + if opt.mergeYears: _cat = opt.cat + else: _cat = "%s_%s"%(opt.cat,year) + + # Input flashgg ws + _inputWSFile = glob.glob("%s/*M%s*_%s.root"%(inputWSDirMap[year],opt.mass,proc))[0] + _nominalDataName = "%s_%s_hgg_%s_%s_%s"%(_proc_s0,year, opt.mass,sqrts__,opt.cat) + # print('AAA') + # print(_nominalDataName) + # print('BBB') + + # If opt.skipZeroes check nominal yield if 0 then do not add + skipProc = False + if opt.skipZeroes: + f = ROOT.TFile(_inputWSFile) + w = f.Get(inputWSName__) + sumw = w.data(_nominalDataName).sumEntries() + if sumw == 0.: skipProc = True + w.Delete() + f.Close() + if skipProc: continue + + # Input model ws + if opt.cat == "NOTAG": _modelWSFile, _model = '-', '-' + else: + _modelWSFile = "%s/CMS-HGG_sigfit_%s_%s.root"%(opt.sigModelWSDir,opt.sigModelExt,_cat) + _model = "%s_%s:%s_%s"%(outputWSName__,sqrts__,outputWSObjectTitle__,_id) + + # Extract rate from lumi + _rate = float(lumiMap[year])*1000 + + # Add signal process to dataFrame: + print(" --> Adding to dataFrame: (proc,cat) = (%s,%s)"%(_proc,_cat)) + data.loc[len(data)] = [year,'sig',_procOriginal,_proc,_proc_s0,_cat,_inputWSFile,_nominalDataName,_modelWSFile,_model,_rate] # Background and data processes if( not opt.skipBkg)&( opt.cat != "NOTAG" ): @@ -200,11 +204,15 @@ def get_options(): if s['type'] == 'factory': # Fix for HEM as only in 2018 workspaces if s['name'] == 'JetHEM': experimentalFactoryType[s['name']] = "a_h" - else: experimentalFactoryType[s['name']] = factoryType(data,s) + else: + experimentalFactoryType[s['name']] = factoryType(data,s) + # print('ftype'+str(factoryType(data,s))) if experimentalFactoryType[s['name']] in ["a_w","a_h"]: data['%s_up_yield'%s['name']] = '-' data['%s_down_yield'%s['name']] = '-' else: data['%s_yield'%s['name']] = '-' + # print(experimentalFactoryType) + for s in theory_systematics: if s['type'] == 'factory': theoryFactoryType[s['name']] = factoryType(data,s) @@ -226,10 +234,12 @@ def get_options(): # Open input WS file and extract workspace f_in = ROOT.TFile(r.inputWSFile) - print(r.inputWSFile) + # print(r.inputWSFile) inputWS = f_in.Get(inputWSName__) # Extract nominal RooDataSet and yield rdata_nominal = inputWS.data(r.nominalDataName) + # print(rdata_nominal) + # print('nominal='+str(rdata_nominal.Print())) # Calculate nominal yield, sumw2 and add COW correction for in acceptance events contents = "" @@ -250,17 +260,21 @@ def get_options(): else: y_COWCorr += w*(f_NNLOPS/f_COWCorr) except ReferenceError: print(f"\n Proc {r.proc} in Cat {r['cat']} has no entries, skipping\n" ) + data.at[ir,'nominal_yield'] = y + # print(y) data.at[ir,'sumw2'] = sumw2 if not opt.skipCOWCorr: data.at[ir,'nominal_yield_COWCorr'] = y_COWCorr # Systematics: loop over systematics and use function to extract yield variations if opt.doSystematics: - + print(contents) # For experimental systematics: skip NOTAG events if "NOTAG" not in r['cat']: # Skip centralObjectWeight correction as concerns events in acceptance experimentalSystYields = calcSystYields(r['nominalDataName'],contents,inputWS,experimentalFactoryType,skipCOWCorr=True,proc=r['proc'],year=r['year'],systWeightScheme=opt.systWeightScheme,ignoreWarnings=opt.ignore_warnings) + # print('YIELLLLLDS:') + # print(experimentalSystYields) for s,f in experimentalFactoryType.items(): if f in ['a_w','a_h']: for direction in ['up','down']: @@ -278,11 +292,13 @@ def get_options(): else: data.at[ir,"%s_yield"%s] = theorySystYields[s] if not opt.skipCOWCorr: data.at[ir,"%s_yield_COWCorr"%s] = theorySystYields["%s_COWCorr"%s] - + # print(theorySystYields) # Remove the workspace and file from heap inputWS.Delete() f_in.Close() - +# print('check') +# for i in data.columns: + # print(i) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # SAVE YIELDS DATAFRAME print(" ..........................................................................................") diff --git a/Datacard/systematics.py b/Datacard/systematics.py index 8025d6a97..e9955a9d8 100644 --- a/Datacard/systematics.py +++ b/Datacard/systematics.py @@ -22,45 +22,93 @@ theory_systematics = [ # Normalisation uncertainties: enter interpretations {'name':'BR_hgg','title':'BR_hgg','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':"0.98/1.021"}, - {'name':'QCDscale_ggH','title':'QCDscale_ggH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh.json'}, - {'name':'QCDscale_qqH','title':'QCDscale_qqH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh.json'}, - #{'name':'QCDscale_VH','title':'QCDscale_VH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_vh.json'}, # Note: VH had components accounted for in THU_qqH_*, set to 1 in json - #{'name':'QCDscale_ggZH','title':'QCDscale_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, # Note: ggZH lep components are accounted for in THU_ggZH i.e. this only covers the ggZH had component - #{'name':'QCDscale_ttH','title':'QCDscale_ttH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth.json'}, - #{'name':'QCDscale_tHq','title':'QCDscale_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, - #{'name':'QCDscale_tHW','title':'QCDscale_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, - #{'name':'QCDscale_bbH','title':'QCDscale_bbH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_bbh.json'}, + + {'name':'THU_ggH_stxs_Yield','title':'THU_ggH_stxs_Yield','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_Res','title':'THU_ggH_stxs_Res','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_Mig01','title':'THU_ggH_stxs_Mig01','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_Mig12','title':'THU_ggH_stxs_Mig12','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_Boosted','title':'THU_ggH_stxs_Boosted','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_PTH200','title':'THU_ggH_stxs_PTH200','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_PTH300','title':'THU_ggH_stxs_PTH300','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_PTH450','title':'THU_ggH_stxs_PTH450','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_PTH650','title':'THU_ggH_stxs_PTH650','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_0J_PTH10','title':'THU_ggH_stxs_0J_PTH10','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_1J_PTH60','title':'THU_ggH_stxs_1J_PTH60','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_1J_PTH120','title':'THU_ggH_stxs_1J_PTH120','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_PTH60','title':'THU_ggH_stxs_GE2J_PTH60','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_PTH120','title':'THU_ggH_stxs_GE2J_PTH120','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_MJJ350','title':'THU_ggH_stxs_GE2J_MJJ350','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_MJJ700','title':'THU_ggH_stxs_GE2J_MJJ700','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25','title':'THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25','title':'THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh_stxs.json'}, + {'name':'THU_qqH_Yield','title':'THU_qqH_Yield','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_PTH200','title':'THU_qqH_PTH200','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ60','title':'THU_qqH_MJJ60','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ120','title':'THU_qqH_MJJ120','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ350','title':'THU_qqH_MJJ350','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ700','title':'THU_qqH_MJJ700','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ1000','title':'THU_qqH_MJJ1000','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_MJJ1500','title':'THU_qqH_MJJ1500','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_PTHJJ25','title':'THU_qqH_PTHJJ25','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_qqH_JET01','title':'THU_qqH_JET01','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh_stxs.json'}, + {'name':'THU_WH_inc','title':'THU_WH_inc','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_whlep_stxs.json'}, + {'name':'THU_WH_mig75','title':'THU_WH_mig75','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_whlep_stxs.json'}, + {'name':'THU_WH_mig150','title':'THU_WH_mig150','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_whlep_stxs.json'}, + {'name':'THU_WH_mig250','title':'THU_WH_mig250','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_whlep_stxs.json'}, + {'name':'THU_WH_mig01','title':'THU_WH_mig01','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_whlep_stxs.json'}, + {'name':'THU_ZH_inc','title':'THU_ZH_inc','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_zhlep_stxs.json'}, + {'name':'THU_ZH_mig75','title':'THU_ZH_mig75','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_zhlep_stxs.json'}, + {'name':'THU_ZH_mig150','title':'THU_ZH_mig150','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_zhlep_stxs.json'}, + {'name':'THU_ZH_mig250','title':'THU_ZH_mig250','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_zhlep_stxs.json'}, + {'name':'THU_ZH_mig01','title':'THU_ZH_mig01','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_zhlep_stxs.json'}, + {'name':'THU_ggZH_inc','title':'THU_ggZH_inc','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzhlep_stxs.json'}, + {'name':'THU_ggZH_mig75','title':'THU_ggZH_mig75','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzhlep_stxs.json'}, + {'name':'THU_ggZH_mig150','title':'THU_ggZH_mig150','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzhlep_stxs.json'}, + {'name':'THU_ggZH_mig250','title':'THU_ggZH_mig250','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzhlep_stxs.json'}, + {'name':'THU_ggZH_mig01','title':'THU_ggZH_mig01','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzhlep_stxs.json'}, + {'name':'THU_ttH_Yield','title':'THU_ttH_Yield','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth_stxs.json'}, + {'name':'THU_ttH_mig60','title':'THU_ttH_mig60','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth_stxs.json'}, + {'name':'THU_ttH_mig120','title':'THU_ttH_mig120','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth_stxs.json'}, + {'name':'THU_ttH_mig200','title':'THU_ttH_mig200','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth_stxs.json'}, + {'name':'THU_ttH_mig300','title':'THU_ttH_mig300','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth_stxs.json'}, + + {'name':'QCDscale_ggZH','title':'QCDscale_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, # Note: ggZH lep components are accounted for in THU_ggZH i.e. this only covers the ggZH had component + {'name':'QCDscale_tHq','title':'QCDscale_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, + {'name':'QCDscale_tHW','title':'QCDscale_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, + {'name':'QCDscale_bbH','title':'QCDscale_bbH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_bbh.json'}, + {'name':'pdf_Higgs_ggH','title':'pdf_Higgs_ggH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh.json'}, {'name':'pdf_Higgs_qqH','title':'pdf_Higgs_qqH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh.json'}, - #{'name':'pdf_Higgs_VH','title':'pdf_Higgs_VH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_vh.json'}, - #{'name':'pdf_Higgs_ggZH','title':'pdf_Higgs_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, - #{'name':'pdf_Higgs_ttH','title':'pdf_Higgs_ttH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth.json'}, - #{'name':'pdf_Higgs_tHq','title':'pdf_Higgs_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, - #{'name':'pdf_Higgs_tHW','title':'pdf_Higgs_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, + {'name':'pdf_Higgs_VH','title':'pdf_Higgs_VH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_vh.json'}, + {'name':'pdf_Higgs_ggZH','title':'pdf_Higgs_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, + {'name':'pdf_Higgs_ttH','title':'pdf_Higgs_ttH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth.json'}, + {'name':'pdf_Higgs_tHq','title':'pdf_Higgs_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, + {'name':'pdf_Higgs_tHW','title':'pdf_Higgs_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, + {'name':'alphaS_ggH','title':'alphaS_ggH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggh.json'}, {'name':'alphaS_qqH','title':'alphaS_qqH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_qqh.json'}, - #{'name':'alphaS_VH','title':'alphaS_VH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_vh.json'}, - #{'name':'alphaS_ggZH','title':'alphaS_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, - #{'name':'alphaS_ttH','title':'alphaS_ttH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth.json'}, - #{'name':'alphaS_tHq','title':'alphaS_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, - #{'name':'alphaS_tHW','title':'alphaS_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, - - # Shape uncertainties: enter direct XS measurements - # Shape uncertainties: enter direct XS measurements - # Scale weights grouping is defined in makeDatacard.py - # For some reason, the name is saved only as `Scal`, not `Scale`, do not ask me why - # Comment out the nominal weight here as it does not contain any `tiers`, so it would fail in `makeDatacard.py`` - # The scheme below is valid for v13, you need to explicitly check the nanoAOD documentation to validate your setup - #{'name':'weight_LHEScal_0','title':'CMS_hgg_scaleWeight_0','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - #{'name':'weight_LHEScal_1','title':'CMS_hgg_scaleWeight_1','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - #{'name':'weight_LHEScal_2','title':'CMS_hgg_scaleWeight_2','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, #Unphysical - #{'name':'weight_LHEScal_3','title':'CMS_hgg_scaleWeight_3','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - #{'name':'weight_LHEScal_4','title':'CMS_hgg_scaleWeight_4','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, # nominal weight - #{'name':'weight_LHEScal_5','title':'CMS_hgg_scaleWeight_5','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - #{'name':'weight_LHEScal_6','title':'CMS_hgg_scaleWeight_6','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, #Unphysical - #{'name':'weight_LHEScal_7','title':'CMS_hgg_scaleWeight_7','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - #{'name':'weight_LHEScal_8','title':'CMS_hgg_scaleWeight_8','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, - {'name':'weight_AlphaS','title':'CMS_hgg_AlphaS','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + {'name':'alphaS_VH','title':'alphaS_VH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_vh.json'}, + {'name':'alphaS_ggZH','title':'alphaS_ggZH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_ggzh.json'}, + {'name':'alphaS_ttH','title':'alphaS_ttH','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_tth.json'}, + {'name':'alphaS_tHq','title':'alphaS_tHq','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thq.json'}, + {'name':'alphaS_tHW','title':'alphaS_tHW','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':'theory_uncertainties/thu_thw.json'}, + + # # Shape uncertainties: enter direct XS measurements + # # Shape uncertainties: enter direct XS measurements + # # Scale weights grouping is defined in makeDatacard.py + # # For some reason, the name is saved only as `Scal`, not `Scale`, do not ask me why + # # Comment out the nominal weight here as it does not contain any `tiers`, so it would fail in `makeDatacard.py`` + # # The scheme below is valid for v13, you need to explicitly check the nanoAOD documentation to validate your setup + # #{'name':'weight_LHEScal_0','title':'CMS_hgg_scaleWeight_0','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # #{'name':'weight_LHEScal_1','title':'CMS_hgg_scaleWeight_1','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # #{'name':'weight_LHEScal_2','title':'CMS_hgg_scaleWeight_2','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, #Unphysical + # #{'name':'weight_LHEScal_3','title':'CMS_hgg_scaleWeight_3','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # #{'name':'weight_LHEScal_4','title':'CMS_hgg_scaleWeight_4','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, # nominal weight + # #{'name':'weight_LHEScal_5','title':'CMS_hgg_scaleWeight_5','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # #{'name':'weight_LHEScal_6','title':'CMS_hgg_scaleWeight_6','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, #Unphysical + # #{'name':'weight_LHEScal_7','title':'CMS_hgg_scaleWeight_7','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # #{'name':'weight_LHEScal_8','title':'CMS_hgg_scaleWeight_8','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, + # {'name':'weight_AlphaS','title':'CMS_hgg_AlphaS','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, {'name':'weight_PS_ISR','title':'CMS_hgg_PS_ISR','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']}, {'name':'weight_PS_FSR','title':'CMS_hgg_PS_FSR','type':'factory','prior':'lnN','correlateAcrossYears':1,'tiers':['shape']} @@ -78,13 +126,16 @@ experimental_systematics = [ {'name':'lumi_13p6TeV_2022','title':'lumi_13p6TeV_2022','type':'constant','prior':'lnN','correlateAcrossYears':1,'value':"1.014"}, + # {'name':'weight_Dummy','title':'CMS_hgg_DummyWeight','type':'factory','prior':'lnN','correlateAcrossYears':1}, + {'name':'weight_Pileup','title':'CMS_hgg_PileupWeight','type':'factory','prior':'lnN','correlateAcrossYears':1}, {'name':'weight_TriggerSF','title':'CMS_hgg_TriggerWeight','type':'factory','prior':'lnN','correlateAcrossYears':1}, {'name':'weight_ElectronVetoSF','title':'CMS_hgg_ElectronVetoSF','type':'factory','prior':'lnN','correlateAcrossYears':1}, {'name':'weight_PreselSF','title':'CMS_hgg_PreselSF','type':'factory','prior':'lnN','correlateAcrossYears':1}, + {'name':'weight_SF_photon_ID','title':'CMS_hgg_phoIdMva','type':'factory','prior':'lnN','correlateAcrossYears':1}, - #{'name':'energyErrShift','title':'CMS_hgg_SigmaEOverEShift','type':'factory','prior':'lnN','correlateAcrossYears':1} - ] + {'name':'energyErrShift','title':'CMS_hgg_SigmaEOverEShift','type':'factory','prior':'lnN','correlateAcrossYears':1}, + {'name':'jec_syst_Total','title':'CMS_jec','type':'factory','prior':'lnN','correlateAcrossYears':0} ] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -92,9 +143,20 @@ # mode = (other,scalesGlobal,scales,scalesCorr,smears): match the definition in the signal models signal_shape_systematics = [ - {'name':'deltafracright','title':'deltafracright','type':'signal_shape','mode':'other','mean':'0.0','sigma':'0.02'}, - {'name':'Scale','title':'Scale','type':'signal_shape','mode':'scales','mean':'0.0','sigma':'1.0'}, - {'name':'Smearing','title':'Smearing','type':'signal_shape','mode':'smears','mean':'0.0','sigma':'1.0'}, - #{'name':'NonLinearity','title':'NonLinearity','type':'signal_shape','mode':'scalesGlobal','mean':'0.0','sigma':'0.002'}, - #{'name':'Geant4','title':'Geant4','type':'signal_shape','mode':'scalesGlobal','mean':'0.0','sigma':'0.0005'} - ] +# # {'name':'deltafracright','title':'deltafracright','type':'signal_shape','mode':'other','mean':'0.0','sigma':'0.02'}, +# # {'name':'Scale','title':'Scale','type':'signal_shape','mode':'scales','mean':'0.0','sigma':'1.0'}, +# # {'name':'Smearing','title':'Smearing','type':'signal_shape','mode':'smears','mean':'0.0','sigma':'1.0'}, +# # #{'name':'NonLinearity','title':'NonLinearity','type':'signal_shape','mode':'scalesGlobal','mean':'0.0','sigma':'0.002'}, +# #{'name':'Geant4','title':'Geant4','type':'signal_shape','mode':'scalesGlobal','mean':'0.0','sigma':'0.0005'} +# ] + +# signal_shape_systematics = [ + + {'name':'Material','title':'Material','type':'signal_shape','mode':'scalesCorr','mean':'0.0','sigma':'1.0','correlateAcrossYears':1}, + {'name':'FNUF','title':'FNUF','type':'signal_shape','mode':'scalesCorr','mean':'0.0','sigma':'1.0','correlateAcrossYears':1}, + {'name':'ScaleEB2G_IJazZ','title':'ScaleEB2G_IJazZ','type':'signal_shape','mode':'scales','mean':'0.0','sigma':'1.0','correlateAcrossYears':0}, + {'name':'ScaleEE2G_IJazZ','title':'ScaleEE2G_IJazZ','type':'signal_shape','mode':'scales','mean':'0.0','sigma':'1.0','correlateAcrossYears':0}, + {'name':'Smearing2G_IJazZ','title':'Smearing2G_IJazZ','type':'signal_shape','mode':'scales','mean':'0.0','sigma':'1.0','correlateAcrossYears':0}, + + +] \ No newline at end of file diff --git a/Datacard/theory_uncertainties/thu_bbh.json b/Datacard/theory_uncertainties/thu_bbh.json index 7716e74c0..7a40ef61b 100644 --- a/Datacard/theory_uncertainties/thu_bbh.json +++ b/Datacard/theory_uncertainties/thu_bbh.json @@ -1,8 +1,8 @@ { - "bbH_FWDH":{ + "BBH_FWDH":{ "QCDscale_bbH":[1.202,0.761] }, - "bbH":{ + "BBH_FID":{ "QCDscale_bbH":[1.202,0.761] } } diff --git a/Datacard/theory_uncertainties/thu_ggh.json b/Datacard/theory_uncertainties/thu_ggh.json index 1698fe109..51b037d29 100644 --- a/Datacard/theory_uncertainties/thu_ggh.json +++ b/Datacard/theory_uncertainties/thu_ggh.json @@ -4,87 +4,87 @@ "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_FWDH":{ + "GG2H_FWDH":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_0J_PTH_0_10":{ + "GG2H_0J_PTH_0_10":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_0J_PTH_GT10":{ + "GG2H_0J_PTH_GT10":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_1J_PTH_0_60":{ + "GG2H_1J_PTH_0_60":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_1J_PTH_60_120":{ + "GG2H_1J_PTH_60_120":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_1J_PTH_120_200":{ + "GG2H_1J_PTH_120_200":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_0_350_PTH_0_60":{ + "GG2H_GE2J_MJJ_0_350_PTH_0_60":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_0_350_PTH_60_120":{ + "GG2H_GE2J_MJJ_0_350_PTH_60_120":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_0_350_PTH_120_200":{ + "GG2H_GE2J_MJJ_0_350_PTH_120_200":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_PTH_200_300":{ + "GG2H_PTH_200_300":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_PTH_300_450":{ + "GG2H_PTH_300_450":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_PTH_450_650":{ + "GG2H_PTH_450_650":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 }, - "ggH_PTH_GT650":{ + "GG2H_PTH_GT650":{ "QCDscale_ggH":[1.047,0.931], "pdf_Higgs_ggH":1.019, "alphaS_ggH":1.026 diff --git a/Datacard/theory_uncertainties/thu_ggh_stxs.json b/Datacard/theory_uncertainties/thu_ggh_stxs.json index e8a466115..3480a5d9b 100644 --- a/Datacard/theory_uncertainties/thu_ggh_stxs.json +++ b/Datacard/theory_uncertainties/thu_ggh_stxs.json @@ -1,5 +1,5 @@ { - "ggH_FWDH":{ + "GG2H_FWDH":{ "THU_ggH_stxs_Yield":1.045, "THU_ggH_stxs_Res":1.021, "THU_ggH_stxs_Mig01":1.000, @@ -19,7 +19,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_0J_PTH_0_10":{ + "GG2H_0J_PTH_0_10":{ "THU_ggH_stxs_Yield":1.039, "THU_ggH_stxs_Res":1.001, "THU_ggH_stxs_Mig01":0.958, @@ -39,7 +39,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_0J_PTH_GT10":{ + "GG2H_0J_PTH_GT10":{ "THU_ggH_stxs_Yield":1.039, "THU_ggH_stxs_Res":1.001, "THU_ggH_stxs_Mig01":0.958, @@ -59,7 +59,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_1J_PTH_0_60":{ + "GG2H_1J_PTH_0_60":{ "THU_ggH_stxs_Yield":1.0523, "THU_ggH_stxs_Res":1.0451, "THU_ggH_stxs_Mig01":1.0792, @@ -79,7 +79,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_1J_PTH_60_120":{ + "GG2H_1J_PTH_60_120":{ "THU_ggH_stxs_Yield":1.0523, "THU_ggH_stxs_Res":1.0451, "THU_ggH_stxs_Mig01":1.0792, @@ -99,7 +99,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_1J_PTH_120_200":{ + "GG2H_1J_PTH_120_200":{ "THU_ggH_stxs_Yield":1.0523, "THU_ggH_stxs_Res":1.0451, "THU_ggH_stxs_Mig01":1.0792, @@ -119,7 +119,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_0_350_PTH_0_60":{ + "GG2H_GE2J_MJJ_0_350_PTH_0_60":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -139,7 +139,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_0_350_PTH_60_120":{ + "GG2H_GE2J_MJJ_0_350_PTH_60_120":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -159,7 +159,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_0_350_PTH_120_200":{ + "GG2H_GE2J_MJJ_0_350_PTH_120_200":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -179,7 +179,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -199,7 +199,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":0.6870, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -219,7 +219,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.200, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -239,7 +239,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":0.6786 }, - "ggH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "THU_ggH_stxs_Yield":1.0887, "THU_ggH_stxs_Res":1.0887, "THU_ggH_stxs_Mig01":1.0444, @@ -259,7 +259,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.200 }, - "ggH_PTH_200_300":{ + "GG2H_PTH_200_300":{ "THU_ggH_stxs_Yield":1.045, "THU_ggH_stxs_Res":1.021, "THU_ggH_stxs_Mig01":1.000, @@ -279,7 +279,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_PTH_300_450":{ + "GG2H_PTH_300_450":{ "THU_ggH_stxs_Yield":1.045, "THU_ggH_stxs_Res":1.021, "THU_ggH_stxs_Mig01":1.000, @@ -299,7 +299,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_PTH_450_650":{ + "GG2H_PTH_450_650":{ "THU_ggH_stxs_Yield":1.045, "THU_ggH_stxs_Res":1.021, "THU_ggH_stxs_Mig01":1.000, @@ -319,7 +319,7 @@ "THU_ggH_stxs_GE2J_LOWMJJ_PTHJJ25":1.000, "THU_ggH_stxs_GE2J_HIGHMJJ_PTHJJ25":1.000 }, - "ggH_PTH_GT650":{ + "GG2H_PTH_GT650":{ "THU_ggH_stxs_Yield":1.045, "THU_ggH_stxs_Res":1.021, "THU_ggH_stxs_Mig01":1.000, diff --git a/Datacard/theory_uncertainties/thu_ggzh.json b/Datacard/theory_uncertainties/thu_ggzh.json index da67509c0..60cd31366 100644 --- a/Datacard/theory_uncertainties/thu_ggzh.json +++ b/Datacard/theory_uncertainties/thu_ggzh.json @@ -1,145 +1,145 @@ { - "ggZH_had_FWDH":{ + "GG2HQQ_FWDH":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_0J_PTH_0_10":{ + "GG2HQQ_0J_PTH_0_10":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_0J_PTH_GT10":{ + "GG2HQQ_0J_PTH_GT10":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_1J_PTH_0_60":{ + "GG2HQQ_1J_PTH_0_60":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_1J_PTH_60_120":{ + "GG2HQQ_1J_PTH_60_120":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_1J_PTH_120_200":{ + "GG2HQQ_1J_PTH_120_200":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_0_350_PTH_0_60":{ + "GG2HQQ_GE2J_MJJ_0_350_PTH_0_60":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_0_350_PTH_60_120":{ + "GG2HQQ_GE2J_MJJ_0_350_PTH_60_120":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_0_350_PTH_120_200":{ + "GG2HQQ_GE2J_MJJ_0_350_PTH_120_200":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_PTH_200_300":{ + "GG2HQQ_PTH_200_300":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_PTH_300_450":{ + "GG2HQQ_PTH_300_450":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_PTH_450_650":{ + "GG2HQQ_PTH_450_650":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_had_PTH_GT650":{ + "GG2HQQ_PTH_GT650":{ "QCDscale_ggZH":[1.251,0.811], "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_FWDH":{ + "GG2HLL_FWDH":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_PTV_0_75":{ + "GG2HLL_PTV_0_75":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_PTV_75_150":{ + "GG2HLL_PTV_75_150":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_PTV_150_250_0J":{ + "GG2HLL_PTV_150_250_0J":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_PTV_150_250_GE1J":{ + "GG2HLL_PTV_150_250_GE1J":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_ll_PTV_GT250":{ + "GG2HLL_PTV_GT250":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_FWDH":{ + "GG2HNUNU_FWDH":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_PTV_0_75":{ + "GG2HNUNU_PTV_0_75":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_PTV_75_150":{ + "GG2HNUNU_PTV_75_150":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_PTV_150_250_0J":{ + "GG2HNUNU_PTV_150_250_0J":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_PTV_150_250_GE1J":{ + "GG2HNUNU_PTV_150_250_GE1J":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 }, - "ggZH_nunu_PTV_GT250":{ + "GG2HNUNU_PTV_GT250":{ "QCDscale_ggZH":1.000, "pdf_Higgs_ggZH":1.018, "alphaS_ggZH":1.016 diff --git a/Datacard/theory_uncertainties/thu_ggzhlep_stxs.json b/Datacard/theory_uncertainties/thu_ggzhlep_stxs.json index d3572146d..1e238bb5f 100644 --- a/Datacard/theory_uncertainties/thu_ggzhlep_stxs.json +++ b/Datacard/theory_uncertainties/thu_ggzhlep_stxs.json @@ -1,82 +1,82 @@ { - "ggZH_ll_FWDH":{ + "GG2HLL_FWDH":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.000, "THU_ggZH_mig150":1.000, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_ll_PTV_0_75":{ + "GG2HLL_PTV_0_75":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":0.1000, "THU_ggZH_mig150":1.000, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_ll_PTV_75_150":{ + "GG2HLL_PTV_75_150":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":0.882, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_ll_PTV_150_250_0J":{ + "GG2HLL_PTV_150_250_0J":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, "THU_ggZH_mig250":0.963, "THU_ggZH_mig01":0.393 }, - "ggZH_ll_PTV_150_250_GE1J":{ + "GG2HLL_PTV_150_250_GE1J":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, "THU_ggZH_mig250":0.963, "THU_ggZH_mig01":1.277 }, - "ggZH_ll_PTV_GT250":{ + "GG2HLL_PTV_GT250":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, "THU_ggZH_mig250":1.154, "THU_ggZH_mig01":1.000 }, - "ggZH_nunu_FWDH":{ + "GG2HNUNU_FWDH":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.000, "THU_ggZH_mig150":1.000, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_nunu_PTV_0_75":{ + "GG2HNUNU_PTV_0_75":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":0.1000, "THU_ggZH_mig150":1.000, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_nunu_PTV_75_150":{ + "GG2HNUNU_PTV_75_150":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":0.882, "THU_ggZH_mig250":1.000, "THU_ggZH_mig01":1.000 }, - "ggZH_nunu_PTV_150_250_0J":{ + "GG2HNUNU_PTV_150_250_0J":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, "THU_ggZH_mig250":0.963, "THU_ggZH_mig01":0.393 }, - "ggZH_nunu_PTV_150_250_GE1J":{ + "GG2HNUNU_PTV_150_250_GE1J":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, "THU_ggZH_mig250":0.963, "THU_ggZH_mig01":1.277 }, - "ggZH_nunu_PTV_GT250":{ + "GG2HNUNU_PTV_GT250":{ "THU_ggZH_inc":[1.251,0.811], "THU_ggZH_mig75":1.27, "THU_ggZH_mig150":1.142, diff --git a/Datacard/theory_uncertainties/thu_qqh.json b/Datacard/theory_uncertainties/thu_qqh.json index 6611aca01..2ece28eb4 100644 --- a/Datacard/theory_uncertainties/thu_qqh.json +++ b/Datacard/theory_uncertainties/thu_qqh.json @@ -1,60 +1,60 @@ { - "qqH":{ + "VBF":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_FWDH":{ + "VBF_FWDH":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_0J":{ + "VBF_0J":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_1J":{ + "VBF_1J":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_0_60":{ + "VBF_GE2J_MJJ_0_60":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_60_120":{ + "VBf_GE2J_MJJ_60_120":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_120_350":{ + "VBF_GE2J_MJJ_120_350":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 }, - "qqH_GE2J_MJJ_GT350_PTH_GT200":{ + "VBF_GE2J_MJJ_GT350_PTH_GT200":{ "QCDscale_qqH":[1.004,0.997], "pdf_Higgs_qqH":1.021, "alphaS_qqH":1.005 diff --git a/Datacard/theory_uncertainties/thu_qqh_stxs.json b/Datacard/theory_uncertainties/thu_qqh_stxs.json index 77eaa3c88..8eed6d61d 100644 --- a/Datacard/theory_uncertainties/thu_qqh_stxs.json +++ b/Datacard/theory_uncertainties/thu_qqh_stxs.json @@ -1,5 +1,5 @@ { - "qqH_FWDH":{ + "VBF_FWDH":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -11,7 +11,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":1.0000 }, - "WH_had_FWDH":{ + "WMINUSH2HQQ_FWDH":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -23,7 +23,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":1.0000 }, - "ZH_had_FWDH":{ + "WPLUSH2HQQ_FWDH":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -35,7 +35,19 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":1.0000 }, - "qqH_0J":{ + "ZH2HQQ_FWDH":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":1.0000, + "THU_qqH_MJJ120":1.0000, + "THU_qqH_MJJ350":1.0000, + "THU_qqH_MJJ700":1.0000, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0000, + "THU_qqH_JET01":1.0000 + }, + "VBF_0J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -47,7 +59,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "WH_had_0J":{ + "WMINUSH2HQQ_0J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -59,7 +71,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "ZH_had_0J":{ + "WPLUSH2HQQ_0J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -71,7 +83,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "qqH_1J":{ + "ZH2HQQ_0J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -83,7 +95,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "WH_had_1J":{ + "VBF_1J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -95,7 +107,7 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "ZH_had_1J":{ + "WMINUSH2HQQ_1J":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0000, @@ -107,7 +119,31 @@ "THU_qqH_PTHJJ25":1.0000, "THU_qqH_JET01":0.9859 }, - "qqH_GE2J_MJJ_0_60":{ + "WPLUSH2HQQ_1J":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":1.0000, + "THU_qqH_MJJ120":1.0000, + "THU_qqH_MJJ350":1.0000, + "THU_qqH_MJJ700":1.0000, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0000, + "THU_qqH_JET01":0.9859 + }, + "ZH2HQQ_1J":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":1.0000, + "THU_qqH_MJJ120":1.0000, + "THU_qqH_MJJ350":1.0000, + "THU_qqH_MJJ700":1.0000, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0000, + "THU_qqH_JET01":0.9859 + }, + "VBF_GE2J_MJJ_0_60":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9997, "THU_qqH_MJJ60":0.9690, @@ -119,7 +155,7 @@ "THU_qqH_PTHJJ25":1.0073, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_0_60":{ + "WMINUSH2HQQ_GE2J_MJJ_0_60":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9997, "THU_qqH_MJJ60":0.9690, @@ -131,7 +167,7 @@ "THU_qqH_PTHJJ25":1.0073, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_0_60":{ + "WPLUSH2HQQ_GE2J_MJJ_0_60":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9997, "THU_qqH_MJJ60":0.9690, @@ -143,7 +179,31 @@ "THU_qqH_PTHJJ25":1.0073, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_60_120":{ + "ZH2HQQ_GE2J_MJJ_0_60":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":0.9997, + "THU_qqH_MJJ60":0.9690, + "THU_qqH_MJJ120":1.0034, + "THU_qqH_MJJ350":1.0026, + "THU_qqH_MJJ700":1.0026, + "THU_qqH_MJJ1000":1.0029, + "THU_qqH_MJJ1500":0.9967, + "THU_qqH_PTHJJ25":1.0073, + "THU_qqH_JET01":1.0118 + }, + "VBF_GE2J_MJJ_60_120":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":0.9998, + "THU_qqH_MJJ60":1.0029, + "THU_qqH_MJJ120":0.9878, + "THU_qqH_MJJ350":1.0018, + "THU_qqH_MJJ700":1.0018, + "THU_qqH_MJJ1000":1.0020, + "THU_qqH_MJJ1500":1.0023, + "THU_qqH_PTHJJ25":0.9850, + "THU_qqH_JET01":1.0118 + }, + "WMINUSH2HQQ_GE2J_MJJ_60_120":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -155,7 +215,7 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_60_120":{ + "WPLUSH2HQQ_GE2J_MJJ_60_120":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -167,7 +227,7 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_60_120":{ + "ZH2HQQ_GE2J_MJJ_60_120":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -179,7 +239,7 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_120_350":{ + "VBF_GE2J_MJJ_120_350":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, @@ -191,7 +251,7 @@ "THU_qqH_PTHJJ25":0.9893, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_120_350":{ + "WMINUSH2HQQ_GE2J_MJJ_120_350":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, @@ -203,7 +263,7 @@ "THU_qqH_PTHJJ25":0.9893, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_120_350":{ + "WPLUSH2HQQ_GE2J_MJJ_120_350":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, @@ -215,7 +275,31 @@ "THU_qqH_PTHJJ25":0.9893, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "ZH2HQQ_GE2J_MJJ_120_350":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":1.0029, + "THU_qqH_MJJ120":1.0063, + "THU_qqH_MJJ350":0.9902, + "THU_qqH_MJJ700":1.0005, + "THU_qqH_MJJ1000":1.0006, + "THU_qqH_MJJ1500":1.0006, + "THU_qqH_PTHJJ25":0.9893, + "THU_qqH_JET01":1.0118 + }, + "VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":0.9306, + "THU_qqH_MJJ120":1.0000, + "THU_qqH_MJJ350":1.0000, + "THU_qqH_MJJ700":1.0000, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0271, + "THU_qqH_JET01":1.0118 + }, + "WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":0.9306, @@ -227,7 +311,7 @@ "THU_qqH_PTHJJ25":1.0271, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":0.9306, @@ -239,7 +323,7 @@ "THU_qqH_PTHJJ25":1.0271, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ + "ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":0.9306, @@ -251,7 +335,7 @@ "THU_qqH_PTHJJ25":1.0271, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0030, @@ -263,7 +347,7 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0117 }, - "WH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0030, @@ -275,7 +359,7 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0117 }, - "ZH_had_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0030, @@ -287,7 +371,31 @@ "THU_qqH_PTHJJ25":0.9850, "THU_qqH_JET01":1.0117 }, - "qqH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0037, + "THU_qqH_MJJ60":1.0030, + "THU_qqH_MJJ120":1.0063, + "THU_qqH_MJJ350":1.0050, + "THU_qqH_MJJ700":0.9931, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":0.9850, + "THU_qqH_JET01":1.0117 + }, + "VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":0.9998, + "THU_qqH_MJJ60":1.0029, + "THU_qqH_MJJ120":0.9987, + "THU_qqH_MJJ350":0.9984, + "THU_qqH_MJJ700":0.9971, + "THU_qqH_MJJ1000":1.0000, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0093, + "THU_qqH_JET01":1.0118 + }, + "WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -299,7 +407,7 @@ "THU_qqH_PTHJJ25":1.0093, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -311,7 +419,7 @@ "THU_qqH_PTHJJ25":1.0093, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ + "ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":0.9998, "THU_qqH_MJJ60":1.0029, @@ -323,7 +431,19 @@ "THU_qqH_PTHJJ25":1.0093, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0037, + "THU_qqH_MJJ60":1.0029, + "THU_qqH_MJJ120":1.0063, + "THU_qqH_MJJ350":1.0050, + "THU_qqH_MJJ700":0.9996, + "THU_qqH_MJJ1000":0.9944, + "THU_qqH_MJJ1500":1.0000, + "THU_qqH_PTHJJ25":1.0142, + "THU_qqH_JET01":1.0118 + }, + "WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0029, @@ -335,7 +455,7 @@ "THU_qqH_PTHJJ25":1.0142, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0029, @@ -347,7 +467,7 @@ "THU_qqH_PTHJJ25":1.0142, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ + "ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0037, "THU_qqH_MJJ60":1.0029, @@ -359,7 +479,19 @@ "THU_qqH_PTHJJ25":1.0142, "THU_qqH_JET01":1.0118 }, - "qqH_GE2J_MJJ_GT350_PTH_GT200":{ + "VBF_GE2J_MJJ_GT350_PTH_GT200":{ + "THU_qqH_Yield":1.0038, + "THU_qqH_PTH200":1.0000, + "THU_qqH_MJJ60":1.0029, + "THU_qqH_MJJ120":1.0063, + "THU_qqH_MJJ350":1.0050, + "THU_qqH_MJJ700":1.0021, + "THU_qqH_MJJ1000":0.9982, + "THU_qqH_MJJ1500":0.9984, + "THU_qqH_PTHJJ25":1.0004, + "THU_qqH_JET01":1.0118 + }, + "WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, @@ -371,7 +503,7 @@ "THU_qqH_PTHJJ25":1.0004, "THU_qqH_JET01":1.0118 }, - "WH_had_GE2J_MJJ_GT350_PTH_GT200":{ + "WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, @@ -383,7 +515,7 @@ "THU_qqH_PTHJJ25":1.0004, "THU_qqH_JET01":1.0118 }, - "ZH_had_GE2J_MJJ_GT350_PTH_GT200":{ + "ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200":{ "THU_qqH_Yield":1.0038, "THU_qqH_PTH200":1.0000, "THU_qqH_MJJ60":1.0029, diff --git a/Datacard/theory_uncertainties/thu_thq.json b/Datacard/theory_uncertainties/thu_thq.json index ae6ea322b..a155af6d6 100644 --- a/Datacard/theory_uncertainties/thu_thq.json +++ b/Datacard/theory_uncertainties/thu_thq.json @@ -1,10 +1,10 @@ { - "tHq_FWDH":{ + "THQ_FWDH":{ "QCDscale_tHq":[1.065,0.851], "pdf_Higgs_tHq":1.035, "alphaS_tHq":1.012 }, - "tHq":{ + "THQ_FID":{ "QCDscale_tHq":[1.065,0.851], "pdf_Higgs_tHq":1.035, "alphaS_tHq":1.012 diff --git a/Datacard/theory_uncertainties/thu_thw.json b/Datacard/theory_uncertainties/thu_thw.json index d26de0d89..39f18350a 100644 --- a/Datacard/theory_uncertainties/thu_thw.json +++ b/Datacard/theory_uncertainties/thu_thw.json @@ -1,10 +1,10 @@ { - "tHW_FWDH":{ + "THW_FWDH":{ "QCDscale_tHW":[1.049,0.933], "pdf_Higgs_tHW":1.061, "alphaS_tHW":1.015 }, - "tHW":{ + "THW_FID":{ "QCDscale_tHW":[1.049,0.933], "pdf_Higgs_tHW":1.061, "alphaS_tHW":1.015 diff --git a/Datacard/theory_uncertainties/thu_tth.json b/Datacard/theory_uncertainties/thu_tth.json index 45b4d6125..70e0754d8 100644 --- a/Datacard/theory_uncertainties/thu_tth.json +++ b/Datacard/theory_uncertainties/thu_tth.json @@ -1,30 +1,30 @@ { - "ttH_FWDH":{ + "TTH_FWDH":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 }, - "ttH_PTH_0_60":{ + "TTH_PTH_0_60":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 }, - "ttH_PTH_60_120":{ + "TTH_PTH_60_120":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 }, - "ttH_PTH_120_200":{ + "TTH_PTH_120_200":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 }, - "ttH_PTH_200_300":{ + "TTH_PTH_200_300":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 }, - "ttH_PTH_GT300":{ + "TTH_PTH_GT300":{ "QCDscale_ttH":[1.058,0.908], "pdf_Higgs_ttH":1.030, "alphaS_ttH":1.020 diff --git a/Datacard/theory_uncertainties/thu_tth_stxs.json b/Datacard/theory_uncertainties/thu_tth_stxs.json index 0621f4036..39ee5bebd 100644 --- a/Datacard/theory_uncertainties/thu_tth_stxs.json +++ b/Datacard/theory_uncertainties/thu_tth_stxs.json @@ -1,40 +1,40 @@ { - "ttH_FWDH":{ + "TTH_FWDH":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":1.000, "THU_ttH_mig120":1.000, "THU_ttH_mig200":1.000, "THU_ttH_mig300":1.000 }, - "ttH_PTH_0_60":{ + "TTH_PTH_0_60":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":0.908, "THU_ttH_mig120":1.000, "THU_ttH_mig200":1.000, "THU_ttH_mig300":1.000 }, - "ttH_PTH_60_120":{ + "TTH_PTH_60_120":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":1.014, "THU_ttH_mig120":0.967, "THU_ttH_mig200":1.000, "THU_ttH_mig300":1.000 }, - "ttH_PTH_120_200":{ + "TTH_PTH_120_200":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":1.000, "THU_ttH_mig120":1.049, "THU_ttH_mig200":0.991, "THU_ttH_mig300":1.000 }, - "ttH_PTH_200_300":{ + "TTH_PTH_200_300":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":1.000, "THU_ttH_mig120":1.049, "THU_ttH_mig200":1.051, "THU_ttH_mig300":0.999 }, - "ttH_PTH_GT300":{ + "TTH_PTH_GT300":{ "THU_ttH_Yield":[1.058,0.908], "THU_ttH_mig60":1.000, "THU_ttH_mig120":1.049, diff --git a/Datacard/theory_uncertainties/thu_whlep_stxs.json b/Datacard/theory_uncertainties/thu_whlep_stxs.json index 2c2d3a54c..7a3b91914 100644 --- a/Datacard/theory_uncertainties/thu_whlep_stxs.json +++ b/Datacard/theory_uncertainties/thu_whlep_stxs.json @@ -1,40 +1,82 @@ { - "WH_lep_FWDH":{ + "WMINUSH2HLNU_FWDH":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":1.000, "THU_WH_mig150":1.000, "THU_WH_mig250":1.000, "THU_WH_mig01":1.000 }, - "WH_lep_PTV_0_75":{ + "WMINUSH2HLNU_PTV_0_75":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":0.965, "THU_WH_mig150":1.000, "THU_WH_mig250":1.000, "THU_WH_mig01":1.000 }, - "WH_lep_PTV_75_150":{ + "WMINUSH2HLNU_PTV_75_150":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":1.039, "THU_WH_mig150":0.995, "THU_WH_mig250":1.000, "THU_WH_mig01":1.000 }, - "WH_lep_PTV_150_250_0J":{ + "WMINUSH2HLNU_PTV_150_250_0J":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":1.039, "THU_WH_mig150":1.013, "THU_WH_mig250":0.9958, "THU_WH_mig01":0.961 }, - "WH_lep_PTV_150_250_GE1J":{ + "WMINUSH2HLNU_PTV_150_250_GE1J":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":1.039, "THU_WH_mig150":1.013, "THU_WH_mig250":0.9958, "THU_WH_mig01":1.050 }, - "WH_lep_PTV_GT250":{ + "WMINUSH2HLNU_PTV_GT250":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":1.039, + "THU_WH_mig150":1.013, + "THU_WH_mig250":1.014, + "THU_WH_mig01":1.000 + }, + "WPLUSH2HLNU_FWDH":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":1.000, + "THU_WH_mig150":1.000, + "THU_WH_mig250":1.000, + "THU_WH_mig01":1.000 + }, + "WPLUSH2HLNU_PTV_0_75":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":0.965, + "THU_WH_mig150":1.000, + "THU_WH_mig250":1.000, + "THU_WH_mig01":1.000 + }, + "WPLUSH2HLNU_PTV_75_150":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":1.039, + "THU_WH_mig150":0.995, + "THU_WH_mig250":1.000, + "THU_WH_mig01":1.000 + }, + "WPLUSH2HLNU_PTV_150_250_0J":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":1.039, + "THU_WH_mig150":1.013, + "THU_WH_mig250":0.9958, + "THU_WH_mig01":0.961 + }, + "WPLUSH2HLNU_PTV_150_250_GE1J":{ + "THU_WH_inc":[1.005,0.993], + "THU_WH_mig75":1.039, + "THU_WH_mig150":1.013, + "THU_WH_mig250":0.9958, + "THU_WH_mig01":1.050 + }, + "WPLUSH2HLNU_PTV_GT250":{ "THU_WH_inc":[1.005,0.993], "THU_WH_mig75":1.039, "THU_WH_mig150":1.013, diff --git a/Datacard/theory_uncertainties/thu_zhlep_stxs.json b/Datacard/theory_uncertainties/thu_zhlep_stxs.json index 2b8b5254a..d5107b70b 100644 --- a/Datacard/theory_uncertainties/thu_zhlep_stxs.json +++ b/Datacard/theory_uncertainties/thu_zhlep_stxs.json @@ -1,40 +1,83 @@ { - "ZH_lep_FWDH":{ + "ZH2HLL_FWDH":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":1.000, "THU_ZH_mig150":1.000, "THU_ZH_mig250":1.000, "THU_ZH_mig01":1.000 }, - "ZH_lep_PTV_0_75":{ + "ZH2HLL_PTV_0_75":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":0.963, "THU_ZH_mig150":1.000, "THU_ZH_mig250":1.000, "THU_ZH_mig01":1.000 }, - "ZH_lep_PTV_75_150":{ + "ZH2HLL_PTV_75_150":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":1.04, "THU_ZH_mig150":0.995, "THU_ZH_mig250":1.000, "THU_ZH_mig01":1.000 }, - "ZH_lep_PTV_150_250_0J":{ + "ZH2HLL_PTV_150_250_0J":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":1.04, "THU_ZH_mig150":1.013, "THU_ZH_mig250":0.9958, "THU_ZH_mig01":0.956 }, - "ZH_lep_PTV_150_250_GE1J":{ + "ZH2HLL_PTV_150_250_GE1J":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":1.04, "THU_ZH_mig150":1.013, "THU_ZH_mig250":0.9958, "THU_ZH_mig01":1.053 }, - "ZH_lep_PTV_GT250":{ + "ZH2HLL_PTV_GT250":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":1.04, + "THU_ZH_mig150":1.013, + "THU_ZH_mig250":1.014, + "THU_ZH_mig01":1.000 + }, + + "ZH2HNUNU_FWDH":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":1.000, + "THU_ZH_mig150":1.000, + "THU_ZH_mig250":1.000, + "THU_ZH_mig01":1.000 + }, + "ZH2HNUNU_PTV_0_75":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":0.963, + "THU_ZH_mig150":1.000, + "THU_ZH_mig250":1.000, + "THU_ZH_mig01":1.000 + }, + "ZH2HNUNU_PTV_75_150":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":1.04, + "THU_ZH_mig150":0.995, + "THU_ZH_mig250":1.000, + "THU_ZH_mig01":1.000 + }, + "ZH2HNUNU_PTV_150_250_0J":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":1.04, + "THU_ZH_mig150":1.013, + "THU_ZH_mig250":0.9958, + "THU_ZH_mig01":0.956 + }, + "ZH2HNUNU_PTV_150_250_GE1J":{ + "THU_ZH_inc":[1.005,0.994], + "THU_ZH_mig75":1.04, + "THU_ZH_mig150":1.013, + "THU_ZH_mig250":0.9958, + "THU_ZH_mig01":1.053 + }, + "ZH2HNUNU_PTV_GT250":{ "THU_ZH_inc":[1.005,0.994], "THU_ZH_mig75":1.04, "THU_ZH_mig150":1.013, diff --git a/Datacard/tools/calcSystematics.py b/Datacard/tools/calcSystematics.py index 997fd7281..2111584c5 100644 --- a/Datacard/tools/calcSystematics.py +++ b/Datacard/tools/calcSystematics.py @@ -45,8 +45,17 @@ def getValueFromJson(row,uncertainties,sname): p = re.sub("_2016_%s"%decayMode,"",row['proc']) p = re.sub("_2017_%s"%decayMode,"",p) p = re.sub("_2018_%s"%decayMode,"",p) - p = re.sub("_2022preEE_%s"%decayMode,"",p) - p = re.sub("_2022postEE_%s"%decayMode,"",p) + # p = re.sub("_2022preEE_%s"%decayMode,"",p) + # p = re.sub("_2022postEE_%s"%decayMode,"",p) + p = re.sub("_preEE_%s"%decayMode,"",p) + p = re.sub("_postEE_%s"%decayMode,"",p) + p = re.sub("_postBPix_%s"%decayMode,"",p) + p = re.sub("_preBPix_%s"%decayMode,"",p) + # print('uncertainties') + # print(p) + # print('j') + # print(uncertainties) + if p in uncertainties: if type(uncertainties[p][sname])==list: return uncertainties[p][sname] else: return [uncertainties[p][sname]] @@ -58,7 +67,7 @@ def getValueFromJson(row,uncertainties,sname): # b) Symmetric weight in nominal RooDataSet: "s_w" # c) Anti-symmetric shifts in RooDataHist: "a_h" def factoryType(d,s): - + #Fix for pdfWeight (as Nweights > 10) if('weight_LHEPd' in s['name']): return "s_w" @@ -68,6 +77,12 @@ def factoryType(d,s): ws = f.Get(inputWSName__) dataHistUp = "%s_%sUp01sigma"%(r.nominalDataName,s['name']) dataHistDown = "%s_%sDown01sigma"%(r.nominalDataName,s['name']) + # print('datahistup') + # print(dataHistUp) + # print(r.inputWSFile) + # print(ws.allData()) + # print(ws.data(dataHistUp)) + # Check if syst is var (i.e. weight) in workspace if ws.allVars().selectByName("%s*"%(s['name'])).getSize(): @@ -156,15 +171,19 @@ def calcSystYields(_nominalDataName,_nominalDataContents,_inputWS,_systFactoryTy systYields["%s_down_COWCorr"%s] += w*(f_NNLOPS/f_COWCorr) else: + # print(_nominalDataContents) centralWeightStr = "weight_central" # Careful, f_central is actually not used here at the moment # Do not set it to "weight" since then he will not find it (it is variable and not in the RooDataSet, setting it to zero and skipping all calculations :/) if centralWeightStr in _nominalDataContents: f_central = p.getRealValue(centralWeightStr) else: - print("Be careful, the centralWeightStr %s cannot be found in the contents of the nominal tree"%centralWeightStr) + pass#print("Be careful, the centralWeightStr %s cannot be found in the contents of the nominal tree"%centralWeightStr) # Changed and removed 01sigma to account for HiggsDNA conventions f_up, f_down = p.getRealValue("%sUp"%s), p.getRealValue("%sDown"%s) + # print(f_up) + # print(f_down) + f_central=1 # Checks: # 1) if central weights are zero then skip event if f_central == 0: continue diff --git a/Datacard/tools/writeToDatacard.py b/Datacard/tools/writeToDatacard.py index 014193762..32facdf44 100644 --- a/Datacard/tools/writeToDatacard.py +++ b/Datacard/tools/writeToDatacard.py @@ -17,7 +17,7 @@ def writePreamble(f,options): def writeProcesses(f,d,options): f.write("\n") # If opt.prune then remove all rows from dataFrame with prune=1 - if options.prune: d = d[d['prune']==0] + if options.prune: d = d[(d['prune']==0)] # d = Pandas DataFrame # Shapes # Loop over categories in dataframe @@ -62,7 +62,8 @@ def writeProcesses(f,d,options): def writeSystematic(f,d,s,options,stxsMergeScheme=None,scaleCorrScheme=None): - + print('neww') + # print(d.weight_DummyDown) # For signal shape systematics add simple line if s['type'] == 'signal_shape': stitle = "%s_%s"%(outputWSNuisanceTitle__,s['title']) @@ -111,10 +112,13 @@ def writeSystematic(f,d,s,options,stxsMergeScheme=None,scaleCorrScheme=None): lsyst = '%-50s %-10s '%(stitle,s['prior']) # Loop over categories and then iterate over rows in category for cat in d.cat.unique(): + print(cat) + # print(d[d['cat']==cat][['weight_DummyUp_yield','lumi_13p6TeV_2022']]) for ir,r in d[d['cat']==cat].iterrows(): if r['proc'] == "data_obs": continue # Extract value and add to line (with checks) sval = r["%s%s%s"%(s['name'],mergeStr,tierStr)] + print(sval) lsyst = addSyst(lsyst,sval,stitle,r['proc'],cat) # Remove final space from line and add to file f.write("%s\n"%lsyst[:-1]) diff --git a/Plots/makeMultipdfPlot.py b/Plots/makeMultipdfPlot.py index a87f24a0b..bcf0afa5d 100644 --- a/Plots/makeMultipdfPlot.py +++ b/Plots/makeMultipdfPlot.py @@ -249,6 +249,8 @@ def LoadTranslations(jsonfilename): lat1.SetNDC() lat1.SetTextSize(0.06) lat1.DrawLatex(0.9,0.92,"61.9 fb^{-1} (13.6 TeV)") +lat1.DrawLatex(0.38,0.92,"#bf{CMS} #it{Preliminary}") + pad2.cd() h_axes_ratio = hists_ratio['data'].Clone() diff --git a/Signal/check_alloutputs_exist.py b/Signal/check_alloutputs_exist.py new file mode 100644 index 000000000..5f50fef73 --- /dev/null +++ b/Signal/check_alloutputs_exist.py @@ -0,0 +1,42 @@ +import glob + +import argparse +from collections import defaultdict + +# 1. Load all root files +parser = argparse.ArgumentParser() + + +parser.add_argument('--path') + +args=parser.parse_args() + + +file_list = glob.glob(f"{args.path}/*.root") # adjust path as needed + +# 2. Map process → set of categories +proc_to_cats = defaultdict(set) + +for filepath in file_list: + filename = filepath.split("/")[-1] + for er in ['preEE','postEE','preBPix','postBPix']: + if er in filepath: + era=er + try: + # Extract process name between `preEE_` and `_preEE_RECO` + process = filename.split(f"{era}_")[1].split(f"_{era}_RECO")[0] + + # Extract category name after `RECO_` and before `.root` + category = filename.split("RECO_")[1].replace(".root", "") + + proc_to_cats[process].add(category) + + except IndexError: + print(f"Filename doesn't match expected format: {filename}") + +# 3. Check which processes are missing categories +for proc, cats in proc_to_cats.items(): + if len(cats) != 20: + print(f"❌ Process {proc} has only {len(cats)} categories") + else: + print(f"✅ Process {proc} has 20 categories") \ No newline at end of file diff --git a/Signal/config_STXS_2022postEE.py b/Signal/config_STXS_2022postEE.py index b8eeaa700..d8e944906 100644 --- a/Signal/config_STXS_2022postEE.py +++ b/Signal/config_STXS_2022postEE.py @@ -5,8 +5,8 @@ signalScriptCfg = { # Setup - 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/postEE', - 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2HQQ_FWDH', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_2dec/signal/postEE', + 'procs':"auto", # if auto: inferred automatically from filenames 'cats':'auto', # if auto: inferred automatically from (0) workspace 'ext':'Run3STXS_%s'%_year, 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) @@ -17,13 +17,12 @@ 'massPoints':'125', #Photon shape systematics - 'scales':'', # separate nuisance per year - 'scalesCorr':'', # correlated across years + 'scales':'ScaleEB2G_IJazZ,ScaleEE2G_IJazZ', # separate nuisance per year + 'scalesCorr':'Material,FNUF', # correlated across years 'scalesGlobal':'', # affect all processes equally, correlated across years - 'smears':'', # separate nuisance per year - + 'smears':'Smearing2G_IJazZ', # separate nuisance per year # Job submission options 'batch':'condor', # ['condor','SGE','IC','local'] - 'queue':'espresso', + 'queue':'tomorrow', #workday for 8 hours, tomorrow for 24h } \ No newline at end of file diff --git a/Signal/config_STXS_2022preEE.py b/Signal/config_STXS_2022preEE.py index 579d6f736..5476e6412 100644 --- a/Signal/config_STXS_2022preEE.py +++ b/Signal/config_STXS_2022preEE.py @@ -5,8 +5,8 @@ signalScriptCfg = { # Setup - 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/preEE', - 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_2dec/signal/preEE', + 'procs':'auto', # if auto: inferred automatically from filenames 'cats':'auto', # if auto: inferred automatically from (0) workspace 'ext':'Run3STXS_%s'%_year, 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) @@ -17,13 +17,13 @@ 'massPoints':'125', #Photon shape systematics - 'scales':'', # separate nuisance per year - 'scalesCorr':'', # correlated across years + 'scales':'ScaleEB2G_IJazZ,ScaleEE2G_IJazZ', # separate nuisance per year + 'scalesCorr':'Material,FNUF', # correlated across years 'scalesGlobal':'', # affect all processes equally, correlated across years - 'smears':'', # separate nuisance per year + 'smears':'Smearing2G_IJazZ', # separate nuisance per year # Job submission options 'batch':'condor', # ['condor','SGE','IC','local'] - 'queue':'espresso', + 'queue':'tomorrow', } diff --git a/Signal/config_STXS_2023postBPix.py b/Signal/config_STXS_2023postBPix.py index 6e20286f0..2c20c88e6 100644 --- a/Signal/config_STXS_2023postBPix.py +++ b/Signal/config_STXS_2023postBPix.py @@ -5,8 +5,8 @@ signalScriptCfg = { # Setup - 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/postBPix', - 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_2dec/signal/postBPix', + 'procs':"auto", # if auto: inferred automatically from filenames 'cats':'auto', # if auto: inferred automatically from (0) workspace 'ext':'Run3STXS_%s'%_year, 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) @@ -17,13 +17,12 @@ 'massPoints':'125', #Photon shape systematics - 'scales':'', # separate nuisance per year - 'scalesCorr':'', # correlated across years + 'scales':'ScaleEB2G_IJazZ,ScaleEE2G_IJazZ', # separate nuisance per year + 'scalesCorr':'Material,FNUF', # correlated across years 'scalesGlobal':'', # affect all processes equally, correlated across years - 'smears':'', # separate nuisance per year - + 'smears':'Smearing2G_IJazZ', # separate nuisance per year # Job submission options 'batch':'condor', # ['condor','SGE','IC','local'] - 'queue':'espresso', + 'queue':'tomorrow', } \ No newline at end of file diff --git a/Signal/config_STXS_2023preBPix.py b/Signal/config_STXS_2023preBPix.py index 1042fca0e..cd64773df 100644 --- a/Signal/config_STXS_2023preBPix.py +++ b/Signal/config_STXS_2023preBPix.py @@ -5,8 +5,8 @@ signalScriptCfg = { # Setup - 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_13July/signal/preBPix', - 'procs':",".join(['VBF_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HLL_PTV_75_150', 'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'GG2H_PTH_450_650', 'GG2HQQ_0J_PTH_0_10', 'ZH2HNUNU_FWDH', 'WPLUSH2HQQ_0J', 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_GT250', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HLL_PTV_GT250', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200', 'VBF_GE2J_MJJ_0_60', 'WMINUSH2HLNU_PTV_0_75', 'GG2HNUNU_PTV_75_150', 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HLNU_FWDH', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'VBF_GE2J_MJJ_120_350', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_60_120', 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120', 'ZH2HNUNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_150_250_0J', 'WPLUSH2HQQ_FWDH', 'ZH2HLL_FWDH', 'GG2H_0J_PTH_GT10', 'WPLUSH2HLNU_PTV_75_150', 'GG2H_PTH_300_450', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_75_150', 'THQ_FID', 'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HNUNU_PTV_0_75', 'GG2HLL_FWDH', 'TTH_PTH_200_300', 'TTH_PTH_0_60', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_1J_PTH_60_120', 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_150_250_0J', 'GG2H_1J_PTH_120_200', 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2H_PTH_GT650', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2H_PTH_200_300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_1J', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_0_60', 'GG2H_1J_PTH_0_60', 'VBF_FWDH', 'WPLUSH2HLNU_PTV_150_250_GE1J', 'WPLUSH2HLNU_PTV_GT250', 'GG2H_0J_PTH_0_10', 'THW_FID', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HQQ_0J', 'VBF_1J', 'ZH2HQQ_GE2J_MJJ_0_60', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'TTH_PTH_60_120', 'GG2H_1J_PTH_60_120', 'WMINUSH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'WMINUSH2HQQ_GE2J_MJJ_120_350', 'WPLUSH2HQQ_GE2J_MJJ_120_350', 'GG2HQQ_0J_PTH_GT10', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WMINUSH2HLNU_PTV_75_150', 'ZH2HLL_PTV_0_75', 'THQ_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HLNU_FWDH', 'WMINUSH2HQQ_FWDH', 'ZH2HQQ_1J', 'WMINUSH2HLNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_0_75', 'GG2HLL_PTV_150_250_GE1J', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25', 'ZH2HQQ_FWDH', 'GG2HNUNU_PTV_GT250', 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'VBF_0J', 'WPLUSH2HLNU_PTV_0_75', 'ZH2HQQ_0J', 'BBH_FID', 'ZH2HLL_PTV_150_250_0J', 'GG2H_GE2J_MJJ_0_350_PTH_120_200', 'TTH_PTH_GT300', 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HQQ_PTH_300_450', 'WMINUSH2HQQ_1J', 'GG2HNUNU_PTV_150_250_0J', 'TTH_FWDH', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_450_650', 'WMINUSH2HLNU_PTV_GT250', 'GG2HQQ_FWDH', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25', 'GG2HLL_PTV_75_150', 'VBF_GE2J_MJJ_60_120', 'TTH_PTH_120_200', 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HLL_PTV_0_75', 'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25']), # if auto: inferred automatically from filenames + 'inputWSDir':'/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Workspaces_2dec/signal/preBPix', + 'procs':"auto", # if auto: inferred automatically from filenames 'cats':'auto', # if auto: inferred automatically from (0) workspace 'ext':'Run3STXS_%s'%_year, 'analysis':"Run3STXS12",#'tutorial', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py) @@ -17,13 +17,12 @@ 'massPoints':'125', #Photon shape systematics - 'scales':'', # separate nuisance per year - 'scalesCorr':'', # correlated across years + 'scales':'ScaleEB2G_IJazZ,ScaleEE2G_IJazZ', # separate nuisance per year + 'scalesCorr':'Material,FNUF', # correlated across years 'scalesGlobal':'', # affect all processes equally, correlated across years - 'smears':'', # separate nuisance per year - + 'smears':'Smearing2G_IJazZ', # separate nuisance per year # Job submission options 'batch':'condor', # ['condor','SGE','IC','local'] - 'queue':'espresso', + 'queue':'tomorrow', } \ No newline at end of file diff --git a/Signal/readout_sumw_inRooWSfile.py b/Signal/readout_sumw_inRooWSfile.py new file mode 100644 index 000000000..4db5a1301 --- /dev/null +++ b/Signal/readout_sumw_inRooWSfile.py @@ -0,0 +1,107 @@ +import ROOT +import argparse + +import glob + +parser=argparse.ArgumentParser() + +parser.add_argument('--path') +parser.add_argument('--comparepath',default=None) +parser.add_argument('--checkall',action='store_true') +args=parser.parse_args() + +if not args.checkall: + proc = args.path.split('/')[-1].split('_M125')[0].replace('output_','') + era = args.path.split('/')[-2] + + file=ROOT.TFile(args.path).Get('tagsDumper/cms_hgg_13TeV') + + all_datasets = [k.GetName() for k in file.allData()] + + wsum=0 + counter=0 + for i in all_datasets: + + Data=file.data(i) + if Data and Data.ClassName() == "RooDataSet": + for j in range(Data.numEntries()): + entry=Data.get(j) + w=Data.weight() + wsum+=w + counter+=1 + + print(f'{proc} and {era}: '+str(wsum)) + + print(str(counter)+'datasets used') + + if args.comparepath!=None: + proc = args.comparepath.split('/')[-1].split('_M125')[0].replace('output_','') + era = args.comparepath.split('/')[-2] + + file=ROOT.TFile(args.comparepath).Get('tagsDumper/cms_hgg_13TeV') + + all_datasets = [k.GetName() for k in file.allData()] + + wsum_ref=0 + counter_ref=0 + for i in all_datasets: + + Data=file.data(i) + if Data and Data.ClassName() == "RooDataSet": + for j in range(Data.numEntries()): + entry=Data.get(j) + w=Data.weight() + wsum_ref+=w + counter_ref+=1 + print(f'comparison file: '+str(wsum_ref)) + print(f'input / ref = {wsum/wsum_ref}') + + +if args.checkall: + globalsum=0 + gloabalsum_ref=0 + listf=glob.glob(args.path+'/*') + for f in listf: + proc=f.split('/')[-1].split('_M125')[0].replace('output_','') + era = f.split('/')[-2] + + file=ROOT.TFile(f).Get('tagsDumper/cms_hgg_13TeV') + + all_datasets = [k.GetName() for k in file.allData()] + + wsum=0 + + counter=0 + for i in all_datasets: + + Data=file.data(i) + if Data and Data.ClassName() == "RooDataSet": + for j in range(Data.numEntries()): + entry=Data.get(j) + w=Data.weight() + wsum+=w + counter+=1 + globalsum+=wsum + listf_ref=glob.glob(args.comparepath+'/*') + for fref in listf_ref: + if proc in fref: + + file=ROOT.TFile(fref).Get('tagsDumper/cms_hgg_13TeV') + + all_datasets = [k.GetName() for k in file.allData()] + + wsumref=0 + counterref=0 + for i in all_datasets: + + Data=file.data(i) + if Data and Data.ClassName() == "RooDataSet": + for j in range(Data.numEntries()): + entry=Data.get(j) + w=Data.weight() + wsumref+=w + counterref+=1 + print('f/fref='+str(wsum/wsumref)+' '+proc) + gloabalsum_ref+=wsumref + continue + # print(globalsum/gloabalsum_ref *(1+4/120)) \ No newline at end of file diff --git a/Signal/scripts/calcPhotonSyst.py b/Signal/scripts/calcPhotonSyst.py index b3cfa3f68..ca15a6899 100644 --- a/Signal/scripts/calcPhotonSyst.py +++ b/Signal/scripts/calcPhotonSyst.py @@ -35,6 +35,7 @@ def get_options(): parser.add_option("--thresholdMean", dest='thresholdMean', default=0.05, type='float', help='Reject mean variations if larger than thresholdMean') parser.add_option("--thresholdSigma", dest='thresholdSigma', default=0.5, type='float', help='Reject mean variations if larger than thresholdSigma') parser.add_option("--thresholdRate", dest='thresholdRate', default=0.05, type='float', help='Reject mean variations if larger than thresholdRate') + parser.add_option("--year") return parser.parse_args() (opt,args) = get_options() @@ -116,7 +117,7 @@ def getRateVar(_hists): for _proc in opt.procs.split(","): # Glob M125 filename _WSFileName = glob.glob("%s/output*M125*%s.root"%(opt.inputWSDir,_proc))[0] - _nominalDataName = "%s_125_%s_%s"%(procToData(_proc.split("_")[0]),sqrts__,opt.cat) + _nominalDataName = "%s_%s_hgg_125_%s_%s"%(_proc,opt.year,sqrts__,opt.cat) data = pd.concat([data,pd.DataFrame([{'proc':_proc,'cat':opt.cat,'inputWSFile':_WSFileName,'nominalDataName':_nominalDataName}])], ignore_index=True, sort=False) # Loop over rows in dataFrame and open ws diff --git a/Signal/scripts/fTest.py b/Signal/scripts/fTest.py index b2eedc725..4ae81bbe3 100644 --- a/Signal/scripts/fTest.py +++ b/Signal/scripts/fTest.py @@ -31,7 +31,7 @@ def get_options(): parser.add_option("--inputWSDir", dest='inputWSDir', default='', help="Input flashgg WS directory") parser.add_option("--ext", dest='ext', default='', help="Extension") parser.add_option("--procs", dest='procs', default='', help="Signal processes") - parser.add_option("--nProcsToFTest", dest='nProcsToFTest', default=5, type='int',help="Number of signal processes to fTest (ordered by sum entries), others are set to nRV=1,nWV=1. Set to -1 to run over all") + parser.add_option("--nProcsToFTest", dest='nProcsToFTest', default=-1, type='int',help="Number of signal processes to fTest (ordered by sum entries), others are set to nRV=1,nWV=1. Set to -1 to run over all") parser.add_option("--cat", dest='cat', default='', help="RECO category") parser.add_option('--mass', dest='mass', default='125', help="Mass point to fit") parser.add_option('--doPlots', dest='doPlots', default=False, action="store_true", help="Produce Signal fTest plots") @@ -54,13 +54,14 @@ def get_options(): # Load xvar to fit nominalWSFileName = glob.glob("%s/output*"%(opt.inputWSDir))[0] f0 = ROOT.TFile(nominalWSFileName,"read") +print('first') inputWS0 = f0.Get(inputWSName__) xvar = inputWS0.var(opt.xvar) xvarFit = xvar.Clone() dZ = inputWS0.var("dZ") aset = ROOT.RooArgSet(xvar,dZ) f0.Close() - +print('second') # Create MH var MH = ROOT.RooRealVar("MH","m_{H}", int(MHLow), int(MHHigh)) MH.setUnit("GeV") @@ -70,17 +71,21 @@ def get_options(): df = pd.DataFrame(columns=['proc','sumEntries','nRV','nWV']) procYields = od() for proc in opt.procs.split(","): - WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,opt.mass,proc))[0] - f = ROOT.TFile(WSFileName,"read") - inputWS = f.Get(inputWSName__) + print(proc) try: - d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(proc,opt.year,opt.mass,sqrts__,opt.cat)),aset) - df.loc[len(df)] = [proc,d.sumEntries(),1,1] - except TypeError: - df.loc[len(df)] = [proc,0,1,1] - inputWS.Delete() - f.Close() - + WSFileName = glob.glob("%s/output*M%s*%s.root"%(opt.inputWSDir,opt.mass,proc))[0] + f = ROOT.TFile(WSFileName,"read") + inputWS = f.Get(inputWSName__) + try: + d = reduceDataset(inputWS.data("%s_%s_hgg_%s_%s_%s"%(proc,opt.year,opt.mass,sqrts__,opt.cat)),aset) + df.loc[len(df)] = [proc,d.sumEntries(),1,1] + except TypeError: + df.loc[len(df)] = [proc,0,1,1] + inputWS.Delete() + f.Close() + except: + print(f'error with {proc}') +print('read in') # Extract processes to perform fTest (i.e. first nProcsToFTest): if( opt.nProcsToFTest == -1)|( opt.nProcsToFTest > len(opt.procs.split(",")) ): procsToFTest = opt.procs.split(",") else: procsToFTest = list(df.sort_values('sumEntries',ascending=False)[0:opt.nProcsToFTest].proc.values) @@ -109,6 +114,7 @@ def get_options(): ssf.buildNGaussians(nGauss) ssf.runFit() ssf.buildSplines() + print(ssf.Ndof) if ssf.Ndof >= 1: ssfs[k] = ssf if ssfs[k].getReducedChi2() < min_reduced_chi2: diff --git a/Signal/scripts/signalFit.py b/Signal/scripts/signalFit.py index ec8bcdb2b..73a8b397c 100644 --- a/Signal/scripts/signalFit.py +++ b/Signal/scripts/signalFit.py @@ -46,7 +46,7 @@ def get_options(): parser.add_option('--skipZeroes', dest='skipZeroes', default=False, action="store_true", help="Skip proc x cat is numEntries = 0., or sumEntries < 0.") parser.add_option('--era') # For systematics - parser.add_option('--skipSystematics', dest='skipSystematics', default=True, action="store_true", help="Skip shape systematics in signal model") + parser.add_option('--skipSystematics', dest='skipSystematics', default=False, action="store_true", help="Skip shape systematics in signal model") parser.add_option('--useDiagonalProcForSyst', dest='useDiagonalProcForSyst', default=False, action="store_true", help="Use diagonal process for systematics (requires diagonal mapping produced by getDiagProc script)") parser.add_option("--scales", dest='scales', default='', help="Photon shape systematics: scales") parser.add_option("--scalesCorr", dest='scalesCorr', default='', help='Photon shape systematics: scalesCorr') @@ -267,7 +267,10 @@ def get_options(): # If using nGaussian fit then extract nGaussians from fTest json file if not opt.useDCB: with open("%s/outdir_%s/fTest/json/nGauss_%s.json"%(swd__,opt.ext,catRVFit)) as jf: ngauss = json.load(jf) - nRV = int(ngauss["%s__%s"%(procRVFit,catRVFit)]['nRV']) + try: + nRV = int(ngauss["%s__%s"%(procRVFit,catRVFit)]['nRV']) + except KeyError: + nRV = 1 if opt.skipVertexScenarioSplit: print(" --> Fitting function: convolution of nGaussians (%g)"%nRV) else: with open("%s/outdir_%s/fTest/json/nGauss_%s.json"%(swd__,opt.ext,catWVFit)) as jf: ngauss = json.load(jf) diff --git a/Signal/tools/plottingTools.py b/Signal/tools/plottingTools.py index d6434a95d..2cb7e0051 100644 --- a/Signal/tools/plottingTools.py +++ b/Signal/tools/plottingTools.py @@ -69,8 +69,38 @@ def getEffSigma(_h): # Plot possible nGauss fits and chi2 values def plotFTest(ssfs,_opt=1,_outdir='./',_extension='',_proc='',_cat='',_mass='125'): canv = ROOT.TCanvas() - canv.SetLeftMargin(0.15) - LineColorMap = {'1':ROOT.kAzure+1,'2':ROOT.kRed-4,'3':ROOT.kGreen+2,'4':ROOT.kMagenta-9,'5':ROOT.kOrange} + canv.SetLeftMargin(0.15) + LineColorMap = { + '1': ROOT.kAzure+1, + '2': ROOT.kRed-4, + '3': ROOT.kGreen+2, + '4': ROOT.kMagenta-9, + '5': ROOT.kOrange, + + '6': ROOT.kBlue+2, + '7': ROOT.kViolet+1, + '8': ROOT.kSpring+5, + '9': ROOT.kCyan+2, + '10': ROOT.kTeal+3, + + '11': ROOT.kPink+6, + '12': ROOT.kYellow-6, + '13': ROOT.kOrange+7, + '14': ROOT.kGreen-6, + '15': ROOT.kRed+1, + + '16': ROOT.kBlue-4, + '17': ROOT.kMagenta+3, + '18': ROOT.kViolet-8, + '19': ROOT.kCyan-6, + '20': ROOT.kSpring-4, + + '21': ROOT.kTeal-5, + '22': ROOT.kPink+9, + '23': ROOT.kYellow+2, + '24': ROOT.kAzure-4, + '25': ROOT.kOrange-3 +} pdfs = od() hists = od() hmax, hmin = 0, 0 @@ -175,6 +205,7 @@ def plotFTestResults(ssfs,_opt,_outdir="./",_extension='',_proc='',_cat='',_mass lat.SetNDC() lat.SetTextSize(0.03) lat.DrawLatex(0.9,0.92,"( %s , %s , %s )"%(_extension,_proc,_cat)) + lat.DrawLatex(0.6,0.75,"Optimum N_{gauss} = %s"%_opt) canv.Update() canv.SaveAs("%s/fTest_%s_%s_%s_chi2_vs_nGauss.png"%(_outdir,_cat,_proc,_extension)) @@ -535,7 +566,7 @@ def plotSignalModel(_hists,_opt,_outdir=".",offset=0.02): lat0.SetNDC() lat0.SetTextSize(0.045) lat0.DrawLatex(0.15,0.92,"#bf{CMS} #it{%s}"%_opt.label) - lat0.DrawLatex(0.77,0.92,"%s TeV"%(sqrts__.split("TeV")[0])) + lat0.DrawLatex(0.67,0.92,"61.9 fb^{-1} (13.6 TeV)") lat0.DrawLatex(0.16+offset,0.83,"H #rightarrow #gamma#gamma") # Load translations diff --git a/Signal/tools/simultaneousFit.py b/Signal/tools/simultaneousFit.py index a410fe13e..566635015 100644 --- a/Signal/tools/simultaneousFit.py +++ b/Signal/tools/simultaneousFit.py @@ -71,7 +71,7 @@ def poisson_interval(x,eSumW2,level=0.68): # Function to calc chi2 for binned fit given pdf, RooDataHist and xvar as inputs #def calcChi2(x,pdf,d,errorType="Sumw2",_verbose=False,fitRange=[100,180]): #def calcChi2(x,pdf,d,errorType="Poisson",_verbose=False,fitRange=[110,140]): -def calcChi2(x,pdf,d,errorType="Poisson",_verbose=False,fitRange=[110,140]): +def calcChi2(x,pdf,d,errorType="Poisson",_verbose=False,fitRange=[115,135]): k = 0. # number of non empty bins (for calc degrees of freedom) normFactor = d.sumEntries() diff --git a/Signal/tools/submissionTools.py b/Signal/tools/submissionTools.py index cc18e5e0f..c547751f2 100644 --- a/Signal/tools/submissionTools.py +++ b/Signal/tools/submissionTools.py @@ -16,6 +16,24 @@ def writePreamble(_file): _file.write("source /cvmfs/cms.cern.ch/cmsset_default.sh\n") _file.write("eval `scramv1 runtime -sh`\n") _file.write("cd %s\n"%swd__) + _file.write("cd ..\n") + + # NEW: activate standalone_setup + _file.write('source /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/setup_standalone.sh\n') + _file.write("cd Signal\n") + # NEW: micromamba in standalone FF: + + _file.write("export MAMBA_EXE='/eos/home-p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/y/micromamba';\n") + _file.write("export MAMBA_ROOT_PREFIX='/eos/home-p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/micromamba';\n") + _file.write("__mamba_setup=\"$(\"$MAMBA_EXE\" shell hook --shell bash --root-prefix \"$MAMBA_ROOT_PREFIX\" 2> /dev/null)\"\n") + _file.write("if [ $? -eq 0 ]; then\n") + _file.write(" eval \"$__mamba_setup\"\n") + _file.write("else\n") + _file.write(" alias micromamba=\"$MAMBA_EXE\" # Fallback on help from micromamba activate\n") + _file.write("fi\n") + _file.write("unset __mamba_setup\n") + _file.write("micromamba activate flashggFinalFit\n") + _file.write("export PYTHONPATH=$PYTHONPATH:%s/tools:%s/tools\n\n"%(cwd__,swd__)) def writeCondorSub(_file,_exec,_queue,_nJobs,_jobOpts,doHoldOnFailure=True,doPeriodicRetry=True,dir="fTest"): @@ -24,8 +42,9 @@ def writeCondorSub(_file,_exec,_queue,_nJobs,_jobOpts,doHoldOnFailure=True,doPer _file.write(f"output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).out\n") _file.write(f"error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).err\n") _file.write(f"log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/{_exec}.$(ClusterId).$(ProcId).log\n") - _file.write(f"output_destination = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/\n") + # _file.write(f"output_destination = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/\n") #_file.write("transfer_output_files = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal/logs/") + _file.write("transfer_output_files = \"\" \n") if _jobOpts != '': _file.write("# User specified job options\n") for jo in _jobOpts.split(":"): _file.write("%s\n"%jo) @@ -41,6 +60,7 @@ def writeCondorSub(_file,_exec,_queue,_nJobs,_jobOpts,doHoldOnFailure=True,doPer # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def writeSubFiles(_opts): + print('hellllllllp') # Make directory to store sub files if not os.path.isdir("%s/outdir_%s"%(swd__,_opts['ext'])): os.system("mkdir %s/outdir_%s"%(swd__,_opts['ext'])) if not os.path.isdir("%s/outdir_%s/%s"%(swd__,_opts['ext'],_opts['mode'])): os.system("mkdir %s/outdir_%s/%s"%(swd__,_opts['ext'],_opts['mode'])) @@ -75,14 +95,14 @@ def writeSubFiles(_opts): _f.write("if [ $1 -eq %g ]; then\n"%cidx) for pidx in range(_opts['nProcs']): p = _opts['procs'].split(",")[pidx] - _f.write(f" python3 %s/scripts/signalFit.py --inputWSDir %s --ext %s --proc %s --cat %s --year %s --analysis %s --massPoints %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s 2>&1 | tee logs/signalfit/log_ftest_{p}_{c}_{_opts['year']}.txt \n"%(swd__,_opts['inputWSDir'],_opts['ext'],p,c,_opts['year'],_opts['analysis'],_opts['massPoints'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) + _f.write(f" python3 %s/scripts/signalFit.py --inputWSDir %s --ext %s --proc %s --cat %s --year %s --analysis %s --massPoints %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s \n"%(swd__,_opts['inputWSDir'],_opts['ext'],p,c,_opts['year'],_opts['analysis'],_opts['massPoints'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) _f.write("fi\n") elif _opts['mode'] == "calcPhotonSyst": for cidx in range(_opts['nCats']): c = _opts['cats'].split(",")[cidx] _f.write("if [ $1 -eq %g ]; then\n"%cidx) - _f.write(" python3 %s/scripts/calcPhotonSyst.py --cat %s --procs %s --ext %s --inputWSDir %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s\n"%(swd__,c,_opts['procs'],_opts['ext'],_opts['inputWSDir'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) + _f.write(" python3 %s/scripts/calcPhotonSyst.py --year %s --cat %s --procs %s --ext %s --inputWSDir %s --scales \'%s\' --scalesCorr \'%s\' --scalesGlobal \'%s\' --smears \'%s\' %s\n"%(swd__,_opts['year'],c,_opts['procs'],_opts['ext'],_opts['inputWSDir'],_opts['scales'],_opts['scalesCorr'],_opts['scalesGlobal'],_opts['smears'],_opts['modeOpts'])) _f.write("fi\n") elif _opts['mode'] == "fTest": @@ -90,7 +110,7 @@ def writeSubFiles(_opts): for cidx in range(_opts['nCats']): c = _opts['cats'].split(",")[cidx] _f.write("if [ $1 -eq %g ]; then\n"%cidx) - _f.write(f" python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s 2>&1 | tee logs/ftest/log_ftest_{c}_{_opts['year']}.txt\n"%(swd__,c,_opts['procs'],_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) + _f.write(f" python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s \n"%(swd__,c,_opts['procs'],_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) _f.write("fi\n") elif _opts['mode'] == "packageSignal": @@ -156,10 +176,18 @@ def writeSubFiles(_opts): elif _opts['mode'] == "fTest": for cidx in range(_opts['nCats']): + c = _opts['cats'].split(",")[cidx] _f = open("%s/%s_%s.sh"%(_jobdir,_executable,c),"w") writePreamble(_f) - _f.write("python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s\n"%(swd__,c,_opts['procs'],_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) + for pidx in range(_opts['nProcs']): + p = _opts['procs'].split(",")[pidx] + print(p) + print('hi here') + + + + _f.write("python3 %s/scripts/fTest.py --cat %s --procs %s --year %s --ext %s --inputWSDir %s %s\n"%(swd__,c,p,_opts['year'],_opts['ext'],_opts['inputWSDir'],_opts['modeOpts'])) _f.close() os.system("chmod 775 %s/%s_%s.sh"%(_jobdir,_executable,c)) diff --git a/Trees2WS/check_efficiencies_root.py b/Trees2WS/check_efficiencies_root.py new file mode 100644 index 000000000..258eec856 --- /dev/null +++ b/Trees2WS/check_efficiencies_root.py @@ -0,0 +1,73 @@ +import pandas as pd + +import ROOT + +import glob +import argparse + +parser=argparse.ArgumentParser() + +parser.add_argument('--path') +parser.add_argument('--threshold',default=0.02) +parser.add_argument('--skipprocs',default=['THQ_FID','TTH_FWDH','THW_FID','VBF_1J','BBH_FWDH','GG2HQQ_FWDH','ZH2HQQ_FWDH','ZH2HNUNU_FWDH'],nargs='+',help="If procs too large for local memory, add here to skip") + +args = parser.parse_args() + +era=args.path.split('/')[-2] +if era=='preBPix': + args.skipprocs+='GG2HNUNU_FWDH' + args.skipprocs+='WPLUSH2HQQ_FWDH' +if era=='postBPix': + + args.skipprocs+='WPLUSH2HQQ_FWDH' + +filelist=glob.glob(args.path+'/*') +flag=True +for file in filelist: + if ('shortened' in file)|(any( [ i in file for i in args.skipprocs])): + continue + proc = file.split('/')[-1] + files_proc=glob.glob(args.path+'/'+proc+'/nominal/*') + files_proc_nominal=[] + for i in files_proc: + if ('_nominal' in i): + files_proc_nominal.append(i) + df=pd.DataFrame([]) + for n in range(len(files_proc_nominal)): + df=pd.concat([df,pd.read_parquet(files_proc_nominal[n])]) + + # make sure no background included + df=df[df.pred!=0] + + parquet_wsum=df.weight.sum() + + + + t=ROOT.TFile(args.path+'/'+proc+'/nominal/ws_'+proc+f'/output_{proc}_M125_pythia8_{proc}.root').Get('tagsDumper/cms_hgg_13TeV') + + all_datasets = [k.GetName() for k in t.allData()] + + wsum=0 + counter=0 + for i in all_datasets: + + Data=t.data(i) + if Data and Data.ClassName() == "RooDataSet": + for j in range(Data.numEntries()): + entry=Data.get(j) + w=Data.weight() + wsum+=w + counter+=1 + # print(f'{proc}: {wsum} {parquet_wsum}') + + try: + assert abs(wsum - parquet_wsum)/parquet_wsum /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate +fi +unset __mamba_setup +micromamba activate flashggFinalFit +export PYTHONPATH=$PYTHONPATH:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/tools:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/tools + +proc_x_stxs_x_era=('BBH_FID' 'GG2HLL_FWDH' 'GG2HLL_PTV_0_75' 'GG2HLL_PTV_150_250_0J' 'GG2HLL_PTV_150_250_GE1J' 'GG2HLL_PTV_75_150' 'GG2HLL_PTV_GT250' 'GG2HNUNU_PTV_0_75' 'GG2HNUNU_PTV_150_250_0J' 'GG2HNUNU_PTV_150_250_GE1J' 'GG2HNUNU_PTV_75_150' 'GG2HNUNU_PTV_GT250' 'GG2HQQ_0J_PTH_0_10' 'GG2HQQ_0J_PTH_GT10' 'GG2HQQ_1J_PTH_0_60' 'GG2HQQ_1J_PTH_120_200' 'GG2HQQ_1J_PTH_60_120' 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60' 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200' 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_PTH_200_300' 'GG2HQQ_PTH_300_450' 'GG2HQQ_PTH_450_650' 'GG2HQQ_PTH_GT650' 'GG2H_0J_PTH_0_10' 'GG2H_0J_PTH_GT10' 'GG2H_1J_PTH_0_60' 'GG2H_1J_PTH_120_200' 'GG2H_1J_PTH_60_120' 'GG2H_FWDH' 'GG2H_GE2J_MJJ_0_350_PTH_0_60' 'GG2H_GE2J_MJJ_0_350_PTH_120_200' 'GG2H_GE2J_MJJ_0_350_PTH_60_120' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2H_PTH_200_300' 'GG2H_PTH_300_450' 'GG2H_PTH_450_650' 'GG2H_PTH_GT650' 'THQ_FID' 'THQ_FWDH' 'THW_FID' 'THW_FWDH' 'TTH_PTH_0_60' 'TTH_PTH_120_200' 'TTH_PTH_200_300' 'TTH_PTH_60_120' 'TTH_PTH_GT300' 'VBF_0J' 'VBF_1J' 'VBF_FWDH' 'VBF_GE2J_MJJ_0_60' 'VBF_GE2J_MJJ_120_350' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'VBF_GE2J_MJJ_60_120' 'VBF_GE2J_MJJ_GT350_PTH_GT200' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HLNU_FWDH' 'WMINUSH2HLNU_PTV_0_75' 'WMINUSH2HLNU_PTV_150_250_0J' 'WMINUSH2HLNU_PTV_150_250_GE1J' 'WMINUSH2HLNU_PTV_75_150' 'WMINUSH2HLNU_PTV_GT250' 'WMINUSH2HQQ_0J' 'WMINUSH2HQQ_1J' 'WMINUSH2HQQ_FWDH' 'WMINUSH2HQQ_GE2J_MJJ_0_60' 'WMINUSH2HQQ_GE2J_MJJ_120_350' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HQQ_GE2J_MJJ_60_120' 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HLNU_FWDH' 'WPLUSH2HLNU_PTV_0_75' 'WPLUSH2HLNU_PTV_150_250_0J' 'WPLUSH2HLNU_PTV_150_250_GE1J' 'WPLUSH2HLNU_PTV_75_150' 'WPLUSH2HLNU_PTV_GT250' 'WPLUSH2HQQ_0J' 'WPLUSH2HQQ_1J' 'WPLUSH2HQQ_GE2J_MJJ_0_60' 'WPLUSH2HQQ_GE2J_MJJ_120_350' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HQQ_GE2J_MJJ_60_120' 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'ZH2HLL_FWDH' 'ZH2HLL_PTV_0_75' 'ZH2HLL_PTV_150_250_0J' 'ZH2HLL_PTV_150_250_GE1J' 'ZH2HLL_PTV_75_150' 'ZH2HLL_PTV_GT250' 'ZH2HNUNU_PTV_0_75' 'ZH2HNUNU_PTV_150_250_0J' 'ZH2HNUNU_PTV_150_250_GE1J' 'ZH2HNUNU_PTV_75_150' 'ZH2HNUNU_PTV_GT250' 'ZH2HQQ_0J' 'ZH2HQQ_1J' 'ZH2HQQ_GE2J_MJJ_0_60' 'ZH2HQQ_GE2J_MJJ_120_350' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'ZH2HQQ_GE2J_MJJ_60_120' 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25') +length=${#proc_x_stxs_x_era[@]} + +for ((i=0;i /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate +fi +unset __mamba_setup +micromamba activate flashggFinalFit +export PYTHONPATH=$PYTHONPATH:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/tools:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/tools + +# proc_x_stxs_x_era=('BBH_FID' 'GG2HLL_FWDH' 'GG2HLL_PTV_0_75' 'GG2HLL_PTV_150_250_0J' 'GG2HLL_PTV_150_250_GE1J' 'GG2HLL_PTV_75_150' 'GG2HLL_PTV_GT250' 'GG2HNUNU_PTV_0_75' 'GG2HNUNU_PTV_150_250_0J' 'GG2HNUNU_PTV_150_250_GE1J' 'GG2HNUNU_PTV_75_150' 'GG2HNUNU_PTV_GT250' 'GG2HQQ_0J_PTH_0_10' 'GG2HQQ_0J_PTH_GT10' 'GG2HQQ_1J_PTH_0_60' 'GG2HQQ_1J_PTH_120_200' 'GG2HQQ_1J_PTH_60_120' 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60' 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200' 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_PTH_200_300' 'GG2HQQ_PTH_300_450' 'GG2HQQ_PTH_450_650' 'GG2HQQ_PTH_GT650' 'GG2H_0J_PTH_0_10' 'GG2H_0J_PTH_GT10' 'GG2H_1J_PTH_0_60' 'GG2H_1J_PTH_120_200' 'GG2H_1J_PTH_60_120' 'GG2H_FWDH' 'GG2H_GE2J_MJJ_0_350_PTH_0_60' 'GG2H_GE2J_MJJ_0_350_PTH_120_200' 'GG2H_GE2J_MJJ_0_350_PTH_60_120' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2H_PTH_200_300' 'GG2H_PTH_300_450' 'GG2H_PTH_450_650' 'GG2H_PTH_GT650' 'THQ_FID' 'THQ_FWDH' 'THW_FID' 'THW_FWDH' 'TTH_PTH_0_60' 'TTH_PTH_120_200' 'TTH_PTH_200_300' 'TTH_PTH_60_120' 'TTH_PTH_GT300' 'VBF_0J' 'VBF_1J' 'VBF_FWDH' 'VBF_GE2J_MJJ_0_60' 'VBF_GE2J_MJJ_120_350' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'VBF_GE2J_MJJ_60_120' 'VBF_GE2J_MJJ_GT350_PTH_GT200' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HLNU_FWDH' 'WMINUSH2HLNU_PTV_0_75' 'WMINUSH2HLNU_PTV_150_250_0J' 'WMINUSH2HLNU_PTV_150_250_GE1J' 'WMINUSH2HLNU_PTV_75_150' 'WMINUSH2HLNU_PTV_GT250' 'WMINUSH2HQQ_0J' 'WMINUSH2HQQ_1J' 'WMINUSH2HQQ_FWDH' 'WMINUSH2HQQ_GE2J_MJJ_0_60' 'WMINUSH2HQQ_GE2J_MJJ_120_350' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HQQ_GE2J_MJJ_60_120' 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HLNU_FWDH' 'WPLUSH2HLNU_PTV_0_75' 'WPLUSH2HLNU_PTV_150_250_0J' 'WPLUSH2HLNU_PTV_150_250_GE1J' 'WPLUSH2HLNU_PTV_75_150' 'WPLUSH2HLNU_PTV_GT250' 'WPLUSH2HQQ_0J' 'WPLUSH2HQQ_1J' 'WPLUSH2HQQ_GE2J_MJJ_0_60' 'WPLUSH2HQQ_GE2J_MJJ_120_350' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HQQ_GE2J_MJJ_60_120' 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'ZH2HLL_FWDH' 'ZH2HLL_PTV_0_75' 'ZH2HLL_PTV_150_250_0J' 'ZH2HLL_PTV_150_250_GE1J' 'ZH2HLL_PTV_75_150' 'ZH2HLL_PTV_GT250' 'ZH2HNUNU_FWDH' 'ZH2HNUNU_PTV_0_75' 'ZH2HNUNU_PTV_150_250_0J' 'ZH2HNUNU_PTV_150_250_GE1J' 'ZH2HNUNU_PTV_75_150' 'ZH2HNUNU_PTV_GT250' 'ZH2HQQ_0J' 'ZH2HQQ_1J' 'ZH2HQQ_GE2J_MJJ_0_60' 'ZH2HQQ_GE2J_MJJ_120_350' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'ZH2HQQ_GE2J_MJJ_60_120' 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25') +proc_x_stxs_x_era=( 'THQ_FID' 'ZH2HQQ_FWDH') +length=${#proc_x_stxs_x_era[@]} + +for ((i=0;i /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate +fi +unset __mamba_setup +micromamba activate flashggFinalFit +export PYTHONPATH=$PYTHONPATH:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/tools:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/tools + +proc_x_stxs_x_era=('BBH_FID' 'GG2HLL_FWDH' 'GG2HLL_PTV_0_75' 'GG2HLL_PTV_150_250_0J' 'GG2HLL_PTV_150_250_GE1J' 'GG2HLL_PTV_75_150' 'GG2HLL_PTV_GT250' 'GG2HNUNU_PTV_0_75' 'GG2HNUNU_PTV_150_250_0J' 'GG2HNUNU_PTV_150_250_GE1J' 'GG2HNUNU_PTV_75_150' 'GG2HNUNU_PTV_GT250' 'GG2HQQ_0J_PTH_0_10' 'GG2HQQ_0J_PTH_GT10' 'GG2HQQ_1J_PTH_0_60' 'GG2HQQ_1J_PTH_120_200' 'GG2HQQ_1J_PTH_60_120' 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60' 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200' 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_PTH_200_300' 'GG2HQQ_PTH_300_450' 'GG2HQQ_PTH_450_650' 'GG2HQQ_PTH_GT650' 'GG2H_0J_PTH_0_10' 'GG2H_0J_PTH_GT10' 'GG2H_1J_PTH_0_60' 'GG2H_1J_PTH_120_200' 'GG2H_1J_PTH_60_120' 'GG2H_FWDH' 'GG2H_GE2J_MJJ_0_350_PTH_0_60' 'GG2H_GE2J_MJJ_0_350_PTH_120_200' 'GG2H_GE2J_MJJ_0_350_PTH_60_120' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2H_PTH_200_300' 'GG2H_PTH_300_450' 'GG2H_PTH_450_650' 'GG2H_PTH_GT650' 'THQ_FID' 'THQ_FWDH' 'THW_FID' 'THW_FWDH' 'TTH_PTH_0_60' 'TTH_PTH_120_200' 'TTH_PTH_200_300' 'TTH_PTH_60_120' 'TTH_PTH_GT300' 'VBF_0J' 'VBF_1J' 'VBF_FWDH' 'VBF_GE2J_MJJ_0_60' 'VBF_GE2J_MJJ_120_350' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'VBF_GE2J_MJJ_60_120' 'VBF_GE2J_MJJ_GT350_PTH_GT200' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HLNU_FWDH' 'WMINUSH2HLNU_PTV_0_75' 'WMINUSH2HLNU_PTV_150_250_0J' 'WMINUSH2HLNU_PTV_150_250_GE1J' 'WMINUSH2HLNU_PTV_75_150' 'WMINUSH2HLNU_PTV_GT250' 'WMINUSH2HQQ_0J' 'WMINUSH2HQQ_1J' 'WMINUSH2HQQ_FWDH' 'WMINUSH2HQQ_GE2J_MJJ_0_60' 'WMINUSH2HQQ_GE2J_MJJ_120_350' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HQQ_GE2J_MJJ_60_120' 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HLNU_FWDH' 'WPLUSH2HLNU_PTV_0_75' 'WPLUSH2HLNU_PTV_150_250_0J' 'WPLUSH2HLNU_PTV_150_250_GE1J' 'WPLUSH2HLNU_PTV_75_150' 'WPLUSH2HLNU_PTV_GT250' 'WPLUSH2HQQ_0J' 'WPLUSH2HQQ_1J' 'WPLUSH2HQQ_GE2J_MJJ_0_60' 'WPLUSH2HQQ_GE2J_MJJ_120_350' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HQQ_GE2J_MJJ_60_120' 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'ZH2HLL_FWDH' 'ZH2HLL_PTV_0_75' 'ZH2HLL_PTV_150_250_0J' 'ZH2HLL_PTV_150_250_GE1J' 'ZH2HLL_PTV_75_150' 'ZH2HLL_PTV_GT250' 'ZH2HNUNU_FWDH' 'ZH2HNUNU_PTV_0_75' 'ZH2HNUNU_PTV_150_250_0J' 'ZH2HNUNU_PTV_150_250_GE1J' 'ZH2HNUNU_PTV_75_150' 'ZH2HNUNU_PTV_GT250' 'ZH2HQQ_0J' 'ZH2HQQ_1J' 'ZH2HQQ_FWDH' 'ZH2HQQ_GE2J_MJJ_0_60' 'ZH2HQQ_GE2J_MJJ_120_350' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'ZH2HQQ_GE2J_MJJ_60_120' 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25') +length=${#proc_x_stxs_x_era[@]} + +for ((i=0;i /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate +fi +unset __mamba_setup +micromamba activate flashggFinalFit +export PYTHONPATH=$PYTHONPATH:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/tools:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/tools + +proc_x_stxs_x_era=('BBH_FID' 'GG2HLL_FWDH' 'GG2HLL_PTV_0_75' 'GG2HLL_PTV_150_250_0J' 'GG2HLL_PTV_150_250_GE1J' 'GG2HLL_PTV_75_150' 'GG2HLL_PTV_GT250' 'GG2HNUNU_FWDH' 'GG2HNUNU_PTV_0_75' 'GG2HNUNU_PTV_150_250_0J' 'GG2HNUNU_PTV_150_250_GE1J' 'GG2HNUNU_PTV_75_150' 'GG2HNUNU_PTV_GT250' 'GG2HQQ_0J_PTH_0_10' 'GG2HQQ_0J_PTH_GT10' 'GG2HQQ_1J_PTH_0_60' 'GG2HQQ_1J_PTH_120_200' 'GG2HQQ_1J_PTH_60_120' 'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60' 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200' 'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2HQQ_PTH_200_300' 'GG2HQQ_PTH_300_450' 'GG2HQQ_PTH_450_650' 'GG2HQQ_PTH_GT650' 'GG2H_0J_PTH_0_10' 'GG2H_0J_PTH_GT10' 'GG2H_1J_PTH_0_60' 'GG2H_1J_PTH_120_200' 'GG2H_1J_PTH_60_120' 'GG2H_FWDH' 'GG2H_GE2J_MJJ_0_350_PTH_0_60' 'GG2H_GE2J_MJJ_0_350_PTH_120_200' 'GG2H_GE2J_MJJ_0_350_PTH_60_120' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'GG2H_PTH_200_300' 'GG2H_PTH_300_450' 'GG2H_PTH_450_650' 'GG2H_PTH_GT650' 'THQ_FID' 'THQ_FWDH' 'THW_FID' 'THW_FWDH' 'TTH_PTH_0_60' 'TTH_PTH_120_200' 'TTH_PTH_200_300' 'TTH_PTH_60_120' 'TTH_PTH_GT300' 'VBF_0J' 'VBF_1J' 'VBF_FWDH' 'VBF_GE2J_MJJ_0_60' 'VBF_GE2J_MJJ_120_350' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'VBF_GE2J_MJJ_60_120' 'VBF_GE2J_MJJ_GT350_PTH_GT200' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HLNU_FWDH' 'WMINUSH2HLNU_PTV_0_75' 'WMINUSH2HLNU_PTV_150_250_0J' 'WMINUSH2HLNU_PTV_150_250_GE1J' 'WMINUSH2HLNU_PTV_75_150' 'WMINUSH2HLNU_PTV_GT250' 'WMINUSH2HQQ_0J' 'WMINUSH2HQQ_1J' 'WMINUSH2HQQ_FWDH' 'WMINUSH2HQQ_GE2J_MJJ_0_60' 'WMINUSH2HQQ_GE2J_MJJ_120_350' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WMINUSH2HQQ_GE2J_MJJ_60_120' 'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HLNU_FWDH' 'WPLUSH2HLNU_PTV_0_75' 'WPLUSH2HLNU_PTV_150_250_0J' 'WPLUSH2HLNU_PTV_150_250_GE1J' 'WPLUSH2HLNU_PTV_75_150' 'WPLUSH2HLNU_PTV_GT250' 'WPLUSH2HQQ_0J' 'WPLUSH2HQQ_1J' 'WPLUSH2HQQ_GE2J_MJJ_0_60' 'WPLUSH2HQQ_GE2J_MJJ_120_350' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'WPLUSH2HQQ_GE2J_MJJ_60_120' 'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' 'ZH2HLL_FWDH' 'ZH2HLL_PTV_0_75' 'ZH2HLL_PTV_150_250_0J' 'ZH2HLL_PTV_150_250_GE1J' 'ZH2HLL_PTV_75_150' 'ZH2HLL_PTV_GT250' 'ZH2HNUNU_FWDH' 'ZH2HNUNU_PTV_0_75' 'ZH2HNUNU_PTV_150_250_0J' 'ZH2HNUNU_PTV_150_250_GE1J' 'ZH2HNUNU_PTV_75_150' 'ZH2HNUNU_PTV_GT250' 'ZH2HQQ_0J' 'ZH2HQQ_1J' 'ZH2HQQ_FWDH' 'ZH2HQQ_GE2J_MJJ_0_60' 'ZH2HQQ_GE2J_MJJ_120_350' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' 'ZH2HQQ_GE2J_MJJ_60_120' 'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' 'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25') +length=${#proc_x_stxs_x_era[@]} + +for ((i=0;i 600) + ++JobFlavour = "workday" +queue 1 \ No newline at end of file diff --git a/Trees2WS/run_jobs/submission_postEE.sub b/Trees2WS/run_jobs/submission_postEE.sub new file mode 100644 index 000000000..249c9cc36 --- /dev/null +++ b/Trees2WS/run_jobs/submission_postEE.sub @@ -0,0 +1,17 @@ +executable = execution_postEE.sh +arguments = $(ProcId) +output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).out +error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).err +log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).log +transfer_output_files = "" + +request_memory = 12GB + +# Send the job to Held state on failure +on_exit_hold = (ExitBySignal == True) || (ExitCode != 0) + +# Periodically retry the jobs every 10 minutes, up to a maximum of 5 retries. +periodic_release = (NumJobStarts < 3) && ((CurrentTime - EnteredCurrentStatus) > 600) + ++JobFlavour = "tomorrow" +queue 1 \ No newline at end of file diff --git a/Trees2WS/run_jobs/submission_preBPix.sub b/Trees2WS/run_jobs/submission_preBPix.sub new file mode 100644 index 000000000..47b9ab80f --- /dev/null +++ b/Trees2WS/run_jobs/submission_preBPix.sub @@ -0,0 +1,17 @@ +executable = execution_preBPix.sh +arguments = $(ProcId) +output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).out +error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).err +log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).log +transfer_output_files = "" + +request_memory = 12GB + +# Send the job to Held state on failure +on_exit_hold = (ExitBySignal == True) || (ExitCode != 0) + +# Periodically retry the jobs every 10 minutes, up to a maximum of 5 retries. +periodic_release = (NumJobStarts < 3) && ((CurrentTime - EnteredCurrentStatus) > 600) + ++JobFlavour = "workday" +queue 1 \ No newline at end of file diff --git a/Trees2WS/run_jobs/submission_preEE.sub b/Trees2WS/run_jobs/submission_preEE.sub new file mode 100644 index 000000000..ab81c7c0e --- /dev/null +++ b/Trees2WS/run_jobs/submission_preEE.sub @@ -0,0 +1,17 @@ +executable = execution_preEE.sh +arguments = $(ProcId) +output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).out +error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).err +log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS.$(ClusterId).$(ProcId).log +transfer_output_files = "" + +request_memory = 12GB + +# Send the job to Held state on failure +on_exit_hold = (ExitBySignal == True) || (ExitCode != 0) + +# Periodically retry the jobs every 10 minutes, up to a maximum of 5 retries. +periodic_release = (NumJobStarts < 3) && ((CurrentTime - EnteredCurrentStatus) > 600) + ++JobFlavour = "workday" +queue 1 \ No newline at end of file diff --git a/Trees2WS/subm.sub b/Trees2WS/subm.sub new file mode 100644 index 000000000..0a115d99b --- /dev/null +++ b/Trees2WS/subm.sub @@ -0,0 +1,17 @@ +executable = trees.sh +arguments = $(ProcId) +output = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS_preBPix.$(ClusterId).$(ProcId).out +error = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS_preBPix.$(ClusterId).$(ProcId).err +log = /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/logs/condor_signalFit_Run3STXS_preBPix.$(ClusterId).$(ProcId).log +transfer_output_files = "" + +request_memory = 12GB + +# Send the job to Held state on failure +on_exit_hold = (ExitBySignal == True) || (ExitCode != 0) + +# Periodically retry the jobs every 10 minutes, up to a maximum of 5 retries. +periodic_release = (NumJobStarts < 3) && ((CurrentTime - EnteredCurrentStatus) > 600) + ++JobFlavour = "longlunch" +queue 1 diff --git a/Trees2WS/trees.sh b/Trees2WS/trees.sh new file mode 100755 index 000000000..5b069459f --- /dev/null +++ b/Trees2WS/trees.sh @@ -0,0 +1,27 @@ +#!/bin/bash +ulimit -s unlimited +set -e +cd /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src +export SCRAM_ARCH=None +source /cvmfs/cms.cern.ch/cmsset_default.sh +eval `scramv1 runtime -sh` +cd /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Signal +cd .. +source /eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/setup_standalone.sh +cd Trees2WS +export MAMBA_EXE='/eos/home-p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/y/micromamba'; +export MAMBA_ROOT_PREFIX='/eos/home-p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/higgsdna_finalfits_tutorial_24/micromamba'; +__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__mamba_setup" +else + alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate +fi +unset __mamba_setup +micromamba activate flashggFinalFit +export PYTHONPATH=$PYTHONPATH:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/tools:/eos/user/p/pkrueper/HiggsDNA_and_FinalFits_tutorial24/FF_standalone/src/flashggFinalFit/Trees2WS/tools + +proc_x_stxs_x_era=('THW_FID' 'THQ_FID') +length=${#proc_x_stxs_x_era[@]} + +for ((i=0;i___ e.g. ggh_125_13TeV_RECO_0J_PTH_0_10_Tag0 -# For systematics: requires trees of the format: -# * ____Up01sigma e.g. ggh_125_13TeV_RECO_0J_PTH_0_10_Tag0_JECUp01sigma -# * ____Down01sigma e.g. ggh_125_13TeV_RECO_0J_PTH_0_10_Tag0_JECDown01sigma - -import os, sys -import re +import os, sys, re from optparse import OptionParser - -def get_options(): - parser = OptionParser() - parser.add_option('--inputConfig',dest='inputConfig', default="", help='Input config: specify list of variables/systematics/analysis categories') - parser.add_option('--inputTreeFile',dest='inputTreeFile', default="./output_0.root", help='Input tree file') - parser.add_option('--inputMass',dest='inputMass', default="125", help='Input mass') - parser.add_option('--productionMode',dest='productionMode', default="ggh", help='Production mode [ggh,vbf,wh,zh,tth,thq,ggzh,bbh]') - parser.add_option('--year',dest='year', default="2016", help='Year') - parser.add_option('--decayExt',dest='decayExt', default='', help='Decay extension') - parser.add_option('--doNNLOPS',dest='doNNLOPS', default=False, action="store_true", help='Add NNLOPS weight variable: NNLOPSweight') - parser.add_option('--doSystematics',dest='doSystematics', default=False, action="store_true", help='Add systematics datasets to output WS') - parser.add_option('--doSTXSSplitting',dest='doSTXSSplitting', default=False, action="store_true", help='Split output WS per STXS bin') - return parser.parse_args() -(opt,args) = get_options() - from collections import OrderedDict as od from importlib import import_module - +import json import ROOT -import pandas +import pandas as pd import numpy as np -import uproot -import awkward as ak from commonTools import * from commonObjects import * from tools.STXS_tools import * -print(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG TREES 2 WS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") +def get_options(): + parser = OptionParser() + parser.add_option('--inputConfig', dest='inputConfig', default="", help='Input config file') + parser.add_option('--inputMass', dest='inputMass', default="125", help='Higgs mass') + parser.add_option('--inputTreeFile',dest='inputTreeFile', default="./output_0.root", help='Input tree file') + parser.add_option('--productionMode', dest='productionMode', default="ggh", help='Production mode') + parser.add_option('--year', dest='year', default="2016", help='Year') + parser.add_option('--decayExt', dest='decayExt', default='', help='Decay extension') + parser.add_option('--doNNLOPS', dest='doNNLOPS', default=False, action="store_true", help='Add NNLOPS weight') + parser.add_option('--doSystematics', dest='doSystematics', default=False, action="store_true", help='Add systematics') + parser.add_option('--doSTXSSplitting', dest='doSTXSSplitting', default=False, action="store_true", help='Split WS by STXS bin') + parser.add_option('--categorisationConfig',default='category_STXS_stage1p2.json') + parser.add_option('-v',default=False,action="store_true") + parser.add_option('--skiplength',default=10000000000) + parser.add_option('--reduceprocs',default=[]) + return parser.parse_args() + +(opt, args) = get_options() + +proc=opt.inputTreeFile.split('/')[-2] + + +if proc in opt.reduceprocs: + skip_len=int(opt.skiplength) +else: + skip_len=10000000000000000000 + def leave(): - print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG TREES 2 WS (END) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") - exit(0) - -# Function to add vars to workspace -def add_vars_to_workspace(_ws=None,_data=None,_stxsVar=None): - # Add intLumi var - intLumi = ROOT.RooRealVar("intLumi","intLumi",1000.,0.,999999999.) - intLumi.setConstant(True) - getattr(_ws,'import')(intLumi) - # Add vars specified by dataframe columns: skipping cat, stxsvar and type - _vars = od() - for var in _data.columns: - if var in ['type','cat',_stxsVar,'']: continue - if var == "CMS_hgg_mass": - _vars[var] = ROOT.RooRealVar(var,var,125.,100.,180.) - _vars[var].setBins(160) - elif var == "dZ": - _vars[var] = ROOT.RooRealVar(var,var,0.,-20.,20.) - _vars[var].setBins(40) - elif var == "weight": - _vars[var] = ROOT.RooRealVar(var,var,0.) - else: - _vars[var] = ROOT.RooRealVar(var,var,1.,-999999,999999) - _vars[var].setBins(1) - getattr(_ws,'import')(_vars[var],ROOT.RooFit.Silence()) - return _vars.keys() - -# Function to make RooArgSet -def make_argset(_ws=None,_varNames=None): - _aset = ROOT.RooArgSet() - for v in _varNames: _aset.add(_ws.var(v)) - return _aset - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Production modes to skip theory weights: fill with 1's -modesToSkipTheoryWeights = ['bbh','thq','thw'] - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Extract options from config file: -options = od() -if opt.inputConfig != '': - if os.path.exists( opt.inputConfig ): - - # Import config options - _cfg = import_module(re.sub(".py","",opt.inputConfig)).trees2wsCfg - - #Extract options - inputTreeDir = _cfg['inputTreeDir'] - mainVars = _cfg['mainVars'] - stxsVar = _cfg['stxsVar'] - systematicsVars = _cfg['systematicsVars'] - theoryWeightContainers = _cfg['theoryWeightContainers'] - systematics = _cfg['systematics'] - cats = _cfg['cats'] - - else: - print( "[ERROR] %s config file does not exist. Leaving..."%opt.inputConfig) + print("~~~~~~~~~~~~~~~~~~~~~~~~~ SCRIPT END ~~~~~~~~~~~~~~~~~~~~~~~~~") + exit(0) + +# Load config +if opt.inputConfig == '' or not os.path.exists(opt.inputConfig): + print(f"[ERROR] Config file {opt.inputConfig} not found.") leave() -else: - print( "[ERROR] Please specify config file to run from. Leaving..."%opt.inputConfig) - leave() -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# For theory weights: create vars for each weight -theoryWeightColumns = {} -for ts, nWeights in theoryWeightContainers.items(): theoryWeightColumns[ts] = ["%s_%g"%(ts[:-1],i) for i in range(0,nWeights)] # drop final s from container name +_cfg = import_module(re.sub(".py$", "", opt.inputConfig)).trees2wsCfg + +inputTreeDir = _cfg['inputTreeDir'].rstrip('/') +mainVars = _cfg['mainVars'] +stxsVar = _cfg['stxsVar'] +systematicsVars = _cfg['systematicsVars'] +theoryWeightContainers = _cfg['theoryWeightContainers'] +systematics = _cfg['systematics'] +cats = _cfg['cats'] + +# If STXS var is not defined, disable splitting +if not stxsVar: + opt.doSTXSSplitting = False + stxsVar = 'nosplit' + print("[INFO] STXS variable not defined. Disabling STXS splitting.") + +# CHANGING STRUCTURE +import pyarrow.parquet as pq +import glob +import random + +def fast_sample_single_file(dirpath, n): + # take only nominal, non-systematic files + files = [ + f for f in glob.glob(f"{dirpath}/*.parquet") + if "Up" not in f and "Down" not in f and "ws_" not in f + ] + + if not files: + return pd.DataFrame() + + # pick ONE random file + f = random.choice(files) + pf = pq.ParquetFile(f) + + dfs = [] + total = 0 + + # iter_batches lets you stop early + for batch in pf.iter_batches(batch_size=20000): + df = batch.to_pandas() + dfs.append(df) + total += len(df) + if total >= n: + break + + return pd.concat(dfs).iloc[:n] + +if skip_len < 1e15: # skiplen active + merged = fast_sample_single_file(opt.inputTreeFile, skip_len) +else: + merged = fast_sample_single_file(opt.inputTreeFile,skip_len) +print('nominal merged') +# Auto-detect categories from .parquet files in inputTreeFile directory +if cats == 'auto': + if not os.path.isdir(opt.inputTreeFile): + print(f"[ERROR] Input directory '{opt.inputTreeFile}' does not exist.") + leave() -# If year == 2018, add HET -if opt.year == '2018': systematics.append("JetHEM") + + # for f in os.listdir(opt.inputTreeFile): + # if f.endswith(".parquet"): + # cats.append(f.replace(".parquet", "")) + + with open(opt.categorisationConfig, "r") as f: + cat_dict = json.load(f) + cats = [] + for cat in merged.pred_ia.unique(): + if cat!=0: + cats.append(cat_dict['cat_dict'][str(cat)]) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# UPROOT file -f = uproot.open(opt.inputTreeFile) -if inputTreeDir == '': listOfTreeNames == f.keys() -else: listOfTreeNames = f[inputTreeDir].keys() -# If cats = 'auto' then determine from list of trees -if cats == 'auto': - cats = [] - for tn in listOfTreeNames: - if "sigma" in tn: continue - c = tn.split("_%s_"%sqrts__)[-1].split(";")[0] - cats.append(c) - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# 1) Convert tree to pandas dataframe -# Create dataframe to store all events in file -data = pandas.DataFrame() -if opt.doSystematics: sdata = pandas.DataFrame() - -# Loop over categories: fill dataframe -for cat in cats: - print( " --> Extracting events from category: %s"%cat) - if inputTreeDir == '': treeName = "%s_%s_%s_%s"%(opt.productionMode,opt.inputMass,sqrts__,cat) - else: treeName = "%s/%s_%s_%s_%s"%(inputTreeDir,opt.productionMode,opt.inputMass,sqrts__,cat) - print(" * tree: %s"%treeName) - # Extract tree from uproot - t = f[treeName] - if t.num_entries == 0: continue - - # Convert tree to pandas dataframe - dfs = {} - - # Theory weights - for ts, tsColumns in theoryWeightColumns.items(): - if opt.productionMode in modesToSkipTheoryWeights: - dfs[ts] = pandas.DataFrame(np.ones(shape=(t.num_entries,theoryWeightContainers[ts]))) + if not cats: + print(f"[ERROR] No parquet files found in '{opt.inputTreeFile}'") + leave() else: - dfs[ts] = pandas.DataFrame(np.reshape(np.array(t[ts].array()),(t.num_entries,len(tsColumns)))) - dfs[ts].columns = tsColumns - - # Main variables to add to nominal RooDataSets - # For wildcards use filter_name functionality - mainVars_dropWildcards = [] - for var in mainVars: - if "*" not in var: - mainVars_dropWildcards.append(var) - - dfs['main'] = t.arrays(mainVars_dropWildcards, library='pd') - - for var in mainVars: - if "*" in var: - dfs[var] = t.arrays(filter_name=var, library='pd') - - # Concatenate current dataframes - df = pandas.concat(dfs.values(), axis=1) - - # Add STXS splitting var if splitting necessary - if opt.doSTXSSplitting: df[stxsVar] = t.arrays(stxsVar, library='pd') - - # For experimental phase space - df['type'] = 'nominal' - # Add NNLOPS variable - if(opt.doNNLOPS): - if opt.productionMode == 'ggh': df['NNLOPSweight'] = t.arrays(['NNLOPSweight'], library='pd') - else: df['NNLOPSweight'] = 1. - - # Add columns specifying category add to overall dataframe - df['cat'] = cat - data = pandas.concat([data,df], ignore_index=True, axis=0, sort=False) - - # For systematics trees: only for events in experimental phase space - if opt.doSystematics: - sdf = pandas.DataFrame() - for s in systematics: - print(" --> Systematic: %s"%re.sub("YEAR",opt.year,s)) - for direction in ['Up','Down']: - streeName = "%s_%s%s01sigma"%(treeName,s,direction) - # If year in streeName then replace by year being processed - streeName = re.sub("YEAR",opt.year,streeName) - st = f[streeName] - if len(st)==0: continue - sdf = st.arrays(systematicsVars, library='pd') - sdf['type'] = "%s%s"%(s,direction) - # Add STXS splitting var if splitting necessary - if opt.doSTXSSplitting: sdf[stxsVar] = st.arrays(stxsVar, library='pd') - - # Add column specifying category and add to systematics dataframe - sdf['cat'] = cat - sdata = pandas.concat([sdata,sdf], ignore_index=True, axis=0, sort=False) - -# If not splitting by STXS bin then add dummy column to dataframe -if not opt.doSTXSSplitting: - data[stxsVar] = 'nosplit' - if opt.doSystematics: sdata[stxsVar] = 'nosplit' - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# 2) Convert pandas dataframe to RooWorkspace -for stxsId in data[stxsVar].unique(): + print(f"[INFO] Detected categories: {cats}") - # Split output files for different STXS bins - if opt.doSTXSSplitting: - df = data[data[stxsVar]==stxsId] - if opt.doSystematics: sdf = sdata[sdata[stxsVar]==stxsId] - - # Extract stxsBin - stxsBin = flashggSTXSDict[int(stxsId)] - if opt.productionMode == "wh": - if "QQ2HQQ" in stxsBin: stxsBin = re.sub("QQ2HQQ","WH2HQQ",stxsBin) - elif opt.productionMode == "zh": - if "QQ2HQQ" in stxsBin: stxsBin = re.sub("QQ2HQQ","ZH2HQQ",stxsBin) - # ggZH: split by decay mode - elif opt.productionMode == "ggzh": - if opt.decayExt == "_ZToQQ": stxsBin = re.sub("GG2H","GG2HQQ",stxsBin) - elif opt.decayExt == "_ZToNuNu": stxsBin = re.sub("GG2HLL","GG2HNUNU",stxsBin) - # For tHL split into separate bins for tHq and tHW - elif opt.productionMode == "thq": stxsBin = re.sub("TH","THQ",stxsBin) - elif opt.productionMode == 'thw': stxsBin = re.sub("TH","THW",stxsBin) - - # Define output workspace file - outputWSDir = "/".join(opt.inputTreeFile.split("/")[:-1])+"/ws_%s"%stxsBin - if not os.path.exists(outputWSDir): os.system("mkdir %s"%outputWSDir) - outputWSFile = outputWSDir+"/"+re.sub(".root","_%s.root"%stxsBin,opt.inputTreeFile.split("/")[-1]) - print(" --> Creating output workspace for STXS bin: %s (%s)"%(stxsBin,outputWSFile)) - - else: - df = data - if opt.doSystematics: sdf = sdata - - # Define output workspace file - outputWSDir = "/".join(opt.inputTreeFile.split("/")[:-1])+"/ws_%s"%dataToProc(opt.productionMode) - if not os.path.exists(outputWSDir): os.system("mkdir %s"%outputWSDir) - outputWSFile = outputWSDir+"/"+re.sub(".root","_%s.root"%dataToProc(opt.productionMode),opt.inputTreeFile.split("/")[-1]) - print(" --> Creating output workspace: (%s)"%outputWSFile) +cats=list(cat_dict['cat_dict'].values() )# ensure ALL cats are included + +# Add HEM for 2018 +if opt.year == '2018': + systematics.append("JetHEM") + +# Theory weight names +modesToSkipTheoryWeights = ['bbh', 'thq', 'thw'] +theoryWeightColumns = { + ts: [f"{ts[:-1]}_{i}" for i in range(n)] for ts, n in theoryWeightContainers.items() +} + + + +merged['cat'] = merged['pred_ia'].map(str).map(cat_dict['cat_dict']) +merged['type'] = 'nominal' +data = merged.copy() +# Ensure STXS var +if stxsVar not in data.columns: + data[stxsVar] = 'nosplit' +# # Combine data +# data = pd.DataFrame() + +# for cat in cats: +# # parquet_path = os.path.join(opt.inputTreeFile, f"{cat}.parquet") +# # print(f"[INFO] Loading {parquet_path}") +# # if not os.path.exists(parquet_path): +# # print(f"[WARNING] Missing file: {parquet_path}. Skipping...") +# # continue - # Open file and initiate workspace - fout = ROOT.TFile(outputWSFile,"RECREATE") - foutdir = fout.mkdir(inputWSName__.split("/")[0]) - foutdir.cd() - ws = ROOT.RooWorkspace(inputWSName__.split("/")[1],inputWSName__.split("/")[1]) - - # Add variables to workspace - varNames = add_vars_to_workspace(ws,df,stxsVar) - # Loop over cats - for cat in cats: +# # df = pd.read_parquet(parquet_path) +# df= merged +# if df.empty: +# print(f"[WARNING] Empty parquet: {parquet_path}") +# continue - # a) make RooDataSets: type = nominal - mask = (df['cat']==cat) +# - # Make argset - aset = make_argset(ws,varNames) +# # Add theory weight cols if missing +# for ts, cols in theoryWeightColumns.items(): +# for col in cols: +# if col not in df.columns: +# df[col] = 1.0 if opt.productionMode in modesToSkipTheoryWeights else 0.0 - # Define RooDataSet - dName = "%s_%s_%s_%s"%(opt.productionMode,opt.inputMass,sqrts__,cat) - d = ROOT.RooDataSet(dName,dName,aset,ROOT.RooFit.WeightVar('weight')) +# # Metadata + +# df['cat'] = df['pred'].map(str).map(cat_dict['cat_dict']) +# # print(f'cat==={}') +# df['type'] = 'nominal' +# if opt.doNNLOPS and "NNLOPSweight" not in df.columns: +# df["NNLOPSweight"] = 1.0 + +# data = pd.concat([data, df], ignore_index=True) + +# ~~~~~~~ RooWorkspace Helpers ~~~~~~~ +def add_vars_to_workspace(ws, df, stxsVar): + intLumi = ROOT.RooRealVar("intLumi", "intLumi", 1000., 0., 999999999.) + intLumi.setConstant(True) + getattr(ws, 'import')(intLumi) + + rvars = od() + for col in df.columns: + if col in ['cat', 'type', stxsVar, '']: continue + if col == "CMS_hgg_mass": + rvar = ROOT.RooRealVar(col, col, 125., 100., 180.) + rvar.setBins(160) + elif col == "dZ": + rvar = ROOT.RooRealVar(col, col, 0., -20., 20.) + rvar.setBins(40) + elif col == "weight": + rvar = ROOT.RooRealVar(col, col, 0.) + else: + rvar = ROOT.RooRealVar(col, col, 1., -999999, 999999) + rvar.setBins(1) + getattr(ws, 'import')(rvar, ROOT.RooFit.Silence()) + rvars[col] = rvar + return list(rvars.keys()) + +def make_argset(ws, var_names): + aset = ROOT.RooArgSet() + for name in var_names: + aset.add(ws.var(name)) + return aset + +# ~~~~~~~ RooWorkspace Creation ~~~~~~~ +for stxsId in data[stxsVar].unique(): + df = data[data[stxsVar] == stxsId] - # Loop over events in dataframe and add entry - for row in df[mask][varNames].to_numpy(): - for i, val in enumerate(row): - aset[i].setVal(val) - d.add(aset,aset.getRealValue("weight")) + if stxsVar == 'nosplit': + stxsBin = opt.productionMode + else: + stxsBin = flashggSTXSDict.get(int(stxsId), f"unknownSTXS_{stxsId}") + if opt.productionMode == "wh": + stxsBin = stxsBin.replace("QQ2HQQ", "WH2HQQ") + elif opt.productionMode == "zh": + stxsBin = stxsBin.replace("QQ2HQQ", "ZH2HQQ") + elif opt.productionMode == "ggzh": + if opt.decayExt == "_ZToQQ": + stxsBin = stxsBin.replace("GG2H", "GG2HQQ") + elif opt.decayExt == "_ZToNuNu": + stxsBin = stxsBin.replace("GG2HLL", "GG2HNUNU") + elif opt.productionMode == "thq": + stxsBin = stxsBin.replace("TH", "THQ") + elif opt.productionMode == "thw": + stxsBin = stxsBin.replace("TH", "THW") + + output_dir = f"{opt.inputTreeFile}/ws_{stxsBin}" + os.makedirs(output_dir, exist_ok=True) + output_file = os.path.join(output_dir, f"output_{stxsBin}_M{opt.inputMass}_pythia8_{stxsBin}.root") + print(f"[INFO] Creating workspace: {output_file}") + + fout = ROOT.TFile(output_file, "RECREATE") + + foutdir = fout.mkdir(inputTreeDir) + foutdir.cd() # IMPORTANT: switch to that directory + + ws = ROOT.RooWorkspace("cms_hgg_13TeV", "cms_hgg_13TeV") - # Add to workspace - getattr(ws,'import')(d) + + if 'mass' in df.columns: + df = df.rename(columns={'mass': 'CMS_hgg_mass'}) + reduced_df = df[mainVars ] + + var_names = add_vars_to_workspace(ws, reduced_df, stxsVar) + # for cat in cats: + + + # df_cat = df[df['cat'] == cat] + # print(f"[DEBUG] Dataset for category '{cat}' has {len(df_cat)} events before dropping NaNs.") + # print(f"[DEBUG] Columns available: {df_cat.columns.tolist()}") + # print(f"[DEBUG] Variables expected: {var_names}") + # aset = make_argset(ws, var_names) + # dset_name = f"{opt.productionMode}_{opt.inputMass}_{opt.year}_{cat}" + # dset = ROOT.RooDataSet(dset_name, dset_name, aset, ROOT.RooFit.WeightVar("weight")) + # numeric_var_names = [v for v in var_names if pd.api.types.is_numeric_dtype(df_cat[v])] + + # df_cat[var_names] = df_cat[var_names].apply(pd.to_numeric, errors='coerce') + # df_cat = df_cat.dropna(subset=var_names) + + # for row in df_cat[var_names].to_numpy(): + # for i, val in enumerate(row): + # aset[i].setVal(val) + # dset.add(aset, aset.getRealValue("weight")) + # getattr(ws, 'import')(dset) + + for cat in cats: + + + + df_cat = df[df['cat'] == cat] + + if len(df_cat) > skip_len: + df_cat = df_cat.iloc[:skip_len] + if opt.v: + print(f"[INFO] Truncated nominal category '{cat}' to {skip_len} entries.") + + + aset = make_argset(ws, var_names) # full list (workspace needs everything) + cat_renamed=cat#'_'.join(cat.split('_')[:-1]) + dset_name = f"{opt.productionMode}_{opt.year}_hgg_{opt.inputMass}_13TeV_{cat_renamed}" + dset = ROOT.RooDataSet(dset_name, dset_name, aset, ROOT.RooFit.WeightVar("weight")) + + # Only try to convert numeric columns + numeric_var_names = [v for v in var_names if v in df_cat.columns and pd.api.types.is_numeric_dtype(df_cat[v])] + df_cat[numeric_var_names] = df_cat[numeric_var_names].astype('float64') + df_cat = df_cat.dropna(subset=numeric_var_names) + + if opt.v: + print(f"[INFO] Category {cat} has {len(df_cat)} entries after cleaning.") + + # for row in df_cat[numeric_var_names].to_numpy(): + # for i, val in enumerate(row): + # aset[i].setVal(float(val)) + # dset.add(aset, aset.getRealValue("weight")) + for row in df_cat[numeric_var_names].itertuples(index=False, name=None): + for name, val in zip(numeric_var_names, row): + var = aset.find(name) + if var: # safeguard + var.setVal(float(val)) + dset.add(aset, aset.find("weight").getVal()) + + getattr(ws, 'import')(dset) + if opt.doSystematics: - # b) make RooDataHists for systematic variations - for s in systematics: - for direction in ['Up','Down']: - # Create mask for systematic variation - mask = (sdf['type']=='%s%s'%(s,direction))&(sdf['cat']==cat) - - # Define RooDataHist - hName = "%s_%s_%s_%s_%s%s01sigma"%(opt.productionMode,opt.inputMass,sqrts__,cat,s,direction) - - # Make argset: drop weight column for histogrammed observables - systematicsVarsDropWeight = [] - for var in systematicsVars: - if var != "weight": systematicsVarsDropWeight.append(var) - aset = make_argset(ws,systematicsVarsDropWeight) - - h = ROOT.RooDataHist(hName,hName,aset) - for row, weight in zip(sdf[mask][systematicsVarsDropWeight].to_numpy(),sdf[mask]["weight"].to_numpy()): - for i, val in enumerate(row): - aset[i].setVal(val) - h.add(aset,weight) - - # Add to workspace - getattr(ws,'import')(h) - - # Write WS to file - ws.Write() - - # Close file and delete workspace from heap - fout.Close() + def fast_sample_syst_single_file(dirpath, syst, direction, n): + """ + Load only ONE parquet file for each systematic variation, + take first n rows, and stop. + """ + + # Example matches: ...PileupUp.parquet, ...JERDown.parquet + files = [ + f for f in glob.glob(f"{dirpath}/*.parquet") + if syst in f and direction in f and "ws_" not in f + ] + + if not files: + return pd.DataFrame() + + # Pick the largest file (most likely to contain enough rows) + f = max(files, key=os.path.getsize) + + # Read only first n rows + try: + table = pq.read_table(f) + return table.to_pandas() + except Exception as e: + print(f"[ERROR] Could not read {f}: {e}") + return pd.DataFrame() + + + + for cat in cats: + catcopy=cat + + for syst in systematics: + for direction in ['Down',"Up"]:#, "Down"]: + syst_name = f"{syst}{direction}" + # print(f'systname={syst_name}') + + + merged_sys = fast_sample_syst_single_file(opt.inputTreeFile, syst, direction, skip_len) + + merged_sys['cat'] = merged_sys['pred_ia'].map(str).map(cat_dict['cat_dict']) + merged_sys = merged_sys[merged_sys['cat'] == cat] + + # if 'Down' in syst_name: + # print('print'+direction) + # print(merged_sys.tail()) + + + # catcopy = catcopy.replace(catcopy,catcopy.split('_merged')[0]) + # catcopy+='_merged' + # print(catcopy) + # syst_file = os.path.join(opt.inputTreeFile, f"{catcopy}_{syst_name}01sigma.parquet") + + # if not os.path.exists(syst_file): + # print(f"[WARNING] Missing systematic file: {syst_file}") + # continue + + # sdf = pd.read_parquet(syst_file) + sdf = merged_sys + if len(sdf) > skip_len: + sdf = sdf.iloc[:skip_len] + if opt.v: + print(f"[INFO] Truncated systematic '{syst_name}' for category '{cat}' to {skip_len} entries.") + + if sdf.empty: + if opt.v: + print(f"[WARNING] Empty systematic parquet:") # {syst_file}") + # continue + if 'mass' in sdf.columns: + sdf = sdf.rename(columns={'mass': 'CMS_hgg_mass'}) + + # If splitting: ensure STXS var + if stxsVar not in sdf.columns: + sdf[stxsVar] = stxsId + + # Clean and ensure needed vars + systematicsVarsDropWeight = [v for v in systematicsVars if v != 'weight'] + for v in systematicsVarsDropWeight: + if v not in sdf.columns: + print(f"[ERROR] Missing var {v} in {syst_file}") + break + + sdf = sdf.dropna(subset=systematicsVarsDropWeight + ['weight']) + + aset = make_argset(ws, systematicsVarsDropWeight) + hist_name = f"{opt.productionMode}_{opt.year}_hgg_{opt.inputMass}_13TeV_{catcopy}_{syst_name}01sigma" + # print(f"[DEBUG] Importing histogram: {hist_name}") + hist = ROOT.RooDataHist(hist_name, hist_name, aset) + + for row, weight in zip(sdf[systematicsVarsDropWeight].to_numpy(), sdf["weight"].to_numpy()): + for i, val in enumerate(row): + aset[i].setVal(float(val)) + hist.add(aset, weight) + + getattr(ws, 'import')(hist) + if opt.v: + print(f"[INFO] Imported systematics hist: {hist_name}") + if opt.v: + print(ws) + + + ws.Print('v') + ws.Write() + fout.Close() + + # up=0 + # down=0 + # ne=ws.data('BBH_FID_preEE_hgg_125_13TeV_RECO_ggH_0J_PTH_0_10') + # for i in range(ne.numEntries()): + # entry=ne.get(i) + # u=entry['weight_PileupUp'].getVal() + # d=entry['weight_PileupDown'].getVal() + # up+=u + # down+=d + # print(up) + # print(down) + + # print('now for ID SF:') + # up=0 + # down=0 + # ne=ws.data('BBH_FID_preEE_hgg_125_13TeV_RECO_ggH_0J_PTH_0_10') + # for i in range(ne.numEntries()): + # entry=ne.get(i) + # u=entry['weight_SF_photon_IDDown'].getVal() + # d=entry['weight_SF_photon_IDUp'].getVal() + # up+=u + # down+=d + # print(up) + # print(down) + +print("~~~~~~~~~~~~~~~~~~~~~~~~~ ALL WORKSPACES DONE ~~~~~~~~~~~~~~~~~~~~~~~~~") + + +print(' WARNING: In this setup, parquet files had background (pred=0). This got dropped when making RooWS!') + +debug= False + +if debug: + for i in merged.cat.unique(): + proc=opt.inputTreeFile.split('/')[-3] + n=f'{proc}_preEE_hgg_125_13TeV_{i}' + print(f'{i} and {merged[merged.cat==i].weight.sum()} vs root: {ws.data(n).Print()}') + print('\n') \ No newline at end of file diff --git a/Trees2WS/trees2ws_data.py b/Trees2WS/trees2ws_data.py index a99d78da0..9fb332aa9 100644 --- a/Trees2WS/trees2ws_data.py +++ b/Trees2WS/trees2ws_data.py @@ -1,147 +1,195 @@ # Script to convert data trees to RooWorkspace (compatible for finalFits) # Assumes tree names of the format: # * Data__category - -import os, sys -import re +import os, sys, re from optparse import OptionParser - -def get_options(): - parser = OptionParser() - parser.add_option('--inputConfig',dest='inputConfig', default="", help='Input config: specify list of variables/analysis categories') - parser.add_option('--inputTreeFile',dest='inputTreeFile', default=None, help='Input tree file') - parser.add_option('--outputWSDir',dest='outputWSDir', default=None, help='Output dir (default is same as input dir)') - parser.add_option('--applyMassCut',dest='applyMassCut', default=False, action="store_true", help='Apply cut on CMS_hgg_mass') - parser.add_option('--massCutRange',dest='massCutRange', default='100,180', help='CMS_hgg_mass cut range') - return parser.parse_args() -(opt,args) = get_options() - from collections import OrderedDict as od from importlib import import_module +import json import ROOT -import pandas +import pandas as pd import numpy as np -import uproot from commonTools import * from commonObjects import * +from tools.STXS_tools import * +def get_options(): + parser = OptionParser() + parser.add_option('--inputConfig', dest='inputConfig', default="", help='Input config file') + parser.add_option('--inputMass', dest='inputMass', default="125", help='Higgs mass') + parser.add_option('--inputTreeFile',dest='inputTreeFile', default="./output_0.root", help='Input tree file') + parser.add_option('--outputWSDir',dest='outputWSDir', default=None, help='Output dir (default is same as input dir)') + parser.add_option('--applyMassCut',dest='applyMassCut', default=False, action="store_true", help='Apply cut on CMS_hgg_mass') + parser.add_option('--massCutRange',dest='massCutRange', default='100,180', help='CMS_hgg_mass cut range') + parser.add_option('--categorisationConfig',default='category_STXS_stage1p2.json') + return parser.parse_args() + +(opt, args) = get_options() -print(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG TREES 2 WS (DATA) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ") def leave(): - print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HGG TREES 2 WS (END) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") - exit(0) - -# Function to add vars to workspace -def add_vars_to_workspace(_ws=None,_dataVars=None): - # Add intLumi var - intLumi = ROOT.RooRealVar("intLumi","intLumi",1000.,0.,999999999.) - intLumi.setConstant(True) - getattr(_ws,'import')(intLumi) - _vars = od() - for var in _dataVars: - if var == "CMS_hgg_mass": - _vars[var] = ROOT.RooRealVar(var,var,125.,100.,180.) - _vars[var].setBins(160) - elif var == "dZ": - _vars[var] = ROOT.RooRealVar(var,var,0.,-20.,20.) - _vars[var].setBins(40) - elif var == "weight": - _vars[var] = ROOT.RooRealVar(var,var,0.) - else: - _vars[var] = ROOT.RooRealVar(var,var,1.,-999999,999999) - _vars[var].setBins(1) - getattr(_ws,'import')(_vars[var],ROOT.RooFit.Silence()) - return _vars.keys() - -# Function to make RooArgSet -def make_argset(_ws=None,_varNames=None): - _aset = ROOT.RooArgSet() - for v in _varNames: _aset.add(_ws.var(v)) - return _aset - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Extract options from config file: -options = od() -if opt.inputConfig != '': - if os.path.exists( opt.inputConfig ): - - # Import config options - _cfg = import_module(re.sub(".py","",opt.inputConfig)).trees2wsCfg - - #Extract options - inputTreeDir = _cfg['inputTreeDir'] - dataVars = _cfg['dataVars'] - cats = _cfg['cats'] - - else: - print("[ERROR] %s config file does not exist. Leaving..."%opt.inputConfig) + print("~~~~~~~~~~~~~~~~~~~~~~~~~ SCRIPT END ~~~~~~~~~~~~~~~~~~~~~~~~~") + exit(0) + +# Load config +if opt.inputConfig == '' or not os.path.exists(opt.inputConfig): + print(f"[ERROR] Config file {opt.inputConfig} not found.") leave() -else: - print("[ERROR] Please specify config file to run from. Leaving..."%opt.inputConfig) - leave() - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# UPROOT file -f = uproot.open(opt.inputTreeFile) -if inputTreeDir == '': listOfTreeNames == f.keys() -else: listOfTreeNames = f[inputTreeDir].keys() -# If cats = 'auto' then determine from list of trees + +_cfg = import_module(re.sub(".py$", "", opt.inputConfig)).trees2wsCfg + +inputTreeDir = _cfg['inputTreeDir'].rstrip('/') +dataVars = _cfg['dataVars'] +stxsVar = _cfg['stxsVar'] +cats = _cfg['cats'] + +with open(opt.categorisationConfig, "r") as f: + cat_dict = json.load(f) +merged=pd.DataFrame([]) +for file in glob.glob(opt.inputTreeFile+'/*/*.parquet'): + merged = pd.concat([merged,pd.read_parquet(file)]) + +# Auto-detect categories from .parquet files in inputTreeFile directory if cats == 'auto': - cats = [] - for tn in listOfTreeNames: - if "sigma" in tn: continue - c = tn.split("_%s_"%sqrts__)[-1].split(";")[0] - cats.append(c) - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Open input ROOT file -f = ROOT.TFile(opt.inputTreeFile) - -# Open output ROOT file and initiate workspace to store RooDataSets -if opt.outputWSDir is not None: outputWSDir = opt.outputWSDir+"/ws" -else: outputWSDir = "/".join(opt.inputTreeFile.split("/")[:-1])+"/ws" -if not os.path.exists(outputWSDir): os.system("mkdir %s"%outputWSDir) -outputWSFile = outputWSDir+"/"+opt.inputTreeFile.split("/")[-1] -print(" --> Creating output workspace: (%s)"%outputWSFile) -fout = ROOT.TFile(outputWSFile,"RECREATE") -foutdir = fout.mkdir(inputWSName__.split("/")[0]) -foutdir.cd() -ws = ROOT.RooWorkspace(inputWSName__.split("/")[1],inputWSName__.split("/")[1]) - -# Add variables to workspace -varNames = add_vars_to_workspace(ws,dataVars) - -# Make argset -aset = make_argset(ws,varNames) - -# Loop over categories and -for cat in cats: - print(" --> Extracting events from category: %s"%cat) - if inputTreeDir == '': treeName = "Data_%s_%s"%(sqrts__,cat) - else: treeName = "%s/Data_%s_%s"%(inputTreeDir,sqrts__,cat) - print(" * tree: %s"%treeName) - t = f.Get(treeName) - - # Define dataset for cat - dname = "Data_%s_%s"%(sqrts__,cat) - d = ROOT.RooDataSet(dname,dname,aset,ROOT.RooFit.WeightVar('weight')) - - # Loop over events in tree and add to dataset with weight 1 - for ev in t: - if opt.applyMassCut: - if(getattr(ev,"CMS_hgg_mass") < float(opt.massCutRange.split(",")[0])) | (getattr(ev,"CMS_hgg_mass") > float(opt.massCutRange.split(",")[1])): continue - for var in dataVars: - if var == "weight": continue - ws.var(var).setVal(getattr(ev,var)) - d.add(aset,1.) - - # Add dataset to worksapce - getattr(ws,'import')(d) - -# Write workspace to file -ws.Write() - -# Close file -fout.Close() + if not os.path.isdir(opt.inputTreeFile): + print(f"[ERROR] Input directory '{opt.inputTreeFile}' does not exist.") + leave() + + cats = [] + for cat in merged.pred_ia.unique(): + if cat!=0: + cats.append(cat_dict['cat_dict'][str(cat)]) + + if not cats: + print(f"[ERROR] No parquet files found in '{opt.inputTreeFile}'") + leave() + else: + print(f"[INFO] Detected categories: {cats}") + +cats=list(cat_dict['cat_dict'].values() )# ensure ALL cats are included + + + +# Combine data +data = pd.DataFrame() + +merged['cat'] = merged['pred_ia'].map(str).map(cat_dict['cat_dict']) +data=merged.copy() +# ~~~~~~~ RooWorkspace Helpers ~~~~~~~ +def add_vars_to_workspace(ws, df, stxsVar): + intLumi = ROOT.RooRealVar("intLumi", "intLumi", 1000., 0., 999999999.) + intLumi.setConstant(True) + getattr(ws, 'import')(intLumi) + + rvars = od() + for col in df.columns: + if col in ['cat', 'type', stxsVar, '']: continue + if col == "CMS_hgg_mass": + rvar = ROOT.RooRealVar(col, col, 125., 100., 180.) + rvar.setBins(160) + elif col == "dZ": + rvar = ROOT.RooRealVar(col, col, 0., -20., 20.) + rvar.setBins(40) + elif col == "weight": + rvar = ROOT.RooRealVar(col, col, 0.) + else: + rvar = ROOT.RooRealVar(col, col, 1., -999999, 999999) + rvar.setBins(1) + getattr(ws, 'import')(rvar, ROOT.RooFit.Silence()) + rvars[col] = rvar + return list(rvars.keys()) + +def make_argset(ws, var_names): + aset = ROOT.RooArgSet() + for name in var_names: + aset.add(ws.var(name)) + return aset + +print('A') +data[stxsVar]=stxsVar +# ~~~~~~~ RooWorkspace Creation ~~~~~~~ +for stxsId in data[stxsVar].unique(): + print('B') + df = data[data[stxsVar] == stxsId] + + + + output_dir = f"{opt.inputTreeFile}/ws_data" + os.makedirs(output_dir, exist_ok=True) + output_file = os.path.join(output_dir, f"allData_data.root") + print(f"[INFO] Creating workspace: {output_file}") + + fout = ROOT.TFile(output_file, "RECREATE") + + foutdir = fout.mkdir(inputTreeDir) + foutdir.cd() # IMPORTANT: switch to that directory + + ws = ROOT.RooWorkspace("cms_hgg_13TeV", "cms_hgg_13TeV") + + + if 'mass' in df.columns: + df = df.rename(columns={'mass': 'CMS_hgg_mass'}) + reduced_df = df[dataVars] + + + var_names = add_vars_to_workspace(ws, reduced_df, stxsVar) + # for cat in cats: + + + # df_cat = df[df['cat'] == cat] + # print(f"[DEBUG] Dataset for category '{cat}' has {len(df_cat)} events before dropping NaNs.") + # print(f"[DEBUG] Columns available: {df_cat.columns.tolist()}") + # print(f"[DEBUG] Variables expected: {var_names}") + # aset = make_argset(ws, var_names) + # dset_name = f"{opt.productionMode}_{opt.inputMass}_{opt.year}_{cat}" + # dset = ROOT.RooDataSet(dset_name, dset_name, aset, ROOT.RooFit.WeightVar("weight")) + # numeric_var_names = [v for v in var_names if pd.api.types.is_numeric_dtype(df_cat[v])] + + # df_cat[var_names] = df_cat[var_names].apply(pd.to_numeric, errors='coerce') + # df_cat = df_cat.dropna(subset=var_names) + + # for row in df_cat[var_names].to_numpy(): + # for i, val in enumerate(row): + # aset[i].setVal(val) + # dset.add(aset, aset.getRealValue("weight")) + # getattr(ws, 'import')(dset) + + for cat in cats: + + + + df_cat = df[df['cat'] == cat] + + + + + aset = make_argset(ws, var_names) # full list (workspace needs everything) + cat_renamed=cat#'_'.join(cat.split('_')[1:-1]) + dset_name = f"Data_13TeV_{cat_renamed}" + dset = ROOT.RooDataSet(dset_name, dset_name, aset, ROOT.RooFit.WeightVar("weight")) + + # Only try to convert numeric columns + numeric_var_names = [v for v in var_names if v in df_cat.columns and pd.api.types.is_numeric_dtype(df_cat[v])] + df_cat[numeric_var_names] = df_cat[numeric_var_names].apply(pd.to_numeric, errors='coerce') + df_cat = df_cat.dropna(subset=numeric_var_names) + + print(f"[INFO] Category {cat} has {len(df_cat)} entries after cleaning.") + + for row in df_cat[numeric_var_names].itertuples(index=False, name=None): + for name, val in zip(numeric_var_names, row): + var = aset.find(name) + if var: # safeguard + var.setVal(float(val)) + + dset.add(aset, aset.find("weight").getVal()) + + getattr(ws, 'import')(dset) + + + print(ws) + ws.Print('v') + ws.Write() + fout.Close() + +print("~~~~~~~~~~~~~~~~~~~~~~~~~ ALL WORKSPACES DONE ~~~~~~~~~~~~~~~~~~~~~~~~~") \ No newline at end of file diff --git a/check_roows.py b/check_roows.py new file mode 100644 index 000000000..1dd671929 --- /dev/null +++ b/check_roows.py @@ -0,0 +1,28 @@ +import ROOT +from optparse import OptionParser +import glob +parser = OptionParser() +parser.add_option("--path") +(opt,args)=parser.parse_args() + +file_list=glob.glob(f'{opt.path}/*') +# proc_x_stxs_x_era=['BBH_FID', 'GG2HLL_FWDH' ,'GG2HLL_PTV_0_75', 'GG2HLL_PTV_150_250_0J', 'GG2HLL_PTV_150_250_GE1J' ,'GG2HLL_PTV_75_150', 'GG2HLL_PTV_GT250' ,'GG2HNUNU_FWDH', 'GG2HNUNU_PTV_0_75' ,'GG2HNUNU_PTV_150_250_0J', 'GG2HNUNU_PTV_150_250_GE1J', 'GG2HNUNU_PTV_75_150', 'GG2HNUNU_PTV_GT250' ,'GG2HQQ_0J_PTH_0_10' ,'GG2HQQ_0J_PTH_GT10' ,'GG2HQQ_1J_PTH_0_60', 'GG2HQQ_1J_PTH_120_200', 'GG2HQQ_1J_PTH_60_120' ,'GG2HQQ_GE2J_MJJ_0_350_PTH_0_60', 'GG2HQQ_GE2J_MJJ_0_350_PTH_120_200' ,'GG2HQQ_GE2J_MJJ_0_350_PTH_60_120' ,'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'GG2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'GG2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'GG2HQQ_PTH_200_300' ,'GG2HQQ_PTH_300_450', 'GG2HQQ_PTH_450_650', 'GG2HQQ_PTH_GT650' ,'GG2H_0J_PTH_0_10' ,'GG2H_0J_PTH_GT10' ,'GG2H_1J_PTH_0_60', 'GG2H_1J_PTH_120_200', 'GG2H_1J_PTH_60_120' ,'GG2H_FWDH', 'GG2H_GE2J_MJJ_0_350_PTH_0_60' ,'GG2H_GE2J_MJJ_0_350_PTH_120_200' ,'GG2H_GE2J_MJJ_0_350_PTH_60_120', 'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'GG2H_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' ,'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'GG2H_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' ,'GG2H_PTH_200_300' ,'GG2H_PTH_300_450' ,'GG2H_PTH_450_650' ,'GG2H_PTH_GT650', 'THQ_FID', 'THQ_FWDH', 'THW_FID', 'THW_FWDH' ,'TTH_PTH_0_60','TTH_PTH_120_200', 'TTH_PTH_200_300' ,'TTH_PTH_60_120', 'TTH_PTH_GT300' ,'VBF_0J' ,'VBF_1J' ,'VBF_FWDH', 'VBF_GE2J_MJJ_0_60', 'VBF_GE2J_MJJ_120_350' ,'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'VBF_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' ,'VBF_GE2J_MJJ_60_120' ,'VBF_GE2J_MJJ_GT350_PTH_GT200' 'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'VBF_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' ,'WMINUSH2HLNU_FWDH', 'WMINUSH2HLNU_PTV_0_75' ,'WMINUSH2HLNU_PTV_150_250_0J' ,'WMINUSH2HLNU_PTV_150_250_GE1J', 'WMINUSH2HLNU_PTV_75_150' ,'WMINUSH2HLNU_PTV_GT250', 'WMINUSH2HQQ_0J', 'WMINUSH2HQQ_1J', 'WMINUSH2HQQ_FWDH' ,'WMINUSH2HQQ_GE2J_MJJ_0_60', 'WMINUSH2HQQ_GE2J_MJJ_120_350' ,'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'WMINUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25' ,'WMINUSH2HQQ_GE2J_MJJ_60_120' ,'WMINUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'WMINUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HLNU_FWDH', 'WPLUSH2HLNU_PTV_0_75' ,'WPLUSH2HLNU_PTV_150_250_0J' ,'WPLUSH2HLNU_PTV_150_250_GE1J' ,'WPLUSH2HLNU_PTV_75_150' ,'WPLUSH2HLNU_PTV_GT250', 'WPLUSH2HQQ_0J' ,'WPLUSH2HQQ_1J' ,'WPLUSH2HQQ_GE2J_MJJ_0_60', 'WPLUSH2HQQ_GE2J_MJJ_120_350' ,'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'WPLUSH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'WPLUSH2HQQ_GE2J_MJJ_60_120' ,'WPLUSH2HQQ_GE2J_MJJ_GT350_PTH_GT200', 'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'WPLUSH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25' ,'ZH2HLL_FWDH' ,'ZH2HLL_PTV_0_75' ,'ZH2HLL_PTV_150_250_0J', 'ZH2HLL_PTV_150_250_GE1J', 'ZH2HLL_PTV_75_150' ,'ZH2HLL_PTV_GT250' ,'ZH2HNUNU_FWDH' ,'ZH2HNUNU_PTV_0_75' ,'ZH2HNUNU_PTV_150_250_0J', 'ZH2HNUNU_PTV_150_250_GE1J' ,'ZH2HNUNU_PTV_75_150' ,'ZH2HNUNU_PTV_GT250', 'ZH2HQQ_0J', 'ZH2HQQ_1J', 'ZH2HQQ_FWDH' ,'ZH2HQQ_GE2J_MJJ_0_60', 'ZH2HQQ_GE2J_MJJ_120_350', 'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_0_25' ,'ZH2HQQ_GE2J_MJJ_350_700_PTH_0_200_PTHJJ_GT25', 'ZH2HQQ_GE2J_MJJ_60_120' ,'ZH2HQQ_GE2J_MJJ_GT350_PTH_GT200' ,'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_0_25' ,'ZH2HQQ_GE2J_MJJ_GT700_PTH_0_200_PTHJJ_GT25'] + +removed_for_now=['THQ_FID','THW_FID',"VBF_1J"] +errors=[] + +# for proc in proc_x_stxs_x_era: +for file in file_list: + proc=file + if proc not in removed_for_now: + try: + # WSFileName = f"{opt.path}/output_{proc}_M125_pythia8_{proc}.root" + WSFileName =file + f = ROOT.TFile(WSFileName,"read") + f.Get('tagsDumper/cms_hgg_13TeV').Print() + except Exception as e: + print(f'error with {proc} in {e}') + errors.append(f'error with {proc} in {e}') + +for i in errors: + print(i) diff --git a/run_workflow_standalone.sh b/run_workflow_standalone.sh new file mode 100644 index 000000000..e69de29bb diff --git a/tools/commonTools.py b/tools/commonTools.py index 34e4d57ab..69cdbc4c7 100644 --- a/tools/commonTools.py +++ b/tools/commonTools.py @@ -57,6 +57,7 @@ def extractListOfCats( _listOfWSFileNames ): def extractListOfCatsFromData( _fileName ): f = ROOT.TFile(_fileName) ws = f.Get(inputWSName__) + print(ws) allData = ws.allData() cats = [] for d in allData: