Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ana::ModularExtrapSterile Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/NuXAna/Extrap/ExtrapSterile.h"

Inheritance diagram for ana::ModularExtrapSterile:
ana::ModularExtrap ana::IExtrap

Public Member Functions

 ModularExtrapSterile (const ModularExtrapSterile &)=delete
 
ModularExtrapSterileoperator= (const ModularExtrapSterile &)=delete
 
 ModularExtrapSterile (ModularExtrapSterile &&)=default
 
ModularExtrapSterileoperator= (ModularExtrapSterile &&)=default
 
virtual ~ModularExtrapSterile ()=default
 
void SaveTo (TDirectory *dir, const std::string &name) const override
 
OscillatableSpectrum OscNCComponent () const
 Return the oscillatable NC component. More...
 
Spectrum NCTotalComponent () override
 Override the ModularExtrap method. More...
 
Ratio NCNueProportion () const
 Return the proportion of NCs that originate as a given neutrino flavor/sign. More...
 
Ratio NCAntiNueProportion () const
 
Ratio NCNumuProportion () const
 
Ratio NCAntiNumuProportion () const
 
void SavePlotsNue (TDirectory *dir, double potFD) const
 
void SavePlotsNueRHC (TDirectory *dir, double potFD) const
 
void SavePlotsNumu (TDirectory *dir, double potFD) const
 
OscillatableSpectrum NueSurvComponent () override
 Charged current electron neutrino survival ( $\nu_e\to\nu_e$) More...
 
OscillatableSpectrum AntiNueSurvComponent () override
 Charged current electron antineutrino survival ( $\bar\nu_e\to\bar\nu_e$) More...
 
OscillatableSpectrum NumuSurvComponent () override
 Charged current muon neutrino survival ( $\nu_\mu\to\nu_\mu$) More...
 
OscillatableSpectrum AntiNumuSurvComponent () override
 Charged current muon antineutrino survival ( $\bar\nu_\mu\to\bar\nu_\mu$) More...
 
OscillatableSpectrum NueAppComponent () override
 Charged current electron neutrino appearance ( $\nu_\mu\to\nu_e$) More...
 
OscillatableSpectrum AntiNueAppComponent () override
 Charged current electron antineutrino appearance ( $\bar\nu_\mu\to\bar\nu_e$) More...
 
OscillatableSpectrum NumuAppComponent () override
 Charged current muon neutrino appearance ( $\nu_e\to\nu_\mu$) More...
 
OscillatableSpectrum AntiNumuAppComponent () override
 Charged current muon antineutrino appearance ( $\bar\nu_e\to\bar\nu_\mu$) More...
 
OscillatableSpectrum TauFromMuComponent () override
 Charged current tau neutrino appearance from muon neutrino ( $\nu_\mu\to\nu_\tau$) More...
 
OscillatableSpectrum AntiTauFromMuComponent () override
 Charged current tau antineutrino appearance from muon antineutrino ( $\bar\nu_\mu\to\bar\nu_\tau$) More...
 
OscillatableSpectrum TauFromEComponent () override
 Charged current tau neutrino appearance from electron neutrino ( $\nu_e\to\nu_\tau$) More...
 
OscillatableSpectrum AntiTauFromEComponent () override
 Charged current tau antineutrino appearance from electron antineutrino ( $\bar\nu_e\to\bar\nu_\tau$) More...
 
Spectrum NCComponent () override
 
Spectrum NCAntiComponent () override
 
std::vector< ModularExtrapComponent * > GetModExtrapComponents () const
 

Static Public Member Functions

static ModularExtrapSterile NCDisappearance (Loaders &loaders, const IDecomp &NCSurvDecomp, const IDecomp &NumuOscDecomp, const HistAxis &axis, const HistAxis &axisNumuND, const Cut &fdcut, const Cut &NCNDcut, const Cut &NumuNDcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
 Creates a NC disappearance extrapolation. More...
 
static ModularExtrapSterile NCDisappearance (SpectrumLoaderBase &nearMCLoader, SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const IDecomp &NCSurvDecomp, const IDecomp &NumuOscDecomp, const HistAxis &axis, const HistAxis &axisNumuND, const Cut &fdcut, const Cut &NCNDcut, const Cut &NumuNDcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
 Creates a NC disappearance extrapolation with individual spectrum loaders. More...
 
static ModularExtrapSterile TrivialExtrapNC (Loaders &loaders, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
 Creates a NC disappearance "extrapolation" by returning FD MC. More...
 
static ModularExtrapSterile TrivialExtrapNC (SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
 
static std::unique_ptr< ModularExtrapSterileLoadFrom (TDirectory *dir, const std::string &name)
 

Protected Member Functions

 ModularExtrapSterile (ModularExtrap &&load)
 Constructor necessary for loading an extrapolation from file. More...
 

Protected Attributes

std::unique_ptr< SpectrumfNCNueNumerator
 
std::unique_ptr< SpectrumfNCAntiNueNumerator
 
std::unique_ptr< SpectrumfNCNumuNumerator
 
std::unique_ptr< SpectrumfNCAntiNumuNumerator
 
std::unique_ptr< SpectrumfNCDenominator
 
std::unique_ptr< ModularExtrapComponentfEEextrap
 
std::unique_ptr< ModularExtrapComponentfEEAntiextrap
 
std::unique_ptr< ModularExtrapComponentfMMextrap
 
std::unique_ptr< ModularExtrapComponentfMMAntiextrap
 
std::unique_ptr< ModularExtrapComponentfMEextrap
 
std::unique_ptr< ModularExtrapComponentfMEAntiextrap
 
std::unique_ptr< ModularExtrapComponentfEMextrap
 
std::unique_ptr< ModularExtrapComponentfEMAntiextrap
 
std::unique_ptr< ModularExtrapComponentfNCTotalextrap
 
std::unique_ptr< ModularExtrapComponentfNCextrap
 
std::unique_ptr< ModularExtrapComponentfNCAntiextrap
 
std::unique_ptr< ModularExtrapComponentfMTextrap
 
std::unique_ptr< ModularExtrapComponentfMTAntiextrap
 
std::unique_ptr< ModularExtrapComponentfETextrap
 
std::unique_ptr< ModularExtrapComponentfETAntiextrap
 

Private Member Functions

 ModularExtrapSterile (SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC, const Var &weight)
 Sets up all components to use FD MC–internal use only. More...
 

Detailed Description

A ModularExtrap compatible with sterile oscillations. Only extrapolates one sample.

Definition at line 24 of file ExtrapSterile.h.

Constructor & Destructor Documentation

ana::ModularExtrapSterile::ModularExtrapSterile ( SpectrumLoaderBase farMCswapLoader,
SpectrumLoaderBase farMCnonswapLoader,
SpectrumLoaderBase farMCtauswapLoader,
const HistAxis axis,
const Cut fdcut,
const SystShifts shiftMC,
const Var weight 
)
private

Sets up all components to use FD MC–internal use only.

Use a named constructor to create a ModularExtrapSterile.

Definition at line 188 of file ExtrapSterile.cxx.

Referenced by LoadFrom().

196  : ModularExtrap(
197  farMCswap,
198  farMCnonswap,
199  farMCtauswap,
200  axis,
201  fdcut,
202  shiftMC,
203  weight
204  ), // Sets up the components with default NoReweights
205 
206  // Set up Spectrum objects for NC Proportion Ratios
207  fNCNueNumerator(std::make_unique<Spectrum>(farMCnonswap, axis,
208  fdcut && kIsNC && !kIsAntiNu && kNCBeamNue,
209  shiftMC, weight)),
210  fNCAntiNueNumerator(std::make_unique<Spectrum>(farMCnonswap, axis,
211  fdcut && kIsNC && kIsAntiNu && kNCBeamNue,
212  shiftMC, weight)),
213  fNCNumuNumerator(std::make_unique<Spectrum>(farMCnonswap, axis,
214  fdcut && kIsNC && !kIsAntiNu && kNCBeamNumu,
215  shiftMC, weight)),
216  fNCAntiNumuNumerator(std::make_unique<Spectrum>(farMCnonswap, axis,
217  fdcut && kIsNC && kIsAntiNu && kNCBeamNumu,
218  shiftMC, weight)),
219  fNCDenominator(std::make_unique<Spectrum>(farMCnonswap, axis,
220  fdcut && kIsNC,
221  shiftMC, weight)) {
222  }
std::unique_ptr< Spectrum > fNCNueNumerator
const Var weight
std::unique_ptr< Spectrum > fNCNumuNumerator
std::unique_ptr< Spectrum > fNCAntiNumuNumerator
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
std::unique_ptr< Spectrum > fNCDenominator
const Cut kNCBeamNue(NCFlavSel(12, 12))
Select NC .
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 kNCBeamNumu(NCFlavSel(14, 14))
Select NC .
std::unique_ptr< Spectrum > fNCAntiNueNumerator
ana::ModularExtrapSterile::ModularExtrapSterile ( const ModularExtrapSterile )
delete
ana::ModularExtrapSterile::ModularExtrapSterile ( ModularExtrapSterile &&  )
default
virtual ana::ModularExtrapSterile::~ModularExtrapSterile ( )
virtualdefault
ana::ModularExtrapSterile::ModularExtrapSterile ( ModularExtrap &&  load)
protected

Constructor necessary for loading an extrapolation from file.

Definition at line 225 of file ExtrapSterile.cxx.

226  : ModularExtrap(std::move(load)) { // Sets up the ModularExtrapComponents
227  }
void load(std::string lib)
Definition: load_libs.C:3

Member Function Documentation

OscillatableSpectrum ana::ModularExtrap::AntiNueAppComponent ( )
overridevirtualinherited

Charged current electron antineutrino appearance ( $\bar\nu_\mu\to\bar\nu_e$)

Implements ana::IExtrap.

Definition at line 197 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMEAntiextrap.

198  {return fMEAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
OscillatableSpectrum ana::ModularExtrap::AntiNueSurvComponent ( )
overridevirtualinherited

Charged current electron antineutrino survival ( $\bar\nu_e\to\bar\nu_e$)

Implements ana::IExtrap.

Definition at line 185 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEEAntiextrap.

186  {return fEEAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fEEAntiextrap
Definition: ModularExtrap.h:91
OscillatableSpectrum ana::ModularExtrap::AntiNumuAppComponent ( )
overridevirtualinherited

Charged current muon antineutrino appearance ( $\bar\nu_e\to\bar\nu_\mu$)

Implements ana::IExtrap.

Definition at line 203 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEMAntiextrap.

204  {return fEMAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fEMAntiextrap
Definition: ModularExtrap.h:97
OscillatableSpectrum ana::ModularExtrap::AntiNumuSurvComponent ( )
overridevirtualinherited

Charged current muon antineutrino survival ( $\bar\nu_\mu\to\bar\nu_\mu$)

Implements ana::IExtrap.

Definition at line 191 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMMAntiextrap.

192  {return fMMAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
OscillatableSpectrum ana::ModularExtrap::AntiTauFromEComponent ( )
overridevirtualinherited

Charged current tau antineutrino appearance from electron antineutrino ( $\bar\nu_e\to\bar\nu_\tau$)

Implements ana::IExtrap.

Definition at line 224 of file ModularExtrap.cxx.

References ana::ModularExtrap::fETAntiextrap.

225  {return fETAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fETAntiextrap
OscillatableSpectrum ana::ModularExtrap::AntiTauFromMuComponent ( )
overridevirtualinherited

Charged current tau antineutrino appearance from muon antineutrino ( $\bar\nu_\mu\to\bar\nu_\tau$)

Implements ana::IExtrap.

Definition at line 218 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMTAntiextrap.

219  {return fMTAntiextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMTAntiextrap
std::vector<ModularExtrapComponent*> ana::ModularExtrap::GetModExtrapComponents ( ) const
inlineinherited

Definition at line 60 of file ModularExtrap.h.

References allInOneTrainingPlots::axis, ana::ModularExtrap::fEEAntiextrap, ana::ModularExtrap::fEEextrap, ana::ModularExtrap::fEMAntiextrap, ana::ModularExtrap::fEMextrap, ana::ModularExtrap::fETAntiextrap, ana::ModularExtrap::fETextrap, ana::ModularExtrap::fMEAntiextrap, ana::ModularExtrap::fMEextrap, ana::ModularExtrap::fMMAntiextrap, ana::ModularExtrap::fMMextrap, ana::ModularExtrap::fMTAntiextrap, ana::ModularExtrap::fMTextrap, ana::ModularExtrap::fNCAntiextrap, ana::ModularExtrap::fNCextrap, ana::ModularExtrap::fNCTotalextrap, ana::ModularExtrap::ModularExtrap(), and ana::weight.

Referenced by ana::GetDecomp(), and make_files_for_decomp_plots().

61  {
62  return {
63  fEEextrap.get(), fEEAntiextrap.get(),
64  fMMextrap.get(), fMMAntiextrap.get(),
65  fMEextrap.get(), fMEAntiextrap.get(),
66  fEMextrap.get(), fEMAntiextrap.get(),
67  //nc
68  fNCTotalextrap.get(), fNCextrap.get(), fNCAntiextrap.get(),
69  //end nc
70  fMTextrap.get(), fMTAntiextrap.get(),
71  fETextrap.get(), fETAntiextrap.get()
72  };
73  }
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
std::unique_ptr< ModularExtrapComponent > fEMAntiextrap
Definition: ModularExtrap.h:97
std::unique_ptr< ModularExtrapComponent > fNCextrap
std::unique_ptr< ModularExtrapComponent > fMTAntiextrap
std::unique_ptr< ModularExtrapComponent > fNCTotalextrap
Definition: ModularExtrap.h:99
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
std::unique_ptr< ModularExtrapComponent > fEMextrap
Definition: ModularExtrap.h:96
std::unique_ptr< ModularExtrapComponent > fEEAntiextrap
Definition: ModularExtrap.h:91
std::unique_ptr< ModularExtrapComponent > fNCAntiextrap
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
std::unique_ptr< ModularExtrapComponent > fETAntiextrap
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
std::unique_ptr< ModularExtrapComponent > fMTextrap
std::unique_ptr< ModularExtrapComponent > fETextrap
std::unique_ptr< ModularExtrapSterile > ana::ModularExtrapSterile::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 284 of file ExtrapSterile.cxx.

References ana::assert(), dir, ana::ModularExtrap::LoadFrom(), ana::Spectrum::LoadFrom(), ModularExtrapSterile(), runNovaSAM::release, and runNovaSAM::ret.

284  {
285  std::unique_ptr<ModularExtrapSterile> ret(new ModularExtrapSterile( std::move( *ModularExtrap::LoadFrom(dir, name).release() ) )
286  );
287 
288  dir = dir->GetDirectory(name.c_str()); // switch to subdir
289  assert(dir);
290 
291  ret->fNCNueNumerator = Spectrum::LoadFrom(dir, "NCNue");
292  ret->fNCAntiNueNumerator = Spectrum::LoadFrom(dir, "NCAntiNue");
293  ret->fNCNumuNumerator = Spectrum::LoadFrom(dir, "NCNumu");
294  ret->fNCAntiNumuNumerator = Spectrum::LoadFrom(dir, "NCAntiNumu");
295  ret->fNCDenominator = Spectrum::LoadFrom(dir, "AllNC");
296 
297  delete dir;
298 
299  return ret;
300  }
const XML_Char * name
Definition: expat.h:151
ModularExtrapSterile(SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC, const Var &weight)
Sets up all components to use FD MC–internal use only.
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:535
static std::unique_ptr< ModularExtrap > LoadFrom(TDirectory *dir, const std::string &name)
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
Spectrum ana::ModularExtrap::NCAntiComponent ( )
overridevirtualinherited

Implements ana::IExtrap.

Definition at line 209 of file ModularExtrap.cxx.

References ana::ModularExtrap::fNCAntiextrap.

Referenced by ana::ModularExtrap::NCTotalComponent().

210  {return fNCAntiextrap->Return().Unoscillated();}
std::unique_ptr< ModularExtrapComponent > fNCAntiextrap
Ratio ana::ModularExtrapSterile::NCAntiNueProportion ( ) const

Definition at line 245 of file ExtrapSterile.cxx.

References fNCAntiNueNumerator, and fNCDenominator.

Referenced by ana::PredictionSterile::PredictComponent().

245  {
246  return Ratio(*fNCAntiNueNumerator.get(), *fNCDenominator.get());
247  }
std::unique_ptr< Spectrum > fNCDenominator
std::unique_ptr< Spectrum > fNCAntiNueNumerator
Ratio ana::ModularExtrapSterile::NCAntiNumuProportion ( ) const

Definition at line 255 of file ExtrapSterile.cxx.

References fNCAntiNumuNumerator, and fNCDenominator.

Referenced by ana::PredictionSterile::PredictComponent().

255  {
256  return Ratio(*fNCAntiNumuNumerator.get(), *fNCDenominator.get());
257  }
std::unique_ptr< Spectrum > fNCAntiNumuNumerator
std::unique_ptr< Spectrum > fNCDenominator
Spectrum ana::ModularExtrap::NCComponent ( )
overridevirtualinherited

Implements ana::IExtrap.

Definition at line 206 of file ModularExtrap.cxx.

References ana::ModularExtrap::fNCextrap.

Referenced by ana::ModularExtrap::NCTotalComponent().

207  {return fNCextrap->Return().Unoscillated();}
std::unique_ptr< ModularExtrapComponent > fNCextrap
ModularExtrapSterile ana::ModularExtrapSterile::NCDisappearance ( Loaders loaders,
const IDecomp NCSurvDecomp,
const IDecomp NumuOscDecomp,
const HistAxis axis,
const HistAxis axisNumuND,
const Cut fdcut,
const Cut NCNDcut,
const Cut NumuNDcut,
const SystShifts shiftMC = kNoShift,
const Var weight = kUnweighted 
)
static

Creates a NC disappearance extrapolation.

NCSurvDecomp and NCNDcut are for survival components selected as NCs. NumuOscDecomp and NumuNDCut are for components oscillated from numus, which then get selected as NCs.

Definition at line 22 of file ExtrapSterile.cxx.

References allInOneTrainingPlots::axis, ana::Loaders::GetLoader(), ana::kBeam, caf::kFARDET, ana::Loaders::kFluxSwap, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, ana::Loaders::kTauSwap, and ana::weight.

Referenced by AnaResultsLoad(), ExtendedAxesLoad(), ana::SterileGenerator::Generate(), MakeNus17Prediction(), MakeNusPrediction(), SideBandLoad(), sterile_demo(), SystsBirksLoad(), SystsCalibAbsLoad(), SystsCalibAbsLoad17(), SystsCalibAbsMethod17(), SystsCalibRelLoad(), SystsCalibRelLoad17(), SystsDecompLoad(), SystsDecompLoad17(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsLoad(), SystsNoiseLoad(), and SystsPPFXLoad17().

33  {
35  loaders.GetLoader(
37  loaders.GetLoader(
39  loaders.GetLoader(
41  loaders.GetLoader(
43  NCSurvDecomp,
44  NumuOscDecomp,
45  axis,
46  axisNumuND,
47  fdcut,
48  NCNDcut,
49  NumuNDcut,
50  shiftMC,
51  weight
52  );
53  }
Near Detector underground.
Definition: SREnums.h:10
Far Detector at Ash River.
Definition: SREnums.h:11
const Var weight
std::vector< Loaders * > loaders
Definition: syst_header.h:386
static ModularExtrapSterile NCDisappearance(Loaders &loaders, const IDecomp &NCSurvDecomp, const IDecomp &NumuOscDecomp, const HistAxis &axis, const HistAxis &axisNumuND, const Cut &fdcut, const Cut &NCNDcut, const Cut &NumuNDcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
Creates a NC disappearance extrapolation.
ModularExtrapSterile ana::ModularExtrapSterile::NCDisappearance ( SpectrumLoaderBase nearMCLoader,
SpectrumLoaderBase farMCswapLoader,
SpectrumLoaderBase farMCnonswapLoader,
SpectrumLoaderBase farMCtauswapLoader,
const IDecomp NCSurvDecomp,
const IDecomp NumuOscDecomp,
const HistAxis axis,
const HistAxis axisNumuND,
const Cut fdcut,
const Cut NCNDcut,
const Cut NumuNDcut,
const SystShifts shiftMC = kNoShift,
const Var weight = kUnweighted 
)
static

Creates a NC disappearance extrapolation with individual spectrum loaders.

NCSurvDecomp and NCNDcut are for survival components selected as NCs. NumuOscDecomp and NumuNDCut are for components oscillated from numus, which then get selected as NCs.

Definition at line 56 of file ExtrapSterile.cxx.

References ana::ModularExtrap::fEEextrap, ana::ModularExtrap::fMEAntiextrap, ana::ModularExtrap::fMEextrap, ana::ModularExtrap::fMMextrap, ana::ModularExtrap::fNCextrap, ana::kIsAntiNu, ana::kIsBeamNue(), ana::kIsNC, ana::kIsNumuCC(), ana::kIsSig(), ana::NCtot, ana::nue, ana::numu, and ana::numubar.

70  {
71  // Initialize all components with NoReweights,
72  // make sure other objects exist
73  ModularExtrapSterile extrap(
74  farMCswap,
75  farMCnonswap,
76  farMCtauswap,
77  axis,
78  fdcut,
79  shiftMC,
80  weight
81  );
82 
83  // NC -> NC ----
84  extrap.fNCextrap = std::unique_ptr<ModularExtrapComponent>(
85  new RecoReweight(
86  nearMC, axis, fdcut, shiftMC, weight,
87  "NC -> NC", "NC #rightarrow NC",
88  NCNDcut, NCSurvDecomp, // NC selection in ND
89  DecompResult::NCtot, kIsNC, // NC truth in ND
90  farMCswap, kIsNC, // NC->NC in FD
91  farMCnonswap, farMCtauswap // extra NC stats
92  )
93  );
94 
95  // mu -> mu ----
96  extrap.fMMextrap = std::unique_ptr<ModularExtrapComponent>(
97  new RecoReweight(
98  nearMC, axis, fdcut, shiftMC, weight,
99  "mu -> mu", "#mu #rightarrow #mu",
100  NCNDcut, NCSurvDecomp, // NC selection in ND
101  DecompResult::numu, kIsNumuCC && !kIsAntiNu, // numu truth in ND
102  farMCnonswap, kIsNumuCC && !kIsAntiNu // mu->mu in FD
103  )
104  );
105 
106  // mu -> e ----
107  extrap.fMEextrap = std::unique_ptr<ModularExtrapComponent>(
108  new TruthReweight(
109  nearMC, axis, axisNumuND, fdcut, shiftMC, weight,
110  "mu -> e", "#mu #rightarrow e",
111  NumuNDcut, NumuOscDecomp, // numu selection in ND
112  DecompResult::numu, kIsNumuCC && !kIsAntiNu, // numu truth in ND
113  farMCswap, kIsSig && !kIsAntiNu // mu->e in FD
114  )
115  );
116  extrap.fMEAntiextrap = std::unique_ptr<ModularExtrapComponent>(
117  new TruthReweight(
118  nearMC, axis, axisNumuND, fdcut, shiftMC, weight,
119  "mubar -> ebar", "#bar{#mu} #rightarrow #bar{e}",
120  NumuNDcut, NumuOscDecomp, // numu selection in ND
121  DecompResult::numubar, kIsNumuCC && kIsAntiNu, // numubar truth in ND
122  farMCswap, kIsSig && kIsAntiNu // mubar->ebar in FD
123  )
124  );
125 
126  // e -> e ----
127  extrap.fEEextrap = std::unique_ptr<ModularExtrapComponent>(
128  new RecoReweight(
129  nearMC, axis, fdcut, shiftMC, weight,
130  "e -> e", "e #rightarrow e",
131  NCNDcut, NCSurvDecomp, // NC selection in ND
132  DecompResult::nue, kIsBeamNue && !kIsAntiNu, // nue truth in ND
133  farMCnonswap, kIsBeamNue && !kIsAntiNu // e->e in FD
134  )
135  );
136 
137  return extrap;
138  }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
const Var weight
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 .
ModularExtrapSterile(SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC, const Var &weight)
Sets up all components to use FD MC–internal use only.
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 .
Ratio ana::ModularExtrapSterile::NCNueProportion ( ) const

Return the proportion of NCs that originate as a given neutrino flavor/sign.

Definition at line 240 of file ExtrapSterile.cxx.

References fNCDenominator, and fNCNueNumerator.

Referenced by ana::PredictionSterile::PredictComponent().

240  {
241  return Ratio(*fNCNueNumerator.get(), *fNCDenominator.get());
242  }
std::unique_ptr< Spectrum > fNCNueNumerator
std::unique_ptr< Spectrum > fNCDenominator
Ratio ana::ModularExtrapSterile::NCNumuProportion ( ) const

Definition at line 250 of file ExtrapSterile.cxx.

References fNCDenominator, and fNCNumuNumerator.

Referenced by ana::PredictionSterile::PredictComponent().

250  {
251  return Ratio(*fNCNumuNumerator.get(), *fNCDenominator.get());
252  }
std::unique_ptr< Spectrum > fNCNumuNumerator
std::unique_ptr< Spectrum > fNCDenominator
Spectrum ana::ModularExtrapSterile::NCTotalComponent ( )
overridevirtual

Override the ModularExtrap method.

Reimplemented from ana::ModularExtrap.

Definition at line 235 of file ExtrapSterile.cxx.

References OscNCComponent(), and ana::OscillatableSpectrum::Unoscillated().

235  {
236  return OscNCComponent().Unoscillated();
237  }
OscillatableSpectrum OscNCComponent() const
Return the oscillatable NC component.
OscillatableSpectrum ana::ModularExtrap::NueAppComponent ( )
overridevirtualinherited

Charged current electron neutrino appearance ( $\nu_\mu\to\nu_e$)

Implements ana::IExtrap.

Definition at line 194 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMEextrap.

195  {return fMEextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
OscillatableSpectrum ana::ModularExtrap::NueSurvComponent ( )
overridevirtualinherited

Charged current electron neutrino survival ( $\nu_e\to\nu_e$)

Implements ana::IExtrap.

Definition at line 182 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEEextrap.

183  {return fEEextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
OscillatableSpectrum ana::ModularExtrap::NumuAppComponent ( )
overridevirtualinherited

Charged current muon neutrino appearance ( $\nu_e\to\nu_\mu$)

Implements ana::IExtrap.

Definition at line 200 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEMextrap.

201  {return fEMextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fEMextrap
Definition: ModularExtrap.h:96
OscillatableSpectrum ana::ModularExtrap::NumuSurvComponent ( )
overridevirtualinherited

Charged current muon neutrino survival ( $\nu_\mu\to\nu_\mu$)

Implements ana::IExtrap.

Definition at line 188 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMMextrap.

189  {return fMMextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
ModularExtrapSterile& ana::ModularExtrapSterile::operator= ( const ModularExtrapSterile )
delete
ModularExtrapSterile& ana::ModularExtrapSterile::operator= ( ModularExtrapSterile &&  )
default
OscillatableSpectrum ana::ModularExtrapSterile::OscNCComponent ( ) const

Return the oscillatable NC component.

Definition at line 230 of file ExtrapSterile.cxx.

References ana::ModularExtrap::fNCextrap.

Referenced by NCTotalComponent(), and ana::PredictionSterile::PredictComponent().

230  {
231  return fNCextrap->Return();
232  }
std::unique_ptr< ModularExtrapComponent > fNCextrap
void ana::ModularExtrap::SavePlotsNue ( TDirectory *  dir,
double  potFD 
) const
inherited

Definition at line 52 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEEextrap, ana::ModularExtrap::fMEAntiextrap, ana::ModularExtrap::fMEextrap, ana::ModularExtrap::fMMextrap, ana::ModularExtrap::fNCTotalextrap, and tmp.

53  {
54  TDirectory* tmp = gDirectory;
55  dir->cd();
56  fMEextrap->SavePlots( dir->mkdir("MEextrap"), potFD );
57  fMEAntiextrap->SavePlots( dir->mkdir("MEAntiextrap"), potFD );
58  fEEextrap->SavePlots( dir->mkdir("EEextrap"), potFD );
59  fMMextrap->SavePlots( dir->mkdir("MMextrap"), potFD );
60  fNCTotalextrap->SavePlots( dir->mkdir("NCTotalextrap"), potFD );
61  tmp->cd();
62  }
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
Float_t tmp
Definition: plot.C:36
std::unique_ptr< ModularExtrapComponent > fNCTotalextrap
Definition: ModularExtrap.h:99
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
TDirectory * dir
Definition: macro.C:5
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
void ana::ModularExtrap::SavePlotsNueRHC ( TDirectory *  dir,
double  potFD 
) const
inherited

Definition at line 66 of file ModularExtrap.cxx.

References ana::ModularExtrap::fEEAntiextrap, ana::ModularExtrap::fEEextrap, ana::ModularExtrap::fMEAntiextrap, ana::ModularExtrap::fMEextrap, ana::ModularExtrap::fMMAntiextrap, ana::ModularExtrap::fMMextrap, ana::ModularExtrap::fNCAntiextrap, ana::ModularExtrap::fNCextrap, and tmp.

67  {
68  TDirectory* tmp = gDirectory;
69  dir->cd();
70  fMEextrap->SavePlots( dir->mkdir("MEextrap"), potFD );
71  fMEAntiextrap->SavePlots( dir->mkdir("MEAntiextrap"), potFD );
72  fEEextrap->SavePlots( dir->mkdir("EEextrap"), potFD );
73  fEEAntiextrap->SavePlots( dir->mkdir("EEAntiextrap"), potFD );
74  fMMextrap->SavePlots( dir->mkdir("MMextrap"), potFD );
75  fMMAntiextrap->SavePlots( dir->mkdir("MMAntiextrap"), potFD );
76  fNCextrap->SavePlots( dir->mkdir("NCextrap"), potFD );
77  fNCAntiextrap->SavePlots( dir->mkdir("NCAntiextrap"), potFD );
78  tmp->cd();
79  }
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
std::unique_ptr< ModularExtrapComponent > fMEextrap
Definition: ModularExtrap.h:94
Float_t tmp
Definition: plot.C:36
std::unique_ptr< ModularExtrapComponent > fNCextrap
std::unique_ptr< ModularExtrapComponent > fMEAntiextrap
Definition: ModularExtrap.h:95
std::unique_ptr< ModularExtrapComponent > fEEAntiextrap
Definition: ModularExtrap.h:91
std::unique_ptr< ModularExtrapComponent > fNCAntiextrap
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
TDirectory * dir
Definition: macro.C:5
std::unique_ptr< ModularExtrapComponent > fEEextrap
Definition: ModularExtrap.h:90
void ana::ModularExtrap::SavePlotsNumu ( TDirectory *  dir,
double  potFD 
) const
inherited

Definition at line 83 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMMAntiextrap, ana::ModularExtrap::fMMextrap, and tmp.

Referenced by make_extrap_figure_hists(), and modularextrap_demo_numu().

84  {
85  TDirectory* tmp = gDirectory;
86  dir->cd();
87  fMMextrap->SavePlots( dir->mkdir("MMextrap"), potFD );
88  fMMAntiextrap->SavePlots( dir->mkdir("MMAntiextrap"), potFD );
89  tmp->cd();
90  }
std::unique_ptr< ModularExtrapComponent > fMMextrap
Definition: ModularExtrap.h:92
Float_t tmp
Definition: plot.C:36
std::unique_ptr< ModularExtrapComponent > fMMAntiextrap
Definition: ModularExtrap.h:93
TDirectory * dir
Definition: macro.C:5
void ana::ModularExtrapSterile::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Reimplemented from ana::ModularExtrap.

Definition at line 260 of file ExtrapSterile.cxx.

References dir, fNCAntiNueNumerator, fNCAntiNumuNumerator, fNCDenominator, fNCNueNumerator, fNCNumuNumerator, ana::ModularExtrap::SaveTo(), and tmp.

Referenced by MakeNus17Prediction(), and MakeNusPrediction().

260  {
261  TDirectory* tmp = gDirectory;
262 
263  dir = dir->mkdir(name.c_str()); // switch to subdir
264  dir->cd();
265 
267 
268  dir->cd();
269  TObjString("ModularExtrapSterile").Write("type", TObject::kOverwrite);
270 
271  fNCNueNumerator->SaveTo(dir, "NCNue");
272  fNCAntiNueNumerator->SaveTo(dir, "NCAntiNue");
273  fNCNumuNumerator->SaveTo(dir, "NCNumu");
274  fNCAntiNumuNumerator->SaveTo(dir, "NCAntiNumu");
275  fNCDenominator->SaveTo(dir, "AllNC");
276 
277  dir->Write();
278  delete dir;
279 
280  tmp->cd();
281  }
const XML_Char * name
Definition: expat.h:151
std::unique_ptr< Spectrum > fNCNueNumerator
void SaveTo(TDirectory *dir, const std::string &name) const override
std::unique_ptr< Spectrum > fNCNumuNumerator
std::unique_ptr< Spectrum > fNCAntiNumuNumerator
Float_t tmp
Definition: plot.C:36
std::unique_ptr< Spectrum > fNCDenominator
TDirectory * dir
Definition: macro.C:5
std::unique_ptr< Spectrum > fNCAntiNueNumerator
OscillatableSpectrum ana::ModularExtrap::TauFromEComponent ( )
overridevirtualinherited

Charged current tau neutrino appearance from electron neutrino ( $\nu_e\to\nu_\tau$)

Implements ana::IExtrap.

Definition at line 221 of file ModularExtrap.cxx.

References ana::ModularExtrap::fETextrap.

222  {return fETextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fETextrap
OscillatableSpectrum ana::ModularExtrap::TauFromMuComponent ( )
overridevirtualinherited

Charged current tau neutrino appearance from muon neutrino ( $\nu_\mu\to\nu_\tau$)

Implements ana::IExtrap.

Definition at line 215 of file ModularExtrap.cxx.

References ana::ModularExtrap::fMTextrap.

216  {return fMTextrap->Return();}
std::unique_ptr< ModularExtrapComponent > fMTextrap
ModularExtrapSterile ana::ModularExtrapSterile::TrivialExtrapNC ( Loaders loaders,
const HistAxis axis,
const Cut fdcut,
const SystShifts shiftMC = kNoShift,
const Var weight = kUnweighted 
)
static

Creates a NC disappearance "extrapolation" by returning FD MC.

Definition at line 141 of file ExtrapSterile.cxx.

References allInOneTrainingPlots::axis, ana::Loaders::GetLoader(), ana::kBeam, caf::kFARDET, ana::Loaders::kFluxSwap, ana::Loaders::kMC, ana::Loaders::kNonSwap, ana::Loaders::kTauSwap, and ana::weight.

147  {
149  loaders.GetLoader(
151  loaders.GetLoader(
153  loaders.GetLoader(
155  axis,
156  fdcut,
157  shiftMC,
158  weight
159  );
160  }
Far Detector at Ash River.
Definition: SREnums.h:11
const Var weight
std::vector< Loaders * > loaders
Definition: syst_header.h:386
static ModularExtrapSterile TrivialExtrapNC(Loaders &loaders, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC=kNoShift, const Var &weight=kUnweighted)
Creates a NC disappearance "extrapolation" by returning FD MC.
ModularExtrapSterile ana::ModularExtrapSterile::TrivialExtrapNC ( SpectrumLoaderBase farMCswapLoader,
SpectrumLoaderBase farMCnonswapLoader,
SpectrumLoaderBase farMCtauswapLoader,
const HistAxis axis,
const Cut fdcut,
const SystShifts shiftMC = kNoShift,
const Var weight = kUnweighted 
)
static

Creates a NC disappearance "extrapolation" by returning FD MC, using individual SpectrumLoaders

Definition at line 163 of file ExtrapSterile.cxx.

171  {
172  // Initialize all components with NoReweights,
173  // make sure other objects exist
174  ModularExtrapSterile extrap(
175  farMCswap,
176  farMCnonswap,
177  farMCtauswap,
178  axis,
179  fdcut,
180  shiftMC,
181  weight
182  );
183 
184  return extrap;
185  }
const Var weight
ModularExtrapSterile(SpectrumLoaderBase &farMCswapLoader, SpectrumLoaderBase &farMCnonswapLoader, SpectrumLoaderBase &farMCtauswapLoader, const HistAxis &axis, const Cut &fdcut, const SystShifts &shiftMC, const Var &weight)
Sets up all components to use FD MC–internal use only.

Member Data Documentation

std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fEEAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fEEextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fEMAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fEMextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fETAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fETextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMEAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMEextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMMAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMMextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMTAntiextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fMTextrap
protectedinherited
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fNCAntiextrap
protectedinherited
std::unique_ptr<Spectrum> ana::ModularExtrapSterile::fNCAntiNueNumerator
protected

Definition at line 124 of file ExtrapSterile.h.

Referenced by NCAntiNueProportion(), and SaveTo().

std::unique_ptr<Spectrum> ana::ModularExtrapSterile::fNCAntiNumuNumerator
protected

Definition at line 126 of file ExtrapSterile.h.

Referenced by NCAntiNumuProportion(), and SaveTo().

std::unique_ptr<Spectrum> ana::ModularExtrapSterile::fNCDenominator
protected
std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fNCextrap
protectedinherited
std::unique_ptr<Spectrum> ana::ModularExtrapSterile::fNCNueNumerator
protected

Definition at line 123 of file ExtrapSterile.h.

Referenced by NCNueProportion(), and SaveTo().

std::unique_ptr<Spectrum> ana::ModularExtrapSterile::fNCNumuNumerator
protected

Definition at line 125 of file ExtrapSterile.h.

Referenced by NCNumuProportion(), and SaveTo().

std::unique_ptr<ModularExtrapComponent> ana::ModularExtrap::fNCTotalextrap
protectedinherited

The documentation for this class was generated from the following files: