Skip to content

Commit

Permalink
Merge pull request #14 from emanueledimarco/vbfac-dev
Browse files Browse the repository at this point in the history
Developments to re-include all the STXS cats to the anomalous couplings fit
  • Loading branch information
emanueledimarco committed Feb 14, 2023
2 parents 594ca8d + bb11962 commit 6c96515
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 80 deletions.
1 change: 1 addition & 0 deletions Signal/RunPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,5 @@ def get_options():
outdir="%s/%s/Plots"%(opt.outdir,opt.ext)
if not os.path.isdir(outdir): os.system("mkdir -p %s"%outdir)
if os.path.exists("/afs/cern.ch"): os.system("cp /afs/cern.ch/user/g/gpetrucc/php/index.php "+outdir)
elif os.path.exists("/cmshome/dimarcoe"): s.system("cp /cmshome/dimarcoe/php/index.php "+outdir)
plotSignalModel(hists,opt,_outdir=outdir)
12 changes: 6 additions & 6 deletions Signal/config_test_2016postVFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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,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-11-21_year%s'%_year,
'inputWSDir':'cards/signal_%s'%_year,
'procs':'auto',
'cats':'auto',
'ext':'2023-02-13_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 All @@ -21,6 +21,6 @@
'smears':'HighR9EBPhi,HighR9EBRho,HighR9EEPhi,HighR9EERho,LowR9EBPhi,LowR9EBRho,LowR9EEPhi,LowR9EERho', # separate nuisance per year

# Job submission options
'batch':'condor', # ['condor','SGE','IC','local']
'queue':'espresso'
'batch':'Rome', # ['condor','SGE','IC','Rome','local']
'queue':'cmsan'
}
12 changes: 6 additions & 6 deletions Signal/config_test_2016preVFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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,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-11-21_year%s'%_year,
'inputWSDir':'cards/signal_%s'%_year,
'procs':'auto',
'cats':'auto',
'ext':'2023-02-13_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 All @@ -21,6 +21,6 @@
'smears':'HighR9EBPhi,HighR9EBRho,HighR9EEPhi,HighR9EERho,LowR9EBPhi,LowR9EBRho,LowR9EEPhi,LowR9EERho', # separate nuisance per year

# Job submission options
'batch':'condor', # ['condor','SGE','IC','local']
'queue':'espresso'
'batch':'Rome', # ['condor','SGE','IC','Rome','local']
'queue':'cmsan'
}
12 changes: 6 additions & 6 deletions Signal/config_test_2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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,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-11-21_year%s'%_year,
'inputWSDir':'cards/signal_%s'%_year,
'procs':'auto',
'cats':'auto',
'ext':'2023-02-13_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 All @@ -21,6 +21,6 @@
'smears':'HighR9EBPhi,HighR9EBRho,HighR9EEPhi,HighR9EERho,LowR9EBPhi,LowR9EBRho,LowR9EEPhi,LowR9EERho', # separate nuisance per year

# Job submission options
'batch':'condor', # ['condor','SGE','IC','local']
'queue':'espresso'
'batch':'Rome', # ['condor','SGE','IC','Rome','local']
'queue':'cmsan'
}
12 changes: 6 additions & 6 deletions Signal/config_test_2018.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

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,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-11-21_year%s'%_year,
'inputWSDir':'cards/signal_%s'%_year,
'procs':'auto',
'cats':'auto',
'ext':'2023-02-13_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 All @@ -21,6 +21,6 @@
'smears':'HighR9EBPhi,HighR9EBRho,HighR9EEPhi,HighR9EERho,LowR9EBPhi,LowR9EBRho,LowR9EEPhi,LowR9EERho', # separate nuisance per year

# Job submission options
'batch':'condor', # ['condor','SGE','IC','local']
'queue':'espresso'
'batch':'Rome', # ['condor','SGE','IC','Rome','local']
'queue':'cmsan'
}
36 changes: 22 additions & 14 deletions Signal/run_sequence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ shift
done

echo "Requested to run the step ${STEP} for the year: ${YEAR}"
if [[ $YEAR < 2016 || $YEAR>2018 ]]; then
if [[ $YEAR != "all" && ($YEAR < 2016 || $YEAR>2018) ]]; then
echo "Year $YEAR does not belong to Run2. Exiting."
exit
fi
Expand All @@ -44,29 +44,37 @@ if [[ $DR ]]; then
DROPT=" --printOnly "
fi

if [[ $STEP == "fTest" ]]; then
python RunSignalScripts.py --inputConfig config_test_${YEAR}.py --mode fTest --modeOpts "--doPlots --outdir plots --nProcsToFTest -1" ${DROPT}
elif [[ $STEP == "calcPhotonSyst" ]]; then
python RunSignalScripts.py --inputConfig config_test_${YEAR}.py --mode calcPhotonSyst ${DROPT}
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-11-21_year2016preVFP,2022-11-21_year2016postVFP,2022-11-21_year2017,2022-11-21_year2018 --mergeYears ${DROPT}
elif [[ $STEP == 'plotter' ]]; then
years=("2016preVFP" "2016postVFP" "2017" "2018")

for year in ${years[*]}
do
echo "====> Running for year $year"
if [[ $year == $YEAR ]] || [[ $YEAR == "all" ]]; then
if [[ $STEP == "fTest" ]]; then
python RunSignalScripts.py --inputConfig config_test_${year}.py --mode fTest --modeOpts "--doPlots --outdir plots --nProcsToFTest -1" ${DROPT}
elif [[ $STEP == "calcPhotonSyst" ]]; then
python RunSignalScripts.py --inputConfig config_test_${year}.py --mode calcPhotonSyst ${DROPT}
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 "auto" --inputWSDir cards/signal_${year} --exts 2022-11-21_year2016preVFP,2022-11-21_year2016postVFP,2022-11-21_year2017,2022-11-21_year2018 --mergeYears ${DROPT}
fi
fi
done

if [[ $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,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,WH_WP,WH_WM,TTH" --cats "VBFTag_$i" --year 2016preVFP,2016postVFP,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" "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 2016preVFP,2016postVFP,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."
fi


2 changes: 1 addition & 1 deletion Signal/scripts/calcPhotonSyst.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,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_%s_%s"%(procToData(_proc),sqrts__,opt.cat)
_nominalDataName = "%s_125_%s_%s"%(procToData(_proc),sqrts__,opt.cat)
data = data.append({'proc':_proc,'cat':opt.cat,'inputWSFile':_WSFileName,'nominalDataName':_nominalDataName}, ignore_index=True, sort=False)

# Loop over rows in dataFrame and open ws
Expand Down
5 changes: 3 additions & 2 deletions Signal/scripts/fTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def get_options():
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"%(procToData(proc),sqrts__,opt.cat)),aset)
# print "===> In file ",WSFileName," look for roodataset = ","%s_%s_%s_%s"%(procToData(proc),opt.mass,sqrts__,opt.cat)
d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procToData(proc),opt.mass,sqrts__,opt.cat)),aset)
df.loc[len(df)] = [proc,d.sumEntries(),1,1]
inputWS.Delete()
f.Close()
Expand All @@ -90,7 +91,7 @@ def get_options():
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"%(procToData(proc),sqrts__,opt.cat)),aset)
d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procToData(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")

Expand Down
4 changes: 2 additions & 2 deletions Signal/scripts/signalFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_options():
WSFileName = glob.glob("%s/output*%s*.root"%(opt.inputWSDir,MHNominal))[0]
f = ROOT.TFile(WSFileName,"read")
inputWS = f.Get(inputWSName__)
d = reduceDataset(inputWS.data("%s_%s_%s"%(procToData(opt.proc),sqrts__,opt.cat)),aset)
d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procToData(opt.proc),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()
Expand Down Expand Up @@ -156,7 +156,7 @@ def get_options():
WSFileName = glob.glob("%s/output*%s*%s.root"%(opt.inputWSDir,mp,procRVFit))[0]
f = ROOT.TFile(WSFileName,"read")
inputWS = f.Get(inputWSName__)
d = reduceDataset(inputWS.data("%s_%s_%s"%(procToData(procRVFit),sqrts__,catRVFit)),aset)
d = reduceDataset(inputWS.data("%s_%s_%s_%s"%(procToData(procRVFit),mp,sqrts__,catRVFit)),aset)
nominalDatasets[mp] = d.Clone()
if opt.skipVertexScenarioSplit: datasetRVForFit[mp] = d
else: datasetRVForFit[mp] = splitRVWV(d,aset,mode="RV")
Expand Down
11 changes: 6 additions & 5 deletions Signal/tools/submissionTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def writeSubFiles(_opts):
_fsub.close()

# SGE...
if (_opts['batch'] == "IC")|(_opts['batch'] == "SGE")|(_opts['batch'] == "local" ):
if (_opts['batch'] == "IC")|(_opts['batch'] == "SGE")|(_opts['batch'] == "Rome")|(_opts['batch'] == "local" ):
_executable = "sub_%s_%s"%(_opts['mode'],_opts['ext'])

# Write details depending on mode
Expand Down Expand Up @@ -205,8 +205,9 @@ def submitFiles(_opts):
print " --> Finished submitting files"

# SGE
elif _opts['batch'] in ['IC','SGE']:
elif _opts['batch'] in ['IC','SGE','Rome']:
_executable = "sub_%s_%s"%(_opts['mode'],_opts['ext'])
_subcmd = 'bsub' if _opts['batch']=='Rome' else 'qsub'

# Extract job opts
jobOptsStr = _opts['jobOpts']
Expand All @@ -217,19 +218,19 @@ def submitFiles(_opts):
for cidx in range(_opts['nCats']):
pcidx = pidx*_opts['nCats']+cidx
_subfile = "%s/%s_%g"%(_jobdir,_executable,pcidx)
cmdLine = "qsub -q hep.q %s -o %s.log -e %s.err %s.sh"%(jobOptsStr,_subfile,_subfile,_subfile)
cmdLine = "%s -q %s %s -o %s.log -e %s.err %s.sh"%(_subcmd,_opts['queue'],jobOptsStr,_subfile,_subfile,_subfile)
run(cmdLine)
# Separate submission per category
elif( _opts['mode'] == "packageSignal" )|( _opts['mode'] == "fTest" )|( _opts['mode'] == "calcPhotonSyst" )|(( _opts['mode'] == "signalFit" )&( _opts['groupSignalFitJobsByCat'] )):
for cidx in range(_opts['nCats']):
c = _opts['cats'].split(",")[cidx]
_subfile = "%s/%s_%s"%(_jobdir,_executable,c)
cmdLine = "qsub -q hep.q %s -o %s.log -e %s.err %s.sh"%(jobOptsStr,_subfile,_subfile,_subfile)
cmdLine = "%s -q %s %s -o %s.log -e %s.err %s.sh"%(_subcmd,_opts['queue'],jobOptsStr,_subfile,_subfile,_subfile)
run(cmdLine)
# Single submission
elif(_opts['mode'] == "getEffAcc")|(_opts['mode'] == "getDiagProc"):
_subfile = "%s/%s"%(_jobdir,_executable)
cmdLine = "qsub -q hep.q %s -o %s.log -e %s.err %s.sh"%(jobOptsStr,_subfile,_subfile,_subfile)
cmdLine = "%s -q %s %s -o %s.log -e %s.err %s.sh"%(_subcmd,_opts['queue'],jobOptsStr,_subfile,_subfile,_subfile)
run(cmdLine)
print " --> Finished submitting files"

Expand Down
8 changes: 6 additions & 2 deletions Trees2WS/RunWSScripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ def get_options():
parser.add_option('--year', dest='year', default='2016', help="Year of trees to process")
parser.add_option('--mode', dest='mode', default='', help="Which mode to run. Options: ['trees2ws','trees2ws_data','haddMC','haddData','mass_shift']")
parser.add_option('--modeOpts', dest='modeOpts', default='', help="Additional options to add to command line when running different scripts (specify all within quotes e.g. \"--XYZ ABC\")")
parser.add_option('--selectProcess', dest='selectProcess', action="append", default=[], help="select only these processes to be converted in workspaces (can be specified multiple times)")
# Specifically for hadding
parser.add_option('--flashggPath', dest='flashggPath', default='', help="Path to flashgg area required for hadding")
parser.add_option('--outputWSDir', dest='outputWSDir', default='', help="Location to store output workspaces of hadding script")
# Specifically for mass shifting
parser.add_option('--inputMass', dest='inputMass', default='125', help="Input mass of workspace")
parser.add_option('--targetMasses', dest='targetMasses', default='120,130', help="Comma separated list of target masses")
# Job submission options
parser.add_option('--batch', dest='batch', default='IC', help='Batch')
parser.add_option('--queue', dest='queue', default='hep.q', help='Queue: can take a while if including all systematics for many categories')
parser.add_option('--batch', dest='batch', default='condor', help='Batch')
parser.add_option('--queue', dest='queue', default='longlunch', help='Queue: can take a while if including all systematics for many categories')
parser.add_option('--jobOpts', dest='jobOpts', default='', help="Additional options to add to job submission. For Condor separate individual options with a colon (specify all within quotes e.g. \"option_xyz = abc+option_123 = 456\")")
parser.add_option('--printOnly', dest='printOnly', default=False, action="store_true", help="Dry run: print submission files only")
return parser.parse_args()
Expand All @@ -47,6 +48,7 @@ def leave():
options['year'] = opt.year
options['mode'] = opt.mode
options['modeOpts'] = opt.modeOpts
options['selectProcess'] = opt.selectProcess
options['flashggPath'] = opt.flashggPath
options['outputWSDir'] = opt.outputWSDir if opt.outputWSDir != '' else "%s/outdir_%s/%s"%(twd__,opt.ext,opt.mode)
options['inputMass'] = opt.inputMass
Expand Down Expand Up @@ -75,6 +77,8 @@ def leave():
elif options['mode'] == "haddMC": print " --> Hadd MC workspaces..."
elif options['mode'] == "haddData": print " --> Hadd data workspaces..."
elif options['mode'] == "mass_shift": print " --> Ad-hoc shifting of mass in RooWorkspaces..."

if options['mode'] == "trees2ws" and len(options['selectProcess']): print " ==> Chosen to convert only the processes in this list: ",options['selectProcess']
print " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
15 changes: 15 additions & 0 deletions Trees2WS/WSRenamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ def get_options():
fnew = re.sub("QQ2HQQ","VBF",f)
os.system("mv %s %s"%(f,fnew))

vbf = glob.glob("%s/*_VBFH*_vbf*"%opt.inputDir)
for f in vbf:
fnew = re.sub("_vbf","_VBF",f)
os.system("mv %s %s"%(f,fnew))

wh = glob.glob("%s/*_WHToGG_*_QQ2HQQ_*"%opt.inputDir)
for f in wh:
fnew = re.sub("QQ2HQQ","WH2HQQ",f)
os.system("mv %s %s"%(f,fnew))

wplush = glob.glob("%s/*_WplusH_HToGG_*_QQ2HLNU*"%opt.inputDir)
for f in wplush:
fnew = re.sub("QQ2HLNU","WPLUSH2HQQ",f)
os.system("mv %s %s"%(f,fnew))

wminush = glob.glob("%s/*_WminusH_HToGG_*_QQ2HLNU*"%opt.inputDir)
for f in wminush:
fnew = re.sub("QQ2HLNU","WMINUSH2HQQ",f)
os.system("mv %s %s"%(f,fnew))

zh = glob.glob("%s/*_ZHToGG_*_QQ2HQQ_*"%opt.inputDir)
for f in zh:
fnew = re.sub("QQ2HQQ","ZH2HQQ",f)
Expand Down
2 changes: 1 addition & 1 deletion Trees2WS/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'theoryWeightContainers':{'alphaSWeights':2,'scaleWeights':9,'pdfWeights':60}, # Theory weights to add to nominal + NOTAG RooDatasets, value corresponds to number of weights (0-N)

# List of systematics: use string YEAR for year-dependent systematics
'systematics':['FNUFEB', 'FNUFEE', 'JEC', 'JER', 'MCScaleGain1EB', 'MCScaleGain6EB', 'MCScaleHighR9EB', 'MCScaleHighR9EE', 'MCScaleLowR9EB', 'MCScaleLowR9EE', 'MCSmearHighR9EBPhi', 'MCSmearHighR9EBRho', 'MCSmearHighR9EEPhi', 'MCSmearHighR9EERho', 'MCSmearLowR9EBPhi', 'MCSmearLowR9EBRho', 'MCSmearLowR9EEPhi', 'MCSmearLowR9EERho', 'MaterialCentralBarrel', 'MaterialForward', 'MaterialOuterBarrel', 'MvaShift', 'PUJIDShift', 'ShowerShapeHighR9EB', 'ShowerShapeHighR9EE', 'ShowerShapeLowR9EB', 'ShowerShapeLowR9EE', 'SigmaEOverEShift', 'metJecUncertainty', 'metJerUncertainty', 'metPhoUncertainty', 'metUncUncertainty'],
'systematics':['FNUFEB', 'FNUFEE', 'JEC', 'JER', 'MCScaleGain1EB', 'MCScaleGain6EB', 'MCScaleHighR9EB', 'MCScaleHighR9EE', 'MCScaleLowR9EB', 'MCScaleLowR9EE', 'MCSmearHighR9EBPhi', 'MCSmearHighR9EBRho', 'MCSmearHighR9EEPhi', 'MCSmearHighR9EERho', 'MCSmearLowR9EBPhi', 'MCSmearLowR9EBRho', 'MCSmearLowR9EEPhi', 'MCSmearLowR9EERho', 'MaterialCentralBarrel', 'MaterialForward', 'MaterialOuterBarrel', 'MvaShift', 'PUJIDShift', 'ShowerShapeHighR9EB', 'ShowerShapeHighR9EE', 'ShowerShapeLowR9EB', 'ShowerShapeLowR9EE', 'SigmaEOverEShift'],

# Analysis categories: python list of cats or use 'auto' to extract from input tree
'cats':'auto'
Expand Down
Loading

0 comments on commit 6c96515

Please sign in to comment.