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

Class to sum a set of PredictionExtraps. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/CAFAna/Prediction/PredictionExtrapSum.h"

Inheritance diagram for ana::PredictionExtrapSum:
ana::IPrediction

Public Member Functions

 PredictionExtrapSum (TFile *fin, const std::vector< std::string > &paths)
 
 PredictionExtrapSum (std::vector< TFile * > fins, const std::string &path)
 
virtual ~PredictionExtrapSum ()
 
virtual Spectrum Predict (osc::IOscCalc *calc) const override
 
virtual Spectrum Predict (osc::IOscCalcStan *calc) 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 *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
 
 PredictionExtrapSum ()=delete
 
unsigned int NPredictions () const
 
const PredictionExtrapGetPrediction (unsigned int i) const
 
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 void SaveTo (TDirectory *dir, const std::string &name) const
 

Protected Member Functions

template<typename T >
Spectrum _PredictComponent (osc::_IOscCalc< T > *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
 

Protected Attributes

std::vector< const PredictionExtrap * > fPreds
 

Detailed Description

Class to sum a set of PredictionExtraps.

Definition at line 11 of file PredictionExtrapSum.h.

Constructor & Destructor Documentation

ana::PredictionExtrapSum::PredictionExtrapSum ( TFile *  fin,
const std::vector< std::string > &  paths 
)

Definition at line 23 of file PredictionExtrapSum.cxx.

References ana::assert(), fPreds, and runNovaSAM::release.

24  {
25  for ( auto p : paths )
26  {
27  fPreds.push_back( LoadFrom<PredictionExtrap>( fin, p ).release() );
28  }
29  assert(!fPreds.empty());
30  }
TString fin
Definition: Style.C:24
const char * p
Definition: xmltok.h:285
std::vector< const PredictionExtrap * > fPreds
assert(nhit_max >=nhit_nbins)
ana::PredictionExtrapSum::PredictionExtrapSum ( std::vector< TFile * >  fins,
const std::string path 
)

Definition at line 14 of file PredictionExtrapSum.cxx.

References ana::assert(), MakeMiniprodValidationCuts::f, fPreds, and runNovaSAM::release.

15  {
16  for ( auto f : fins )
17  {
18  fPreds.push_back( LoadFrom<PredictionExtrap>( f, path ).release() );
19  }
20  assert(!fPreds.empty());
21  }
std::vector< const PredictionExtrap * > fPreds
const std::string path
Definition: plot_BEN.C:43
assert(nhit_max >=nhit_nbins)
ana::PredictionExtrapSum::~PredictionExtrapSum ( )
virtual

Definition at line 33 of file PredictionExtrapSum.cxx.

References fPreds.

34  {
35  for( auto p : fPreds ) delete p;
36  }
const char * p
Definition: xmltok.h:285
std::vector< const PredictionExtrap * > fPreds
ana::PredictionExtrapSum::PredictionExtrapSum ( )
delete

Member Function Documentation

template<typename T >
template Spectrum ana::PredictionExtrapSum::_PredictComponent ( osc::_IOscCalc< T > *  calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
protected

Definition at line 58 of file PredictionExtrapSum.cxx.

References calc, ana::Spectrum::Clear(), febshutoff_auto::curr, fPreds, MECModelEnuComparisons::i, PredictComponent(), runNovaSAM::ret, and canMan::sign().

Referenced by GetPrediction(), and PredictComponent().

62  {
63  Spectrum ret = fPreds.front()->ComponentNCTotal(); // Get binning
64  ret.Clear();
65 
66  for( unsigned int i = 0; i < fPreds.size(); ++i ) ret += fPreds[i]->PredictComponent( calc, flav, curr, sign );
67 
68  return ret;
69  }
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
std::vector< const PredictionExtrap * > fPreds
std::vector< float > Spectrum
Definition: Constants.h:610
def sign(x)
Definition: canMan.py:197
OscillatableSpectrum ana::PredictionExtrapSum::ComponentCC ( int  from,
int  to 
) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 99 of file PredictionExtrapSum.cxx.

References ana::ReweightableSpectrum::Clear(), fPreds, MECModelEnuComparisons::i, and runNovaSAM::ret.

100  {
101  OscillatableSpectrum ret = fPreds.front()->ComponentCC( from, to );
102  ret.Clear();
103 
104  for( unsigned int i = 0; i < fPreds.size(); ++i ) ret += fPreds[i]->ComponentCC( from, to );
105 
106  return ret;
107  }
std::vector< const PredictionExtrap * > fPreds
OscillatableSpectrum ComponentCC(int from, int to) const override
Spectrum ana::PredictionExtrapSum::ComponentNC ( ) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 120 of file PredictionExtrapSum.cxx.

References ana::Spectrum::Clear(), fPreds, MECModelEnuComparisons::i, and runNovaSAM::ret.

121  {
122  Spectrum ret = fPreds.front()->ComponentNCTotal(); // Get binning
123  ret.Clear();
124 
125  for( unsigned int i = 0; i < fPreds.size(); ++i ) ret += fPreds[i]->ComponentNC();
126 
127  return ret;
128  }
Spectrum ComponentNC() const override
std::vector< const PredictionExtrap * > fPreds
std::vector< float > Spectrum
Definition: Constants.h:610
Spectrum ana::PredictionExtrapSum::ComponentNCAnti ( ) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 129 of file PredictionExtrapSum.cxx.

References ana::Spectrum::Clear(), fPreds, MECModelEnuComparisons::i, and runNovaSAM::ret.

130  {
131  Spectrum ret = fPreds.front()->ComponentNCTotal(); // Get binning
132  ret.Clear();
133 
134  for( unsigned int i = 0; i < fPreds.size(); ++i ) ret += fPreds[i]->ComponentNCAnti();
135 
136  return ret;
137  }
Spectrum ComponentNCAnti() const override
std::vector< const PredictionExtrap * > fPreds
std::vector< float > Spectrum
Definition: Constants.h:610
Spectrum ana::PredictionExtrapSum::ComponentNCTotal ( ) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 111 of file PredictionExtrapSum.cxx.

References ana::Spectrum::Clear(), fPreds, MECModelEnuComparisons::i, and runNovaSAM::ret.

112  {
113  Spectrum ret = fPreds.front()->ComponentNCTotal(); // Get binning
114  ret.Clear();
115 
116  for( unsigned int i = 0; i < fPreds.size(); ++i ) ret += fPreds[i]->ComponentNCTotal();
117 
118  return ret;
119  }
Spectrum ComponentNCTotal() const override
std::vector< const PredictionExtrap * > fPreds
std::vector< float > Spectrum
Definition: Constants.h:610
const PredictionExtrap* ana::PredictionExtrapSum::GetPrediction ( unsigned int  i) const
inline

Definition at line 52 of file PredictionExtrapSum.h.

References _PredictComponent(), fPreds, and MECModelEnuComparisons::i.

52 { return fPreds[i]; }
std::vector< const PredictionExtrap * > fPreds
unsigned int ana::PredictionExtrapSum::NPredictions ( ) const
inline

Definition at line 51 of file PredictionExtrapSum.h.

References fPreds.

51 { return fPreds.size(); }
std::vector< const PredictionExtrap * > fPreds
Spectrum ana::PredictionExtrapSum::Predict ( osc::IOscCalc calc) const
overridevirtual

Implements ana::IPrediction.

Definition at line 39 of file PredictionExtrapSum.cxx.

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

40  {
41  return PredictComponent( calc,
44  Sign::kBoth);
45  }
virtual 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::PredictionExtrapSum::Predict ( osc::IOscCalcStan calc) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 48 of file PredictionExtrapSum.cxx.

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

49  {
50  return PredictComponent( calc,
53  Sign::kBoth);
54  }
virtual 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::PredictionExtrapSum::PredictComponent ( osc::IOscCalc calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Implements ana::IPrediction.

Definition at line 81 of file PredictionExtrapSum.cxx.

References _PredictComponent().

Referenced by _PredictComponent(), and Predict().

85  {
86  return _PredictComponent(calc, flav, curr, sign);
87  }
Spectrum _PredictComponent(osc::_IOscCalc< T > *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
def sign(x)
Definition: canMan.py:197
Spectrum ana::PredictionExtrapSum::PredictComponent ( osc::IOscCalcStan calc,
Flavors::Flavors_t  flav,
Current::Current_t  curr,
Sign::Sign_t  sign 
) const
overridevirtual

Reimplemented from ana::IPrediction.

Definition at line 90 of file PredictionExtrapSum.cxx.

References _PredictComponent().

94  {
95  return _PredictComponent(calc, flav, curr, sign);
96  }
Spectrum _PredictComponent(osc::_IOscCalc< T > *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
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

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

Definition at line 49 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().

51  {
52  assert(syst.IsNominal() && "This Prediction doesn't support PredictSyst(). Did you just mean Predict()?");
53 
54  // Default implementation: no treatment of systematics
55  return Predict(calc);
56  }
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 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(), plot_nd_data_mc(), 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::IPrediction::SaveTo ( TDirectory *  dir,
const std::string name 
) const
virtualinherited

Member Data Documentation

std::vector<const PredictionExtrap*> ana::PredictionExtrapSum::fPreds
protected

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