Code setup
- Check out and compile code as described here PhysicsLightSetup. This is needed to set up python path for importing local modules.
- On lxplus, simpler commands do the same job:
$ ssh lxplus5
$ svn co svn+ssh://svn.cern.ch/reps/penn/PhysicsNtuple/PhysicsBatch/trunk/code
$ python code/setupCode.py --release=light --dirname=hmm
Run macro - this is obsolete, see below for runFitBkg.py:
- Run macro which fits background histograms and signal shape:
$ cd $TestArea/PhysicsNtuple/PhysicsLight
$ python macros/hmm/limFitMll.py --bkg-file=docs/examples/hmm_hists_2013_10_15.root --sig-file=docs/examples/hmm_hists_2013_10_15.root --do-bkg --do-gev --do-ss --outdir=fit-powmll --do-powmll --fix-zm --fix-zw --wait
- limFitMll.py python macro fits mll distributions for signal and backgrounds, and also compute spurious signal.
Brief comments
- This analysis is described here:
- A first step is to run this macro and to understand code logic.
- As an exercise, you can update python code to perform fit using the background model used by CMS:
Filtered DY datasets
mc12_8TeV.147807.PowhegPythia8_AU2CT10_Zmumu.merge.AOD.e1852_a188_a171_r3549
mc12_8TeV.147807.PowhegPythia8_AU2CT10_Zmumu.merge.NTUP_SMWZ.e1169_s1469_s1470_r3752_r3549_p1328
H to gamma gamma code
$ svn co svn+ssh://svn.cern.ch/reps/atlasoff/PhysicsAnalysis/HiggsPhys/Fitters/ReSearch/trunk ReSearch
How to run signal fits
$ ulimit -n 2048
$ python macros/hmm/runFitSig.py docs/examples/hmm_hists_sig_v2-26_feb-17.root --do-gev -o sfits.root -b -s --outdir=fit-sig --do-narrow --plot-sig &> log & tail -f log
How to run background fits
- Prepare variables for input data:
$ cd $TestArea/PhysicsNtuple/PhysicsLight
$ HPATH=docs/examples/hmm_hists_bkg_v2-26.root
$ SPATH=docs/examples/hmm_shape_sig_v2-26.root
- Standard background only fit in signal region:
$ FDIR=fit-bkg-reg; mkdir -p $FDIR; python macros/hmm/runFitBkg.py $HPATH --outdir=$FDIR -s -b --do-ss --sig-file=$SPATH --fix-z &> $FDIR/log & tail -f $FDIR/log
- Standard background only fit in signal region with free MZ and Z widths BW parameters:
$ FDIR=fit-bkg-reg-free-bw; mkdir -p $FDIR; python macros/hmm/runFitBkg.py $HPATH --outdir=$FDIR -s -b --do-ss --sig-file=$SPATH &> $FDIR/log & tail -f $FDIR/log
- Z peak fit with BW convoluted with GS+CB (this takes time):
$ FDIR=fit-bkg-fit-z; mkdir -p $FDIR; python macros/hmm/runFitBkg.py $HPATH --outdir=$FDIR -s -b --fit-z -o zfits.root &> $FDIR/log & tail -f $FDIR/log
- Background only fit with BW convoluted with GS+CB plus EXP with fit parameters taken from Z peak:
$ FDIR=fit-bkg-use-z; mkdir -p $FDIR; python macros/hmm/runFitBkg.py $HPATH --outdir=$FDIR -s -b --do-ss --sig-file=$SPATH --use-z --z-file=fit-bkg-fit-z/zfits.root &> $FDIR/log & tail -f $FDIR/log
Run fits using smeared samples:
$ FDIR=fit-bkg-reg-fix-zw-105-160-smear; mkdir -p $FDIR; python macros/hmm/runFitBkg.py docs/examples/genlevel_datalumi_plusndy.root --do-ss --sig-file=docs/examples/hmm_shape_sig_v2-26.root --min-mll=105 --max-mll=160 --fix-zw --cut-key=Ptll -w -s --use-christian --do-mev --no-minos --outdir=$FDIR &> $FDIR/log & tail -f $FDIR/log
How to test different background functions
- Setup HPATH and SPATH environmental variables as shown above
- Run job only for filtered Powheg samples:
$ FDIR=fit-bkg-new; mkdir -p $FDIR; python macros/hmm/runFitBkg.py $HPATH --outdir=$FDIR -s -w --do-ss --sig-file=$SPATH --fit-new --zkey=powmll --min-mll=115 --max-mll=160 --min-mh=120 --max-mh=150 --par-fixed='ZW,MZ' &> $FDIR/log & tail -f $FDIR/log