-
Notifications
You must be signed in to change notification settings - Fork 14
Hmm Analysis
Set up the area with combine as described here.
Use as CMSSW release
CMSSW_9_1_0_pre2 combine doesn't compile in 80X*, you need to merge amarini:HiggsAnalysis-CombinedLimit/cmssw80x .
Merge latest development from the fork
amarini/taunu_and_hmm
Submit jobs (for more detail see here ):
POSTFIX=$(date +_%Y_%m_%d)
python script/submit.py -n 100 -q 8nh -d test/Hmumu${POSTFIX} -i dat/configHmumu.dat
python script/submit.py --status -d test/Hmumu${POSTFIX}
and when all jobs are done merge the files:
python script/submit.py --hadd --clear -d test/Hmumu${POSTFIX}
mkdir Hmumu
python python/fitter.py -c Fitter -f test/Hmumu/Hmumu${POSTFIX}/Hmumu${POSTFIX}.root -o Hmumu/SignalModel.root 2>&1 | tee /tmp/$USER/log.txt
python python/fitter.py -c BackgroundFitter -f test/Hmumu/Hmumu${POSTFIX}/Hmumu${POSTFIX}.root -o Hmumu/BackgroundModel.root 2>&1 | tee /tmp/amarini/log2.txt
Analysis is STILL BLIND: always use "-t -1" and "run=expected" in combine!! I put the possible datacard in
test/cms_datacard_hmumu_cat13.txt
N.B.: You need to have run with the relevant systematic shift.
SYST="_JES_BTAG"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=PU --outname=cms_pu
SYST="_JES_BTAG"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=JES --outname=cms_scale_j
SYST="_JES_BTAG"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=BTAGB --outname=cms_eff_b
SYST="_JES_BTAG"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=BTAGL --outname=cms_fake_b
SYST="_PDFSCALES"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=Pdf --outname=cms_pdf
SYST="_PDFSCALES"; python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=Scale --outname=cms_theory_scale
SYST="_JESSOURCE";
for s in AbsoluteStat AbsoluteScale AbsoluteMPFBias Fragmentation SinglePionECAL FlavorQCD TimePtEta RelativeJEREC1 RelativeJEREC2 RelativeJERHF RelativePtBB RelativePtEC1 RelativePtEC2 RelativePtHF RelativeBal RelativeFSR PileUpDataMC PileUpPtRef PileUpPtBB PileUpPtEC1 PileUpPtEC2 PileUpPtHF;
do
python script/dumpSystHmm.py -i test/Hmumu/Hmumu${POSTFIX}${SYST}/Hmumu${POSTFIX}${SYST}.root --syst=JES_$s --outname=cms_scale_j_$s ;
done
Convert it in a combine workspace:
text2workspace.py -o cms_datacard_hmumu.root test/cms_datacard_hmumu.txt
combine -M Asymptotic -m 125.09 -t -1 --run=expected cms_datacard_hmumu.root
-- Asymptotic --
Expected 2.5%: r < 0.9172
Expected 16.0%: r < 1.2272
Expected 50.0%: r < 1.6953
Expected 84.0%: r < 2.3643
Expected 97.5%: r < 3.1383
N.B.: In the future I will import all the combination stuff we need in python/combine.py
python script/combine.py -M Asymptotic -i test/cms_datacard_hmumu.txt --onews --rmax=10 --begin=120,121,122,123,124,124.8,124.9,125,125.1,125.2,126,127,128,129,130 -q 8nh -d test/Hmumu/combine_$POSTFIX
hadd the files
python script/makeCombinePlots.py -f test/Hmumu/combine_$POSTFIX/combine_$POSTFIX.root -o Hmumu/limit -v --yaxis=0.1,10 --xaxis=120,130
Or the AsymptoticGrid:
python script/combine.py -M AsymptoticGrid -i test/cms_datacard_hmumu.txt --onews --begin=120,125130 -q 8nh -d test/Hmumu/combine_$POSTFIX --rmin=0 --rmax=6 --npoints=100 --njobs=10
for the signal plots in categories I was using:
mkdir Hmumu
python script/Hmumu/makeFinalPlotsHmm.py -i test/Hmumu/Hmumu${POSTFIX}/Hmumu${POSTFIX}.root -o Hmumu/${postfix}/plots --hmm=hmmWithTTH
Specific plots. Bdt, BdtQuantile and Met
python script/Hmumu/makeFinalPlotsHmm.py --noSig --hmm=hmmWithTTH --xrange=-1,1 -o Hmumu/2017_07_20_NewCat4/Extra -c '' -v BdtOnH -i test/Hmumu/Hmumu_2017_07_20_NewCat4/Hmumu_2017_07_20_NewCat4.root --doRemap --rebin=1 -x 0,1
python script/Hmumu/makeFinalPlotsHmm.py --noSig --hmm=hmmWithTTH --xrange=-1,1 -o Hmumu/2017_07_20_NewCat4/Extra -c '' -v BdtOnH -i test/Hmumu/Hmumu_2017_07_20_NewCat4/Hmumu_2017_07_20_NewCat4.root --rebin=10
python script/Hmumu/makeFinalPlotsHmm.py --noSig --hmm=hmmAutoCat --xrange=0,300 -o Hmumu/2017_07_20_NewCat4/Extra -c '' -v MetOnH -i test/Hmumu/Hmumu_2017_07_20_NewCat4/Hmumu_2017_07_20_NewCat4.root --rebin=10
for syst. plots:
python script/drawSyst.py --rebin=20 --base=HmumuAnalysis/Vars/Mmm_Untag0_BB_GluGlu_HToMuMu_M125 -i test/Hmumu/Hmumu${POSTFIX}/Hmumu${POSTFIX}.root --syst=PU
Plot Background and Signal model plots.
DISPLAY=XXXX python script/Hmumu/makeBackgroundPlots.py -i Hmumu/2017_07_20_NewCat4/BackgroundModel.root -p Hmumu/2017_07_20_NewCat4/bkgfit/final/
DISPLAY=XXX python script/Hmumu/plotSignalModel.py -i Hmumu/2017_07_20_NewCat4/SignalModel.root -p Hmumu/2017_07_20_NewCat4/sigfit/final/
for a description of the analysis flow see here