test_prediction_interp.C
Go to the documentation of this file.
2 #include "CAFAna/Core/Loaders.h"
7 using namespace ana;
8 
9 #include "OscLib/IOscCalc.h"
10 
11 #include "TCanvas.h"
12 #include "TGraph.h"
13 #include "TH2.h"
15 
17 {
19  loaders.SetLoaderPath("defname: prod_caf_S15-05-22_fd_genie_fhc_nonswap with stride 100",
21 
23 
24  const Binning bins = Binning::Simple(10, 0, 5);
25  NoExtrapGenerator gen(HistAxis("CC E", bins, kCCE), kNumuCC);
26  PredictionInterp pred({&kEnergyScaleSyst}, calc, gen, loaders);
27 
28  loaders.Go();
29 
30  pred.DebugPlots(calc);
31 
32  // Make sure we get the same answer after going to a file and back
33  SaveToFile(pred, "pred.root", "pred");
34  PredictionInterp* pred2 = LoadFromFile<PredictionInterp>("pred.root", "pred").release();
35  pred2->DebugPlots(calc);
36 }
37 
Implements systematic errors by interpolation between shifted templates.
_HistAxis< Var > HistAxis
Definition: HistAxis.h:103
Far Detector at Ash River.
Definition: SREnums.h:11
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void SaveToFile(const T &x, const std::string &fname, const std::string &label)
Definition: LoadFromFile.h:66
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
const Cut kNumuCC
Definition: NumuCuts.h:70
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
Generates FD-only predictions (no extrapolation)
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
const Var kCCE
Definition: NumuVars.h:21
void test_prediction_interp()
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
const Binning bins
Definition: NumuCC_CPiBin.h:8
std::vector< Loaders * > loaders
Definition: syst_header.h:386
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107