XsecTunes.cxx
Go to the documentation of this file.
1 /// XsecTunes.cxx:
2 /// Global cross section "tunes" suitable for various analyses.
3 /// See header file for more documentation.
4 
5 // needed to instantiate GetRegisterable()
6 #include "NOvARwgt/rwgt/EventRecord.h"
7 #include "NOvARwgt/rwgt/Tune.h"
8 #include "NOvARwgt/util/InputVals.h"
9 #include "NOvARwgt/util/Registry.ixx"
10 
13 #include "CAFAna/Core/Var.h"
14 
15 #include "CAFAna/Vars/XsecTunes.h"
16 
17 namespace ana
18 {
19  NuTruthVar VarFromNOvATune(const novarwgt::Tune &tune)
20  {
21  return NuTruthVar([tune](const caf::SRNeutrinoProxy *nu)
22  {
23  auto evt = novarwgt::ConvertSRTruth(nu);
24  return tune.EventWeight(evt);
25  });
26 
27  }
28 
29  // Rescale MEC in miniprod5 to get the same number of events than prod4
31  {
32  if ( truth->mode != caf::kMEC ) return 1.0;
33  double weight = 1.6;
34  return weight;
35  });
36 
37  const novarwgt::Tune kXsecCVTune2020_Provisional(
38  {
39  { "MEC", novarwgt::GetWeighter<EmpiricalMECWgt2020>() },
40  }
41  );
42 
43  const novarwgt::Tune kXsecCVTune2020Gauss_Provisional(
44  {
45  { "MEC", novarwgt::GetWeighter<ValenciaMECWgt2020_Provisional>() },
46  }
47  );
48 
49 
50 }
_Var< caf::SRNeutrinoProxy > NuTruthVar
Definition: Var.h:9
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
Proxy for caf::SRNeutrino.
Definition: SRProxy.h:510
caf::Proxy< int > mode
Definition: SRProxy.h:543
NuTruthVar VarFromNOvATune(const novarwgt::Tune &tune)
Build a CAFAna NuTruthVar from a novarwgt::Tune instance.
Definition: XsecTunes.cxx:19
const NuTruthVar kScaleMECWgtminiprod5_NT([](const caf::SRNeutrinoProxy *truth){if(truth->mode!=caf::kMEC) return 1.0;double weight=1.6;return weight;})
Definition: XsecTunes.h:61
const novarwgt::Tune kXsecCVTune2020_Provisional
int evt
Definition: NusVarsTemp.cxx:53
const novarwgt::EventRecord & ConvertSRTruth(const T *nu, bool forceNoCache)
Copy information out of an SRNeutrino.
Template for Vars applied to any type of object.
Definition: FwdDeclare.h:12
const novarwgt::Tune kXsecCVTune2020Gauss_Provisional
First attempt at tuning MEC using a double Gaussian parameterization.