Implements systematic errors by interpolation between shifted templates. More...
#include <PredictionInterp.h>
Classes | |
struct | Coeffs |
struct | Key_t |
struct | ShiftedPreds |
struct | Val_t |
Public Types | |
enum | EMode_t { kCombineSigns, kSplitBySign } |
enum | CoeffsType { kNueApp, kNueSurv, kNumuSurv, kNC, kOther, kNCoeffTypes } |
Public Member Functions | |
PredictionInterp (std::vector< const ISyst * > systs, osc::IOscCalc *osc, const IPredictionGenerator &predGen, Loaders &loaders, const SystShifts &shiftMC=kNoShift, EMode_t mode=kCombineSigns) | |
virtual | ~PredictionInterp () |
virtual Spectrum | Predict (osc::IOscCalc *calc) const override |
virtual Spectrum | PredictSyst (osc::IOscCalc *calc, const SystShifts &shift) const override |
virtual Spectrum | PredictComponent (osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override |
virtual Spectrum | PredictComponentSyst (osc::IOscCalc *calc, const SystShifts &shift, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override |
virtual void | SaveTo (TDirectory *dir) const override |
void | MinimizeMemory () |
void | DebugPlot (const ISyst *syst, osc::IOscCalc *calc, Flavors::Flavors_t flav=Flavors::kAll, Current::Current_t curr=Current::kBoth, Sign::Sign_t sign=Sign::kBoth) const |
void | DebugPlots (osc::IOscCalc *calc, const std::string &savePattern="", Flavors::Flavors_t flav=Flavors::kAll, Current::Current_t curr=Current::kBoth, Sign::Sign_t sign=Sign::kBoth) const |
void | SetOscSeed (osc::IOscCalc *oscSeed) |
void | DebugPlotColz (const ISyst *syst, osc::IOscCalc *calc, Flavors::Flavors_t flav=Flavors::kAll, Current::Current_t curr=Current::kBoth, Sign::Sign_t sign=Sign::kBoth) const |
void | DebugPlotsColz (osc::IOscCalc *calc, const std::string &savePattern="", Flavors::Flavors_t flav=Flavors::kAll, Current::Current_t curr=Current::kBoth, Sign::Sign_t sign=Sign::kBoth) const |
bool | SplitBySign () const |
PredictionInterp () | |
std::vector< std::vector < Coeffs > > | FitRatios (const std::vector< double > &shifts, const std::vector< std::unique_ptr< TH1 >> &ratios) const |
Find coefficients describing this set of shifts. More... | |
std::vector< std::vector < Coeffs > > | FitComponent (const std::vector< double > &shifts, const std::vector< IPrediction * > &preds, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign, const std::string &shortName) const |
Find coefficients describing the ratios from this component. More... | |
Spectrum | ShiftSpectrum (const Spectrum &s, CoeffsType type, bool nubar, const SystShifts &shift) const |
Spectrum | ShiftedComponent (osc::IOscCalc *calc, const TMD5 *hash, const SystShifts &shift, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign, CoeffsType type) const |
Helper for PredictComponentSyst. More... | |
Public Member Functions inherited from ana::IPrediction | |
virtual | ~IPrediction () |
virtual Spectrum | PredictUnoscillated () const |
virtual OscillatableSpectrum | ComponentCC (int from, int to) const |
Static Public Member Functions | |
static std::unique_ptr < PredictionInterp > | LoadFrom (TDirectory *dir) |
Public Attributes | |
std::unique_ptr< IPrediction > | fPredNom |
The nominal prediction. More... | |
Protected Member Functions | |
void | InitFits () const |
void | InitFitsHelper (ShiftedPreds &sp, std::vector< std::vector< std::vector< Coeffs >>> &fits, Sign::Sign_t sign) const |
Protected Attributes | |
std::unordered_map< const ISyst *, ShiftedPreds > | fPreds |
osc::IOscCalc * | fOscOrigin |
The oscillation values we assume when evaluating the coefficients. More... | |
Spectrum | fBinning |
Dummy spectrum to provide binning. More... | |
std::map< Key_t, Val_t > | fNomCache |
bool | fSplitBySign |
Implements systematic errors by interpolation between shifted templates.
Definition at line 22 of file PredictionInterp.h.
Enumerator | |
---|---|
kNueApp | |
kNueSurv | |
kNumuSurv | |
kNC | |
kOther |
Taus, numu appearance. |
kNCoeffTypes |
Definition at line 101 of file PredictionInterp.h.
ana::PredictionInterp::PredictionInterp | ( | std::vector< const ISyst * > | systs, |
osc::IOscCalc * | osc, | ||
const IPredictionGenerator & | predGen, | ||
Loaders & | loaders, | ||
const SystShifts & | shiftMC = kNoShift , |
||
EMode_t | mode = kCombineSigns |
||
) |
systs | What systematics we should be capable of interpolating |
osc | The oscillation point to expand around |
predGen | Construct an IPrediction from the following information. |
loaders | The loaders to be passed on to the underlying prediction |
shiftMC | Underlying shift. Use with care. Mostly for PredictionNumuFAHadE. Should not contain any of of systs |
mode | In FHC the wrong-sign has bad stats and probably the fits can't be split out reasonably. For RHC it's important not to conflate them. |
Definition at line 29 of file PredictionInterp.cxx.
|
virtual |
Definition at line 60 of file PredictionInterp.cxx.
|
inline |
Definition at line 107 of file PredictionInterp.h.
void ana::PredictionInterp::DebugPlot | ( | const ISyst * | syst, |
osc::IOscCalc * | calc, | ||
Flavors::Flavors_t | flav = Flavors::kAll , |
||
Current::Current_t | curr = Current::kBoth , |
||
Sign::Sign_t | sign = Sign::kBoth |
||
) | const |
Definition at line 556 of file PredictionInterp.cxx.
void ana::PredictionInterp::DebugPlotColz | ( | const ISyst * | syst, |
osc::IOscCalc * | calc, | ||
Flavors::Flavors_t | flav = Flavors::kAll , |
||
Current::Current_t | curr = Current::kBoth , |
||
Sign::Sign_t | sign = Sign::kBoth |
||
) | const |
Definition at line 677 of file PredictionInterp.cxx.
void ana::PredictionInterp::DebugPlots | ( | osc::IOscCalc * | calc, |
const std::string & | savePattern = "" , |
||
Flavors::Flavors_t | flav = Flavors::kAll , |
||
Current::Current_t | curr = Current::kBoth , |
||
Sign::Sign_t | sign = Sign::kBoth |
||
) | const |
Definition at line 644 of file PredictionInterp.cxx.
void ana::PredictionInterp::DebugPlotsColz | ( | osc::IOscCalc * | calc, |
const std::string & | savePattern = "" , |
||
Flavors::Flavors_t | flav = Flavors::kAll , |
||
Current::Current_t | curr = Current::kBoth , |
||
Sign::Sign_t | sign = Sign::kBoth |
||
) | const |
Definition at line 712 of file PredictionInterp.cxx.
std::vector< std::vector< PredictionInterp::Coeffs > > ana::PredictionInterp::FitComponent | ( | const std::vector< double > & | shifts, |
const std::vector< IPrediction * > & | preds, | ||
Flavors::Flavors_t | flav, | ||
Current::Current_t | curr, | ||
Sign::Sign_t | sign, | ||
const std::string & | shortName | ||
) | const |
Find coefficients describing the ratios from this component.
Definition at line 167 of file PredictionInterp.cxx.
std::vector< std::vector< PredictionInterp::Coeffs > > ana::PredictionInterp::FitRatios | ( | const std::vector< double > & | shifts, |
const std::vector< std::unique_ptr< TH1 >> & | ratios | ||
) | const |
Find coefficients describing this set of shifts.
Definition at line 71 of file PredictionInterp.cxx.
|
protected |
Definition at line 225 of file PredictionInterp.cxx.
|
protected |
Definition at line 209 of file PredictionInterp.cxx.
|
static |
Definition at line 479 of file PredictionInterp.cxx.
void ana::PredictionInterp::MinimizeMemory | ( | ) |
After calling this DebugPlots won't work fully and SaveTo won't work at all.
Definition at line 531 of file PredictionInterp.cxx.
|
overridevirtual |
Implements ana::IPrediction.
Definition at line 259 of file PredictionInterp.cxx.
|
overridevirtual |
Implements ana::IPrediction.
Definition at line 265 of file PredictionInterp.cxx.
|
overridevirtual |
Reimplemented from ana::IPrediction.
Definition at line 391 of file PredictionInterp.cxx.
|
overridevirtual |
Reimplemented from ana::IPrediction.
Definition at line 274 of file PredictionInterp.cxx.
|
overridevirtual |
Reimplemented from ana::IPrediction.
Definition at line 436 of file PredictionInterp.cxx.
void ana::PredictionInterp::SetOscSeed | ( | osc::IOscCalc * | oscSeed | ) |
Definition at line 253 of file PredictionInterp.cxx.
Spectrum ana::PredictionInterp::ShiftedComponent | ( | osc::IOscCalc * | calc, |
const TMD5 * | hash, | ||
const SystShifts & | shift, | ||
Flavors::Flavors_t | flav, | ||
Current::Current_t | curr, | ||
Sign::Sign_t | sign, | ||
CoeffsType | type | ||
) | const |
Helper for PredictComponentSyst.
Definition at line 345 of file PredictionInterp.cxx.
Spectrum ana::PredictionInterp::ShiftSpectrum | ( | const Spectrum & | s, |
CoeffsType | type, | ||
bool | nubar, | ||
const SystShifts & | shift | ||
) | const |
Definition at line 287 of file PredictionInterp.cxx.
|
inline |
Definition at line 100 of file PredictionInterp.h.
|
mutableprotected |
Dummy spectrum to provide binning.
Definition at line 170 of file PredictionInterp.h.
Definition at line 188 of file PredictionInterp.h.
|
protected |
The oscillation values we assume when evaluating the coefficients.
Definition at line 168 of file PredictionInterp.h.
std::unique_ptr<IPrediction> ana::PredictionInterp::fPredNom |
The nominal prediction.
Definition at line 146 of file PredictionInterp.h.
|
mutableprotected |
Definition at line 165 of file PredictionInterp.h.
|
protected |
Definition at line 190 of file PredictionInterp.h.