PredictionNoOsc.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace ana
7 {
8  class Loaders;
9 
10  /// Prediction that wraps a simple Spectrum
12  {
13  public:
15  const HistAxis& axis,
16  const Cut& cut,
17  const SystShifts& shift = kNoShift,
18  const Var& wei = kUnweighted);
19 
21  const std::string& label,
22  const Binning& bins,
23  const Var& var,
24  const Cut& cut,
25  const SystShifts& shift = kNoShift,
26  const Var& wei = kUnweighted);
27 
28  static std::unique_ptr<PredictionNoOsc> LoadFrom(TDirectory* dir, const std::string& name);
29  virtual void SaveTo(TDirectory* dir, const std::string& name) const override;
30 
31  // un-hide inherited method stubs so we don't get warnings from the compiler
33 
34  virtual Spectrum Predict(osc::IOscCalc* /*calc*/) const override
35  {
36  return fSpectrum;
37  }
38 
39  virtual Spectrum Predict(osc::IOscCalcStan* /*calc*/) const override {
40  return fSpectrum;
41  }
42 
44  Flavors::Flavors_t flav,
46  Sign::Sign_t sign) const override;
47 
49  Flavors::Flavors_t flav,
50  Current::Current_t curr,
51  Sign::Sign_t sign) const override
52  {
53  return PredictComponent(static_cast<osc::IOscCalc*>(nullptr), flav, curr, sign);
54  }
55 
56 
57  protected:
59  const Spectrum& sNC,
60  const Spectrum& sNumu, const Spectrum& sNumubar,
61  const Spectrum& sNue, const Spectrum& sNuebar)
62  : fSpectrum(s),
63  fSpectrumNC(sNC),
64  fSpectrumNumu(sNumu), fSpectrumNumubar(sNumubar),
65  fSpectrumNue(sNue), fSpectrumNuebar(sNuebar)
66  {
67  }
68 
70 
76  };
77 
78 
80  {
81  public:
83  HistAxis axis,
84  Cut cut,
85  Var wei)
86  : fLoader(loader), fAxis(axis), fCut(cut), fWei(wei)
87  {
88  }
89 
90  virtual std::unique_ptr<IPrediction>
91  Generate(Loaders& loaders, const SystShifts& shiftMC = kNoShift) const override
92  {
93  return std::unique_ptr<IPrediction>(new PredictionNoOsc(fLoader,
94  fAxis,
95  fCut,
96  shiftMC,
97  fWei));
98  }
99  protected:
104  };
105 
106 }
const XML_Char * name
Definition: expat.h:151
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
SpectrumLoaderBase & fLoader
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
PredictionNoOsc(const Spectrum &s, const Spectrum &sNC, const Spectrum &sNumu, const Spectrum &sNumubar, const Spectrum &sNue, const Spectrum &sNuebar)
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
virtual Spectrum Predict(osc::IOscCalcStan *) const override
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
virtual std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
static std::unique_ptr< PredictionNoOsc > LoadFrom(TDirectory *dir, const std::string &name)
osc::OscCalcDumb calc
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const char * label
const XML_Char * s
Definition: expat.h:262
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
PredictionNoOsc(SpectrumLoaderBase &loader, const HistAxis &axis, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
virtual Spectrum PredictSyst(osc::IOscCalc *calc, const SystShifts &syst) const
Definition: IPrediction.cxx:49
NoOscPredictionGenerator(SpectrumLoaderBase &loader, HistAxis axis, Cut cut, Var wei)
loader
Definition: demo0.py:10
const SystShifts kNoShift
Definition: SystShifts.cxx:22
Base class for the various types of spectrum loader.
const Binning bins
Definition: NumuCC_CPiBin.h:8
const Cut cut
Definition: exporter_fd.C:30
TDirectory * dir
Definition: macro.C:5
std::vector< Loaders * > loaders
Definition: syst_header.h:386
virtual Spectrum PredictComponent(osc::IOscCalcStan *, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
Given loaders and an MC shift, Generate() generates an IPrediction.
virtual Spectrum Predict(osc::IOscCalc *) const override
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:96
def sign(x)
Definition: canMan.py:197
Prediction that wraps a simple Spectrum.
enum BeamMode string