PredictionSyst3Flavor2020.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace ana
6 {
7  enum class ENu2020ExtrapType
8  {
9  kNoExtrap,
11  kCombo,
14  kFake,
16  kNuMu,
18  };
19 
20  /// Loads shifted spectra from files
22  {
23  public:
24  /// Nue constructor
27  const std::vector<const ISyst*>& systs,
28  std::string beam = "fhc",
29  bool isFakeData = false,
30  bool mergePeripheral = true,
31  const std::string fname = "",
32  bool minimizeMemory = true,
33  bool NERSC = false);
34 
35  /// Numu constructor
37  osc::IOscCalc* osc,
38  const std::string beam,
39  const int EhadFracQuant,
40  const std::vector<const ISyst*>& systs,
41  bool isFakeData = false,
42  const std::string fname = "",
43  bool minimizeMemory = true,
44  bool NERSC = false);
45 
46  virtual ~PredictionSyst3Flavor2020();
47 
48  /// Method to expose fPredNom
49  ///
50  /// \returns fPredNom Unique ptr to nominal prediction
52  {
53  //std::cout << "GETNOMPRED " << fPredNom.get() << std::endl;
54  return fPredNom.get();
55  };
56 
57  /// Method to expose fPreds
58  ///
59  /// \returns shifted prediction (ShiftedPreds) from fPreds
61  {
62  // for (auto& shift:fPreds[syst].preds) { std::cout << "\t Func shift: " << shift.get() << " " << std::endl; }
63  return fPreds[syst];
64  };
65 
66  static std::unique_ptr<PredictionSyst3Flavor2020> LoadFrom(TDirectory* dir, const std::string& name);
67  void SaveTo(TDirectory* dir, const std::string& name) const override;
68 
69  protected:
71 
72  /// Must set fBeam first
73  void AddNormSysts(const std::vector<const ISyst*>& systs, ENu2020ExtrapType extrap);
74 
75  void AddNormSyst(const ISyst* syst,
76  const std::vector<const ISyst*>& systs,
77  double fracNueApp, double fracOthers);
78 
79  std::string SigmaToString(int sigma) const;
80 
81  IPrediction* LoadNuePtExtrapPred( TFile* file, ENu2020ExtrapType extrap, std::string syst_name, std::string sigma_str ) const;
82 
83  IPrediction* LoadNumuPtExtrapPred( TFile* file, int EhadFracQuant, std::string syst_name, std::string sigma_str ) const;
84 
85  /// Interprets fBeam
86  bool IsFHC() const;
87 
89  };
90 }
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
Loads shifted spectra from files.
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &name)
bool mergePeripheral
bool IsFHC
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
std::unique_ptr< T > LoadFrom(TDirectory *dir, const std::string &label)
Definition: LoadFromFile.h:17
const ShiftedPreds & GetShiftedPrediction(const ISyst *syst)
Oscillation probability calculators.
Definition: Calcs.h:5
double sigma(TH1F *hist, double percentile)
TDirectory * dir
Definition: macro.C:5
TFile * file
Definition: cellShifts.C:17
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
enum BeamMode string