Giter Club home page Giter Club logo

fitmetrecoilunc's Introduction

Package for CombineHarvester to constrain uncertainties for MET recoil corrections

Setup

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

Preparing inputs

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 $\vec{p}_{T}$, called e.g. 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.

Creating datacards

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

Creating workspaces

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

Performing the fits

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

Calculating total values of the uncertainties

As a final step, the total uncertainty for scale and resolution is determined for each category. The computation follows this formula: $10\% \cdot \sqrt{\text{pull}^2 + \text{constraint}^2}$. The calulcation is performed with the determine_recoiluncs.py script. To perform the computation for all years and MET definitions, execute:

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

Producing postfit and prefit shapes

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

fitmetrecoilunc's People

Contributors

arturakh avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.