11 #include "core/baby.hpp" 21 const std::function<ScalarFunc> &
function);
23 const std::function<VectorFunc> &
function);
34 const std::string &
Name()
const;
91 bool HavePass(
const std::vector<NamedFunc::VectorType> &vv);
NamedFunc operator>=(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if result of f is greater than or equal to result of g.
NamedFunc operator==(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests for equality of results of f and g.
std::vector< ScalarType > VectorType
NamedFunc & operator*=(const NamedFunc &func)
Multiply *this by func.
std::string name_
String representation of the function.
const std::string & Name() const
Get the string representation of this function.
Abstract base class for access to ntuple variables.
NamedFunc operator>(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if result of f is greater than result of g.
ScalarType GetScalar(const Baby &b) const
Evaluate scalar function with b as argument.
ScalarType(const Baby &) ScalarFunc
NamedFunc operator<(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if result of f is less than result of g.
NamedFunc operator-(NamedFunc f, NamedFunc g)
Add a NamedFunc from another.
Combines a callable function taking a Baby and returning a scalar or vector with its string represent...
NamedFunc operator<=(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if result of f is less than or equal to result of g.
VectorType(const Baby &) VectorFunc
bool IsScalar() const
Check if scalar function is valid.
NamedFunc operator!(NamedFunc f)
Gets NamedFunct returning logical inverse of result of f.
NamedFunc operator%(NamedFunc f, NamedFunc g)
Get remainder form division of two NamedFuncs.
NamedFunc operator[](const NamedFunc &func) const
Apply indexing operator and return result as a NamedFunc.
void CleanName()
Strip spaces from name.
NamedFunc operator*(NamedFunc f, NamedFunc g)
Multiply two NamedFuncs.
VectorType GetVector(const Baby &b) const
Evaluate vector function with b as argument.
std::function< ScalarFunc > scalar_func_
NamedFunc operator&&(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if results of both f and g are true.
std::string PlainName() const
NamedFunc & operator-=(const NamedFunc &func)
Subtract func from *this.
NamedFunc & operator=(const NamedFunc &)=default
NamedFunc operator||(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests if result of f or g is true.
NamedFunc & Function(const std::function< ScalarFunc > &function)
Set function to given scalar function.
std::function< VectorFunc > vector_func_
NamedFunc operator+(NamedFunc f, NamedFunc g)
Add two NamedFuncs.
bool IsVector() const
Check if vectorr function is valid.
const std::function< VectorFunc > & VectorFunction() const
Return the (possibly invalid) vector function.
std::string PrettyName() const
NamedFunc & operator%=(const NamedFunc &func)
Set *this to remainder of *this divided by func.
NamedFunc operator!=(NamedFunc f, NamedFunc g)
Gets NamedFunc which tests for inequality of results of f and g.
NamedFunc & operator+=(const NamedFunc &func)
Add func to *this.
bool HavePass(const NamedFunc::VectorType &v)
std::ostream & operator<<(std::ostream &stream, const NamedFunc &function)
Print NamedFunc to output stream.
NamedFunc & operator/=(const NamedFunc &func)
Divide *this by func.
const std::function< ScalarFunc > & ScalarFunction() const
Return the (possibly invalid) scalar function.
NamedFunc operator/(NamedFunc f, NamedFunc g)
Divide two NamedFuncs.