-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Options -x and -k are used to exclude or keep nuisances in the datacards by using regular expressions, they can be used together, allowing one to exclude everything and then keep a few systs, e.g. -x ".*" -k ".*mass.*|.*effStat", since -k wins over -x.
Problem: the regular expression is evaluated both on the input boost histogram name passed to each call of CardTool.addSystematics, and also on the actual nuisance names generated internally afterwards.
In the previous example with the combined usage of -x and -k, if the expression passed to -k matches the nuisance names but not the histogram name, the histogram will be skipped, since -x will remove it, and then the code will never get to the part which produces the single nuisances.
For example, in the case of the mass weights the histogram is called massWeight, but nuisances are then renamed as massShift100MeV or similar. As a consequence, a syntax like -x ".*" -k ".*massWeight" will skip the mass nuisances, because it will select the histogram but will not match the actual nuisance names. Conversely, -x ".*" -k ".*massShift" will not match the histogram name and thus all the related nuisances will be skipped, even if the expression was correct for the nuisance names.
Temporary patch: these options are mainly for tests or special studies, so the simplest solution is just to write the expression in the most inclusive case as possible so to match all expected cases, with some redundancy if needed. For example, -x ".*" -k ".*mass(Weight|Shift)" (in this case -k ".*mass" works fine as well because the prefix is the same, but this may not always be the case).
With these caveats in mind, the options work correctly and can be safely used.