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

A prediction object compatible with sterile oscillations. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-08-14/CAFAna/Prediction/PredictionSterile.h"

Inheritance diagram for ana::PredictionSterile:
ana::PredictionExtrap ana::IPrediction

Public Member Functions

 PredictionSterile (std::unique_ptr< ModularExtrapSterile > &&extrap)
 
virtual Spectrum PredictUnoscillated () const override
 
virtual Spectrum PredictComponent (osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
virtual void SaveTo (TDirectory *dir, const std::string &name) const override
 
 PredictionSterile ()=delete
 
Spectrum Predict (osc::IOscCalc *calc) const override
 
SpectrumStan Predict (osc::IOscCalcStan *calc) const override
 
SpectrumStan PredictComponent (osc::IOscCalcStan *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
 
OscillatableSpectrum ComponentCC (int from, int to) const override
 
Spectrum ComponentNCTotal () const override
 
Spectrum ComponentNC () const override
 
Spectrum ComponentNCAnti () const override
 
const IExtrapGetExtrap () const
 
virtual Spectrum PredictSyst (osc::IOscCalc *calc, const SystShifts &syst) const
 
virtual SpectrumStan 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 SpectrumStan PredictComponentSyst (osc::IOscCalcStan *calc, const SystShifts &syst, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 
virtual void Derivative (osc::IOscCalc *calc, const SystShifts &shift, double pot, std::unordered_map< const ISyst *, std::vector< double >> &dchi) const
 

Static Public Member Functions

static std::unique_ptr< PredictionSterileLoadFrom (TDirectory *dir, const std::string &name)
 

Protected Member Functions

 PredictionSterile (PredictionExtrap &&load)
 Constructor used for loading a PredictionSterile from file. More...
 

Protected Attributes

std::unique_ptr< IExtrapfExtrap
 

Detailed Description

A prediction object compatible with sterile oscillations.

Definition at line 12 of file PredictionSterile.h.

Constructor & Destructor Documentation

ana::PredictionSterile::PredictionSterile ( std::unique_ptr< ModularExtrapSterile > &&  extrap)

Definition at line 17 of file PredictionSterile.cxx.

18  : PredictionExtrap(std::move(extrap))
19  // This base class constructor initializes everything
20  {
21  }
ana::PredictionSterile::PredictionSterile ( )
delete

Referenced by LoadFrom().

ana::PredictionSterile::PredictionSterile ( PredictionExtrap &&  load)
protected

Constructor used for loading a PredictionSterile from file.

Definition at line 24 of file PredictionSterile.cxx.

25  : PredictionExtrap(std::move(load))
26  {
27  }
void load(std::string lib)
Definition: load_libs.C:3

Member Function Documentation

OscillatableSpectrum ana::PredictionExtrap::ComponentCC ( int  from,
int  to 
) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 98 of file PredictionExtrap.cxx.

References ana::assert(), and ana::PredictionExtrap::fExtrap.

Referenced by ana::PredictionAddRock::ComponentCC(), nue_decomp_scales(), and ana::PredictionExtendToPeripheral::PredictionExtendToPeripheral().

99  {
100  if(from == +12 && to == +12) return fExtrap->NueSurvComponent();
101  if(from == -12 && to == -12) return fExtrap->AntiNueSurvComponent();
102 
103  if(from == +12 && to == +14) return fExtrap->NumuAppComponent();
104  if(from == -12 && to == -14) return fExtrap->AntiNumuAppComponent();
105 
106  if(from == +12 && to == +16) return fExtrap->TauFromEComponent();
107  if(from == -12 && to == -16) return fExtrap->AntiTauFromEComponent();
108 
109  if(from == +14 && to == +12) return fExtrap->NueAppComponent();
110  if(from == -14 && to == -12) return fExtrap->AntiNueAppComponent();
111 
112  if(from == +14 && to == +14) return fExtrap->NumuSurvComponent();
113  if(from == -14 && to == -14) return fExtrap->AntiNumuSurvComponent();
114 
115  if(from == +14 && to == +16) return fExtrap->TauFromMuComponent();
116  if(from == -14 && to == -16) return fExtrap->AntiTauFromMuComponent();
117 
118  assert(0 && "Not reached");
119  }
std::unique_ptr< IExtrap > fExtrap
assert(nhit_max >=nhit_nbins)
Spectrum ana::PredictionExtrap::ComponentNC ( ) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 127 of file PredictionExtrap.cxx.

References ana::PredictionExtrap::fExtrap.

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

128  {
129  return fExtrap->NCComponent();
130  }
std::unique_ptr< IExtrap > fExtrap
Spectrum ana::PredictionExtrap::ComponentNCAnti ( ) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 131 of file PredictionExtrap.cxx.

References ana::PredictionExtrap::fExtrap.

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

132  {
133  return fExtrap->NCAntiComponent();
134  }
std::unique_ptr< IExtrap > fExtrap
Spectrum ana::PredictionExtrap::ComponentNCTotal ( ) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 123 of file PredictionExtrap.cxx.

References ana::PredictionExtrap::fExtrap.

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

124  {
125  return fExtrap->NCTotalComponent();
126  }
std::unique_ptr< IExtrap > fExtrap
virtual void ana::IPrediction::Derivative ( osc::IOscCalc 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  }
const IExtrap* ana::PredictionExtrap::GetExtrap ( ) const
inlineinherited

Definition at line 45 of file PredictionExtrap.h.

References ana::PredictionExtrap::fExtrap.

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

45 {return fExtrap.get();}
std::unique_ptr< IExtrap > fExtrap
std::unique_ptr< PredictionSterile > ana::PredictionSterile::LoadFrom ( TDirectory *  dir,
const std::string &  name 
)
static

Definition at line 113 of file PredictionSterile.cxx.

References ana::assert(), ana::PredictionExtrap::LoadFrom(), PredictionSterile(), runNovaSAM::release, runNovaSAM::ret, and getGoodRuns4SAM::tag.

Referenced by BlessedPlotsAna(), ana::LoadFrom< IPrediction >(), ana::LoadMaps(), and PlotNus17Prediction().

114  {
115  TObjString* ptag = (TObjString*)dir->Get((name+"/type").c_str());
116  assert(ptag);
117 
118  const TString tag = ptag->GetString();
119  assert(tag.CompareTo("PredictionSterile") == 0);
120  delete ptag;
121 
122  std::unique_ptr<PredictionSterile> ret(
123  new PredictionSterile( std::move( *(PredictionExtrap::LoadFrom(dir, name).release()) ) )
124  );
125 
126  return ret;
127  }
const XML_Char * name
Definition: expat.h:151
static std::unique_ptr< PredictionExtrap > LoadFrom(TDirectory *dir, const std::string &name)
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
Spectrum ana::PredictionExtrap::Predict ( osc::IOscCalc calc) const
overridevirtualinherited

Implements ana::IPrediction.

Definition at line 20 of file PredictionExtrap.cxx.

References ana::Flavors::kAll, ana::Current::kBoth, ana::Sign::kBoth, and ana::PredictionExtrap::PredictComponent().

Referenced by BackPredict(), BlessedPlotsLoad(), caf_numu_sensitivity(), caf_numu_sensitivity_no_tau(), cc(), ComparePredictions(), CVNCuts(), demo5(), demo_CPT(), demo_flat(), drawPlot(), drawSystsShiftingNDdata_updatedAna(), FD_Data_PosComp(), FD_plots(), GetExtrap(), GetNuePredictionFuture(), getTimePeakPlots(), ana::NumuAnalysis::MakeExperiment(), MakePeriCutPlot(), MichelDecompTest(), modularextrap_demo_nue(), modularextrap_demo_numu(), numu_demo_split_plot(), numu_sig_nonmax(), PeripheralCuts(), plot_nue_xsec_pred(), PlotNus17Prediction(), PredictUnoscillated(), PredRatioToNom(), resolution2018(), saveContours_addExpt(), saveContours_simple(), sterile_demo(), template_basic(), test_ana(), test_genie_systs(), test_nueextrapsyst(), and test_saloaders().

21  {
22  return PredictComponent(calc,
25  Sign::kBoth);
26  }
Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Interactions of both types.
Definition: IPrediction.h:42
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
SpectrumStan ana::PredictionExtrap::Predict ( osc::IOscCalcStan calc) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 29 of file PredictionExtrap.cxx.

References ana::Flavors::kAll, ana::Current::kBoth, ana::Sign::kBoth, and ana::PredictionExtrap::PredictComponent().

30  {
31  return PredictComponent(calc,
34  Sign::kBoth);
35  }
Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Interactions of both types.
Definition: IPrediction.h:42
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
All neutrinos, any flavor.
Definition: IPrediction.h:26
Spectrum ana::PredictionSterile::PredictComponent ( osc::IOscCalc calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Reimplemented from ana::PredictionExtrap.

Definition at line 48 of file PredictionSterile.cxx.

References om::cerr, ana::Spectrum::Clear(), allTimeWatchdog::endl, ana::PredictionExtrap::fExtrap, ana::Sign::kAntiNu, ana::Current::kCC, ana::Current::kNC, ana::Sign::kNu, ana::Flavors::kNuEToNuE, ana::Flavors::kNuMuToNuMu, ana::ModularExtrapSterile::NCAntiNueProportion(), ana::ModularExtrapSterile::NCAntiNumuProportion(), ana::ModularExtrapSterile::NCNueProportion(), ana::ModularExtrapSterile::NCNumuProportion(), ana::OscillatableSpectrum::Oscillated(), ana::ModularExtrapSterile::OscNCComponent(), ana::PredictionExtrap::PredictComponent(), and runNovaSAM::ret.

52  {
53  Spectrum ret = fExtrap->NCTotalComponent(); // Get binning
54  ret.Clear();
55 
56  if(curr & Current::kCC){
57  // Nothing new here
58  ret += PredictionExtrap::PredictComponent(calc, flav, Current::kCC, sign);
59  }
60  if(curr & Current::kNC){
61  osc::OscCalcSterile* calc_sterile = osc::DowncastToSterile(calc);
62 
63  if(calc_sterile) {
64  // The PredictionSterile constructors all require a ModularExtrap Sterile,
65  // so this should be safe unless someone else makes a change that breaks this
66  ModularExtrapSterile* extrap = static_cast<ModularExtrapSterile*>(fExtrap.get());
67 
68  // Oscillate NCs as <start flavor> to any active flavor,
69  // then multiply by the proportion of NCs that originate as <start flavor>
70  if(flav & Flavors::kNuEToNuE && sign & Sign::kNu)
71  ret += extrap->OscNCComponent().Oscillated(calc_sterile, +12, 0)
72  *extrap->NCNueProportion();
73  if(flav & Flavors::kNuEToNuE && sign & Sign::kAntiNu)
74  ret += extrap->OscNCComponent().Oscillated(calc_sterile, -12, 0)
75  *extrap->NCAntiNueProportion();
76 
77  if(flav & Flavors::kNuMuToNuMu && sign & Sign::kNu)
78  ret += extrap->OscNCComponent().Oscillated(calc_sterile, +14, 0)
79  *extrap->NCNumuProportion();
80  if(flav & Flavors::kNuMuToNuMu && sign & Sign::kAntiNu)
81  ret += extrap->OscNCComponent().Oscillated(calc_sterile, -14, 0)
82  *extrap->NCAntiNumuProportion();
83  }
84  else {
85  std::cerr << "Input calculator was not of type OscCalcSterile." << std::endl
86  << "Reverting to 3 Flavor oscillation with no NC oscillations." << std::endl;
87 
88  ret += PredictionExtrap::PredictComponent(calc, flav, Current::kNC, sign);
89  }
90  }
91 
92  return ret;
93  }
Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Antineutrinos-only.
Definition: IPrediction.h:50
(&#39;beam &#39;)
Definition: IPrediction.h:15
OStream cerr
Definition: OStream.cxx:7
Charged-current interactions.
Definition: IPrediction.h:39
Neutrinos-only.
Definition: IPrediction.h:49
(&#39; survival&#39;)
Definition: IPrediction.h:19
std::unique_ptr< IExtrap > fExtrap
Neutral-current interactions.
Definition: IPrediction.h:40
def sign(x)
Definition: canMan.py:197
SpectrumStan ana::PredictionExtrap::PredictComponent ( osc::IOscCalcStan calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtualinherited

Reimplemented from ana::IPrediction.

Definition at line 89 of file PredictionExtrap.cxx.

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

93  {
94  return _PredictComponent<SpectrumStan>(calc, flav, curr, sign);
95  }
osc::OscCalcDumb calc
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 115 of file IPrediction.cxx.

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

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

120  {
121  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
122 
123  // Default implementation: no treatment of systematics
124  return PredictComponent(calc, flav, curr, sign);
125  }
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
SpectrumStan 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.

Definition at line 129 of file IPrediction.cxx.

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

134  {
135  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
136 
137  // Default implementation: no treatment of systematics
138  return PredictComponent(calc, flav, curr, sign);
139  }
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
SpectrumStan ana::IPrediction::PredictSyst ( osc::IOscCalcStan calc,
const SystShifts syst 
) const
virtualinherited

Reimplemented in ana::PredictionInterp.

Definition at line 95 of file IPrediction.cxx.

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

97  {
98  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
99 
100  // Default implementation: no treatment of systematics
101  return Predict(calc);
102  }
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
assert(nhit_max >=nhit_nbins)
Spectrum ana::PredictionSterile::PredictUnoscillated ( ) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 30 of file PredictionSterile.cxx.

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

Referenced by sterile_demo().

31  {
32  // Use an osc::OscCalcSterile to avoid warnings/errors from PredictComponent
33  // Just set to a 3 flavor calculator, with all oscillation parameters to 0
34  osc::OscCalcSterile noosc;
35  noosc.SetNFlavors(3);
36  noosc.SetL(0);
37  noosc.SetRho(0);
38  noosc.SetAngle(1, 2, 0);
39  noosc.SetAngle(1, 3, 0);
40  noosc.SetAngle(2, 3, 0);
41  noosc.SetDelta(1, 3, 0);
42  noosc.SetDm(2, 0);
43  noosc.SetDm(3, 0);
44  return Predict(&noosc);
45  }
Spectrum Predict(osc::IOscCalc *calc) const override
osc::NoOscillations noosc
Definition: NueSystFuncs.h:44
void ana::PredictionSterile::SaveTo ( TDirectory *  dir,
const std::string &  name 
) const
overridevirtual

Reimplemented from ana::PredictionExtrap.

Definition at line 96 of file PredictionSterile.cxx.

References dir, ana::PredictionExtrap::SaveTo(), and tmp.

Referenced by BlessedPlotsLoad(), FitSystEffectsLoad(), MakeNus17Prediction(), and MakeNusPrediction().

97  {
98  TDirectory* tmp = gDirectory;
99 
101 
102  dir = (TDirectory*)dir->GetDirectory(name.c_str()); // switch to subdir
103  dir->cd();
104 
105  TObjString("PredictionSterile").Write("type", TObject::kOverwrite);
106 
107  delete dir;
108 
109  tmp->cd();
110  }
const XML_Char * name
Definition: expat.h:151
Float_t tmp
Definition: plot.C:36
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

std::unique_ptr<IExtrap> ana::PredictionExtrap::fExtrap
protectedinherited

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