Skip to content

Commit

Permalink
further UL updates
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueledimarco committed Dec 6, 2022
1 parent c39a7ed commit bbe5dcc
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Background/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'inputWSDir':'cards/cards_current/data_Run2', # 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':'2022-08-01', # extension to add to output directory
'ext':'2022-11-21', # extension to add to output directory
'year':'combined', # Use combined when merging all years in category (for plots)
'xvar': 'CMS_hgg_mass', # not yet used, should be passed to the C++ macros
'plotdir': 'plots',
Expand Down
3 changes: 2 additions & 1 deletion Datacard/tools/calcSystematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def addConstantSyst(sd,_syst,options):

def getValueFromJson(row,uncertainties,sname):
# uncertainties is a dict of the form proc:{sname:X}
p = re.sub("_2016_%s"%decayMode,"",row['proc'])
p = re.sub("_2016preVFP_%s"%decayMode,"",row['proc'])
p = re.sub("_2016postVFP_%s"%decayMode,"",p)
p = re.sub("_2017_%s"%decayMode,"",p)
p = re.sub("_2018_%s"%decayMode,"",p)
if p in uncertainties:
Expand Down
4 changes: 2 additions & 2 deletions Signal/config_test_2016postVFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
signalScriptCfg = {
# Setup
'inputWSDir':'cards/cards_current/signal_%s'%_year,
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'cats':'VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7', # if auto: inferred automatically from (0) workspace
'ext':'2022-10-28_year%s'%_year,
'ext':'2022-11-21_year%s'%_year,
'analysis':'AC', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py)
'year':'%s'%_year, # Use 'combined' if merging all years: not recommended
'massPoints':'120,125,130',
Expand Down
4 changes: 2 additions & 2 deletions Signal/config_test_2016preVFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
signalScriptCfg = {
# Setup
'inputWSDir':'cards/cards_current/signal_%s'%_year,
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'cats':'VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7', # if auto: inferred automatically from (0) workspace
'ext':'2022-10-28_year%s'%_year,
'ext':'2022-11-21_year%s'%_year,
'analysis':'AC', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py)
'year':'%s'%_year, # Use 'combined' if merging all years: not recommended
'massPoints':'120,125,130',
Expand Down
4 changes: 2 additions & 2 deletions Signal/config_test_2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
signalScriptCfg = {
# Setup
'inputWSDir':'cards/cards_current/signal_%s'%_year,
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'cats':'VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7', # if auto: inferred automatically from (0) workspace
'ext':'2022-10-28_year%s'%_year,
'ext':'2022-11-21_year%s'%_year,
'analysis':'AC', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py)
'year':'%s'%_year, # Use 'combined' if merging all years: not recommended
'massPoints':'120,125,130',
Expand Down
4 changes: 2 additions & 2 deletions Signal/config_test_2018.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
signalScriptCfg = {
# Setup
'inputWSDir':'cards/cards_current/signal_%s'%_year,
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'procs':'GG2H,VBF,VBF_ALT0L1,VBF_ALT0L1f05ph0,VBF_ALT0L1Zg,VBF_ALT0L1Zgf05ph0,VBF_ALT0M,VBF_ALT0Mf05ph0,VBF_ALT0PH,VBF_ALT0PHf05ph0,VBF_ALT0PM,WH_WM,WH_WP,WH_ALT0L1f05ph0,WH_ALT0PH,WH_ALT0PHf05ph0,WH_ALT0PM,ZH,ZH_ALT0L1,ZH_ALT0L1f05ph0,ZH_ALT0L1Zg,ZH_ALT0L1Zgf05ph0,ZH_ALT0M,ZH_ALT0Mf05ph0,ZH_ALT0PH,ZH_ALT0PHf05ph0,ZH_ALT0PM,TTH,TTH_ALT0M,TTH_ALT0Mf05ph0,TTH_ALT0PM', # if auto: inferred automatically from filenames
'cats':'VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7', # if auto: inferred automatically from (0) workspace
'ext':'2022-10-28_year%s'%_year,
'ext':'2022-11-21_year%s'%_year,
'analysis':'AC', # To specify which replacement dataset mapping (defined in ./python/replacementMap.py)
'year':'%s'%_year, # Use 'combined' if merging all years: not recommended
'massPoints':'120,125,130',
Expand Down
10 changes: 5 additions & 5 deletions Signal/run_sequence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ elif [[ $STEP == "calcPhotonSyst" ]]; then
elif [[ $STEP == 'signalFit' ]]; then
python RunSignalScripts.py --inputConfig config_test_${YEAR}.py --mode signalFit --modeOpts="--doPlots --outdir plots" ${DROPT}
elif [[ $STEP == 'packager' ]]; then
python RunPackager.py --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --inputWSDir cards/cards_current/signal_${YEAR} --exts 2022-09-09_year2016,2022-09-09_year2017,2022-09-09_year2018 --mergeYears ${DROPT}
python RunPackager.py --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --inputWSDir cards/cards_current/signal_${YEAR} --exts 2022-11-21_year2016preVFP,2022-11-21_year2016postVFP,2022-11-21_year2017,2022-11-21_year2018 --mergeYears ${DROPT}
elif [[ $STEP == 'plotter' ]]; then
# just plot all the (SM) processes, all the categories, all the years together. Can be split with --year ${YEAR}. Do not include BSM to maintain the expected total yield for SM
python RunPlotter.py --procs "GG2H,VBF,VH,TTH" --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --year 2016,2017,2018 --ext packaged --outdir plots
python RunPlotter.py --procs "GG2H,VBF,WH_WP,WH_WM,TTH" --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --year 2016preVFP,2016postVFP,2017,2018 --ext packaged --outdir plots
# split by category, all processes together
for i in 1 3 5 6 7
do
python RunPlotter.py --procs "GG2H,VBF,VH,TTH" --cats "VBFTag_$i" --year 2016,2017,2018 --ext packaged --outdir plots --translateCats ../Plots/cats.json
python RunPlotter.py --procs "GG2H,VBF,WH_WP,WH_WM,TTH" --cats "VBFTag_$i" --year 2016preVFP,2016postVFP,2017,2018 --ext packaged --outdir plots --translateCats ../Plots/cats.json
done
# split by process, all the categories together
for proc in "GG2H" "VBF" "VBF_ALT0M" "VBF_ALT0Mf05" "VBF_ALT0PH" "VBF_ALT0PHf05" "VBF_ALTL1" "VBF_ALTL1f05" "VBF_ALTL1Zg" "VBF_ALTL1Zgf05" "VH" "TTH"
for proc in "GG2H" "VBF" "VBF_ALT0M" "VBF_ALT0Mf05" "VBF_ALT0PH" "VBF_ALT0PHf05" "VBF_ALTL1" "VBF_ALTL1f05" "VBF_ALTL1Zg" "VBF_ALTL1Zgf05" "WH_WP" "WH_WM" "WH_ALT0L1f05ph0" "WH_ALT0PH" "WH_ALT0PHf05ph0" "WH_ALT0PM" "ZH_ALT0L1" "ZH_ALT0L1f05ph0" "ZH_ALT0L1Zg" "ZH_ALT0L1Zgf05ph0" "ZH_ALT0M" "ZH_ALT0Mf05ph0" "ZH_ALT0PH" "ZH_ALT0PHf05ph0" "ZH_ALT0PM" "ZH" "TTH" "TTH_ALT0M" "TTH_ALT0Mf05ph0" "TTH_ALT0PM"
do
python RunPlotter.py --procs $proc --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --year 2016,2017,2018 --ext packaged --outdir plots --translateProcs ../Plots/jcp.json
python RunPlotter.py --procs $proc --cats "VBFTag_1,VBFTag_3,VBFTag_5,VBFTag_6,VBFTag_7" --year 2016preVFP,2016postVFP,2017,2018 --ext packaged --outdir plots --translateProcs ../Plots/jcp.json
done
else
echo "Step $STEP is not one among fTest, signalFit, packager, plotter. Exiting."
Expand Down
7 changes: 7 additions & 0 deletions Signal/tools/XSBRMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,12 @@
globalXSBRMap['AC']['GG2H'] = {'mode':'ggH'}
globalXSBRMap['AC']['VBF'] = {'mode':'qqH'}
globalXSBRMap['AC']['TTH'] = {'mode':'ttH'}
globalXSBRMap['AC']['WH'] = {'mode':'WH'}
globalXSBRMap['AC']['WH_WM'] = {'mode':'WH','factor':0.5}
globalXSBRMap['AC']['WH_WP'] = {'mode':'WH','factor':0.5}
globalXSBRMap['AC']['ZH'] = {'mode':'qqZH'}
globalXSBRMap['AC']['VH'] = {'mode':'WH','factor':BR_W_qq} # not fully correct. Use the samples spli by W and Z
globalXSBRMap['AC']['VBF_ALT'] = {'mode':'qqH'} # not sure it is correct. From the spline plot it seems OK: takes the MH=125 GeV value from JHU sample and then extrapolate with the relative ratio of qqH SM
globalXSBRMap['AC']['TTH_ALT'] = {'mode':'ttH'}
globalXSBRMap['AC']['WH_ALT'] = {'mode':'WH'}
globalXSBRMap['AC']['ZH_ALT'] = {'mode':'qqZH'}
2 changes: 1 addition & 1 deletion Signal/tools/plottingTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,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}
colorMap = {'2016':38,'2016preVFP': 38, '2016postVFP': 35,'2017':30,'2018':46}
canv = ROOT.TCanvas("c","c",650,600)
canv.SetBottomMargin(0.12)
canv.SetLeftMargin(0.15)
Expand Down

0 comments on commit bbe5dcc

Please sign in to comment.