CombineHarvester
Systematic.h
Go to the documentation of this file.
1 #ifndef CombineTools_Systematic_h
2 #define CombineTools_Systematic_h
3 #include <memory>
4 #include <string>
5 #include "TH1.h"
6 #include "RooAbsReal.h"
7 #include "RooDataHist.h"
10 
11 namespace ch {
12 
13 class Systematic : public Object {
14  public:
15  Systematic();
16  ~Systematic();
17  Systematic(Systematic const& other);
18  Systematic(Systematic&& other);
20 
21  void set_name(std::string const& name);
22  std::string const& name() const { return name_; }
23 
24  void set_type(std::string const& type) { type_ = type; }
25  std::string const& type() const { return type_; }
26 
27  void set_value_u(double const& value_u) { value_u_ = value_u; }
28  double value_u() const { return value_u_; }
29 
30  void set_value_d(double const& value_d) { value_d_ = value_d; }
31  double value_d() const { return value_d_; }
32 
33  void set_scale(double const& scale) { scale_ = scale; }
34  double scale() const { return scale_; }
35 
36  void set_asymm(bool const& asymm) { asymm_ = asymm; }
37  bool asymm() const { return asymm_; }
38 
39  TH1 const* shape_u() const { return shape_u_.get(); }
40 
41  std::unique_ptr<TH1> ClonedShapeU() const;
42  std::unique_ptr<TH1> ClonedShapeD() const;
43 
44  TH1F ShapeUAsTH1F() const;
45  TH1F ShapeDAsTH1F() const;
46 
47  TH1 const* shape_d() const { return shape_d_.get(); }
48 
49  RooDataHist const* data_u() const { return data_u_; }
50 
51  RooDataHist const* data_d() const { return data_d_; }
52 
53  RooAbsReal const* pdf_u() const { return pdf_u_; }
54 
55  RooAbsReal const* pdf_d() const { return pdf_d_; }
56 
57  void set_data(RooDataHist* data_u, RooDataHist* data_d,
58  RooDataHist const* nominal);
59 
60  void set_pdf(RooAbsReal* pdf_u, RooAbsReal* pdf_d,
61  RooAbsReal const* nominal);
62 
63  void set_shapes(std::unique_ptr<TH1> shape_u, std::unique_ptr<TH1> shape_d,
64  TH1 const* nominal);
65 
66  void set_shapes(TH1 const& shape_u, TH1 const& shape_d,
67  TH1 const& nominal);
68 
69  void set_param_str_ext(std::string const& param_str_ext) { param_str_ext_ = param_str_ext; }
70  std::string const& param_str_ext() const { return param_str_ext_; }
71 
72  std::string to_string() const;
73  friend std::ostream& operator<< (std::ostream &out, Systematic const& val);
74  static std::ostream& PrintHeader(std::ostream &out);
75 
76  void SwapUpAndDown();
77 
78  private:
79  std::string name_;
80  std::string type_;
81  double value_u_;
82  double value_d_;
83  double scale_;
84  bool asymm_;
85  std::unique_ptr<TH1> shape_u_;
86  std::unique_ptr<TH1> shape_d_;
87  RooAbsReal * pdf_u_;
88  RooAbsReal * pdf_d_;
89  RooDataHist * data_u_;
90  RooDataHist * data_d_;
91  std::string param_str_ext_;
92 
93  friend void swap(Systematic& first, Systematic& second);
94 };
95 }
96 
97 #endif
friend std::ostream & operator<<(std::ostream &out, Systematic const &val)
Definition: Systematic.cc:268
void set_param_str_ext(std::string const &param_str_ext)
Definition: Systematic.h:69
Systematic & operator=(Systematic other)
Definition: Systematic.cc:123
void set_pdf(RooAbsReal *pdf_u, RooAbsReal *pdf_d, RooAbsReal const *nominal)
Definition: Systematic.cc:194
double value_u() const
Definition: Systematic.h:28
RooDataHist const * data_d() const
Definition: Systematic.h:51
std::unique_ptr< TH1 > ClonedShapeU() const
Definition: Systematic.cc:200
std::string const & type() const
Definition: Systematic.h:25
std::unique_ptr< TH1 > ClonedShapeD() const
Definition: Systematic.cc:207
void set_shapes(std::unique_ptr< TH1 > shape_u, std::unique_ptr< TH1 > shape_d, TH1 const *nominal)
Definition: Systematic.cc:128
void set_value_d(double const &value_d)
Definition: Systematic.h:30
bool asymm() const
Definition: Systematic.h:37
TH1 const * shape_d() const
Definition: Systematic.h:47
void set_name(std::string const &name)
Definition: Systematic.cc:54
void set_data(RooDataHist *data_u, RooDataHist *data_d, RooDataHist const *nominal)
Definition: Systematic.cc:184
void set_value_u(double const &value_u)
Definition: Systematic.h:27
TH1 const * shape_u() const
Definition: Systematic.h:39
void SwapUpAndDown()
Definition: Systematic.cc:273
std::string const & name() const
Definition: Systematic.h:22
std::string to_string() const
Definition: Systematic.cc:264
RooAbsReal const * pdf_d() const
Definition: Systematic.h:55
std::string const & param_str_ext() const
Definition: Systematic.h:70
RooAbsReal const * pdf_u() const
Definition: Systematic.h:53
void set_asymm(bool const &asymm)
Definition: Systematic.h:36
RooDataHist const * data_u() const
Definition: Systematic.h:49
void set_scale(double const &scale)
Definition: Systematic.h:33
double value_d() const
Definition: Systematic.h:31
TH1F ShapeUAsTH1F() const
Definition: Systematic.cc:214
TH1F ShapeDAsTH1F() const
Definition: Systematic.cc:232
void set_type(std::string const &type)
Definition: Systematic.h:24
double scale() const
Definition: Systematic.h:34
friend void swap(Systematic &first, Systematic &second)
Definition: Systematic.cc:63
static std::ostream & PrintHeader(std::ostream &out)
Definition: Systematic.cc:251
Definition: Algorithm.h:10