All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ISyst.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "sbnanaobj/StandardRecord/Proxy/FwdDeclare.h"
6 
7 namespace ana
8 {
9  /// \brief Encapsulate code to systematically shift a \ref
10  /// caf::StandardRecord
11  ///
12  /// The Shift() function alters the \ref caf::StandardRecord or the weight
13  /// associated with the event.
14  class ISyst
15  {
16  public:
17  ISyst(const std::string& shortName,
18  const std::string& latexName,
19  bool applyPenalty = true,
20  double min = -3,
21  double max = +3);
22  ISyst(const ISyst &) = delete; // no copying.
23  ISyst(ISyst && rhs) = delete; // no moving either.
24  virtual ~ISyst();
25 
26  void operator=(const ISyst &) = delete; // still no copying.
27  void operator=(ISyst &&) = delete; // etc.
28 
29  /// The name printed out to the screen
30  virtual std::string ShortName() const final {return fShortName;}
31 
32  /// The name used on plots (ROOT's TLatex syntax)
33  virtual std::string LatexName() const final {return fLatexName;}
34 
35  virtual double Penalty(double x) const;
36 
37  /// Should a penalty be applied for this shift?
38  virtual bool ApplyPenalty() const {return fApplyPenalty;}
39 
40  /// Return the min/max value for this syst
41  virtual double Min() const{return fMin;}
42  virtual double Max() const{return fMax;}
43 
44  /// \brief Perform the systematic shift
45  ///
46  /// \param sigma Number of sigma to shift record by
47  /// \param sr The record to inspect and alter
48  /// \param weight Scale this weight for reweighting systematics
49  virtual void Shift(double sigma,
51  double& weight) const = 0;
52 
53  /// PredictionInterp normally interpolates between spectra made at
54  /// +/-1,2,3sigma. For some systematics that's overkill. Override this
55  /// function to specify different behaviour for this systematic.
56  virtual int PredInterpMaxNSigma() const
57  {
58  return 3;
59  }
60 
61  private:
62  std::string fShortName;
63  std::string fLatexName;
65  double fMin;
66  double fMax;
67  };
68 
69 } // namespace
bool fApplyPenalty
Definition: ISyst.h:64
double fMin
Definition: ISyst.h:65
process_name opflash particleana ie x
ISyst(const std::string &shortName, const std::string &latexName, bool applyPenalty=true, double min=-3, double max=+3)
Definition: ISyst.cxx:9
virtual bool ApplyPenalty() const
Should a penalty be applied for this shift?
Definition: ISyst.h:38
virtual double Max() const
Definition: ISyst.h:42
process_name opflashCryoW ana
virtual double Min() const
Return the min/max value for this syst.
Definition: ISyst.h:41
Encapsulate code to systematically shift a caf::StandardRecord.
Definition: ISyst.h:14
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
virtual std::string ShortName() const final
The name printed out to the screen.
Definition: ISyst.h:30
virtual int PredInterpMaxNSigma() const
Definition: ISyst.h:56
std::string fLatexName
Definition: ISyst.h:63
double fMax
Definition: ISyst.h:66
std::string fShortName
Definition: ISyst.h:62
void operator=(const ISyst &)=delete
virtual std::string LatexName() const final
The name used on plots (ROOT&#39;s TLatex syntax)
Definition: ISyst.h:33
virtual double Penalty(double x) const
Definition: ISyst.cxx:28
virtual ~ISyst()
Definition: ISyst.cxx:20
virtual void Shift(double sigma, caf::SRSliceProxy *sr, double &weight) const =0
Perform the systematic shift.