6 #include "CAFAna/Core/Binning.h" 7 #include "CAFAna/Core/Cut.h" 14 template<
class T>
class _Var
21 _Var(
const std::function<VarFunc_t>& fun);
48 _Cut<T> operator<(const _Var<T>&
v)
const;
50 _Cut<T> operator<=(const _Var<T>&
v)
const;
61 _Var(
const std::function<VarFunc_t>& fun,
int id);
88 #define SIMPLEVAR(CAFNAME) ana::Var([](const caf::SRProxy* sr){return sr->CAFNAME;}) 89 #define SIMPLENUTRUTHVAR(CAFNAME) ana::NuTruthVar([](const caf::SRNeutrinoProxy* nu){return nu->CAFNAME;}) 116 const _Var<T>& b,
int nb,
double b0,
double b1);
127 const _Var<T>& b,
int nb,
double b0,
double b1,
137 Var
Sqrt(
const Var& v);
141 template<
class T>
_Cut<T> operator<(double c, const _Var<T>&
v){
return v >
c;}
143 template<
class T>
_Cut<T> operator<=(double c, const _Var<T>&
v){
return v >=
c;}
_Cut< T > operator==(double c) const
std::function< VarFunc_t > fFunc
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
int ID() const
Vars with the same definition will have the same ID.
_Var< T > Var2D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
Variable formed from two input variables.
_Var< T > operator+(const _Var< T > &v) const
_Var< T > operator/(const _Var< T > &v) const
_Var< T > Var3D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb, const _Var< T > &c, const Binning &binsc)
This is just like a Var2D, but useful for 3D Spectra.
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Var Constant(double c)
Use to weight events up and down by some factor.
const SpillVar kSpillUnweighted
_Var< caf::SRSpillProxy > SpillVar
Equivalent of Var acting on caf::SRSpill. For use in making plots of POT per run etc.
double( VarFunc_t)(const T *sr)
The type of the function part of a var.
double operator()(const T *sr) const
Allows a variable to be called with double value = myVar(sr) syntax.
_Cut< T > operator>=(double c) const
_Cut< T > operator>(double c) const
_Var< caf::SRNeutrinoProxy > NuTruthVar
Var designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
double operator()(const T *) const
_Var< T > operator-(const _Var< T > &v) const
Var Sqrt(const Var &v)
Use to take sqrt of a var.
_Var< T > operator*(const _Var< T > &v) const
_Cut< T > operator<=(double c) const
const NuTruthVar kNuTruthUnweighted
_Cut< T > operator<(double c) const
_Var(const std::function< VarFunc_t > &fun)
std::function can wrap a real function, function object, or lambda
Var Scaled(const Var &v, double s)
Use to rescale another variable.
Template for Cut and SpillCut.
Template for Var and SpillVar.
static int fgNextID
The next ID that hasn't yet been assigned.
_Cut< T > operator!=(double c) const
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
_Var & operator=(const _Var< T > &v)