Skip to content

Add factory methods for one-line construction of calculators

Based on the discussion in https://gitlab.cern.ch/cp3-cms/bamboo/-/merge_requests/206 I added factory methods to the calculator classes that can be used to get a const instance in one call, instead of constructing a non-const instance and calling setters on it - something like

const auto myCalc = JetVariationsCalculator::create(...);

The advantage from bamboo is that it allows to automatically reuse a calculator for different samples if they use the same configuration, but it may also be useful in other contexts.

The main open question is if the config helpers from https://gitlab.cern.ch/cp3-cms/bamboo/-/merge_requests/209 should be moved here instead (with a method to construct a calculator from PyROOT - that shouldn't be difficult to add now).

Merge request reports