sundleeb / DMSFit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MonoXFit

Installation

cmsrel CMSSW_8_1_0
cd CMSSW_8_1_0/src
cmsenv
git clone https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
git clone https://github.com/LPC-DM/DMSFit.git -b SuperMonojetFit
scram b -j16

Produce fitting trees

  1. Modify config/categories_config.py to point to the correct input root file
  2. Call python buildModel.py categories_config to create mono-x.root
  3. Call python runModel.py to create combined-model.root

Running a single fit

datacards/combined.txt is the full datacard for this analysis. You can choose which signal model to use by uncommenting the appropriate line. The datacard automatically points to the combined-model.root file one directory up. Any changes to the datacard must be made here and in the datacard used for scans (see below)

To run the fit:

cd datacards/
combine -M MaxLikelihoodFit combined_2cat.txt --saveShapes --saveWithUncertainties

And the signal masked-fit:

cd datacards/
text2workspace.py combined_2cat.txt --channel-masks
combine combined_2cat.root -M MaxLikelihoodFit --saveShapes --saveWithUncertainties --setPhysicsModelParameters mask_tight_sig=1,mask_loose_sig=1

Running the limit scan

datacards/combined_tmpl.txt is identical to combined.txt, except the signal model is not specified. Any changes to the scan datacard must be made here and in the datacard used for fits (see above)

To run the scan:

cd datacards/
python scan.py

The results are dumped in *_obs_limits.txt

Making postfit plots

All plotting tools are in plotting/. They must be run after running the fit (or limit scan, depending on what plots you want to make). These scripts automatically point to the ROOT files generated by the above combine calls, so there is nothing you need to do.

python plot_ratio.py                                             # plots the xfer factors - no need to rerun now that the inputs are finalized
python plotStackedPostFit.py                                     # makes the stack plots with prefit and postfit comparisons to data
python diffNuisances.py -g pulls.root ../datacards/mlfit.root    # draws the pulls plot
python plotLimits.py                                             # makes the limit plots (both sigma and sigma/sigma_theory)

The output directories are specified inside the above scripts and will need to be changed to fit the user's preferences. This should probably be changed to an environment variable.

About


Languages

Language:Python 44.0%Language:C 39.6%Language:C++ 8.5%Language:Makefile 4.5%Language:Shell 3.4%