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
35 
36 
37  virtual Spectrum Predict(osc::IOscCalc* /*calc*/) const override
38  {
39  return fSpectrum;
40  }
41 
43  Flavors::Flavors_t flav,
45  Sign::Sign_t sign) const override;
46 
47  protected:
49  const Spectrum& sNC,
50  const Spectrum& sNumu, const Spectrum& sNumubar,
51  const Spectrum& sNue, const Spectrum& sNuebar)
52  : fSpectrum(s),
53  fSpectrumNC(sNC),
54  fSpectrumNumu(sNumu), fSpectrumNumubar(sNumubar),
55  fSpectrumNue(sNue), fSpectrumNuebar(sNuebar)
56  {
57  }
58 
60 
66  };
67 
68 
70  {
71  public:
73  HistAxis axis,
74  Cut cut,
75  Var wei)
76  : fLoader(loader), fAxis(axis), fCut(cut), fWei(wei)
77  {
78  }
79 
80  virtual std::unique_ptr<IPrediction>
81  Generate(Loaders& loaders, const SystShifts& shiftMC = kNoShift) const override
82  {
83  return std::unique_ptr<IPrediction>(new PredictionNoOsc(fLoader,
84  fAxis,
85  fCut,
86  shiftMC,
87  fWei));
88  }
89  protected:
94  };
95 
96 }
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
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
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)
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
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:21
Base class for the various types of spectrum loader.
const Binning bins
Definition: NumuCC_CPiBin.h:8
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const Cut cut
Definition: exporter_fd.C:30
TDirectory * dir
Definition: macro.C:5
std::vector< Loaders * > loaders
Definition: syst_header.h:386
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.