Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
jw::TrivialPrediction Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-02-16/CAFAna/xsec_tuning/Ana2018/tuning/MECTuningUtils.h"

Inheritance diagram for jw::TrivialPrediction:
ana::IPrediction

Public Member Functions

 TrivialPrediction (ana::Loaders &loaders, const ana::HistAxis &axis, const ana::Cut &cut, const ana::SystShifts &shift=ana::kNoShift, const ana::Var &wei=ana::kUnweighted)
 
 TrivialPrediction (const ana::Spectrum &spec)
 
ana::Spectrum Predict (osc::IOscCalculator *calc) const override
 
ana::Spectrum PredictComponent (osc::IOscCalculator *calc, ana::Flavors::Flavors_t flav, ana::Current::Current_t curr, ana::Sign::Sign_t sign) const override
 
void SaveTo (TDirectory *dir) const override
 
virtual Spectrum PredictUnoscillated () const
 
virtual SpectrumStan Predict (osc::IOscCalculatorStan *calc) const
 
virtual Spectrum PredictSyst (osc::IOscCalculator *calc, const SystShifts &syst) const
 
virtual SpectrumStan PredictSyst (osc::IOscCalculatorStan *calc, const SystShifts &syst) const
 
virtual SpectrumStan PredictComponent (osc::IOscCalculatorStan *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual Spectrum PredictComponentSyst (osc::IOscCalculator *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual SpectrumStan PredictComponentSyst (osc::IOscCalculatorStan *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual void Derivative (osc::IOscCalculator *calc, const SystShifts &shift, double pot, std::unordered_map< const ISyst *, std::vector< double >> &dchi) const
 
virtual OscillatableSpectrum ComponentCC (int from, int to) const
 
virtual Spectrum ComponentNCTotal () const
 
virtual Spectrum ComponentNC () const
 
virtual Spectrum ComponentNCAnti () const
 

Static Public Member Functions

static std::unique_ptr< TrivialPredictionLoadFrom (TDirectory *dir)
 

Private Attributes

ana::Spectrum fSpec
 

Detailed Description

Definition at line 14 of file MECTuningUtils.h.

Constructor & Destructor Documentation

jw::TrivialPrediction::TrivialPrediction ( ana::Loaders loaders,
const ana::HistAxis axis,
const ana::Cut cut,
const ana::SystShifts shift = ana::kNoShift,
const ana::Var wei = ana::kUnweighted 
)
inline

Definition at line 17 of file MECTuningUtils.h.

Referenced by jw::NDPredGenerator::Generate().

23  axis, cut, shift, wei)
24  {};
Near Detector underground.
Definition: SREnums.h:10
SpectrumLoaderBase & GetLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Retrieve a specific loader.
Definition: Loaders.cxx:129
const Cut cut
Definition: exporter_fd.C:30
jw::TrivialPrediction::TrivialPrediction ( const ana::Spectrum spec)
inline

Definition at line 26 of file MECTuningUtils.h.

References calc, febshutoff_auto::curr, dir, LoadFrom(), Predict(), PredictComponent(), SaveTo(), and canMan::sign().

27  : fSpec(spec)
28  {};

Member Function Documentation

virtual OscillatableSpectrum ana::IPrediction::ComponentCC ( int  from,
int  to 
) const
inlinevirtualinherited
virtual Spectrum ana::IPrediction::ComponentNC ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 111 of file IPrediction.h.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::PredictionAddRock::ComponentNC(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

112  {std::cout << "WARNING! ComponentNC is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IPrediction::ComponentNCAnti ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 113 of file IPrediction.h.

References om::cout, dir, allTimeWatchdog::endl, and ana::SaveTo().

Referenced by ana::PredictionAddRock::ComponentNCAnti(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

114  {std::cout << "WARNING! ComponentNCAnti is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual Spectrum ana::IPrediction::ComponentNCTotal ( ) const
inlinevirtualinherited

Reimplemented in ana::PredictionExtendToPeripheral, ana::PredictionAddRock, ana::PredictionCombinePeriods, and ana::PredictionExtrap.

Definition at line 109 of file IPrediction.h.

References om::cout, and allTimeWatchdog::endl.

Referenced by ana::PredictionAddRock::ComponentNCTotal(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

110  {std::cout << "WARNING! ComponentNCTotal is unimplemented in IPrediction" << std::endl; abort();}
OStream cout
Definition: OStream.cxx:6
virtual void ana::IPrediction::Derivative ( osc::IOscCalculator calc,
const SystShifts shift,
double  pot,
std::unordered_map< const ISyst *, std::vector< double >> &  dchi 
) const
inlinevirtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionAddRock.

Definition at line 92 of file IPrediction.h.

Referenced by ana::PredictionAddRock::Derivative(), and ana::SingleSampleExperiment::Derivative().

96  {
97  // Implementing this function is optional. If you don't implement it,
98  // this default implementation will be used, which signals to callers
99  // that your Prediction doesn't implement this feature.
100  dchi.clear();
101  }
std::unique_ptr< TrivialPrediction > jw::TrivialPrediction::LoadFrom ( TDirectory *  dir)
static

Definition at line 75 of file MECTuningUtils.h.

References ana::Spectrum::LoadFrom().

Referenced by TrivialPrediction().

76  {
77  TDirectory * specDir = dir->GetDirectory("spec");
78  assert(specDir);
79  return std::make_unique<TrivialPrediction>(*ana::Spectrum::LoadFrom(specDir));
80  }
TDirectory * dir
Definition: macro.C:5
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir)
Definition: Spectrum.cxx:1055
ana::Spectrum jw::TrivialPrediction::Predict ( osc::IOscCalculator calc) const
overridevirtual

Implements ana::IPrediction.

Definition at line 44 of file MECTuningUtils.h.

References fSpec.

Referenced by TrivialPrediction().

45  {
46  return fSpec;
47  }
SpectrumStan ana::IPrediction::Predict ( osc::IOscCalculatorStan calc) const
virtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionExtrap.

Definition at line 92 of file IPrediction.cxx.

93  {
94  assert(0 && "This Prediction hasn't implemented a Stan-aware Predict()!");
95  }
ana::Spectrum jw::TrivialPrediction::PredictComponent ( osc::IOscCalculator calc,
ana::Flavors::Flavors_t  flav,
ana::Current::Current_t  curr,
ana::Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 48 of file MECTuningUtils.h.

References fSpec, ana::Sign::kBoth, ana::Current::kCC, and ana::Flavors::kNuMuToNuMu.

Referenced by TrivialPrediction().

52  {
53  // basically the whole prediction is regarded as being one component
55  {
56  return fSpec;
57  }
58  else
59  {
60  auto spec = ana::Spectrum(fSpec);
61  spec.Clear();
62  return std::move(spec);
63  }
64  }
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:37
Charged-current interactions.
Definition: IPrediction.h:39
def sign(x)
Definition: canMan.py:204
(&#39; survival&#39;)
Definition: IPrediction.h:19
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
SpectrumStan ana::IPrediction::PredictComponent ( osc::IOscCalculatorStan calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp, and ana::PredictionExtrap.

Definition at line 119 of file IPrediction.cxx.

123  {
124  assert(0 && "This Prediction hasn't implemented a Stan-aware PredictComponent()!");
125  }
Spectrum ana::IPrediction::PredictComponentSyst ( osc::IOscCalculator calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp, ana::PredictionNumuFAHadE, ana::PredictionCombinePeriods, and ana::PredictionAddRock.

Definition at line 128 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::PredictComponent().

Referenced by PlotSysts(), ana::PredictionAddRock::PredictComponentSyst(), ana::PredictionCombinePeriods::PredictComponentSyst(), ana::PredictionNumuFAHadE::PredictComponentSyst(), systematics_extrap_comp_from_pred_interp(), systematics_summary_from_pred_interp(), and systematics_table_from_pred_interp().

133  {
134  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
135 
136  // Default implementation: no treatment of systematics
137  return PredictComponent(calc, flav, curr, sign);
138  }
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
def sign(x)
Definition: canMan.py:204
string syst
Definition: plotSysts.py:176
SpectrumStan ana::IPrediction::PredictComponentSyst ( osc::IOscCalculatorStan calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp.

Definition at line 142 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::PredictComponent().

147  {
148  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
149 
150  // Default implementation: no treatment of systematics
151  return PredictComponent(calc, flav, curr, sign);
152  }
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
def sign(x)
Definition: canMan.py:204
string syst
Definition: plotSysts.py:176
Spectrum ana::IPrediction::PredictSyst ( osc::IOscCalculator calc,
const SystShifts syst 
) const
virtualinherited
SpectrumStan ana::IPrediction::PredictSyst ( osc::IOscCalculatorStan calc,
const SystShifts syst 
) const
virtualinherited

Reimplemented in ana::PredictionInterp.

Definition at line 108 of file IPrediction.cxx.

References ana::SystShifts::IsNominal(), and ana::IPrediction::Predict().

110  {
111  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
112 
113  // Default implementation: no treatment of systematics
114  return Predict(calc);
115  }
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
string syst
Definition: plotSysts.py:176
Spectrum ana::IPrediction::PredictUnoscillated ( ) const
virtualinherited

Reimplemented in ana::PredictionSterile.

Definition at line 82 of file IPrediction.cxx.

References noosc, and ana::IPrediction::Predict().

Referenced by cc(), demo5(), demo::DrawUpDownRatioCanvas(), Efficiency(), efficiency(), efficiencySA(), fa_fd_data_mc_systs(), GetSpectra(), numu_demo_split_plot(), plot_nd_data_mc(), template_basic(), and test_ana().

83  {
84  // Default implementation
86  return Predict(&noosc);
87  }
Pass neutrinos through unchanged.
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
osc::NoOscillations noosc
Definition: NueSystFuncs.h:44
void jw::TrivialPrediction::SaveTo ( TDirectory *  dir) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 65 of file MECTuningUtils.h.

References fSpec, ana::Spectrum::SaveTo(), and tmp.

Referenced by TrivialPrediction().

66  {
67  TDirectory* tmp = gDirectory;
68 
69  dir->cd();
70  TObjString("TrivialPrediction").Write("type", TObject::kOverwrite);
71  fSpec.SaveTo(dir->mkdir("spec"));
72 
73  tmp->cd();
74  }
Float_t tmp
Definition: plot.C:36
TDirectory * dir
Definition: macro.C:5
void SaveTo(TDirectory *dir) const
Definition: Spectrum.cxx:1029

Member Data Documentation

ana::Spectrum jw::TrivialPrediction::fSpec
private

Definition at line 42 of file MECTuningUtils.h.

Referenced by Predict(), PredictComponent(), and SaveTo().


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