NusSysts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/ISyst.h"
5 #include <vector>
6 
7 class TH1D;
8 
10 
11 namespace ana
12 {
13  enum NusChannel{
14  kNC = 0,
15  kBG = 1
16  };
17 
18  class NusSystFromHist: public ISyst
19  {
20  public:
22  const std::string &shortname, const std::string &latexname);
24 
25  void Shift(double sigma,
26  caf::SRProxy* sr, double &weight) const override;
27 
28  double WeightFor(NusChannel chan, double sigma, double nueenergy) const;
29 
30  private:
33 
34  void LoadHists() const;
35 
36  // get oscillation channel for current event
38  // Store hist for sig and bkg for each syst, store a pair of a
39  // sigma shift value and a histogram evaluated at that shift
40  mutable std::vector< std::vector< std::pair<int, TH1D*> > > fHists;
41  };
42 
43  //----------------------------------------------------------------------
44  /// Nus group systematic applied as a flat shift only dependent on NC or CC
45  class NusFlatSyst: public ISyst
46  {
47  public:
48  NusFlatSyst(const std::string &shortname, const std::string &latexname,
49  const double &ncWei, const double &bgWei);
50  ~NusFlatSyst();
51 
52  void Shift(double sigma,
53  caf::SRProxy* sr, double &weight) const override;
54 
55  private:
56  double fNCWei;
57  double fBGWei;
58  };
59 
60  //----------------------------------------------------------------------
61  const std::string kNusAna01SystDir = FindCAFAnaDir() + "/data/nus/ana01/systs";
62  const std::string kNusAna01SystFile = kNusAna01SystDir + "/NusSystsAna01.root";
63  const std::string kNusAna01SystFAlt = kNusAna01SystDir + "/SystsOscParamAna.root";
64 
65  // Systematics based on docdb-15330
66 
67  // Systematics handled using shape information
68 // extern const NusSystFromHist kNusOscParamSysts;
79 
89 
90  // Systematics applied as flat shifts
93  extern const NusFlatSyst kNusNormSyst;
94 
95  //----------------------------------------------------------------------
96  /// Get a vector of all the nus group systs
97  std::vector<const ISyst*> getAllNusSysts();
98 } // namespace
double fNCWei
Definition: NusSysts.h:56
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::string fFileName
Definition: NusSysts.h:31
const NusSystFromHist kNusNDBirksSyst(kNusAna01SystFile,"ND","NDBirks","Birks C")
Definition: NusSysts.h:81
const Var weight
const NusFlatSyst kNusNDContSyst("ndcont","ND Containment", 1.0, 0.6)
Definition: NusSysts.h:92
const std::string kNusAna01SystFAlt
Definition: NusSysts.h:63
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
double fBGWei
Definition: NusSysts.h:57
const NusSystFromHist kNusNDCalibSlopeYSyst(kNusAna01SystFile,"ND","NDCalSlopeY","Sloped Miscalibration, Y")
Definition: NusSysts.h:84
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
const NusSystFromHist kNusCalibFlatSyst(kNusAna01SystFile,"EX","CalFlat","Flat Miscalibration")
Definition: NusSysts.h:71
const NusSystFromHist kNusNDNDRockSyst(kNusAna01SystFile,"ND","NDRock","ND Rock")
Definition: NusSysts.h:86
const NusSystFromHist kNusBeamSysts(kNusAna01SystFile,"EX","Beam","All Beam")
Definition: NusSysts.h:69
const NusSystFromHist kNusNDCalibSlopeXSyst(kNusAna01SystFile,"ND","NDCalSlopeX","Sloped Miscalibration, X")
Definition: NusSysts.h:83
std::vector< std::vector< std::pair< int, TH1D * > > > fHists
Definition: NusSysts.h:40
std::vector< const ISyst * > getAllNusSysts()
Get a vector of all the nus group systs.
Definition: NusSysts.cxx:202
void LoadHists() const
Definition: NusSysts.cxx:62
const NusSystFromHist kNusBirksSyst(kNusAna01SystFile,"EX","Birks","Birks C")
Definition: NusSysts.h:70
caf::StandardRecord * sr
const NusFlatSyst kNusMCStatsSyst("mcstat","MC Stats", 2.0, 4.8)
Definition: NusSysts.h:91
const NusSystFromHist kNusGENIESmallSysts(kNusAna01SystFile,"EX","GENIESm","Summed small GENIE Systs")
Definition: NusSysts.h:75
const std::string kNusAna01SystFile
Definition: NusSysts.h:62
double sigma(TH1F *hist, double percentile)
const NusSystFromHist kNusNueCCSyst(kNusAna01SystFile,"EX","NueCC","#nu_{e} CC Background")
Definition: NusSysts.h:77
Nus group systematic applied as a flat shift only dependent on NC or CC.
Definition: NusSysts.h:45
const NusSystFromHist kNusNDGENIESmallSysts(kNusAna01SystFile,"ND","NDGENIESm","Summed small GENIE Systs")
Definition: NusSysts.h:85
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
Definition: NusSysts.cxx:150
NusSystFromHist(const std::string &fname, const std::string &det, const std::string &shortname, const std::string &latexname)
Definition: NusSysts.cxx:46
NusChannel
Definition: NusSysts.h:13
const NusSystFromHist kNusCalibRelSyst(kNusAna01SystFile,"EX","CalRel","Relative Detector Miscalibration")
Definition: NusSysts.h:72
const std::string kNusAna01SystDir
Definition: NusSysts.h:61
const NusFlatSyst kNusNormSyst("normNus","Normalization", 4.9, 4.9)
Definition: NusSysts.h:93
double WeightFor(NusChannel chan, double sigma, double nueenergy) const
Definition: NusSysts.cxx:116
const NusSystFromHist kNusNDRockSyst(kNusAna01SystFile,"EX","NDNDRock","ND Rock")
Definition: NusSysts.h:76
std::string fDet
Definition: NusSysts.h:32
const NusSystFromHist kNusNDNumuCCSyst(kNusAna01SystFile,"ND","NDNumuCC","#nu_{#mu} CC Background")
Definition: NusSysts.h:88
const NusSystFromHist kNusCalibSlopeXSyst(kNusAna01SystFile,"EX","CalSlopeX","Sloped Miscalibration, X")
Definition: NusSysts.h:73
const NusSystFromHist kNusCalibSlopeYSyst(kNusAna01SystFile,"EX","CalSlopeY","Sloped Miscalibration, Y")
Definition: NusSysts.h:74
const NusSystFromHist kNusNDBeamSysts(kNusAna01SystFile,"ND","NDBeam","All Beam")
Definition: NusSysts.h:80
NusChannel GetNusChannel(caf::SRProxy *sr) const
Definition: NusSysts.cxx:107
const NusSystFromHist kNusNDCalibFlatSyst(kNusAna01SystFile,"ND","NDCalFlat","Flat Miscalibration")
Definition: NusSysts.h:82
const NusSystFromHist kNusNumuCCSyst(kNusAna01SystFile,"EX","NumuCC","#nu_{#mu} CC Background")
Definition: NusSysts.h:78
const NusSystFromHist kNusNDNueCCSyst(kNusAna01SystFile,"ND","NDNueCC","#nu_{e} CC Background")
Definition: NusSysts.h:87
enum BeamMode string