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

Prediction that wraps a simple Spectrum. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-02-16/CAFAna/Prediction/PredictionNoOsc.h"

Inheritance diagram for ana::PredictionNoOsc:
ana::IPrediction

Public Member Functions

 PredictionNoOsc (SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
 PredictionNoOsc (SpectrumLoaderBase &loader, const std::string &label, const Binning &bins, const Var &var, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
 
virtual void SaveTo (TDirectory *dir) const override
 
virtual Spectrum Predict (osc::IOscCalculator *) const override
 
virtual Spectrum PredictComponent (osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) 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< PredictionNoOscLoadFrom (TDirectory *dir)
 

Protected Member Functions

 PredictionNoOsc (const Spectrum &s, const Spectrum &sNC, const Spectrum &sNumu, const Spectrum &sNumubar, const Spectrum &sNue, const Spectrum &sNuebar)
 

Protected Attributes

Spectrum fSpectrum
 
Spectrum fSpectrumNC
 
Spectrum fSpectrumNumu
 
Spectrum fSpectrumNumubar
 
Spectrum fSpectrumNue
 
Spectrum fSpectrumNuebar
 

Detailed Description

Prediction that wraps a simple Spectrum.

Definition at line 11 of file PredictionNoOsc.h.

Constructor & Destructor Documentation

ana::PredictionNoOsc::PredictionNoOsc ( SpectrumLoaderBase loader,
const HistAxis axis,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 30 of file PredictionNoOsc.cxx.

Referenced by ana::NoOscPredictionGenerator::Generate(), and LoadFrom().

35  : fSpectrum( loader, axis, cut, shift, wei),
36  fSpectrumNC( loader, axis, cut && kIsNC, shift, wei),
41  {
42  }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
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 .
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
loader
Definition: demo0.py:10
const Cut cut
Definition: exporter_fd.C:30
ana::PredictionNoOsc::PredictionNoOsc ( SpectrumLoaderBase loader,
const std::string &  label,
const Binning bins,
const Var var,
const Cut cut,
const SystShifts shift = kNoShift,
const Var wei = kUnweighted 
)

Definition at line 18 of file PredictionNoOsc.cxx.

26  {
27  }
var
const char * label
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
loader
Definition: demo0.py:10
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
GenericHistAxis< Var > HistAxis
Definition: HistAxis.h:95
ana::PredictionNoOsc::PredictionNoOsc ( const Spectrum s,
const Spectrum sNC,
const Spectrum sNumu,
const Spectrum sNumubar,
const Spectrum sNue,
const Spectrum sNuebar 
)
inlineprotected

Definition at line 48 of file PredictionNoOsc.h.

52  : fSpectrum(s),
53  fSpectrumNC(sNC),
54  fSpectrumNumu(sNumu), fSpectrumNumubar(sNumubar),
55  fSpectrumNue(sNue), fSpectrumNuebar(sNuebar)
56  {
57  }
const XML_Char * s
Definition: expat.h:262

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< PredictionNoOsc > ana::PredictionNoOsc::LoadFrom ( TDirectory *  dir)
static

Definition at line 99 of file PredictionNoOsc.cxx.

References PredictionNoOsc(), and runNovaSAM::ret.

Referenced by calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), and ana::LoadFrom< IPrediction >().

100  {
102  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect")),
103  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nc")),
104  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_numu")),
105  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_numubar")),
106  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nue")),
107  *ana::LoadFrom<Spectrum>(dir->GetDirectory("spect_nuebar")));
108 
109  // Can't use make_unique because constructor is protected
110  return std::unique_ptr<PredictionNoOsc>(ret);
111  }
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
TDirectory * dir
Definition: macro.C:5
virtual Spectrum ana::PredictionNoOsc::Predict ( osc::IOscCalculator ) const
inlineoverridevirtual

Implements ana::IPrediction.

Definition at line 37 of file PredictionNoOsc.h.

References calc, febshutoff_auto::curr, fSpectrum, PredictComponent(), and canMan::sign().

Referenced by PredictComponent().

38  {
39  return fSpectrum;
40  }
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  }
Spectrum ana::PredictionNoOsc::PredictComponent ( osc::IOscCalculator calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 45 of file PredictionNoOsc.cxx.

References ana::Spectrum::Clear(), fSpectrum, fSpectrumNC, fSpectrumNue, fSpectrumNuebar, fSpectrumNumu, fSpectrumNumubar, ana::Flavors::kAll, ana::Sign::kAntiNu, ana::Current::kBoth, ana::Sign::kBoth, ana::Current::kCC, ana::Current::kNC, ana::Flavors::kNuEToNuE, ana::Flavors::kNuMuToNuMu, Predict(), and runNovaSAM::ret.

Referenced by calculateComponentsNumu(), calculateWrongSignNue(), calculateWrongSignNumuQ1(), calculateWrongSignNumuQ2(), calculateWrongSignNumuQ3(), calculateWrongSignNumuQ4(), and Predict().

49  {
50  if(flav == Flavors::kAll &&
51  curr == Current::kBoth &&
52  sign == Sign::kBoth)
53  return Predict((osc::IOscCalculator*)(nullptr)); // Faster
54 
55  if(curr & Current::kNC){
56  // We don't have NC broken down by sign or flavour
57  assert(flav & Flavors::kAll && sign & Sign::kBoth);
58  return fSpectrumNC;
59  }
60 
61  assert(curr == Current::kCC);
62 
63  using namespace Flavors;
64  using namespace Current;
65  using namespace Sign;
66 
67  Spectrum ret = fSpectrum;
68  ret.Clear();
69 
70  // Safe to assume by this point that it's 100% CC
71  if(flav & kNuMuToNuMu && sign & kNu) ret += fSpectrumNumu;
72  if(flav & kNuMuToNuMu && sign & kAntiNu) ret += fSpectrumNumubar;
73  if(flav & kNuEToNuE && sign & kNu) ret += fSpectrumNue;
74  if(flav & kNuEToNuE && sign & kAntiNu) ret += fSpectrumNuebar;
75 
76  return ret;
77  }
Antineutrinos-only.
Definition: IPrediction.h:50
General interface to oscillation calculators.
Definition: FwdDeclare.h:15
(&#39;beam &#39;)
Definition: IPrediction.h:15
void Clear()
Definition: Spectrum.cxx:878
Charged-current interactions.
Definition: IPrediction.h:39
Interactions of both types.
Definition: IPrediction.h:42
virtual Spectrum Predict(osc::IOscCalculator *) const override
def sign(x)
Definition: canMan.py:204
(&#39; survival&#39;)
Definition: IPrediction.h:19
Neutral-current interactions.
Definition: IPrediction.h:40
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
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 ana::PredictionNoOsc::SaveTo ( TDirectory *  dir) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 80 of file PredictionNoOsc.cxx.

References fSpectrum, fSpectrumNC, fSpectrumNue, fSpectrumNuebar, fSpectrumNumu, fSpectrumNumubar, ana::Spectrum::SaveTo(), and tmp.

81  {
82  TDirectory* tmp = gDirectory;
83 
84  dir->cd();
85 
86  TObjString("PredictionNoOsc").Write("type");
87 
88  fSpectrum.SaveTo(dir->mkdir("spect"));
89  fSpectrumNC.SaveTo(dir->mkdir("spect_nc"));
90  fSpectrumNumu.SaveTo(dir->mkdir("spect_numu"));
91  fSpectrumNumubar.SaveTo(dir->mkdir("spect_numubar"));
92  fSpectrumNue.SaveTo(dir->mkdir("spect_nue"));
93  fSpectrumNuebar.SaveTo(dir->mkdir("spect_nuebar"));
94 
95  tmp->cd();
96  }
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

Spectrum ana::PredictionNoOsc::fSpectrum
protected

Definition at line 59 of file PredictionNoOsc.h.

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

Spectrum ana::PredictionNoOsc::fSpectrumNC
protected

Definition at line 61 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNue
protected

Definition at line 64 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNuebar
protected

Definition at line 65 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNumu
protected

Definition at line 62 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNumubar
protected

Definition at line 63 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().


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