Base class for component extrapolation. More...
Classes | |
class | DivByZeroCounter |
Public Member Functions | |
ModularExtrapComponent () | |
virtual | ~ModularExtrapComponent () |
virtual void | SaveTo (TDirectory *dir, const std::string &name) const =0 |
virtual void | SavePlots (TDirectory *dir, double potFD) const =0 |
const OscillatableSpectrum & | Return () const |
Interface so that result of Eval() is called only once and cached. More... | |
virtual const IDecomp * | GetDecomp () const =0 |
Static Public Member Functions | |
static void | SetQuiet (bool quiet=true) |
Protected Member Functions | |
virtual OscillatableSpectrum | Eval () const =0 |
Core extrapolation math. More... | |
Static Protected Member Functions | |
static Spectrum | GetDecompResult (const IDecomp &, DecompResult) |
Helper function to pick out single Spectrum from a decomposition. More... | |
static std::string | DRToString (DecompResult) |
Helper function to turn a DecompResult into a string (for storage). More... | |
static DecompResult | StringToDR (std::string) |
Helper function to turn a string into a DecompResult (for loading). More... | |
static Ratio | FormSmartRatio (const Spectrum &num, const Spectrum &denom, std::string component, std::string location, const Spectrum &mult) |
Form Ratio, but be aware of zero division. More... | |
static void | ComparisonPlot (Spectrum mc, Spectrum notMC, double pot, std::string notMCLabel, int notMCColor, std::string latex, std::string title, std::string saveAs, bool restrictRange=false) |
Private Attributes | |
bool | fEvaluated |
OscillatableSpectrum | fCache |
Static Private Attributes | |
static bool | fQuiet = false |
Base class for component extrapolation.
Definition at line 21 of file ModularExtrapComponent.h.
|
inline |
Definition at line 25 of file ModularExtrapComponent.h.
|
inlinevirtual |
Definition at line 26 of file ModularExtrapComponent.h.
References dir, ana::SaveTo(), and string.
|
staticprotected |
Definition at line 17 of file ModularExtrapComponentPlot.cxx.
References plot_validation_datamc::c, kRed, make_mec_shifts_plots::legend, and ana::Spectrum::ToTH1().
Referenced by ana::FluxReweight::SavePlots(), ana::TruthReweight::SavePlots(), and ana::RecoReweight::SavePlots().
|
staticprotected |
Helper function to turn a DecompResult into a string (for storage).
Definition at line 98 of file ModularExtrapComponent.cxx.
References ana::assert(), ana::NC, ana::NCbar, ana::NCtot, ana::nue, ana::nuebar, ana::numu, and ana::numubar.
Referenced by ana::TruthReweight::SaveTo(), and ana::RecoReweight::SaveTo().
|
protectedpure virtual |
Core extrapolation math.
Implemented in ana::RecoReweight, ana::TruthReweight, ana::NoReweight, and ana::FluxReweight.
Referenced by Return().
|
staticprotected |
Form Ratio, but be aware of zero division.
Necessary because root thinks n/0==0, so we lose events when low stats cause empty bins. If zero division occurs, ratio is set to 1 and warning is issued. If numerator is 0 and ratio will be multiplied by 0 later, the warning is suppressed.
Definition at line 130 of file ModularExtrapComponent.cxx.
References ana::assert(), bin, hadd_many_files::counter, ana::ModularExtrapComponent::DivByZeroCounter::fBins, fQuiet, ana::Spectrum::GetBinnings(), ana::Spectrum::GetEigen(), and ana::Spectrum::GetLabels().
Referenced by ana::FluxReweight::Eval(), ana::TruthReweight::Eval(), and ana::RecoReweight::Eval().
|
pure virtual |
Implemented in ana::RecoReweight, ana::TruthReweight, ana::NoReweight, and ana::FluxReweight.
|
staticprotected |
Helper function to pick out single Spectrum from a decomposition.
Definition at line 80 of file ModularExtrapComponent.cxx.
References ana::IDecomp::AntiNueComponent(), ana::IDecomp::AntiNumuComponent(), ana::assert(), ana::NC, ana::IDecomp::NCAntiComponent(), ana::NCbar, ana::IDecomp::NCComponent(), ana::NCtot, ana::IDecomp::NCTotalComponent(), ana::nue, ana::nuebar, ana::IDecomp::NueComponent(), ana::numu, ana::numubar, and ana::IDecomp::NumuComponent().
Referenced by ana::TruthReweight::Eval(), ana::RecoReweight::Eval(), ana::TruthReweight::SavePlots(), and ana::RecoReweight::SavePlots().
const OscillatableSpectrum & ana::ModularExtrapComponent::Return | ( | ) | const |
Interface so that result of Eval() is called only once and cached.
Definition at line 68 of file ModularExtrapComponent.cxx.
References Eval(), fCache, and fEvaluated.
Referenced by ana::FluxReweight::SavePlots(), ana::TruthReweight::SavePlots(), and ana::RecoReweight::SavePlots().
|
pure virtual |
Implemented in ana::RecoReweight, ana::TruthReweight, ana::NoReweight, and ana::FluxReweight.
|
pure virtual |
Implemented in ana::RecoReweight, ana::TruthReweight, and ana::NoReweight.
|
inlinestatic |
Definition at line 29 of file ModularExtrapComponent.h.
References ana::GetDecomp(), latex(), location, mc, num, pot, string, and plotROC::title.
|
staticprotected |
Helper function to turn a string into a DecompResult (for loading).
Definition at line 115 of file ModularExtrapComponent.cxx.
References ana::assert(), ana::NC, ana::NCbar, ana::NCtot, ana::nue, ana::nuebar, ana::numu, and ana::numubar.
Referenced by ana::TruthReweight::LoadFrom(), and ana::RecoReweight::LoadFrom().
|
mutableprivate |
Definition at line 77 of file ModularExtrapComponent.h.
Referenced by Return().
|
mutableprivate |
Definition at line 76 of file ModularExtrapComponent.h.
Referenced by Return().
|
staticprivate |
Definition at line 78 of file ModularExtrapComponent.h.
Referenced by FormSmartRatio().