Nus17Systs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/ISyst.h"
5 
6 #include "NuXAna/Systs/NusSysts.h" // for NusChannel
7 
8 #include <vector>
9 
10 class TH1D;
11 
13 
14 namespace ana
15 {
16  class Nus17SystFromHist: public ISyst
17  {
18  public:
20  const std::string &shortname, const std::string &latexname);
22 
23  void Shift(double sigma,
24  caf::SRProxy* sr, double &weight) const override;
25 
26  double WeightFor(NusChannel chan, double sigma, double nueenergy) const;
27 
28  private:
31 
32  void LoadHists() const;
33 
34  // get oscillation channel for current event
36  // Store hist for sig and bkg for each syst, store a pair of a
37  // sigma shift value and a histogram evaluated at that shift
38  mutable std::vector< std::vector< std::pair<int, TH1D*> > > fHists;
39  };
40 
41  //----------------------------------------------------------------------
42  /// Nus group systematic applied as a flat shift only dependent on NC or CC
43  class Nus17FlatSyst: public ISyst
44  {
45  public:
46  Nus17FlatSyst(const std::string &shortname, const std::string &latexname,
47  const double &ncWei, const double &bgWei);
48  ~Nus17FlatSyst();
49 
50  void Shift(double sigma,
51  caf::SRProxy* sr, double &weight) const override;
52 
53  private:
54  double fNCWei;
55  double fBGWei;
56  };
57 
58  //----------------------------------------------------------------------
59 // const std::string kNusAna01SystDir = "$NOVA_ANA/steriles/Ana01/Systematics";
60  const std::string kNusAna17SystDir = FindCAFAnaDir() + "/data/nus17";
61  //const std::string kNusAna17_SystFile = kNusAna17SystDir + "/NusEXISysts17.root";
62  const std::string kNusAna17SystFile = kNusAna17SystDir + "/NusSystMaker.root";
63  const std::string kNusAna17SystFileND = kNusAna17SystDir + "/NusNDISysts17.root";
64  const std::string kNusAna17SystFAlt = kNusAna17SystDir + "/SystsOscParamAna.root";
65 
66  // Systematics based on docdb-15330
67 
68  // Systematics handled using shape information
69 // extern const Nus17SystFromHist kNus17OscParamSysts;
70 /* extern const Nus17SystFromHist kNus17BeamSysts;
71  extern const Nus17SystFromHist kNus17CherenkovSyst;
72  extern const Nus17SystFromHist kNus17CalibFlatSyst;
73  extern const Nus17SystFromHist kNus17CalibRelNDSyst;
74  extern const Nus17SystFromHist kNus17CalibShape;
75  extern const Nus17SystFromHist kNus17Cherenkov_mSyst;
76  extern const Nus17SystFromHist kNus17GENIESmallSysts;
77  extern const Nus17SystFromHist kNus17NueCCSyst;
78  extern const Nus17SystFromHist kNus17NumuCCSyst;
79  extern const Nus17SystFromHist kNus17NCSyst;
80  extern const Nus17SystFromHist kNus17LightLSyst;
81  extern const Nus17SystFromHist kNus17AccSyst;
82  extern const Nus17SystFromHist kNus17CalibRelFDSyst;
83 */
84 
85  /* extern const Nus17SystFromHist kNus17NDBeamSysts;
86  extern const Nus17SystFromHist kNus17NDCherenkovSyst;
87  extern const Nus17SystFromHist kNus17NDCalibFlatSyst;
88  extern const Nus17SystFromHist kNus17NDCalibShapeSyst;
89  extern const Nus17SystFromHist kNus17NDGENIESmallSysts;
90  extern const Nus17SystFromHist kNus17NDCherenkov_mSyst;
91  extern const Nus17SystFromHist kNus17NDNueCCSyst;
92  extern const Nus17SystFromHist kNus17NDNumuCCSyst;
93  extern const Nus17SystFromHist kNus17NDNCSyst;
94  extern const Nus17SystFromHist kNus17NDLightLSyst;
95  extern const Nus17SystFromHist kNus17NDCalibRelSyst;
96 */
97 
98 
99  // extern const Nus17SystFromHist kNus17FDBeamSysts;
100  // extern const Nus17SystFromHist kNus17FDCherenkovSyst;
101  // extern const Nus17SystFromHist kNus17FDCalibFlatSyst;
102  // extern const Nus17SystFromHist kNus17FDCalibShapeSyst;
103  // extern const Nus17SystFromHist kNus17FDGENIESmallSysts;
104  // extern const Nus17SystFromHist kNus17FDCherenkov_mSyst;
105  // extern const Nus17SystFromHist kNus17FDLightLSyst;
106  // extern const Nus17SystFromHist kNus17FDCalibRelSyst;
107 
108  // Systematics applied as flat shifts
109  // extern const NusFlatSyst kNusMCStatsSyst;
110  // extern const Nus17FlatSyst kNus17NormSyst;
111  // extern const Nus17FlatSyst kNus17OscParamSysts;
112  // extern const Nus17FlatSyst kNusFDPPFXSyst;
113  //----------------------------------------------------------------------
114  /// Get a vector of all the nus group systs
115  // std::vector<const ISyst*> getAllNusFDSysts();
116  // std::vector<const ISyst*> getAllNusNDSysts();
117  // std::vector<const ISyst*> getAllNusFDRSysts();
118 } // namespace
const std::string kNusAna17SystFile
Definition: Nus17Systs.h:62
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
NusChannel GetNusChannel(caf::SRProxy *sr) const
Definition: Nus17Systs.cxx:128
void LoadHists() const
Definition: Nus17Systs.cxx:83
double WeightFor(NusChannel chan, double sigma, double nueenergy) const
Definition: Nus17Systs.cxx:137
const std::string kNusAna17SystDir
Definition: Nus17Systs.h:60
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
Nus group systematic applied as a flat shift only dependent on NC or CC.
Definition: Nus17Systs.h:43
const std::string kNusAna17SystFAlt
Definition: Nus17Systs.h:64
NusChannel
Definition: NusSysts.h:13
const std::string kNusAna17SystFileND
Definition: Nus17Systs.h:63
std::vector< std::vector< std::pair< int, TH1D * > > > fHists
Definition: Nus17Systs.h:38
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: Nus17Systs.cxx:171
Nus17SystFromHist(const std::string &fname, const std::string &det, const std::string &shortname, const std::string &latexname)
Definition: Nus17Systs.cxx:67
std::string fFileName
Definition: Nus17Systs.h:29
enum BeamMode string