CombineHarvester
Observation.h
Go to the documentation of this file.
1 #ifndef CombineTools_Observation_h
2 #define CombineTools_Observation_h
3 #include <memory>
4 #include <string>
5 #include "TH1.h"
6 #include "RooAbsData.h"
9 
10 namespace ch {
11 
12 class Observation : public Object {
13  public:
14  Observation();
15  ~Observation();
16  Observation(Observation const& other);
17  Observation(Observation&& other);
19 
20  void set_rate(double const& rate) { rate_ = rate; }
21  double rate() const { return rate_; }
22 
23  void set_shape(std::unique_ptr<TH1> shape, bool set_rate);
24 
25  void set_shape(TH1 const& shape, bool set_rate);
26 
27  TH1 const* shape() const { return shape_.get(); }
28 
29  std::unique_ptr<TH1> ClonedShape() const;
30  std::unique_ptr<TH1> ClonedScaledShape() const;
31 
32  TH1F ShapeAsTH1F() const;
33 
34  void set_data(RooAbsData* data) { data_ = data; }
35  RooAbsData const* data() const { return data_; }
36 
37  std::string to_string() const;
38  friend std::ostream& operator<< (std::ostream &out, Observation const& val);
39  static std::ostream& PrintHeader(std::ostream &out);
40 
41  private:
42  double rate_;
43  std::unique_ptr<TH1> shape_;
44  RooAbsData* data_;
45 
46  friend void swap(Observation& first, Observation& second);
47 };
48 }
49 
50 #endif
void set_rate(double const &rate)
Definition: Observation.h:20
TH1F ShapeAsTH1F() const
Definition: Observation.cc:108
TH1 const * shape() const
Definition: Observation.h:27
std::unique_ptr< TH1 > ClonedScaledShape() const
Definition: Observation.cc:101
static std::ostream & PrintHeader(std::ostream &out)
Definition: Observation.cc:128
Observation & operator=(Observation other)
Definition: Observation.cc:61
void set_shape(std::unique_ptr< TH1 > shape, bool set_rate)
Definition: Observation.cc:66
RooAbsData const * data() const
Definition: Observation.h:35
std::string to_string() const
Definition: Observation.cc:140
std::unique_ptr< TH1 > ClonedShape() const
Definition: Observation.cc:94
void set_data(RooAbsData *data)
Definition: Observation.h:34
friend void swap(Observation &first, Observation &second)
Definition: Observation.cc:33
friend std::ostream & operator<<(std::ostream &out, Observation const &val)
Definition: Observation.cc:144
double rate() const
Definition: Observation.h:21
Definition: Algorithm.h:10