11 #include <unordered_map>
65 virtual void SaveTo(TDirectory*
dir)
const override;
66 static std::unique_ptr<PredictionInterp>
LoadFrom(TDirectory*
dir);
81 const std::string& savePattern =
"",
95 const std::string& savePattern =
"",
110 std::vector<const ISyst*> veto = {});
113 Coeffs(
double _a,
double _b,
double _c,
double _d)
114 :
a(_a),
b(_b),
c(_c),
d(_d) {}
119 std::vector<std::vector<Coeffs>>
120 FitRatios(
const std::vector<double>& shifts,
121 const std::vector<std::unique_ptr<TH1>>& ratios)
const;
124 std::vector<std::vector<Coeffs>>
126 const std::vector<IPrediction*>& preds,
130 const std::string& shortName)
const;
159 std::vector<std::vector<std::vector<Coeffs>>>
fits;
161 std::vector<std::vector<std::vector<Coeffs>>>
fitsNubar;
165 mutable std::unordered_map<const ISyst*, ShiftedPreds>
fPreds;
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Implements systematic errors by interpolation between shifted templates.
virtual Spectrum PredictSyst(osc::IOscCalc *calc, const SystShifts &shift) const override
std::string systName
What systematic we're interpolating.
Simple record of shifts applied to systematic parameters.
Collection of SpectrumLoaders for many configurations.
std::vector< std::vector< std::vector< Coeffs > > > fitsNubar
Will be filled if signs are separated, otherwise not.
virtual void SaveTo(TDirectory *dir) const override
void SetOscSeed(osc::IOscCalc *oscSeed)
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.
process_name opflashCryoW ana
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
Encapsulate code to systematically shift a caf::StandardRecord.
Representation of a spectrum in any variable, with associated POT.
std::unique_ptr< IPrediction > fPredNom
The nominal prediction.
std::map< Key_t, Val_t > fNomCache
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Interactions of both types.
virtual ~PredictionInterp()
std::vector< double > shifts
Shift values sampled.
std::vector< IPrediction * > preds
Spectrum fBinning
Dummy spectrum to provide binning.
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
static std::unique_ptr< PredictionInterp > LoadFrom(TDirectory *dir)
const SystShifts kNoShift
bool operator<(const Key_t &rhs) const
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
then echo File list $list not found else cat $list while read file do echo $file sed s
Coeffs(double _a, double _b, double _c, double _d)
Both neutrinos and antineutrinos.
Standard interface to all prediction techniques.
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 InitFitsHelper(ShiftedPreds &sp, std::vector< std::vector< std::vector< Coeffs >>> &fits, Sign::Sign_t sign) const
Given loaders and an MC shift, Generate() generates an IPrediction.
std::unordered_map< const ISyst *, ShiftedPreds > fPreds
osc::IOscCalc * fOscOrigin
The oscillation values we assume when evaluating the coefficients.
All neutrinos, any flavor.
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.
virtual Spectrum PredictComponentSyst(osc::IOscCalc *calc, const SystShifts &shift, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
virtual Spectrum Predict(osc::IOscCalc *calc) const override
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.
Spectrum ShiftSpectrum(const Spectrum &s, CoeffsType type, bool nubar, const SystShifts &shift) const
std::vector< std::vector< std::vector< Coeffs > > > fits
Indices: [type][histogram bin][shift bin].