All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PredictionIncDirt.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 //#include "sbnana/CAFAna/Prediction/PredictionGenerator.h"
6 
7 namespace ana
8 {
9  class Loaders;
10 
11  /// Prediction summing detector and dirt components
13  {
14  public:
16  SpectrumLoaderBase& loaderNue,
17  SpectrumLoaderBase& loaderNuTau,
18  SpectrumLoaderBase& loaderIntrinsic,
19  SpectrumLoaderBase& loaderDirt,
20  const HistAxis& axis,
21  const SpillCut& spillcut,
22  const Cut& cut,
23  const SystShifts& shift = kNoShift,
24  const Var& wei = kUnweighted);
25 
26  PredictionIncDirt(Loaders& loaders,
27  SpectrumLoaderBase& loaderDirt,
28  const HistAxis& axis,
29  const SpillCut& spillcut,
30  const Cut& cut,
31  const SystShifts& shift = kNoShift,
32  const Var& wei = kUnweighted);
33 
34  virtual ~PredictionIncDirt();
35 
36  static std::unique_ptr<PredictionIncDirt> LoadFrom(TDirectory* dir);
37  virtual void SaveTo(TDirectory* dir) const override;
38 
40  {
41  return fDet.Predict(calc);
42  }
43 
45  {
46  return fDirt.Predict(calc);
47  }
48 
50  Flavors::Flavors_t flav,
51  Current::Current_t curr,
52  Sign::Sign_t sign) const
53  {
54  return fDet.PredictComponent(calc, flav, curr, sign);
55  }
56 
58  Flavors::Flavors_t flav,
59  Current::Current_t curr,
60  Sign::Sign_t sign) const
61  {
62  return fDirt.PredictComponent(calc, flav, curr, sign);
63  }
64 
65  virtual Spectrum Predict(osc::IOscCalc* calc) const override
66  {
67  return PredictDet(calc) + PredictDirt(calc);
68  }
69 
71  Flavors::Flavors_t flav,
72  Current::Current_t curr,
73  Sign::Sign_t sign) const override
74  {
75  return (PredictComponentDet (calc, flav, curr, sign) +
76  PredictComponentDirt(calc, flav, curr, sign));
77  }
78 
79  protected:
80  PredictionIncDirt(std::unique_ptr<PredictionNoExtrap>&& det,
81  std::unique_ptr<PredictionNoExtrap>&& dirt)
82  : fDet(*det), fDirt(*dirt)
83  {
84  }
85 
87  };
88 
89  // TODO how best to write a PredictionGenerator for this?
90 }
Spectrum PredictComponentDet(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
PredictionIncDirt(std::unique_ptr< PredictionNoExtrap > &&det, std::unique_ptr< PredictionNoExtrap > &&dirt)
Prediction summing detector and dirt components.
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:16
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:12
virtual void SaveTo(TDirectory *dir) const override
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const override
static std::unique_ptr< PredictionIncDirt > LoadFrom(TDirectory *dir)
process_name opflashCryoW ana
shift
Definition: fcl_checks.sh:26
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:30
virtual Spectrum Predict(osc::IOscCalc *calc) const override
then if echo $newprj grep q dirt
Spectrum PredictDet(osc::IOscCalc *calc) const
const SystShifts kNoShift
Definition: SystShifts.h:61
tuple dir
Definition: dropbox.py:28
Base class for the various types of spectrum loader.
int sign(double val)
Definition: UtilFunc.cxx:104
PredictionNoExtrap fDirt
const Var kUnweighted([](const caf::SRSliceProxy *){return 1;})
The simplest possible Var, always 1. Used as a default weight.
Standard interface to all prediction techniques.
Definition: IPrediction.h:58
PredictionNoExtrap fDet
Prediction that just uses one detector&#39;s MC, with no extrapolation.
Spectrum PredictComponentDirt(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const
virtual Spectrum Predict(osc::IOscCalc *calc) const override
PredictionIncDirt(SpectrumLoaderBase &loaderNonswap, SpectrumLoaderBase &loaderNue, SpectrumLoaderBase &loaderNuTau, SpectrumLoaderBase &loaderIntrinsic, SpectrumLoaderBase &loaderDirt, const HistAxis &axis, const SpillCut &spillcut, const Cut &cut, const SystShifts &shift=kNoShift, const Var &wei=kUnweighted)
Spectrum PredictDirt(osc::IOscCalc *calc) const