Skip to content

Conversation

@amassiro
Copy link
Contributor

When combining datacards (that is everywhere, for example when we have signal regions and control regions in fits), in the combined datacard if a nuisance is both "lnN" and "shape" (for example in one datacard is "lnN" and in another datacard is "shape"), the nuisance is renamed "shape?" [1]. This new nuisance naming triggers the following procedure in combine [2], in short:

  • check if in the root file the up/down variations are available, i.e. if the histograms are available
  • if found, then those histograms are used, otherwise use the value stored in the text file datacard

The issue is that when we run "AsLnN" in mkdatacard.py [3] we calculate the integral effect up/down, the value is added in the txt file of the datacard, but the hisogram with up/down variation is kept in the root file. Thus the histograms are used (even worse, because the up and down variations will be interpreted as N-sigmas variations as defined in the datacard, e.g. 0.95/1.34 --> 0.95 sigma down variation and 1.34 up variation, or the combine code would actually crash).

This simple cleaning code, to backup the already available root file and then rename the not needed histograms in the root file, to make sure this issue is not there.

[1] https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/blob/f5e201829ebeab08a1d25e7272a30e4a549a5a8e/scripts/combineCards.py#L249

[2] https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/latest/part2/settinguptheanalysis/?h=shape%3F#template-shape-uncertainties

If you have a nuisance parameter that has shape effects on some processes (using shape) and rate effects on other processes (using lnN) you should use a single line for the systematic uncertainty with shape?. This will tell Combine to fist look for Up/Down systematic templates for that process and if it doesnt find them, it will interpret the number that you put for the process as a lnN instead.

[3] https://github.com/latinos/LatinoAnalysis/blob/master/ShapeAnalysis/scripts/mkDatacards.py#L361

@amassiro
Copy link
Contributor Author

Not to be merged already, to be fully checked

@amassiro
Copy link
Contributor Author

To use it:

mkFolletto.py --outputDirDatacard folder/

and the other options if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants