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

Prediction that wraps a simple Spectrum. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-26/CAFAna/Prediction/PredictionXSecTuning.h"

Inheritance diagram for ana::PredictionXSecTuning:
ana::IPrediction

Public Member Functions

 PredictionXSecTuning (Loaders &loaders, const HistAxis &axis, 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 PredictComponent (osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) 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< PredictionXSecTuningLoadFrom (TDirectory *dir, const std::string &name)
 

Protected Member Functions

 PredictionXSecTuning (const Spectrum &s)
 

Protected Attributes

Spectrum fSpectrum
 

Detailed Description

Prediction that wraps a simple Spectrum.

Definition at line 11 of file PredictionXSecTuning.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file PredictionXSecTuning.cxx.

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

24  axis, cut, shift, wei )
25  {
26  }
Near Detector underground.
Definition: SREnums.h:10
const Cut cut
Definition: exporter_fd.C:30
std::vector< Loaders * > loaders
Definition: syst_header.h:386
ana::PredictionXSecTuning::PredictionXSecTuning ( const Spectrum s)
inlineprotected

Definition at line 39 of file PredictionXSecTuning.h.

40  : fSpectrum( s )
41  {}
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 128 of file IPrediction.cxx.

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

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

129  {
130  std::cout << "WARNING! ComponentCC is unimplemented in IPrediction" << std::endl; abort();
131  }
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 138 of file IPrediction.cxx.

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

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

139  {
140  std::cout << "WARNING! ComponentNC is unimplemented in IPrediction" << std::endl; abort();
141  }
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 143 of file IPrediction.cxx.

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

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

144  {
145  std::cout << "WARNING! ComponentNCAnti is unimplemented in IPrediction" << std::endl; abort();
146  }
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 133 of file IPrediction.cxx.

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

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

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

Definition at line 65 of file PredictionXSecTuning.cxx.

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

Referenced by ana::LoadFrom< IPrediction >().

66  {
67  dir = dir->GetDirectory(name.c_str()); // switch to subdir
68  assert(dir);
69 
70  PredictionXSecTuning* ret = new PredictionXSecTuning(*ana::LoadFrom<Spectrum>( dir, "spec" ) );
71 
72  delete dir;
73 
74  // Can't use make_unique because constructor is protected
75  return std::unique_ptr<PredictionXSecTuning>( ret );
76  }
const XML_Char * name
Definition: expat.h:151
PredictionXSecTuning(Loaders &loaders, 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::PredictionXSecTuning::Predict ( osc::IOscCalc ) const
inlineoverridevirtual

Implements ana::IPrediction.

Definition at line 28 of file PredictionXSecTuning.h.

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

Referenced by PredictComponent().

29  {
30  return fSpectrum;
31  }
Spectrum ana::IPrediction::Predict ( osc::IOscCalcStan calc) const
virtualinherited

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

Definition at line 66 of file IPrediction.cxx.

References ana::assert().

67  {
68  assert(0 && "This Prediction hasn't implemented a Stan-aware Predict()!");
69  }
assert(nhit_max >=nhit_nbins)
Spectrum ana::PredictionXSecTuning::PredictComponent ( osc::IOscCalc calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 29 of file PredictionXSecTuning.cxx.

References fSpectrum, ana::Sign::kBoth, ana::Current::kCC, ana::Flavors::kNuMuToNuMu, and Predict().

Referenced by Predict().

33  {
34  // basically the whole prediction is regarded as being one component
36  {
37  return Predict((osc::IOscCalc*)(nullptr)); // Faster
38  }
39  else
40  {
41  auto spec = ana::Spectrum( fSpectrum );
42  spec.Clear();
43  return std::move( spec );
44  }
45  }
Charged-current interactions.
Definition: IPrediction.h:39
std::vector< float > Spectrum
Definition: Constants.h:527
(&#39; survival&#39;)
Definition: IPrediction.h:19
virtual Spectrum Predict(osc::IOscCalc *) const override
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::PredictionExtendToPeripheral, ana::PredictionExtrapSum, ana::PredictionAddRock, and ana::PredictionExtrap.

Definition at line 93 of file IPrediction.cxx.

References ana::assert().

97  {
98  assert(0 && "This Prediction hasn't implemented a Stan-aware PredictComponent()!");
99  }
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 102 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().

107  {
108  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
109 
110  // Default implementation: no treatment of systematics
111  return PredictComponent(calc, flav, curr, sign);
112  }
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 116 of file IPrediction.cxx.

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

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

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

Definition at line 72 of file IPrediction.cxx.

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

Referenced by BicountEllipse_dCP(), ana::CountingExperiment::ChiSq(), ana::DataMCComparison(), demo_nueNumuSysts(), DrawBins(), DrawPulls(), fill_col(), joint_fit_2017_make_fc_slice(), joint_fit_2017_make_fc_surf(), MakeFakeData(), ana::PlotWithAreaSystErrorBand(), ana::PlotWithSystErrorBand(), ana::PlotWithSystErrorBand_Quant(), ana::SingleSampleExperiment::PredHistIncCosmics(), and ana::PredictionScaleComp::~PredictionScaleComp().

74  {
75  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
76 
77  // Default implementation: no treatment of systematics
78  return Predict(calc);
79  }
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
assert(nhit_max >=nhit_nbins)
Spectrum ana::IPrediction::PredictSyst ( osc::IOscCalcStan calc,
const SystShifts syst 
) const
virtualinherited

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

Definition at line 82 of file IPrediction.cxx.

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

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 Predict(calc);
89  }
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 56 of file IPrediction.cxx.

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

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

57  {
58  // Default implementation
60  return Predict(&noosc);
61  }
Pass neutrinos through unchanged.
Definition: IOscCalc.h:40
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
osc::NoOscillations noosc
Definition: NueSystFuncs.h:44
void ana::PredictionXSecTuning::SaveTo ( TDirectory *  dir,
const std::string &  name 
) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 48 of file PredictionXSecTuning.cxx.

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

49  {
50  TDirectory* tmp = gDirectory;
51 
52  dir = dir->mkdir(name.c_str()); // switch to subdir
53  dir->cd();
54 
55  TObjString( "PredictionXSecTuning" ).Write( "type");
56  fSpectrum.SaveTo( dir, "spec" );
57 
58  dir->Write();
59  delete dir;
60 
61  tmp->cd();
62  }
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:578
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

Spectrum ana::PredictionXSecTuning::fSpectrum
protected

Definition at line 43 of file PredictionXSecTuning.h.

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


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