Skip to content

Commit

Permalink
Merge pull request #15 from emanueledimarco/vbfac-dev
Browse files Browse the repository at this point in the history
A lot of changes in the AC fits using now all the STXS categories
  • Loading branch information
emanueledimarco committed Mar 14, 2023
2 parents 6c96515 + 33a2710 commit 44fcb31
Show file tree
Hide file tree
Showing 31 changed files with 598 additions and 215 deletions.
8 changes: 4 additions & 4 deletions Background/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
backgroundScriptCfg = {

# Setup
'inputWSDir':'cards/cards_current/data_Run2', # location of 'allData.root' file
'inputWSDir':'cards/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-11-21', # extension to add to output directory
'ext':'2023-02-13', # 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',

# Job submission options
'batch':'condor', # [condor,SGE,IC,local]
'queue':'espresso' # for condor e.g. espresso
'batch':'Rome', # [condor,SGE,IC,Rome,local]
'queue':'cmsan' # for condor e.g. espresso

}
8 changes: 6 additions & 2 deletions Background/runBackgroundScripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ done

OUTDIR="outdir_${EXT}"
if [[ $PLOTDIR == "" ]]; then
PLOTDIR=OUTDIR
PLOTDIR=$OUTDIR
fi

echo "[INFO] outdir is $OUTDIR, plotdir is $PLOTDIR INTLUMI $INTLUMI"
Expand Down Expand Up @@ -168,7 +168,11 @@ OPT=" --isData 1"
fi

mkdir -p "${PLOTDIR}/bkgfTest${DATAEXT}"
cp "/afs/cern.ch/user/g/gpetrucc/php/index.php" "${PLOTDIR}/bkgfTest${DATAEXT}"
if test -f "/afs/cern.ch/user/g/gpetrucc/php/index.php"; then
cp "/afs/cern.ch/user/g/gpetrucc/php/index.php" "${PLOTDIR}/bkgfTest${DATAEXT}"
elif test -f "/cmshome/dimarcoe/php/index.php"; then
cp "/cmshome/dimarcoe/php/index.php" "${PLOTDIR}/bkgfTest${DATAEXT}"
fi
echo " ./bin/fTest -i $FILE --saveMultiPdf $OUTDIR/CMS-HGG_multipdf_$EXT_$CATS.root -D $OUTDIR/bkgfTest$DATAEXT -f $CATS $OPT --year $YEAR --catOffset $CATOFFSET"
./bin/fTest -i $FILE --saveMultiPdf $OUTDIR/CMS-HGG_multipdf_$EXT_$CATS.root -D $OUTDIR/bkgfTest$DATAEXT -P $PLOTDIR/bkgfTest$DATAEXT -f $CATS $OPT --year $YEAR --catOffset $CATOFFSET

Expand Down
2 changes: 1 addition & 1 deletion Background/run_sequence.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python scripts/mergeMultiYearsData.py -i cards/cards_current -o cards/cards_current/data_Run2/allData.root
#python scripts/mergeMultiYearsData.py -i cards/cards_current -o cards/cards_current/data_Run2/allData.root
python RunBackgroundScripts.py --inputConfig config_test.py --mode fTestParallel
7 changes: 4 additions & 3 deletions Background/tools/submissionTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 @@ -102,8 +102,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 @@ -113,7 +114,7 @@ def submitFiles(_opts):
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)
print " --> Finished submitting files"

Expand Down
21 changes: 19 additions & 2 deletions Combine/CollectFits.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def run(cmd):
if _fit.split(":")[2] == "all": _fitpois = pois
else: _fitpois = _fit.split(":")[2].split(",")
_name = "%s_%s"%(_fit.split(":")[0],_fit.split(":")[1])
if opt.doObserved: _name += "_obs"
if opt.doObserved:
_name += "_obs"
mainlabel = "Observed"
else:
mainlabel = "Expected"
# add this to distinguish different fits with same POI
_name += "_"+opt.ext

if( _fit.split(":")[0] == "bestfit" ):
for poi in _fitpois:
Expand All @@ -56,9 +62,20 @@ def run(cmd):

elif( _fit.split(":")[0] == "profile1D")|( _fit.split(":")[0] == "scan1D" ):
for poi in _fitpois:
if poi in ["r_ggH","r_VBF","r_top","r_VH"]:
translate_json = "pois_mu.json"
elif poi=='CMS_zz4l_fai1':
if 'ALT_0M' in opt.ext: translate_json = "pois_fa3.json"
if 'ALT_0PH' in opt.ext: translate_json = "pois_fa2.json"
if 'ALT_L1' in opt.ext: translate_json = "pois_flambda1.json"
if 'ALT_L1Zg' in opt.ext: translate_json = "pois_flambda1zgamma.json"
else:
print "Warning: unknown poi. Use r as default"
translate_json = "pois_mu.json"
haddcmd = "cd runFits%s_%s; hadd -f %s_%s.root higgsCombine_%s_%s.POINTS.*.*.root; cd .."%(opt.ext,opt.mode,_name,poi,_name,poi)
run(haddcmd)
plotcmd = "cd runFits%s_%s; plot1DScan.py %s_%s.root --y-cut 20 --y-max 20 -o Plots/%s_%s%s --POI %s; cd .."%(opt.ext,opt.mode,_name,poi,_name,poi,opt.ext,poi)
plotcmd = "cd runFits%s_%s; plot1DScan.py %s_%s.root --y-cut 30 --y-max 30 -o Plots/%s_%s%s --POI %s --main-label %s --translate %s/src/flashggFinalFit/Plots/%s; cd .."%(opt.ext,opt.mode,_name,poi,_name,poi,opt.ext,poi,mainlabel,os.environ['CMSSW_BASE'],translate_json)
print "plotcmd = ",plotcmd
run(plotcmd)

elif( _fit.split(":")[0] == "scan2D")|( _fit.split(":")[0] == "profile2D" ):
Expand Down
8 changes: 4 additions & 4 deletions Combine/PlotScans.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def run(cmd):
if poi in ["r_ggH","r_VBF","r_top","r_VH"]:
translate_json = "pois_mu.json"
elif poi=='CMS_zz4l_fai1':
if 'ALT0M' in opt.ext: translate_json = "pois_fa3.json"
if 'ALT0PH' in opt.ext: translate_json = "pois_fa2.json"
if 'ALT0L1' in opt.ext: translate_json = "pois_flambda1.json"
if 'ALT0L1Zg' in opt.ext: translate_json = "pois_flambda1zgamma.json"
if 'ALT_0M' in opt.ext: translate_json = "pois_fa3.json"
if 'ALT_0PH' in opt.ext: translate_json = "pois_fa2.json"
if 'ALT_L1' in opt.ext: translate_json = "pois_flambda1.json"
if 'ALT_L1Zg' in opt.ext: translate_json = "pois_flambda1zgamma.json"
else:
print "Warning: unknown poi. Use r as default"
translate_json = "pois_mu.json"
Expand Down
6 changes: 3 additions & 3 deletions Combine/RunFits.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_options():
parser.add_option('--doObserved', dest='doObserved', action="store_true", default=False, help="Fit to data")
parser.add_option('--snapshotWSFile', dest='snapshotWSFile', default='', help="Full path to snapshot WS file (use when running observed statonly as nuisances are froze at postfit values)")
parser.add_option('--commonOpts', dest='commonOpts', default="--cminDefaultMinimizerStrategy 0 --X-rtd MINIMIZER_freezeDisassociatedParams --X-rtd MINIMIZER_multiMin_hideConstants --X-rtd MINIMIZER_multiMin_maskConstraints --X-rtd MINIMIZER_multiMin_maskChannels=2", help="Common combine options for running fits")
parser.add_option('--batch', dest='batch', default='condor', help='Batch: [crab,condor/SGE/IC]')
parser.add_option('--batch', dest='batch', default='condor', help='Batch: [crab,condor/SGE/IC/lxbatch]')
parser.add_option('--queue', dest='queue', default='espresso', help='Queue e.g. for condor=workday, for IC=hep.q')
parser.add_option('--subOpts', dest='subOpts', default="", help="Submission options")
parser.add_option('--doCustomCrab', dest='doCustomCrab', default=False, action="store_true", help="Load crab options from custom_crab.py file")
Expand Down Expand Up @@ -65,11 +65,11 @@ def getPdfIndicesFromJson(pdfjson):
if opt.subOpts != "": sub_opts += "\n%s"%opt.subOpts
sub_opts += "\'"
job_opts = "--job-mode condor %s"%sub_opts
elif( opt.batch == 'SGE' )|( opt.batch == 'IC' ):
elif( opt.batch == 'SGE' )|( opt.batch == 'IC' )|( opt.batch == 'lxbatch' ):
sub_opts = "--sub-opts=\'-q %s"%opt.queue
if opt.subOpts != "": sub_opts += " %s"%opt.subOpts
sub_opts += "\'"
job_opts = "--job-mode SGE %s"%sub_opts
job_opts = "--job-mode %s %s"%(opt.batch,sub_opts)
elif opt.batch == "local":
print "--> Will print the commands to run combine without combineTool interactively\n\n"
else:
Expand Down
4 changes: 2 additions & 2 deletions Combine/RunText2Workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def run(cmd):
fsub.write("#!/bin/bash\n\n")
fsub.write("cd %s\n\n"%os.environ['PWD'])
fsub.write("eval `scramv1 runtime -sh`\n\n")
fsub.write("text2workspace.py Datacard_%s.txt -o Datacard_%s.root %s %s"%(opt.ext,opt.ext,opt.common_opts,models[opt.mode]))
fsub.write("text2workspace.py Datacard_%s.txt -o Datacard_%s.root %s %s\n"%(opt.ext,opt.ext,opt.common_opts,models[opt.mode]))
fsub.close()

# Change permission for file
Expand All @@ -58,6 +58,6 @@ def run(cmd):
# Submit
if opt.batch == "condor": subcmd = "condor_submit ./t2w_jobs/t2w_%s.sub"%(opt.ext)
elif opt.batch == 'local': subcmd = "bash ./t2w_jobs/t2w_%s.sh"%(opt.ext)
else: subcmd = "qsub -q hep.q -l h_rt=6:0:0 -l h_vmem=24G ./t2w_jobs/t2w_%s.sh"%(opt.ext)
else: subcmd = "bsub -q cmsan -o ./t2w_jobs/t2w_%s.log -e ./t2w_jobs/t2w_%s.err ./t2w_jobs/t2w_%s.sh"%(opt.ext,opt.ext,opt.ext)
if opt.dryRun: print "[DRY RUN] %s"%subcmd
else: run(subcmd)
36 changes: 15 additions & 21 deletions Combine/inputs.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
{
"xsec":{
"pois":"r_VBF",
"pois":"r_ggH,r_VBF,r_VH,r_top",
"fits":"profile1D:syst:all+bestfit:syst:all",
"points":"20:1+:",
"fit_opts":"--setParameters r_ggH=1,r_top=1,r_VH=1 --setParameterRanges r_VBF=0,3:r_ggH=0.99,1.01:r_top=0.99,1.01:r_VH=0.99,1.01 --saveSpecifiedNuis all --saveInactivePOI 1 --freezeParameters MH,r_ggH,r_top,r_VH --autoBoundsPOIs 'r_VBF' --autoMaxPOIs 'r_VBF' --fastScan+--setParameters r_ggH=1,r_top=1,r_VH=1 --setParameterRanges r_VBF=0,3:r_ggH=0.99,1.01:r_top=0.99,1.01:r_VH=0.99,1.01 --saveSpecifiedNuis all --saveInactivePOI 1 --freezeParameters MH,r_ggH,r_top,r_VH --saveWorkspace"
"points":"41:1+:",
"fit_opts":"--setParameters r_ggH=1,r_top=1,r_VH=1,r_VBF=1 --setParameterRanges r_ggH=0.0,2.0:r_VBF=0.0,2.0:r_VH=0.0,3.0:r_top=0.0,4.0 --X-rtd FITTER_NEW_CROSSING_ALGO --X-rtd FITTER_BOUND --saveSpecifiedNuis all --saveInactivePOI 1 --fastScan+--setParameters r_ggH=1,r_top=1,r_VH=1,r_VBF=1 --setParameterRanges r_ggH=0.0,2.0:r_VBF=0.0,2.0:r_VH=0.0,3.0:r_top=0.0,4.0 --robustFit=1 --setRobustFitAlgo=Minuit2,Migrad --X-rtd FITTER_NEW_CROSSING_ALGO --setRobustFitTolerance=0.1 --X-rtd FITTER_NEVER_GIVE_UP --X-rtd FITTER_BOUND --cminFallbackAlgo \"Minuit2,0:1.\" --saveSpecifiedNuis all --saveInactivePOI 1 --saveWorkspace"
},
"cp":{
"pois":"x",
"fits":"profile1D:syst:all",
"points":"20:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --cminApproxPreFitTolerance=10 --freezeParameters MH --fastScan --setParameters r=1 --setParameterRanges x=0,0.5"
},
"ALT0M":{
"ALT_0M":{
"pois":"CMS_zz4l_fai1",
"fits":"profile1D:syst:all",
"points":"200:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --cminApproxPreFitTolerance=10 --setParameterRanges CMS_zz4l_fai1=-0.003,0.003 --freezeParameters MH,fa3_ggH,muf --fastScan --setParameters muV=1,muf=1,fa3_ggH=1 --autoMaxPOIs 'CMS_zz4l_fai1' --autoBoundsPOIs 'CMS_zz4l_fai1' "
"points":"41:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --setParameterRanges muV=0.0,4.0:muf=0.0,10.0:fa3_ggH=0.,1.:CMS_zz4l_fai1=-0.003,0.003 --fastScan --setParameters muV=1.,CMS_zz4l_fai1=0.,muf=1.,fa3_ggH=0. --robustFit=1 --setRobustFitAlgo=Minuit2,Migrad --X-rtd FITTER_NEW_CROSSING_ALGO --setRobustFitTolerance=0.1 --X-rtd FITTER_NEVER_GIVE_UP --X-rtd FITTER_BOUND --cminFallbackAlgo \"Minuit2,0:1.\" "
},
"ALT0PH":{
"ALT_0PH":{
"pois":"CMS_zz4l_fai1",
"fits":"profile1D:syst:all",
"points":"200:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --cminApproxPreFitTolerance=10 --setParameterRanges CMS_zz4l_fai1=-0.003,0.003 --freezeParameters MH,fa3_ggH,muf --fastScan --setParameters muV=1,muf=1,fa3_ggH=1 --autoMaxPOIs 'CMS_zz4l_fai1' --autoBoundsPOIs 'CMS_zz4l_fai1' "
"points":"41:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --setParameterRanges muV=0.0,4.0:muf=0.0,10.0:CMS_zz4l_fai1=-0.01,0.01 --fastScan --setParameters muV=1.,CMS_zz4l_fai1=0.,muf=1. --robustFit=1 --setRobustFitAlgo=Minuit2,Migrad --X-rtd FITTER_NEW_CROSSING_ALGO --setRobustFitTolerance=0.1 --X-rtd FITTER_NEVER_GIVE_UP --X-rtd FITTER_BOUND --cminFallbackAlgo \"Minuit2,0:1.\" "
},
"ALT0L1":{
"ALT_L1":{
"pois":"CMS_zz4l_fai1",
"fits":"profile1D:syst:all",
"points":"200:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --cminApproxPreFitTolerance=10 --setParameterRanges CMS_zz4l_fai1=-0.003,0.003 --freezeParameters MH,fa3_ggH,muf --fastScan --setParameters muV=1,muf=1,fa3_ggH=1 --autoMaxPOIs 'CMS_zz4l_fai1' --autoBoundsPOIs 'CMS_zz4l_fai1' "
"points":"41:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --setParameterRanges muV=0.0,4.0:muf=0.0,10.0:CMS_zz4l_fai1=-0.001,0.001 --fastScan --setParameters muV=1.,CMS_zz4l_fai1=0.,muf=1. --robustFit=1 --setRobustFitAlgo=Minuit2,Migrad --X-rtd FITTER_NEW_CROSSING_ALGO --setRobustFitTolerance=0.1 --X-rtd FITTER_NEVER_GIVE_UP --X-rtd FITTER_BOUND --cminFallbackAlgo \"Minuit2,0:1.\" "
},
"ALT0L1Zg":{
"ALT_L1Zg":{
"pois":"CMS_zz4l_fai1",
"fits":"profile1D:syst:all",
"points":"200:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --cminApproxPreFitTolerance=10 --setParameterRanges CMS_zz4l_fai1=-0.003,0.003 --freezeParameters MH,fa3_ggH,muf --fastScan --setParameters muV=1,muf=1,fa3_ggH=1 --autoMaxPOIs 'CMS_zz4l_fai1' --autoBoundsPOIs 'CMS_zz4l_fai1' "
"points":"41:1",
"fit_opts":"--saveSpecifiedNuis all --saveInactivePOI 1 --setParameterRanges muV=0.0,4.0:muf=0.0,10.0:CMS_zz4l_fai1=-0.01,0.01 --fastScan --setParameters muV=1.,CMS_zz4l_fai1=0.,muf=1. --robustFit=1 --setRobustFitAlgo=Minuit2,Migrad --X-rtd FITTER_NEW_CROSSING_ALGO --setRobustFitTolerance=0.1 --X-rtd FITTER_NEVER_GIVE_UP --X-rtd FITTER_BOUND --cminFallbackAlgo \"Minuit2,0:1.\" "
}
}
26 changes: 14 additions & 12 deletions Combine/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
models = {
"mu_inclusive":"",

"xsec":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \
"mu":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \
--PO \"map=.*/ggH.*hgg:r_ggH[1,0,3]\" \
--PO \"map=.*/qqH.*hgg:r_VBF[1,0,3]\" \
--PO \"map=.*/ttH.*hgg:r_top[1,-1,2]\" \
Expand All @@ -11,26 +11,28 @@
"cp":"-P HiggsAnalysis.CombinedLimit.HiggsJPC:twoHypothesisHiggs \
--PO=muFloating",

"ALT0M":"-P HiggsAnalysis.CombinedLimit.HiggsSingleAnomalousCoupling:FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase \
--PO altSignal=ALT0M",
"ALT_0M":"-P HiggsAnalysis.CombinedLimit.FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase:FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase \
--PO altSignal=ALT_0M",

"ALT0PH":"-P HiggsAnalysis.CombinedLimit.HiggsSingleAnomalousCoupling:FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase \
--PO altSignal=ALT0PH",
"ALT_0PH":"-P HiggsAnalysis.CombinedLimit.FA2_Interference_JHU_rw_MengsMuV:FA2_Interference_JHU_rw_MengsMuV \
--PO altSignal=ALT_0PH",

"ALT0L1":"-P HiggsAnalysis.CombinedLimit.HiggsSingleAnomalousCoupling:FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase \
--PO \"altSignal=ALT0L1\"",
"ALT_L1":"-P HiggsAnalysis.CombinedLimit.FL1_Interference_JHU_rw_MengsMuV:FL1_Interference_JHU_rw_MengsMuV \
--PO \"altSignal=ALT_L1\"",

"ALT0L1Zg":"-P HiggsAnalysis.CombinedLimit.HiggsSingleAnomalousCoupling:FA3_Interference_JHU_ggHSyst_rw_MengsMuV_HeshyXsec_ggHInt_ggHphase \
--PO altSignal=ALT0L1Zg",
"ALT_L1Zg":"-P HiggsAnalysis.CombinedLimit.FL1Zg_Interference_JHU_rw_MengsMuV:FL1Zg_Interference_JHU_rw_MengsMuV \
--PO altSignal=ALT_L1Zg",

"mu":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \
"xsec":"-P HiggsAnalysis.CombinedLimit.PhysicsModel:multiSignalModel \
--PO \"map=.*/ggH.*:r_ggH[1,0,2]\" \
--PO \"map=.*/bbH.*:r_ggH[1,0,2]\" \
--PO \"map=.*/qqH.*:r_VBF[1,0,3]\" \
--PO \"map=.*/WH_had.*:r_VH[1,0,3]\" \
--PO \"map=.*/WPLUSH2HQQ.*:r_VH[1,0,3]\" \
--PO \"map=.*/WMINUSH2HQQ.*:r_VH[1,0,3]\" \
--PO \"map=.*/ZH_had.*:r_VH[1,0,3]\" \
--PO \"map=.*/ggZH_had.*:r_VH[1,0,3]\" \
--PO \"map=.*/WH_lep.*:r_VH[1,0,3]\" \
--PO \"map=.*/WPLUSH_lep.*:r_VH[1,0,3]\" \
--PO \"map=.*/WMINUSH_lep.*:r_VH[1,0,3]\" \
--PO \"map=.*/ZH_lep.*:r_VH[1,0,3]\" \
--PO \"map=.*/ggZH_ll.*:r_VH[1,0,3]\" \
--PO \"map=.*/ggZH_nunu.*:r_VH[1,0,3]\" \
Expand Down
28 changes: 21 additions & 7 deletions Combine/run_sequence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ outdate=`date +%F`

STEP=0
usage(){
echo "Script to run yields and datacard making. Yields need to be done before running datacards"
echo "Script to run fits and plots of fit output. dryRun option is for the fitting only, that can be run in batch."
echo "options:"

echo "-h|--help) "
echo "-s|--step) "
echo "-d|--dryRun) "
}
# options may be followed by one colon to indicate they have a required argument
if ! options=$(getopt -u -o s:h -l help,step: -- "$@")
if ! options=$(getopt -u -o s:hd -l help,step:,dryRun -- "$@")
then
# something went wrong, getopt will put out an error message for us
exit 1
Expand All @@ -20,31 +21,44 @@ do
case $1 in
-h|--help) usage; exit 0;;
-s|--step) STEP=$2; shift ;;
-d|--dryRun) DR=$2; shift ;;
(--) shift; break;;
(-*) usage; echo "$0: error - unrecognized option $1" 1>&2; usage >> /dev/stderr; exit 1;;
(*) break;;
esac
shift
done

fits=("xsec" "ALT0L1" "ALT0L1Zg" "ALT0PH" "ALT0M")
DROPT=""
if [[ $DR ]]; then
DROPT=" --dryRun "
fi

fits=("xsec" "ALT_L1" "ALT_L1Zg" "ALT_0PH" "ALT_0M")

if [[ $STEP == "t2w" ]]; then
for fit in ${fits[*]}
do
python RunText2Workspace.py --ext $fit --mode $fit --batch local
python RunText2Workspace.py --ext $fit --mode $fit --batch Rome
done
elif [[ $STEP == "fit" ]]; then
for obs in " " " --doObserved "
do
for fit in ${fits[*]}
do
python RunFits.py --inputJson inputs.json --ext $fit --mode $fit --batch local $obs
python RunFits.py --inputJson inputs.json --ext $fit --mode $fit --batch lxbatch --queue cmsan ${DROPT} $obs
done
done
elif [[ $STEP == "collect" ]]; then
for obs in " " " --doObserved "
do
for fit in ${fits[*]}
do
python CollectFits.py --inputJson inputs.json --ext $fit --mode $fit $obs
done
done
elif [[ $STEP == "plot" ]]; then
#for obs in " " " --doObserved "
for obs in " "
for obs in " " " --doObserved "
do
for fit in ${fits[*]}
do
Expand Down
Loading

0 comments on commit 44fcb31

Please sign in to comment.