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())),
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())),
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;
#define ATH_MSG_WARNING(x)
Define macros for attributes used to control the static checker.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
IsolationConditionCombined(const std::string &name, const std::vector< xAOD::Iso::IsolationType > &isoType, std::unique_ptr< TF1 > isoFunction, const std::string &cutFunction, const std::string &isoDecSuffix="", bool invertCut=false)
std::unique_ptr< TF1 > m_isoFunction
bool accept(const xAOD::IParticle &x) const override
std::unique_ptr< TF1 > m_cutFunction
IsolationCondition(const std::string &name, xAOD::Iso::IsolationType isoType, const std::string &isoDecSuffix="")
std::string m_isoDecSuffix
const FloatAccessor & accessor_noCloseBy(unsigned int n=0) const
const std::string & name() const
unsigned int num_types() const
xAOD::Iso::IsolationType type(unsigned int n=0) const
const FloatAccessor & accessor(unsigned int n=0) const
static AuxTypeRegistry & instance()
Return the singleton registry instance.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
SG::AuxElement::ConstAccessor< float > FloatAccessor
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.