12 #include "sbnanaobj/StandardRecord/Proxy/FwdDeclare.h"
14 namespace caf{
class SRSpill;
class SRSpillTruthBranch;
class SRSlice;}
23 template<
class T>
class _Var;
30 template<
class T>
class _Var
37 _Var(
const std::function<VarFunc_t>& fun);
56 _Var(
const std::function<VarFunc_t>& fun,
int id)
82 #define SIMPLEVAR(CAFNAME) Var([](const caf::SRSliceProxy* sr) -> double {return sr->CAFNAME;})
84 #define SIMPLESPILLVAR(CAFNAME) SpillVar([](const caf::SRSpillProxy* sr) -> double {return sr->CAFNAME;})
95 template<
class T> _Var<T>
96 Var2D(
const _Var<T>&
a,
const Binning& binsa,
97 const _Var<T>& b,
const Binning& binsb);
103 template<
class T> _Var<T>
104 Var2D(
const _Var<T>&
a,
int na,
double a0,
double a1,
105 const _Var<T>& b,
int nb,
double b0,
double b1);
108 template<
class T> _Var<T>
109 Var3D(
const _Var<T>&
a,
const Binning& binsa,
110 const _Var<T>& b,
const Binning& binsb,
111 const _Var<T>& c,
const Binning& binsc);
114 template<
class T> _Var<T>
115 Var3D(
const _Var<T>&
a,
int na,
double a0,
double a1,
116 const _Var<T>& b,
int nb,
double b0,
double b1,
117 const _Var<T>& c,
int nc,
double c0,
double c1);
120 #define SpillTruthVar2D Var2D
121 #define SpillTruthVar3D Var3D
const SpillVar kSpillUnweighted([](const caf::SRSpillProxy *){return 1;})
std::function< VarFunc_t > fFunc
int ID() const
Vars with the same definition will have the same ID.
double( VarFunc_t)(const T *sr)
The type of the function part of a var.
_Var< T > Var2D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
Variable formed from two input variables.
process_name opflashCryoW ana
_Var< T > operator-(const _Var< T > &a, const _Var< T > &b)
caf::Proxy< caf::SRSlice > SRSliceProxy
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
_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 Constant(double c)
Use to weight events up and down by some factor.
_Var< caf::SRSpillProxy > SpillVar
Equivalent of Var acting on caf::SRSpill.
double operator()(const T *sr) const
Allows a variable to be called with double value = myVar(sr) syntax.
caf::Proxy< caf::StandardRecord > SRSpillProxy
EnsembleSpectrum operator*(const EnsembleRatio &lhs, const EnsembleSpectrum &rhs)
EnsembleRatio operator/(const EnsembleSpectrum &lhs, const EnsembleSpectrum &rhs)
_Var< T > operator+(const _Var< T > &a, const _Var< T > &b)
Var Sqrt(const Var &v)
Use to take sqrt of a var.
const Var kUnweighted([](const caf::SRSliceProxy *){return 1;})
The simplest possible Var, always 1. Used as a default weight.
then echo File list $list not found else cat $list while read file do echo $file sed s
_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.
Most useful for combining weights.
static int fgNextID
The next ID that hasn't yet been assigned.
_Var(const std::function< VarFunc_t > &fun, int id)