In order to setup the software, follow the commands in the checkout.sh or simply download and execute it:
wget https://raw.githubusercontent.com/KIT-CMS/FitMETRecoilUnc/master/scripts/checkout.sh
bash checkout.sh
Before creating datacards, please copy root files with input shapes into the shapes folder of this package. The root files should have the following naming scheme:
htt_mm.inputs-sm-Run${YEAR}-ML-${VARIABLE}.root
Prepare inputs for YEAR
in 2016 2017 2018
and the MET component parallel to Z metParToZ
.
The files must contain the following categories as folders:
mm_0jet
mm_1jet
mm_ge2jet
Futhermore, distriutions of the following processes must be provided:
ZL
(signal process)ZTT
TTT
VVT
TTL
VVL
W
QCD
Only for the ZL
process, systematic variations are introduced being 10% shifts in the scale and resolution of the hadronic recoil. These variations should have the following names:
CMS_htt_boson_scale_met_Run${YEAR}Up
CMS_htt_boson_scale_met_Run${YEAR}Down
CMS_htt_boson_reso_met_Run${YEAR}Up
CMS_htt_boson_reso_met_Run${YEAR}Down
Feel free to extend the uncertainty model, since this one is far from complete.
The first step of datacard creation is covered by the MorphingMETRecoil executable. Asuming, that datacards for all Run II years are needed, using metParToZ
and puppimetParToZ
as variables, the following shell command applies:
for var in metParToZ puppimetParToZ;
do
for year in $(seq 2016 2018);
do
MorphingMETRecoil --era=${year} --variable=${var}
done
done
This is done with the usual text-to-workspace method of CombineHarvester separately for each category:
combineTool.py -M T2W -i output_*/Run201*/mm*/ --parallel 10
To constrain the MET recoil uncertainties, a maximum likelihood fit is performed, with ZL
as signal with a floating signal strength r
in order to cover normalization effects. The recoil uncertainties are treated as nuisances. Execute the following command for the fit:
combineTool.py -M FitDiagnostics -d output_*/Run201*/*/combined.txt.cmb.root --there --parallel 10
As a final step, the total uncertainty for scale and resolution is determined for each category. The computation follows this formula:
for var in metParToZ puppimetParToZ;
do
for year in 2016 2017 2018;
do
python $CMSSW_BASE/src/CombineHarvester/METRecoil/scripts/determine_recoiluncs.py --initial_shift 0.1 --input_dir output_${var}/Run${year}/
done
done
This will create .json
files in the output_${var}/Run${year}/
directories, which can be used further to define final recoil correction uncertainties
To check, how the fit changes the distributions, the following command can be used to obtain postift and prefit shapes:
for cf in `ls output_*metParToZ/Run201*/mm*/ -d`;
do
PostFitShapesFromWorkspace -w ${cf}combined.txt.cmb.root -d ${cf}combined.txt.cmb --postfit -f ${cf}fitDiagnostics.Test.root:fit_s -o ${cf}postfit_shapes.root
done