NueBkgdOnlyExtrap.cxx
Go to the documentation of this file.
2 
3 #include "CAFAna/Core/Loaders.h"
8 
9 namespace ana
10 {
11  //---------------------------------------------------------------------------
12 
14  SpectrumLoaderBase& nearMC,
15  SpectrumLoaderBase& farMCswap,
16  SpectrumLoaderBase& farMCnonswap,
17  SpectrumLoaderBase& farMCtauswap,
18  const IDecomp& nueDecomp,
19  const HistAxis& axis,
20  const Cut& fdcut,
21  const Cut& nueNDcut,
22  const SystShifts& shiftMC,
23  const Var& weight)
24  : ModularExtrap(farMCswap,
25  farMCnonswap,
26  farMCtauswap,
27  axis,
28  fdcut,
29  shiftMC,
30  weight)
31  {
32 
33  // Reset signal extrap comps to be empty
34  fMEextrap = std::unique_ptr<ModularExtrapComponent>(
35  new NoReweight(
36  farMCswap, axis, !kNoCut, shiftMC, weight, kIsSig && !kIsAntiNu ) );
37  fMEAntiextrap = std::unique_ptr<ModularExtrapComponent>(
38  new NoReweight(
39  farMCswap, axis, !kNoCut, shiftMC, weight, kIsSig && kIsAntiNu ) );
40 
41  // mu -> mu ----
42  fMMextrap = std::unique_ptr<ModularExtrapComponent>(
43  new RecoReweight(
44  nearMC, axis, fdcut, shiftMC, weight,
45  "mu -> mu", "#nu_{#mu} #rightarrow #nu_{#mu}",
46  nueNDcut, nueDecomp, // nue selection in ND
47  DecompResult::numu, kIsNumuCC && !kIsAntiNu, // numu truth in ND
48  farMCnonswap, kIsNumuCC && !kIsAntiNu // mu->mu in FD
49  )
50  );
51  // mubar -> mubar ---
52  if ( isRHC ) {
53  fMMAntiextrap = std::unique_ptr<ModularExtrapComponent>(
54  new RecoReweight(
55  nearMC, axis, fdcut, shiftMC, weight,
56  "mubar -> mubar", "#bar{#nu}_{#mu} #rightarrow #bar{#nu}_{#mu}",
57  nueNDcut, nueDecomp, // nue selection in ND
58  DecompResult::numubar, kIsNumuCC && kIsAntiNu, // numu truth in ND
59  farMCnonswap, kIsNumuCC && kIsAntiNu // mu->mu in FD
60  )
61  );
62  }
63  // NC -> NC ----
64  fNCextrap = std::unique_ptr<ModularExtrapComponent>(
65  new RecoReweight(
66  nearMC, axis, fdcut, shiftMC, weight,
67  "NC -> NC", "NC #rightarrow NC",
68  nueNDcut, nueDecomp, // nue selection in ND
69  DecompResult::NC, kIsNC && !kIsAntiNu, // NC truth in ND
70  farMCswap, kIsNC && !kIsAntiNu, // NC->NC in FD
71  farMCnonswap, farMCtauswap // extra NC stats
72  )
73  );
74  // NC Anti -> NC Anti ---
75  fNCAntiextrap = std::unique_ptr<ModularExtrapComponent>(
76  new RecoReweight(
77  nearMC, axis, fdcut, shiftMC, weight,
78  "NCbar -> NCbar", "NC bar #rightarrow NC bar",
79  nueNDcut, nueDecomp, // nue selection in ND
80  DecompResult::NCbar, kIsNC && kIsAntiNu, // NC truth in ND
81  farMCswap, kIsNC && kIsAntiNu, // NC->NC in FD
82  farMCnonswap, farMCtauswap // extra NC stats
83  )
84  );
85  // e -> e ----
86  fEEextrap = std::unique_ptr<ModularExtrapComponent>(
87  new RecoReweight(
88  nearMC, axis, fdcut, shiftMC, weight,
89  "e -> e", "#nu_{e} #rightarrow #nu_{e}",
90  nueNDcut, nueDecomp, // nue selection in ND
91  DecompResult::nue, kIsBeamNue && !kIsAntiNu, // nue truth in ND
92  farMCnonswap, kIsBeamNue && !kIsAntiNu // e->e in FD
93  )
94  );
95  // ebar -> ebar ---
96  if ( isRHC ) {
97  fEEAntiextrap = std::unique_ptr<ModularExtrapComponent>(
98  new RecoReweight(
99  nearMC, axis, fdcut, shiftMC, weight,
100  "ebar -> ebar", "#bar{#nu}_{e} #rightarrow #bar{#nu}_{e}",
101  nueNDcut, nueDecomp, // nue selection in ND
102  DecompResult::nuebar, kIsBeamNue && kIsAntiNu, // nue truth in ND
103  farMCnonswap, kIsBeamNue && kIsAntiNu // e->e in FD
104  )
105  );
106  }
107 
108  }
109 
110  //---------------------------------------------------------------------------
111 
113  Loaders& loaders,
114  const IDecomp& nueDecomp,
115  const HistAxis& axis,
116  const Cut& fdcut,
117  const Cut& nueNDcut,
118  const SystShifts& shiftMC,
119  const Var& weight)
120  : NueBkgdOnlyExtrap(isRHC,
121  loaders.GetLoader(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap),
122  loaders.GetLoader(caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kFluxSwap),
123  loaders.GetLoader(caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap),
124  loaders.GetLoader(caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kTauSwap),
125  nueDecomp,
126  axis,
127  fdcut,
128  nueNDcut,
129  shiftMC,
130  weight)
131  {}
132 
133 }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Nue extrapolation, applied to background only.
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
"Extrapolates" component by returning FD Monte Carlo.
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
const Color_t kMC
const Cut kIsAntiNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg< 0;})
Is this truly an antineutrino?
Definition: TruthCuts.h:53
const Cut kIsBeamNue(CCFlavSel(12, 12))
Select CC .
NueBkgdOnlyExtrap(const bool isRHC, SpectrumLoaderBase &nearMCLoader, SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const IDecomp &nueDecomp, const HistAxis &axis, const Cut &fdcut, const Cut &nueNDcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
std::unique_ptr< ModularExtrapComponent > fNCextrap
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
const Cut kIsNC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return!sr->mc.nu[0].iscc;})
Is this a Neutral Current event?
Definition: TruthCuts.h:8
const Cut kIsSig(CCFlavSel(12, 14))
Select CC .
std::unique_ptr< ModularExtrapComponent > fEEAntiextrap
Definition: ModularExtrap.h:91
Base class for the various types of spectrum loader.
std::unique_ptr< ModularExtrapComponent > fNCAntiextrap
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
std::vector< Loaders * > loaders
Definition: syst_header.h:386
Standard interface to all decomposition techniques.
Definition: IDecomp.h:13
This module creates Common Analysis Files.
Definition: FileReducer.h:10
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:23
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
Extrapolates using reco-over-reco method.