ISyst.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
6 
7 namespace ana
8 {
9  /// \brief Encapsulate code to systematically shift a \ref
10  /// caf::SRProxy
11  ///
12  /// The Shift() function alters the \ref caf::StandardRecord or the weight
13  /// associated with the event.
14  class ISyst
15  {
16  public:
18  const std::string& latexName);
19  ISyst(const ISyst &) = delete; // no copying.
20  ISyst(ISyst && rhs) = delete; // no moving either.
21  virtual ~ISyst();
22 
23  ISyst& operator=(const ISyst &) = delete; // still no copying.
24  ISyst& operator=(ISyst &&) = delete; // etc.
25 
26  /// The name printed out to the screen
27  virtual const std::string & ShortName() const final {return fShortName;}
28 
29  /// The name used on plots (ROOT's TLatex syntax)
30  virtual const std::string & LatexName() const final {return fLatexName;}
31 
32  /// \brief Perform the systematic shift
33  ///
34  /// Override this function if your systematic depends on non-SRNeutrino
35  /// quantities. If it is SRNeutrino-only, implement the other function, and
36  /// let this default forward to you when necessary.
37  ///
38  /// \param sigma Number of sigma to shift record by
39  /// \param sr The record to inspect and alter
40  /// \param weight Scale this weight for reweighting systematics
41  virtual void Shift(double sigma, caf::SRProxy* sr, double& weight) const;
42 
43  /// For systematics that deal only with the neutrino truth and not any
44  /// reconstruction/PID details. Systematics defined this way will work on
45  /// nuTree-derived spectra too (e.g. denominators of efficiencies).
46  virtual void TruthShift(double sigma,
48  double& weight) const
49  {
50  // Implement this function if your systematic depends only
51  // SRNeutrino. Left blank by default, since systematics using other
52  // information can do nothing sensible to the nuTree.
53  }
54 
55  /// GENIE reweights can only provide +/-1,2sigma
56  virtual bool IsGenieReweight() const {return false;}
57 
58  private:
61  };
62 
63 } // namespace
virtual bool IsGenieReweight() const
GENIE reweights can only provide +/-1,2sigma.
Definition: ISyst.h:56
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
virtual const std::string & ShortName() const final
The name printed out to the screen.
Definition: ISyst.h:27
const Var weight
Proxy for caf::SRNeutrino.
Definition: SRProxy.h:510
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
virtual void Shift(double sigma, caf::SRProxy *sr, double &weight) const
Perform the systematic shift.
Definition: ISyst.cxx:26
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
ISyst & operator=(const ISyst &)=delete
virtual void TruthShift(double sigma, caf::SRNeutrinoProxy *nu, double &weight) const
Definition: ISyst.h:46
std::string fLatexName
Definition: ISyst.h:60
std::string fShortName
Definition: ISyst.h:59
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
virtual const std::string & LatexName() const final
The name used on plots (ROOT&#39;s TLatex syntax)
Definition: ISyst.h:30
string shortName
THUMBNAIL BLOCK: We need to make a thumbnail for each.
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10
virtual ~ISyst()
Definition: ISyst.cxx:18
enum BeamMode string