inference merge requestshttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests2021-07-26T18:27:38+02:00https://gitlab.cern.ch/hh/tools/inference/-/merge_requests/36Plot updates2021-07-26T18:27:38+02:00Marcel Riegermarcel.rieger@cern.chPlot updatesThis PR is meant to include a collection of updates of plots after receiving feedback from the 4b boosted approval. In particular, the changes aim to improve visual guidance for reading results, compliance with official [figure guideline...This PR is meant to include a collection of updates of plots after receiving feedback from the 4b boosted approval. In particular, the changes aim to improve visual guidance for reading results, compliance with official [figure guidelines](https://twiki.cern.ch/twiki/bin/view/CMS/Internal/FigGuidelines), overall clearness, and to issue warnings in case uncommon conditions are detected (Nan's in fits, negative dnll2 values, etc.).
- [x] Likelihood plot: warn about negative `dnll2` values that appear when combine used a local minimum to compute likelihood shifts
- [x] Likelihood plot: add option to recompute the POI minimum
- [x] Likelihood plot: use better default for minima when doing log plots
- [x] Likelihood plot 2D: show white pixels by default for grid points with failed fits, print a warning
- [x] Likelihood plot 2D: add option to fill in values from neighboring pixels (only recommended when happening very rarely and at "unimportant" locations)
- [x] Likelihood plot 2D: show best fit value only on request
- [x] Likelihood plots: warn about cases where best fits from combine and scipy diverge
- [x] Likelihood plots: add option to vertically shift dnll2 values when negative ones were detected
- [x] Exclusion plot 2D: show best fit value only on request (just flip the default)
- [x] Exclusion plot 2D: add "brazil" mode
- [x] All: Remove "Preliminary" label when `--paper` flag enabled
- [x] All: Make "CMS" logo larger and move into plot when possible
- [x] All: Use "68/95% expected" instead of "±1σ" where applicable
- [x] ~~All: maybe make legend position configurable via a single parameter~~ When doing this generically, this could lead to severe layout conflicts in most plots and needs different additional changes per plot.
- [x] S-over-B plot: change pre/postfit labels depending on `--unblinded` flag.
- [x] ~~Update fake plots in docs showing new style~~ Coming in additional PR (@mfackeld)
@slaurilaMarcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.chhttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests/32Fix prefit extraction of Poisson priors2021-06-24T18:38:01+02:00Marcel Riegermarcel.rieger@cern.chFix prefit extraction of Poisson priorsThis PR consists of three parts.
1. The extraction of prefit values from Poisson priors (usually added by combine in the form of MC stats. uncertainties below the event threshold) requires some preparation of the parameter in question w...This PR consists of three parts.
1. The extraction of prefit values from Poisson priors (usually added by combine in the form of MC stats. uncertainties below the event threshold) requires some preparation of the parameter in question which was missing so far. A recipe similar to that implemented in the harvester is now in place.
2. The dimensions of box plots, i.e., plots with multiple point-like entries across the y-axis (limit points, 1D exclusion comparison, multi GOF and pulls/impacts) can be fully configured now using `--pad-width`, `--left-margin`, `--right-margin`, `--entry-height` and `--label-size` to fit the needs of different analysis channels.
3. Labels of nuisances in pulls/impact plots can be translated using injectable rules via json or a custom function. See the updated docs for more info.Marcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.chhttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests/23Add unblinding mechanism to all tasks that need it.2021-02-11T17:33:05+01:00Marcel Riegermarcel.rieger@cern.chAdd unblinding mechanism to all tasks that need it.This PR adds a parameter `unblinded` to tasks inheriting from `POITask` (which are almost all tasks need to perform some kind of measurement). To perform the unblinding, three changes are required per task.
1. Change the underlying comb...This PR adds a parameter `unblinded` to tasks inheriting from `POITask` (which are almost all tasks need to perform some kind of measurement). To perform the unblinding, three changes are required per task.
1. Change the underlying combine command to obtain observed results.
2. Store the result in a file with a slight different name (injected "unblinded" to the path).
3. Update plotting methods.
Supersedes !18.Marcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.chhttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests/20Update task parameters to fit most use cases2021-01-19T16:14:53+01:00Marcel Riegermarcel.rieger@cern.chUpdate task parameters to fit most use casesThis PR updates the names and formats of some task parameters to better fit the needs of the inference tasks. In particular, the changes introduce the clear distinction between actual POIs and parameters that are scanned.
For instance, ...This PR updates the names and formats of some task parameters to better fit the needs of the inference tasks. In particular, the changes introduce the clear distinction between actual POIs and parameters that are scanned.
For instance, in the current master, some tasks have parameters `--poi` and `--r-poi`, meaning that the `--r-poi` is the actual POI that is free in the fit, whereas `--poi` is actually the parameter that is scanned (e.g. `kl`). This is confusing and obfuscates what is done by combine in the background. This PR is intended to correct this.
The changes will be presented in detail in the next HH working meeting on 19.1.2021.
Additional features:
- Postfit S-over-B plot, merged over all histogram bins in the datacards.
- 2D exclusion plots of "scan parameters" (e.g. kl and kt) given a POI (e.g. r or r_gghh).
- Move tasks into files within `tasks/` with descriptive names.
- Proper error propagation of theoretical uncertainties in plots.
Things left to do:
- [x] Add documentation to 2D exclusion plot.
- [x] Check if plotting needs to be updated given the changes to the HHModel by Luca and Fabio.
- ~~Update external documentation.~~ Will be updated in an other PR.
@mfackeldMarcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.chhttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests/17Update ggF cross section calculation2020-11-27T20:32:23+01:00Marcel Riegermarcel.rieger@cern.chUpdate ggF cross section calculationThis PR updates the `get_ggf_xsec` function that is currently only used for plotting purposes (but, by extension, also for results directly inferred from plots such as exclusion ranges from limits).
As before, the cross section is calcu...This PR updates the `get_ggf_xsec` function that is currently only used for plotting purposes (but, by extension, also for results directly inferred from plots such as exclusion ranges from limits).
As before, the cross section is calculated based on the GGF formula of the physics model, plugging in predetermined NLO cross section values of the three (or four) ggF samples. I updated these values to the proper NLO values multiplied by the k-factor. When the scaling to NNLO is enabled (which is the default in the function), the returned values now fully comply with the NNLO values recommended by the [LHCHXSWG](https://twiki.cern.ch/twiki/bin/view/LHCPhysics/LHCHXSWGHH?rev=60#Latest_recommendations_for_gluon). Example:
```python
from dhi.models.HHModel import get_ggf_xsec
print(get_ggf_xec(kl=2.))
# -> 0.013803...
```
In addition there is now the option to return up/down varied values based on (kl-dependent) scale and (kl-**in**dependent) PDF uncertainties. This feature should be used for plotting uncertainties of the theory prediction in the future.
@nlu @wangjin @mfackeld @lcadamurMarcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.chhttps://gitlab.cern.ch/hh/tools/inference/-/merge_requests/13Refactor task chain up to limits2020-10-28T10:29:54+01:00Marcel Riegermarcel.rieger@cern.chRefactor task chain up to limitsThis PR refactors the task chain to create limit plots. Most important changes:
- Added `MultiDatacardBaseTask`, `POITask1DWithR` and `POIScanTask1DWithR`
- Encoded hash of input datacards into output paths
- Added two new plots (`PlotM...This PR refactors the task chain to create limit plots. Most important changes:
- Added `MultiDatacardBaseTask`, `POITask1DWithR` and `POIScanTask1DWithR`
- Encoded hash of input datacards into output paths
- Added two new plots (`PlotMultipleUpperLimits`, `PlotUpperLimitsAtPOI`) for comparing limits across configurations
- Updated docs accordinglyWorking limits, likelihood scans, pulls and impactsMarcel Riegermarcel.rieger@cern.chMarcel Riegermarcel.rieger@cern.ch