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/N21-05-06/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::IOscCalc *calc) const override
 
ana::Spectrum PredictComponent (osc::IOscCalc *calc, ana::Flavors::Flavors_t flav, ana::Current::Current_t curr, ana::Sign::Sign_t sign) const override
 
void SaveTo (TDirectory *dir, const std::string &name) const override
 
virtual Spectrum PredictUnoscillated () const
 
virtual Spectrum Predict (osc::IOscCalcStan *calc) const
 
virtual Spectrum PredictSyst (osc::IOscCalc *calc, const SystShifts &syst) const
 
virtual Spectrum PredictSyst (osc::IOscCalcStan *calc, const SystShifts &syst) const
 
virtual Spectrum PredictComponent (osc::IOscCalcStan *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) 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< TrivialPredictionLoadFrom (TDirectory *dir, const std::string &name)
 

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(), canMan::sign(), and string.

27  : fSpec(spec)
28  {};

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< TrivialPrediction > jw::TrivialPrediction::LoadFrom ( TDirectory *  dir,
const std::string name 
)
static

Definition at line 80 of file MECTuningUtils.h.

References ana::assert(), and ana::Spectrum::LoadFrom().

Referenced by TrivialPrediction().

81  {
82  dir = dir->GetDirectory(name.c_str()); // switch to subdir
83  assert(dir);
84 
85  return std::make_unique<TrivialPrediction>(*ana::Spectrum::LoadFrom(dir, "spec"));
86  }
const XML_Char * name
Definition: expat.h:151
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:563
TDirectory * dir
Definition: macro.C:5
assert(nhit_max >=nhit_nbins)
ana::Spectrum jw::TrivialPrediction::Predict ( osc::IOscCalc calc) const
overridevirtual

Implements ana::IPrediction.

Definition at line 44 of file MECTuningUtils.h.

References fSpec.

Referenced by TrivialPrediction().

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

Reimplemented in ana::PredictionInterp, ana::PredictionExtendToPeripheral, ana::PredictionNoOsc, ana::PredictionExtrapSum, ana::PredictionExtrap, and ana::PredictionAddRock.

Definition at line 43 of file IPrediction.cxx.

References ana::assert().

44  {
45  assert(0 && "This Prediction hasn't implemented a Stan-aware Predict()!");
46  }
assert(nhit_max >=nhit_nbins)
ana::Spectrum jw::TrivialPrediction::PredictComponent ( osc::IOscCalc 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  }
std::vector< double > Spectrum
Definition: Constants.h:746
Charged-current interactions.
Definition: IPrediction.h:39
(&#39; survival&#39;)
Definition: IPrediction.h:19
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
def sign(x)
Definition: canMan.py:197
Spectrum ana::IPrediction::PredictComponent ( osc::IOscCalcStan calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
virtualinherited

Reimplemented in ana::PredictionInterp, ana::PredictionNoOsc, ana::PredictionExtendToPeripheral, ana::PredictionExtrapSum, ana::PredictionAddRock, and ana::PredictionExtrap.

Definition at line 70 of file IPrediction.cxx.

References ana::assert().

74  {
75  assert(0 && "This Prediction hasn't implemented a Stan-aware PredictComponent()!");
76  }
assert(nhit_max >=nhit_nbins)
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 jw::TrivialPrediction::SaveTo ( TDirectory *  dir,
const std::string name 
) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 65 of file MECTuningUtils.h.

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

Referenced by TrivialPrediction().

66  {
67  TDirectory* tmp = gDirectory;
68 
69  dir = dir->mkdir(name.c_str()); // switch to subdir
70  dir->cd();
71 
72  TObjString("TrivialPrediction").Write("type", TObject::kOverwrite);
73  fSpec.SaveTo(dir, "spec");
74 
75  dir->Write();
76  delete dir;
77 
78  tmp->cd();
79  }
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:534
TDirectory * dir
Definition: macro.C:5

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: