Var.cxx
Go to the documentation of this file.
1 #include "CAFAna/Core/Var.h"
2 
4 
5 namespace ana
6 {
7  Var VarFromNuTruthVar(const NuTruthVar& stv, double _default)
8  {
9  struct NuTruthFwd
10  {
11  NuTruthVar stv; double _default;
12  double operator()(const caf::SRProxy* sr) const
13  {
14  if(sr->mc.nnu == 0) return _default;
15  return stv(&sr->mc.nu[0]);
16  }
17  };
18 
19  return Var(NuTruthFwd{stv, _default});
20  }
21 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
caf::StandardRecord * sr
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
Definition: Var.cxx:7