Skip to content

Frequently needed methods (FNMs)

Jan Lukas Späh edited this page Nov 12, 2024 · 7 revisions

How can I create the classical Hgg signal modelling plots?

You can create plots like this by executing

python RunPlotter.py --procs all --cats <cats> --years <list of years, comma separated> --ext packaged

in the Signal directory, where is a valid category or all. You can also make the plot for different processes if needed. Include the flag --plot-years-separate if you want to also display the individual years, if more than one.

How can I check the best-fit Higgs boson mass and the uncertainty when floating it in the fit?

combine --floatOtherPOIs 1 -P MH --saveInactivePOI 1 --saveWorkspace --saveSpecifiedNuis all --cminDefaultMinimizerStrategy 0 --X-rtd MINIMIZER_freezeDisassociatedParams --X-rtd MINIMIZER_multiMin_hideConstants --X-rtd MINIMIZER_multiMin_maskConstraints --X-rtd MINIMIZER_multiMin_maskChannels=2 -M MultiDimFit -m 125.38 -d ../Datacard_mu_fiducial.root -n _bestfit_observed_mH_floating_grid --algo grid --points 25 --setParameterRanges MH=124,128 --robustFit 1

Then, you can plot the one-dimensional scan of

plot1DScan.py higgsCombine_bestfit_observed_mH_floating_grid.MultiDimFit.mH125.38.root --POI MH

Great, and how do I do that per category?

You can use the so-called channel masking feature.

python RunText2Workspace.py --mode mu_fiducial --common_opts "-m 125.38 higgsMassRange=122,128 --channel-masks" --batch local

This creates appropriate masks in the output ws. If you turn on high verbosity, you can actually see it in the printout:

[#1] INFO:ObjectHandling -- RooWorkspace::import(w) using existing copy of RooRealVar::mask_best_resolution for import of RooSimultaneousOpt::model_s
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) using existing copy of RooRealVar::mask_medium_resolution for import of RooSimultaneousOpt::model_s
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) using existing copy of RooRealVar::mask_worst_resolution for import of RooSimultaneousOpt::model_s

Then, you can perform the same fits as above but pass the appropriate channel masks with --setParameters mask_XXX=1 (=1 means channel is turned OFF, 0 is the default).

We also tried combine -M ChannelCompatibilityCheck ../Datacard_mu_fiducial.root -m 125.38 -n HggCompatCheck but that is not working yet...

How to produce an uncertainty breakdown?

This is explained in https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/latest/tutorial2023/parametric_exercise/?h=breakdown#uncertainty-breakdown. Here is a quick summary by example.

  1. First, define a nuisance group in the Datacard where you would like to see its relevance for the measurement. For example, for a scale and resolution group, you can define (e.g. for HIG-23-014)
photon-energy-scale-and-resolution group = CMS_hgg_nuisance_ScaleEB_2022preEE CMS_hgg_nuisance_ScaleEE_2022preEE CMS_hgg_nuisance_ScaleEB_2022postEE CMS_hgg_nuisance_ScaleEE_2022postEE CMS_hgg_nuisance_Smearing_2022preEE CMS_hgg_nuisance_Smearing_2022postEE

You can just put this at the end of the datacard. Then, convert the datacard into a workspace with text2workspace.py.

  1. Stat+syst (complete)
combine -M MultiDimFit Datacard_mu_fiducial.root -m 125.38 -n .observed_scan_fBreakdown.with_syst --cminDefaultMinimizerStrategy=0 --algo grid --points 200 --rMin 0.7 --rMax 1.6 --X-rtd MINIMIZER_freezeDisassociatedParams --X-rtd MINIMIZER_multiMin_hideConstants --X-rtd MINIMIZER_multiMin_maskConstraints --X-rtd MINIMIZER_multiMin_maskChannels=2 -P r --saveFitResult --freezeParameters MH --floatOtherPOIs 1 --saveWorkspace --saveSpecifiedIndex pdfindex_best_resolution_2022_13TeV,pdfindex_medium_resolution_2022_13TeV,pdfindex_worst_resolution_2022_13TeV --cminApproxPreFitTolerance 0.01
  1. Freeze nuisance group
combine -M MultiDimFit higgsCombine.observed_scan_fBreakdown.with_syst.MultiDimFit.mH125.38.root --snapshotName MultiDimFit -m 125.38 -n .observed_scan_fBreakdown.freeze_photon-energy-scale-and-resolution --cminDefaultMinimizerStrategy=0 --algo grid --points 200 --rMin 0.7 --rMax 1.6 --X-rtd MINIMIZER_freezeDisassociatedParams --X-rtd MINIMIZER_multiMin_hideConstants --X-rtd MINIMIZER_multiMin_maskConstraints --X-rtd MINIMIZER_multiMin_maskChannels=2 -P r --saveFitResult --freezeParameters MH --freezeNuisanceGroups photon-energy-scale-and-resolution --floatOtherPOIs 1 --saveWorkspace --saveSpecifiedIndex pdfindex_best_resolution_2022_13TeV,pdfindex_medium_resolution_2022_13TeV,pdfindex_worst_resolution_2022_13TeV --cminApproxPreFitTolerance 0.01
  1. Plotting
plot1DScan.py higgsCombine.observed_scan_fBreakdown.with_syst.MultiDimFit.mH125.38.root --others 'higgsCombine.observed_scan_fBreakdown.freeze_photon-energy-scale-and-resolution.MultiDimFit.mH125.38.root:Freeze photon-energy-scale-and-resolution:2' -o r_statsyst_fixedMH_observed_fBreakdown --POI r --breakdown photon-energy-scale-and-resolution,syst