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/N21-04-14/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 std::string &name) const override
 
virtual Spectrum Predict (osc::IOscCalc *) const override
 
virtual Spectrum Predict (osc::IOscCalcStan *) const override
 
virtual Spectrum PredictComponent (osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
virtual Spectrum PredictComponent (osc::IOscCalcStan *, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
virtual Spectrum PredictUnoscillated () const
 
virtual Spectrum PredictSyst (osc::IOscCalc *calc, const SystShifts &syst) const
 
virtual Spectrum PredictSyst (osc::IOscCalcStan *calc, const SystShifts &syst) const
 
virtual Spectrum PredictComponentSyst (osc::IOscCalc *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual Spectrum PredictComponentSyst (osc::IOscCalcStan *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) 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, const std::string &name)
 

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 32 of file PredictionNoOsc.cxx.

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

37  : fSpectrum( loader, axis, cut, shift, wei),
38  fSpectrumNC( loader, axis, cut && kIsNC, shift, wei),
39  fSpectrumNumu( loader, axis, cut && !kIsNC && kIsNumuCC && !kIsAntiNu, shift, wei),
40  fSpectrumNumubar(loader, axis, cut && !kIsNC && kIsNumuCC && kIsAntiNu, shift, wei),
41  fSpectrumNue( loader, axis, cut && !kIsNC && kIsBeamNue && !kIsAntiNu, shift, wei),
42  fSpectrumNuebar( loader, axis, cut && !kIsNC && kIsBeamNue && kIsAntiNu, shift, wei)
43  {
44  }
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 20 of file PredictionNoOsc.cxx.

27  : PredictionNoOsc(loader, HistAxis(label, bins, var), cut, shift, wei)
28  {
29  }
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
var_value< double > var
Definition: StanTypedefs.h:14
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
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 58 of file PredictionNoOsc.h.

62  : fSpectrum(s),
63  fSpectrumNC(sNC),
64  fSpectrumNumu(sNumu), fSpectrumNumubar(sNumubar),
65  fSpectrumNue(sNue), fSpectrumNuebar(sNuebar)
66  {
67  }
const XML_Char * s
Definition: expat.h:262

Member Function Documentation

OscillatableSpectrum ana::IPrediction::ComponentCC ( int  from,
int  to 
) const
virtualinherited

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

Definition at line 105 of file IPrediction.cxx.

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

Referenced by ana::PredictionCombinePeriods::ComponentCC(), ana::PredictionAddRock::ComponentCC(), and ND_DataMC().

106  {
107  std::cout << "WARNING! ComponentCC is unimplemented in IPrediction" << std::endl; abort();
108  }
OStream cout
Definition: OStream.cxx:6
Spectrum ana::IPrediction::ComponentNC ( ) const
virtualinherited

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

Definition at line 115 of file IPrediction.cxx.

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

Referenced by ana::PredictionAddRock::ComponentNC().

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

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

Definition at line 120 of file IPrediction.cxx.

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

Referenced by ana::PredictionAddRock::ComponentNCAnti().

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

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

Definition at line 110 of file IPrediction.cxx.

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

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

111  {
112  std::cout << "WARNING! ComponentNCTotal is unimplemented in IPrediction" << std::endl; abort();
113  }
OStream cout
Definition: OStream.cxx:6
std::unique_ptr< PredictionNoOsc > ana::PredictionNoOsc::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 105 of file PredictionNoOsc.cxx.

References ana::assert(), dir, PredictionNoOsc(), and runNovaSAM::ret.

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

106  {
107  dir = dir->GetDirectory(name.c_str()); // switch to subdir
108  assert(dir);
109 
111  *ana::LoadFrom<Spectrum>(dir, "spect"),
112  *ana::LoadFrom<Spectrum>(dir, "spect_nc"),
113  *ana::LoadFrom<Spectrum>(dir, "spect_numu"),
114  *ana::LoadFrom<Spectrum>(dir, "spect_numubar"),
115  *ana::LoadFrom<Spectrum>(dir, "spect_nue"),
116  *ana::LoadFrom<Spectrum>(dir, "spect_nuebar"));
117 
118  delete dir;
119 
120  // Can't use make_unique because constructor is protected
121  return std::unique_ptr<PredictionNoOsc>(ret);
122  }
const XML_Char * name
Definition: expat.h:151
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
virtual Spectrum ana::PredictionNoOsc::Predict ( osc::IOscCalc ) const
inlineoverridevirtual

Implements ana::IPrediction.

Definition at line 34 of file PredictionNoOsc.h.

References fSpectrum.

Referenced by PredictComponent().

35  {
36  return fSpectrum;
37  }
virtual Spectrum ana::PredictionNoOsc::Predict ( osc::IOscCalcStan ) const
inlineoverridevirtual

Reimplemented from ana::IPrediction.

Definition at line 39 of file PredictionNoOsc.h.

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

39  {
40  return fSpectrum;
41  }
Spectrum ana::PredictionNoOsc::PredictComponent ( osc::IOscCalc calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 47 of file PredictionNoOsc.cxx.

References ana::assert(), 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(), Predict(), and PredictComponent().

51  {
52  if(flav == Flavors::kAll &&
53  curr == Current::kBoth &&
54  sign == Sign::kBoth)
55  return Predict((osc::IOscCalc*)(nullptr)); // Faster
56 
57  if(curr & Current::kNC){
58  // We don't have NC broken down by sign or flavour
59  assert(flav & Flavors::kAll && sign & Sign::kBoth);
60  return fSpectrumNC;
61  }
62 
64 
65  using namespace Flavors;
66  using namespace Current;
67  using namespace Sign;
68 
70  ret.Clear();
71 
72  // Safe to assume by this point that it's 100% CC
73  if(flav & kNuMuToNuMu && sign & kNu) ret += fSpectrumNumu;
74  if(flav & kNuMuToNuMu && sign & kAntiNu) ret += fSpectrumNumubar;
75  if(flav & kNuEToNuE && sign & kNu) ret += fSpectrumNue;
76  if(flav & kNuEToNuE && sign & kAntiNu) ret += fSpectrumNuebar;
77 
78  return ret;
79  }
Antineutrinos-only.
Definition: IPrediction.h:50
(&#39;beam &#39;)
Definition: IPrediction.h:15
General interface to oscillation calculators.
Definition: StanTypedefs.h:23
std::vector< double > Spectrum
Definition: Constants.h:743
void Clear()
Definition: Spectrum.cxx:362
Charged-current interactions.
Definition: IPrediction.h:39
Interactions of both types.
Definition: IPrediction.h:42
(&#39; survival&#39;)
Definition: IPrediction.h:19
Neutral-current interactions.
Definition: IPrediction.h:40
assert(nhit_max >=nhit_nbins)
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
virtual Spectrum Predict(osc::IOscCalc *) const override
All neutrinos, any flavor.
Definition: IPrediction.h:26
def sign(x)
Definition: canMan.py:197
virtual Spectrum ana::PredictionNoOsc::PredictComponent ( osc::IOscCalcStan ,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
inlineoverridevirtual

Reimplemented from ana::IPrediction.

Definition at line 48 of file PredictionNoOsc.h.

References PredictComponent().

52  {
53  return PredictComponent(static_cast<osc::IOscCalc*>(nullptr), flav, curr, sign);
54  }
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
def sign(x)
Definition: canMan.py:197
Spectrum ana::IPrediction::PredictComponentSyst ( osc::IOscCalc calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

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

Definition at line 79 of file IPrediction.cxx.

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

Referenced by ana::PredictionAddRock::_PredictComponentSyst(), ana::CovMxManager::AddSystematic(), ana::GetBFSystBands(), ana::GetSystBands(), PlotSysts(), ana::PredictionCombinePeriods::PredictComponentSyst(), systematics_extrap_comp_from_pred_interp(), systematics_summary_from_pred_interp(), and systematics_table_from_pred_interp().

84  {
85  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
86 
87  // Default implementation: no treatment of systematics
88  return PredictComponent(calc, flav, curr, sign);
89  }
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
assert(nhit_max >=nhit_nbins)
def sign(x)
Definition: canMan.py:197
Spectrum ana::IPrediction::PredictComponentSyst ( osc::IOscCalcStan calc,
const SystShifts syst,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

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

Definition at line 93 of file IPrediction.cxx.

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

98  {
99  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
100 
101  // Default implementation: no treatment of systematics
102  return PredictComponent(calc, flav, curr, sign);
103  }
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
assert(nhit_max >=nhit_nbins)
def sign(x)
Definition: canMan.py:197
Spectrum ana::IPrediction::PredictSyst ( osc::IOscCalc calc,
const SystShifts syst 
) const
virtualinherited
Spectrum ana::IPrediction::PredictSyst ( osc::IOscCalcStan calc,
const SystShifts syst 
) const
virtualinherited

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

Definition at line 59 of file IPrediction.cxx.

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

61  {
62  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
63 
64  // Default implementation: no treatment of systematics
65  return Predict(calc);
66  }
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
assert(nhit_max >=nhit_nbins)
Spectrum ana::IPrediction::PredictUnoscillated ( ) const
virtualinherited

Reimplemented in ana::PredictionSterile.

Definition at line 33 of file IPrediction.cxx.

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

Referenced by cc(), demo5(), demo::DrawUpDownRatioCanvas(), efficiency(), efficiencySA(), template_basic(), and test_ana().

34  {
35  // Default implementation
37  return Predict(&noosc);
38  }
Pass neutrinos through unchanged.
Definition: IOscCalc.h:45
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
osc::NoOscillations noosc
Definition: NueSystFuncs.h:44
void ana::PredictionNoOsc::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 82 of file PredictionNoOsc.cxx.

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

83  {
84  TDirectory* tmp = gDirectory;
85 
86  dir = dir->mkdir(name.c_str()); // switch to subdir
87  dir->cd();
88 
89  TObjString("PredictionNoOsc").Write("type");
90 
91  fSpectrum.SaveTo(dir, "spect");
92  fSpectrumNC.SaveTo(dir, "spect_nc");
93  fSpectrumNumu.SaveTo(dir, "spect_numu");
94  fSpectrumNumubar.SaveTo(dir, "spect_numubar");
95  fSpectrumNue.SaveTo(dir, "spect_nue");
96  fSpectrumNuebar.SaveTo(dir, "spect_nuebar");
97 
98  dir->Write();
99  delete dir;
100 
101  tmp->cd();
102  }
const XML_Char * name
Definition: expat.h:151
Float_t tmp
Definition: plot.C:36
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:507
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

Spectrum ana::PredictionNoOsc::fSpectrum
protected

Definition at line 69 of file PredictionNoOsc.h.

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

Spectrum ana::PredictionNoOsc::fSpectrumNC
protected

Definition at line 71 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNue
protected

Definition at line 74 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNuebar
protected

Definition at line 75 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNumu
protected

Definition at line 72 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().

Spectrum ana::PredictionNoOsc::fSpectrumNumubar
protected

Definition at line 73 of file PredictionNoOsc.h.

Referenced by PredictComponent(), and SaveTo().


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