PredictionSystJointDemo.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace ana
7 {
8  // enum ENu2018ExtrapType{
9  // kNoExtrap,
10  // kProportional,
11  // kCombo,
12  // kFake,
13  // kNuMuNoExtrap,
14  // kNuMu
15  // };
16 
17  /// Loads shifted spectra from files
19  {
20  public:
21  /// Nue constructor
24  const std::vector<const ISyst*>& systs,
25  std::string beam = "fhc",
26  bool isFakeData = false,
27  bool mergePeripheral = true,
28  const std::string fname = "",
29  bool minimizeMemory = true);
30 
31  /// Numu constructor
33  osc::IOscCalc* osc,
34  const std::string beam,
35  int WhichQuant,
36  const std::vector<const ISyst*>& systs,
37  const std::string fname,
38  bool minimizeMemory = true);
39 
40  virtual ~PredictionSystJointDemo();
41 
42  /// Method to expose fPredNom
43  ///
44  /// \returns fPredNom Unique ptr to nominal prediction
46  {
47  //std::cout << "GETNOMPRED " << fPredNom.get() << std::endl;
48  return fPredNom.get();
49  };
50 
51  /// Method to expose fPreds
52  ///
53  /// \returns shifted prediction (ShiftedPreds) from fPreds
55  {
56  //for (auto shift:fPreds[syst].preds) { std::cout << "\t Func shift: " << shift << " " << std::endl; }
57  return fPreds[syst];
58  };
59 
60  static std::unique_ptr<PredictionSystJointDemo> LoadFrom(TDirectory* dir, const std::string& name);
61  void SaveTo(TDirectory* dir, const std::string& name) const override;
62 
63  protected:
65 
66  /// Must set fBeam first
67  void AddNormSysts(const std::vector<const ISyst*>& systs);
68 
69  void AddNormSyst(const ISyst* syst,
70  const std::vector<const ISyst*>& systs,
71  double frac);
72 
73  std::string SigmaToString(int sigma) const;
74 
75  /// Interprets fBeam
76  bool IsFHC() const;
77 
79  };
80 }
bool IsFHC() const
Interprets fBeam.
const XML_Char * name
Definition: expat.h:151
Implements systematic errors by interpolation between shifted templates.
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
bool mergePeripheral
Loads shifted spectra from files.
void SaveTo(TDirectory *dir, const std::string &name) const override
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
std::unique_ptr< IPrediction > fPredNom
The nominal prediction.
std::string SigmaToString(int sigma) const
void AddNormSyst(const ISyst *syst, const std::vector< const ISyst * > &systs, double frac)
double frac(double x)
Fractional part.
Oscillation probability calculators.
Definition: Calcs.h:5
double sigma(TH1F *hist, double percentile)
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
TDirectory * dir
Definition: macro.C:5
static std::unique_ptr< PredictionSystJointDemo > LoadFrom(TDirectory *dir, const std::string &name)
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
std::unordered_map< const ISyst *, ShiftedPreds > fPreds
const ShiftedPreds & GetShiftedPrediction(const ISyst *syst)
void AddNormSysts(const std::vector< const ISyst * > &systs)
Must set fBeam first.