a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
Observable2D.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #ifndef OBSERVABLE2D_H
9 #define OBSERVABLE2D_H
10 
11 #include "Observable.h"
12 #include <TH2D.h>
13 
24 class Observable2D : public Observable {
25 public:
26 
42  Observable2D(const std::string name_i,
43  const std::string thname_i,
44  const std::string thname2_i,
45  const std::string label_i,
46  const std::string label2_i,
47  const bool tMCMC_i,
48  const double min_i,
49  const double max_i,
50  const double min2_i,
51  const double max2_i,
52  ThObservable * tho_i,
53  ThObservable * tho2_i);
54 
58  Observable2D();
59 
64  Observable2D(const Observable& o1d);
65 
69  Observable2D(const Observable2D& orig);
70 
74  virtual ~Observable2D();
75 
76  int ParseObservable2D(std::string& type,
77  boost::tokenizer<boost::char_separator<char> >* tok,
78  boost::tokenizer<boost::char_separator<char> >::iterator& beg,
79  std::string& infilename,
80  std::ifstream& ifile,
81  int lineNo,
82  int rank);
83 
90  virtual void setLikelihoodFromHisto(std::string filename, std::string histoname);
91 
95  double computeTheoryValue2();
96 
101  std::string getLabel2() const
102  {
103  return label2;
104  }
105 
110  void setLabel2(std::string label2)
111  {
112  this->label2 = label2;
113  }
114 
119  double getMax2() const
120  {
121  return max2;
122  }
123 
128  void setMax2(double max2)
129  {
130  this->max2 = max2;
131  }
132 
137  double getMin2() const
138  {
139  return min2;
140  }
141 
146  void setMin2(double min2)
147  {
148  this->min2 = min2;
149  }
150 
155  std::string getThname2() const
156  {
157  return thname2;
158  }
159 
164  void setThname2(std::string thname2)
165  {
166  this->thname2 = thname2;
167  }
168 
175  {
176  return tho2;
177  }
178 
184  void setTho2(ThObservable* tho2_i)
185  {
186  tho2 = tho2_i;
187  tho2->setBinMin(bin_min[1]);
188  tho2->setBinMax(bin_max[1]);
189  }
190 
196  void setTho1Tho2(ThObservable* tho1_i, ThObservable* tho2_i)
197  {
198  setTho(tho1_i, bin_min[0], bin_max[0]);
199  setTho2(tho2_i);
200  }
201 
207  virtual double computeWeight(double th1, double th2);
208 
212  virtual double computeWeight()
213  {
215  }
216 
217  void setObsType2(std::string& obsType2_i)
218  {
219  obsType2 = obsType2_i;
220  }
221 
222  std::string getObsType2() const
223  {
224  return obsType2;
225  }
226 
231  double getAve2() const
232  {
233  return ave2;
234  }
235 
240  void setAve2(double ave2)
241  {
242  this->ave2 = ave2;
243  }
244 
249  double getErrf2() const
250  {
251  return errf2;
252  }
253 
258  void setErrf2(double errf2)
259  {
260  this->errf2 = errf2;
261  }
262 
267  double getErrg2() const
268  {
269  return errg2;
270  }
271 
276  void setErrg2(double errg2)
277  {
278  this->errg2 = errg2;
279  }
280 
285  bool isEOF()
286  {
287  return IsEOF;
288  }
289 
290 private:
291  std::string thname2;
292  std::string label2;
293  double min2;
294  double max2;
295  double ave2;
296  double errg2;
297  double errf2;
298  double errgl2;
299  double errgr2;
300  std::string obsType2;
302  TH2D * inhisto2d;
303  std::vector<double> bin_min;
304  std::vector<double> bin_max;
305  std::string filepath;
307  double thValue2;
308  bool IsEOF;
309 };
310 
311 #endif /* OBSERVABLE2D_H */
312 
Observable::computeTheoryValue
double computeTheoryValue()
A method to access the computed theory value of the observable.
Definition: Observable.cpp:130
Observable2D::setLikelihoodFromHisto
virtual void setLikelihoodFromHisto(std::string filename, std::string histoname)
A set method to set the likelihood from which the experimental likelihood of the observable will be r...
Definition: Observable2D.cpp:118
Observable2D::ParseObservable2D
int ParseObservable2D(std::string &type, boost::tokenizer< boost::char_separator< char > > *tok, boost::tokenizer< boost::char_separator< char > >::iterator &beg, std::string &infilename, std::ifstream &ifile, int lineNo, int rank)
Definition: Observable2D.cpp:160
Observable2D::computeWeight
virtual double computeWeight()
A method to compute the weight associated with the observable.
Definition: Observable2D.h:212
Observable2D::getObsType2
std::string getObsType2() const
Definition: Observable2D.h:222
Observable2D::setMax2
void setMax2(double max2)
A set method to fix the maximum value for the second observable.
Definition: Observable2D.h:128
Observable2D::getThname2
std::string getThname2() const
A get method to access the thname of the second observable as defined in ThFactory class.
Definition: Observable2D.h:155
Observable::histoname
std::string histoname
The name of the histogram for the observable.
Definition: Observable.h:484
Observable2D::ave2
double ave2
The average value of the second observable.
Definition: Observable2D.h:295
Observable2D::tho2
ThObservable * tho2
A pointer to an object of the ThObservable class.
Definition: Observable2D.h:301
Observable2D::getLabel2
std::string getLabel2() const
A get method to access the label for the second observable.
Definition: Observable2D.h:101
Observable::setTho
void setTho(ThObservable *tho_i)
A set method to fix the pointer to object of type ThObservable.
Definition: Observable.h:413
ThObservable::setBinMin
void setBinMin(double min)
A set method to set the minimum value of the bin.
Definition: ThObservable.h:64
Observable2D::thname2
std::string thname2
The name for the second observable as fixed in the ThObservable() class.
Definition: Observable2D.h:291
Observable2D::bin_max
std::vector< double > bin_max
The maximum value of the bin.
Definition: Observable2D.h:304
Observable2D::label2
std::string label2
A label for the second observable.
Definition: Observable2D.h:292
Observable2D::setAve2
void setAve2(double ave2)
A set method to fix the average value of the second observable.
Definition: Observable2D.h:240
Observable2D::errg2
double errg2
The Gaussian error of the second observable.
Definition: Observable2D.h:296
Observable2D::min2
double min2
The minimum value of the second observable.
Definition: Observable2D.h:293
Observable2D::getErrf2
double getErrf2() const
A get method to access the flat error of the second observable.
Definition: Observable2D.h:249
Observable2D::errgr2
double errgr2
The right Gaussian error of the second observable.
Definition: Observable2D.h:299
Observable2D::IsEOF
bool IsEOF
A bolean that is true if the end of file is reached.
Definition: Observable2D.h:308
Observable2D::bin_min
std::vector< double > bin_min
The minimum value of the bin.
Definition: Observable2D.h:303
Observable2D::getMin2
double getMin2() const
A get method to access the minimum value of the second observable.
Definition: Observable2D.h:137
Observable2D::setThname2
void setThname2(std::string thname2)
A set method to fix the name of the second observable as listed in ThFactory class.
Definition: Observable2D.h:164
Observable2D::getTho2
ThObservable * getTho2() const
A get method to access the pointer to the object of the ThObservable class for the second observable.
Definition: Observable2D.h:174
Observable2D::filepath
std::string filepath
The path to the file being parsed.
Definition: Observable2D.h:305
Observable2D::getErrg2
double getErrg2() const
A get method to access the Gaussian error of the second observble.
Definition: Observable2D.h:267
ThObservable::setBinMax
void setBinMax(double max)
A set method to set the maximum value of the bin.
Definition: ThObservable.h:73
Observable2D::setErrf2
void setErrf2(double errf2)
A set method to fix the flat error of the second observable.
Definition: Observable2D.h:258
Observable2D::errgl2
double errgl2
The left Gaussian error of the second observable.
Definition: Observable2D.h:298
Observable2D::iterationNo2
int iterationNo2
Counts the iteration to help with caching.
Definition: Observable2D.h:306
Observable2D::setTho2
void setTho2(ThObservable *tho2_i)
A set method to fix the pointer to object of type ThObservable class for the second observable.
Definition: Observable2D.h:184
Observable.h
Observable
A class for observables.
Definition: Observable.h:28
Observable2D::inhisto2d
TH2D * inhisto2d
2D Histogram containing the experimental likelihood for the observable.
Definition: Observable2D.h:302
Observable2D::errf2
double errf2
the flat error of the second observable.
Definition: Observable2D.h:297
Observable2D
A class for analyzing observables pairwise.
Definition: Observable2D.h:24
Observable2D::getAve2
double getAve2() const
A get method to access the average value of the second observable.
Definition: Observable2D.h:231
Observable2D::setErrg2
void setErrg2(double errg2)
A set method to fix the gaussian error of the observable.
Definition: Observable2D.h:276
Observable2D::computeTheoryValue2
double computeTheoryValue2()
A method to access the computed theory value of the second observable.
Definition: Observable2D.cpp:107
Observable2D::obsType2
std::string obsType2
Type of the second Observable. 0: Observable, 1: HiggsObservable, 2: BinnedObservable,...
Definition: Observable2D.h:300
Observable2D::setLabel2
void setLabel2(std::string label2)
A set method to fix the label for the second observable.
Definition: Observable2D.h:110
ThObservable
A class for a model prediction of an observable.
Definition: ThObservable.h:25
Observable2D::isEOF
bool isEOF()
A method to check if the end of file has been reached.
Definition: Observable2D.h:285
Observable2D::thValue2
double thValue2
The theory value of the second observable.
Definition: Observable2D.h:307
Observable2D::Observable2D
Observable2D()
The default constructor.
Definition: Observable2D.cpp:58
Observable::filename
std::string filename
The name of the file containing the experimental likelihood for the observable.
Definition: Observable.h:483
Observable2D::~Observable2D
virtual ~Observable2D()
The default destructor.
Definition: Observable2D.cpp:104
Observable2D::setObsType2
void setObsType2(std::string &obsType2_i)
Definition: Observable2D.h:217
Observable2D::setMin2
void setMin2(double min2)
A set method to fix the minimum value for the second observable.
Definition: Observable2D.h:146
Observable2D::getMax2
double getMax2() const
A get method to access the maximum value of the second observable.
Definition: Observable2D.h:119
Observable2D::max2
double max2
The maximum valus of the second observable.
Definition: Observable2D.h:294
Observable2D::setTho1Tho2
void setTho1Tho2(ThObservable *tho1_i, ThObservable *tho2_i)
A set method to fix the pointer to object of type ThObservable class for the second observable.
Definition: Observable2D.h:196