All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PredictionNoExtrap.cxx
Go to the documentation of this file.
2 
5 
8 
9 #include "TDirectory.h"
10 #include "TObjString.h"
11 
12 
13 namespace ana
14 {
15  //----------------------------------------------------------------------
17  SpectrumLoaderBase& loaderNue,
18  SpectrumLoaderBase& loaderNuTau,
19  SpectrumLoaderBase& loaderIntrinsic,
20  const std::string& label,
21  const Binning& bins,
22  const Var& var,
23  const SpillCut& spillcut,
24  const Cut& cut,
25  const SystShifts& shift,
26  const Var& wei)
27  : PredictionExtrap(new TrivialExtrap(loaderNonswap, loaderNue, loaderNuTau, loaderIntrinsic,
28  label, bins, var, spillcut, cut, shift, wei))
29  {
30  }
31 
32  //----------------------------------------------------------------------
34  SpectrumLoaderBase& loaderNue,
35  SpectrumLoaderBase& loaderNuTau,
36  SpectrumLoaderBase& loaderIntrinsic,
37  const HistAxis& axis,
38  const SpillCut& spillcut,
39  const Cut& cut,
40  const SystShifts& shift,
41  const Var& wei)
42  : PredictionExtrap(new TrivialExtrap(loaderNonswap, loaderNue, loaderNuTau, loaderIntrinsic,
43  axis, spillcut, cut, shift, wei))
44  {
45  }
46 
47  //----------------------------------------------------------------------
49  {
50  }
51 
52  //----------------------------------------------------------------------
54  const std::string& label,
55  const Binning& bins,
56  const Var& var,
57  const SpillCut& spillcut,
58  const Cut& cut,
59  const SystShifts& shift,
60  const Var& wei)
61  : PredictionNoExtrap(loaders, HistAxis(label, bins, var), spillcut, cut, shift, wei)
62  {
63  }
64 
65  //----------------------------------------------------------------------
67  const HistAxis& axis,
68  const SpillCut& spillcut,
69  const Cut& cut,
70  const SystShifts& shift,
71  const Var& wei)
72  : PredictionExtrap(new TrivialExtrap(loaders, axis, spillcut, cut, shift, wei))
73  {
74  }
75 
76  //----------------------------------------------------------------------
77  void PredictionNoExtrap::SaveTo(TDirectory* dir) const
78  {
79  TDirectory* tmp = gDirectory;
80 
81  dir->cd();
82 
83  TObjString("PredictionNoExtrap").Write("type");
84 
85  fExtrap->SaveTo(dir->mkdir("extrap"));
86 
87  tmp->cd();
88  }
89 
90 
91  //----------------------------------------------------------------------
92  std::unique_ptr<PredictionNoExtrap> PredictionNoExtrap::LoadFrom(TDirectory* dir)
93  {
94  assert(dir->GetDirectory("extrap"));
95  IExtrap* extrap = ana::LoadFrom<IExtrap>(dir->GetDirectory("extrap")).release();
96  PredictionExtrap* pred = new PredictionExtrap(extrap);
97  return std::unique_ptr<PredictionNoExtrap>(new PredictionNoExtrap(pred));
98  }
99 
100 
101  //----------------------------------------------------------------------
103  {
104  // We created this in the constructor so it's our responsibility
105  delete fExtrap;
106  }
107 }
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:18
virtual void SaveTo(TDirectory *dir) const override
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:16
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:12
std::unique_ptr< IExtrap > LoadFrom< IExtrap >(TDirectory *dir)
Definition: IExtrap.cxx:17
static std::unique_ptr< PredictionNoExtrap > LoadFrom(TDirectory *dir)
process_name opflashCryoW ana
shift
Definition: fcl_checks.sh:26
&quot;Extrapolation&quot; that simply returns the MC prediction
Definition: TrivialExtrap.h:10
PredictionNoExtrap(PredictionExtrap *pred)
tuple dir
Definition: dropbox.py:28
Base class for the various types of spectrum loader.
virtual void SaveTo(TDirectory *dir) const
Definition: IExtrap.cxx:31
Interface to extrapolation procedures.
Definition: IExtrap.h:8
Prediction that just uses one detector&#39;s MC, with no extrapolation.
Take the output of an extrapolation and oscillate it as required.