OverlayVars.cxx
Go to the documentation of this file.
3 
4 
5 namespace ana
6 {
7 
8  Var OverlayVarFromNuTruthVar(const NuTruthVar stv, double _default)
9  {
10  return Var([stv, _default](const caf::SRProxy* sr)
11  {
12  for (int i = 0; i < (int)sr->mc.nallnus; i++)
13  if ( sr->mc.allnus[i].mode > 9999 || !sr->spill.ismc )
14  return stv(&sr->mc.allnus[i]);
15  return _default;
16  });
17  }
18 
19 
20  const Var kNoWeight([](const caf::SRProxy *sr)
21  {
22  return 1.;
23  });
24  const Var kSpillPOTRatioWeight([](const caf::SRProxy *sr)
25  {
26  const double centralValue = 40.e12;
27  return sr->spill.spillpot/centralValue;
28  });
29  const Var kSliceCount([](const caf::SRProxy *sr)
30  {
31  return 0.;
32  });
33 
34 
35  const NuTruthVar kTrueE_Nu([](const caf::SRNeutrinoProxy* nu)
36  {
37  return float(nu->E);;
38  });
39  const NuTruthVar kTrueLepE_Nu([](const caf::SRNeutrinoProxy* nu)
40  {
41  return float(nu->prim[0].p.E);
42  });
43  const NuTruthVar kTrueQ2_Nu([](const caf::SRNeutrinoProxy* nu)
44  {
45  return float(nu->q2);
46  });
47  const NuTruthVar kTrueW2_Nu([](const caf::SRNeutrinoProxy* nu)
48  {
49  return float(nu->W2);
50  });
51  const NuTruthVar kTrueXbj_Nu([](const caf::SRNeutrinoProxy* nu)
52  {
53  return float(nu->x);
54  });
55  const NuTruthVar kTrueYbj_Nu([](const caf::SRNeutrinoProxy* nu)
56  {
57  return float(nu->y);
58  });
60  {
61  return float(nu->vtx.x);
62  });
64  {
65  return float(nu->vtx.y);
66  });
68  {
69  return float(nu->vtx.z);
70  });
72  {
73  return (nu->mode>9999) ? (float)nu->mode - 10000. : (float)nu->mode;
74  });
75  const NuTruthVar kIsCC_Nu([](const caf::SRNeutrinoProxy* nu)
76  {
77  return float(nu->iscc);
78  });
79  const NuTruthVar kPDG_Nu([](const caf::SRNeutrinoProxy* nu)
80  {
81  return float(nu->pdg);
82  });
84  {
85  return 0.;
86  });
87 
88  const Var kSlcNoiseFrac([](const caf::SRProxy* sr)
89  {
90  return sr->slc.fracnoiseE;
91  });
92  const Var kSlcNoiseFracN([](const caf::SRProxy* sr)
93  {
94  return 1.*sr->slc.nnoisehit/sr->slc.ncalhit;
95  });
96  const Var kSlcNoiseFracPE([](const caf::SRProxy* sr)
97  {
98  return sr->slc.fracnoisePE;
99  });
100  const Var kSlcEff([](const caf::SRProxy* sr)
101  {
102  for (int i = 0; i < (int)sr->mc.nallnus; i++)
103  if ( sr->mc.allnus[i].mode > 9999 || !sr->spill.ismc )
104  return (float)sr->mc.allnus[i].eff;
105  return -5.f;
106  });
107 
108 
109  const SpillVar kSpillCount_Sp([](const caf::SRSpillProxy* sp)
110  {
111  return 0.;
112  });
113  const SpillVar kSpillPOT_Sp([](const caf::SRSpillProxy* sp)
114  {
115  return sp->spillpot;
116  });
118  {
119  const double centralValue = 40.e12;
120  return sp->spillpot/centralValue;
121  });
122 } // namespace
123 
caf::Proxy< caf::SRSpill > spill
Definition: SRProxy.h:2010
const NuTruthVar kOTrueVtxZ_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->vtx.z);})
Definition: OverlayVars.h:24
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
const NuTruthVar kTrueQ2_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->q2);})
Definition: OverlayVars.h:18
const NuTruthVar kTrueYbj_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->y);})
Definition: OverlayVars.h:21
const Var kSlcNoiseFracPE([](const caf::SRProxy *sr){return sr->slc.fracnoisePE;})
Definition: OverlayVars.h:47
caf::Proxy< unsigned int > nnoisehit
Definition: SRProxy.h:1249
caf::Proxy< float > spillpot
Definition: SRProxy.h:1339
caf::Proxy< short int > nallnus
Definition: SRProxy.h:567
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1993
const NuTruthVar kOTrueVtxX_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->vtx.x);})
Definition: OverlayVars.h:22
const NuTruthVar kUselessVar_Nu([](const caf::SRNeutrinoProxy *nu){return 0.;})
Definition: OverlayVars.h:28
const SpillVar kSpillPOTRatioWeight_Sp([](const caf::SRSpillProxy *sp){const double centralValue=40.e12;return sp->spillpot/centralValue;})
Definition: OverlayVars.h:52
const Var kSliceCount([](const caf::SRProxy *sr){return 0.;})
Definition: OverlayVars.h:13
caf::Proxy< float > fracnoiseE
Definition: SRProxy.h:1238
caf::Proxy< unsigned int > ncalhit
Definition: SRProxy.h:1244
const NuTruthVar kOTrueVtxY_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->vtx.y);})
Definition: OverlayVars.h:23
const Var kNoWeight([](const caf::SRProxy *sr){return 1.;})
Definition: OverlayVars.h:11
const NuTruthVar kTrueLepE_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->prim[0].p.E);})
Definition: OverlayVars.h:17
const Var kSlcEff([](const caf::SRProxy *sr){for(int i=0;i< (int) sr->mc.nallnus;i++) if(sr->mc.allnus[i].mode > 9999||!sr->spill.ismc) return(float) sr->mc.allnus[i].eff;return-5.f;})
Definition: OverlayVars.h:48
const NuTruthVar kTrueXbj_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->x);})
Definition: OverlayVars.h:20
const SpillVar kSpillCount_Sp([](const caf::SRSpillProxy *sp){return 0.;})
Definition: OverlayVars.h:50
const NuTruthVar kTrueE_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->E);;})
Definition: OverlayVars.h:16
const Var kSlcNoiseFrac([](const caf::SRProxy *sr){return sr->slc.fracnoiseE;})
Definition: OverlayVars.h:45
const NuTruthVar kPDG_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->pdg);})
Definition: OverlayVars.h:27
const NuTruthVar kIsCC_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->iscc);})
Definition: OverlayVars.h:26
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2005
const Var kSlcNoiseFracN([](const caf::SRProxy *sr){return 1.*sr->slc.nnoisehit/sr->slc.ncalhit;})
Definition: OverlayVars.h:46
Var OverlayVarFromNuTruthVar(const NuTruthVar stv, double _default)
Definition: OverlayVars.cxx:8
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2009
caf::Proxy< std::vector< caf::SRNeutrino > > allnus
Definition: SRProxy.h:558
const NuTruthVar kOverlayMode_Nu([](const caf::SRNeutrinoProxy *nu){return(nu->mode >9999)?(float) nu->mode-10000.:(float) nu->mode;})
Definition: OverlayVars.h:25
const Var kSpillPOTRatioWeight([](const caf::SRProxy *sr){const double centralValue=40.e12;return sr->spill.spillpot/centralValue;})
Definition: OverlayVars.h:12
caf::Proxy< bool > ismc
Definition: SRProxy.h:1310
caf::Proxy< float > fracnoisePE
Definition: SRProxy.h:1239
const NuTruthVar kTrueW2_Nu([](const caf::SRNeutrinoProxy *nu){return float(nu->W2);})
Definition: OverlayVars.h:19
const SpillVar kSpillPOT_Sp([](const caf::SRSpillProxy *sp){return sp->spillpot;})
Definition: OverlayVars.h:51
static constexpr Double_t sr
Definition: Munits.h:164
Template for Var and SpillVar.
Definition: Var.h:16