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
24class Observable2D : public Observable {
25public:
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
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;
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
290private:
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
A class for analyzing observables pairwise.
Definition: Observable2D.h:24
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
double getMax2() const
A get method to access the maximum value of the second observable.
Definition: Observable2D.h:119
double getErrf2() const
A get method to access the flat error of the second observable.
Definition: Observable2D.h:249
double computeTheoryValue2()
A method to access the computed theory value of the second observable.
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...
double max2
The maximum valus of the second observable.
Definition: Observable2D.h:294
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)
bool isEOF()
A method to check if the end of file has been reached.
Definition: Observable2D.h:285
double errf2
the flat error of the second observable.
Definition: Observable2D.h:297
void setObsType2(std::string &obsType2_i)
Definition: Observable2D.h:217
std::string filepath
The path to the file being parsed.
Definition: Observable2D.h:305
std::string thname2
The name for the second observable as fixed in the ThObservable() class.
Definition: Observable2D.h:291
void setAve2(double ave2)
A set method to fix the average value of the second observable.
Definition: Observable2D.h:240
double getMin2() const
A get method to access the minimum value of the second observable.
Definition: Observable2D.h:137
double errgr2
The right Gaussian error of the second observable.
Definition: Observable2D.h:299
std::string getLabel2() const
A get method to access the label for the second observable.
Definition: Observable2D.h:101
std::string label2
A label for the second observable.
Definition: Observable2D.h:292
bool IsEOF
A bolean that is true if the end of file is reached.
Definition: Observable2D.h:308
double ave2
The average value of the second observable.
Definition: Observable2D.h:295
int iterationNo2
Counts the iteration to help with caching.
Definition: Observable2D.h:306
std::string getThname2() const
A get method to access the thname of the second observable as defined in ThFactory class.
Definition: Observable2D.h:155
Observable2D()
The default constructor.
ThObservable * tho2
A pointer to an object of the ThObservable class.
Definition: Observable2D.h:301
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
std::vector< double > bin_max
The maximum value of the bin.
Definition: Observable2D.h:304
virtual ~Observable2D()
The default destructor.
double errgl2
The left Gaussian error of the second observable.
Definition: Observable2D.h:298
double min2
The minimum value of the second observable.
Definition: Observable2D.h:293
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
double thValue2
The theory value of the second observable.
Definition: Observable2D.h:307
double getErrg2() const
A get method to access the Gaussian error of the second observble.
Definition: Observable2D.h:267
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
virtual double computeWeight()
A method to compute the weight associated with the observable.
Definition: Observable2D.h:212
void setMin2(double min2)
A set method to fix the minimum value for the second observable.
Definition: Observable2D.h:146
void setErrf2(double errf2)
A set method to fix the flat error of the second observable.
Definition: Observable2D.h:258
double errg2
The Gaussian error of the second observable.
Definition: Observable2D.h:296
void setLabel2(std::string label2)
A set method to fix the label for the second observable.
Definition: Observable2D.h:110
void setErrg2(double errg2)
A set method to fix the gaussian error of the observable.
Definition: Observable2D.h:276
std::string getObsType2() const
Definition: Observable2D.h:222
TH2D * inhisto2d
2D Histogram containing the experimental likelihood for the observable.
Definition: Observable2D.h:302
void setMax2(double max2)
A set method to fix the maximum value for the second observable.
Definition: Observable2D.h:128
std::string obsType2
Type of the second Observable. 0: Observable, 1: HiggsObservable, 2: BinnedObservable,...
Definition: Observable2D.h:300
std::vector< double > bin_min
The minimum value of the bin.
Definition: Observable2D.h:303
double getAve2() const
A get method to access the average value of the second observable.
Definition: Observable2D.h:231
A class for observables.
Definition: Observable.h:28
void setTho(ThObservable *tho_i)
A set method to fix the pointer to object of type ThObservable.
Definition: Observable.h:413
std::string histoname
The name of the histogram for the observable.
Definition: Observable.h:484
std::string filename
The name of the file containing the experimental likelihood for the observable.
Definition: Observable.h:483
double computeTheoryValue()
A method to access the computed theory value of the observable.
Definition: Observable.cpp:130
A class for a model prediction of an observable.
Definition: ThObservable.h:25
void setBinMax(double max)
A set method to set the maximum value of the bin.
Definition: ThObservable.h:73
void setBinMin(double min)
A set method to set the minimum value of the bin.
Definition: ThObservable.h:64