16 std::unique_ptr<TF1> isoFunction,
const std::string& cutFunction,
const std::string& isoDecSuffix,
bool invertCut) :
18 m_cutFunction (std::
make_unique<TF1>(cutFunction.c_str(), cutFunction.c_str())),
19 m_isoFunction (std::move(isoFunction)),
20 m_invertCut(invertCut)
24 std::unique_ptr<TF1> isoFunction,
const std::string& cutFunction,
const std::string& isoDecSuffix,
bool invertCut) :
26 m_cutFunction (std::
make_unique<TF1>(cutFunction.c_str(), cutFunction.c_str())),
27 m_isoFunction (std::move(isoFunction)),
28 m_invertCut(invertCut)
34 std::vector<double> isoVars(
num_types(), 0);
35 for (
unsigned int iacc = 0; iacc <
num_types(); ++iacc) {
38 if (!
acc.isAvailable(
x)) {
43 isoVars[iacc] = acc_noCloseBy(
x);
47 <<
" is not available. Expected when using primary AODs, post-p3793 derivations (only for *FixedRad or FixedCutPflow* for electrons), "
48 <<
" pre-p3517 derivations (only for FC*), or pre-p3830 derivations (for other electron WPs)");
49 if (!
m_isoDecSuffix.empty())
throw std::runtime_error (
"IsolationConditionCombined: IsolationSelectionTool property 'IsoDecSuffix' is set to " +
m_isoDecSuffix +
". Must run on derivation made with IsolationCloseByCorrection to create the isolation variables with this suffix, or remove 'IsoDecSuffix'. ");
50 isoVars[iacc] = FLT_MAX;
53 isoVars[iacc] =
acc(
x);
59 const float isoValue =
f->EvalPar(isoVars.data());
61 return isoValue > cutValue;
66 std::vector<double> isoVars;
67 for (
unsigned int itype = 0; itype <
num_types(); ++itype) isoVars.push_back(
x.isolationValues[
type(itype)]);
69 const float isoValue =
f->EvalPar(isoVars.data());
71 return isoValue > cutValue;