1 |
#ifndef MODEL_H
|
2 |
#define MODEL_H
|
3 |
|
4 |
#include<vector>
|
5 |
#include<string>
|
6 |
#include<sstream>
|
7 |
#include "RooFit.h"
|
8 |
#include "RooAbsPdf.h"
|
9 |
#include "RooProdPdf.h"
|
10 |
#include "RooPoisson.h"
|
11 |
#include "RooGaussian.h"
|
12 |
#include "RooRealVar.h"
|
13 |
#include "RooConstVar.h"
|
14 |
#include "RooFormulaVar.h"
|
15 |
#include "RooArgSet.h"
|
16 |
#include"RooPolynomial.h"
|
17 |
#include "RooArgList.h"
|
18 |
#include "RooDataSet.h"
|
19 |
#include "TMath.h"
|
20 |
#include "RooRandom.h"
|
21 |
|
22 |
#include "Chameleon.h"
|
23 |
|
24 |
class Model
|
25 |
{
|
26 |
public:
|
27 |
Model();
|
28 |
//constructor reading background and data input from config file
|
29 |
Model(ConfigFile* bkgConfig, ConfigFile* sigConfig, int selectChannel = -1);
|
30 |
//constructor reading input from vectors
|
31 |
Model(std::vector<double>* signal_expectation,std::vector< std::vector<double>* >* background_expectation,std::vector< vector< vector<double>* >* >* systematic_uncertainties=0,std::vector<double>* nuisance_upper_limits=0,std::vector<int>* n_input=0,int nuisance_range=10,int POI_range=20,int observation_range=20000);
|
32 |
~Model();
|
33 |
|
34 |
|
35 |
//see, what the model looks like
|
36 |
void Print();
|
37 |
|
38 |
//get the parameter of interest
|
39 |
RooRealVar* get_POI();
|
40 |
//get a RooArgSet* containing the parameter of interest
|
41 |
RooArgSet* get_POI_set();
|
42 |
//get a RooArgSet* containing all nuisance parameters
|
43 |
RooArgSet* get_nuisance_set();
|
44 |
//get a RooArgSet* containing all observables
|
45 |
RooArgSet* get_observable_set();
|
46 |
//get a RooProdPdf* containing all s+b Poisson distributions multiplied
|
47 |
RooProdPdf* get_sb_likelihood();
|
48 |
//get a RooProdPdf* containing all b Poisson distributions multiplied
|
49 |
RooProdPdf* get_b_likelihood();
|
50 |
//get a RooProdPdf* containing all s+b poissons and the nuisance distributions
|
51 |
RooProdPdf* get_complete_likelihood();
|
52 |
//get a RooProdPdf* with all the nuisance distributions multiplied
|
53 |
RooProdPdf* get_nuisance_prior_pdf();
|
54 |
//get the prior pdf for the parameter of interest
|
55 |
RooProdPdf* get_POI_prior();
|
56 |
//get the data set
|
57 |
RooDataSet* get_data();
|
58 |
//get the pseudo data sets
|
59 |
RooDataSet* get_pseudo_data_b();
|
60 |
RooDataSet* get_pseudo_data_bDN();
|
61 |
RooDataSet* get_pseudo_data_bUP();
|
62 |
RooDataSet* get_pseudo_data_sb();
|
63 |
|
64 |
double get_lumi_scale();
|
65 |
double get_sum_signal();
|
66 |
double get_sum_background();
|
67 |
double get_total_bunc();
|
68 |
|
69 |
double get_teststat_Data(){return test_Data;};
|
70 |
double get_teststat_Bmean(){return test_Bmean;};
|
71 |
double get_teststat_Bup(){return test_Bup;};
|
72 |
double get_teststat_Bdown(){return test_Bdown;};
|
73 |
double get_teststat_SBmean(){return test_SBmean;};
|
74 |
|
75 |
void set_dataset(RooDataSet* d);
|
76 |
void set_nuisance_const();
|
77 |
void set_nuisance_var();
|
78 |
void set_poi_const(double p);
|
79 |
void set_poi_var(double p);
|
80 |
std::vector< RooConstVar*>* signal;
|
81 |
std::vector< RooRealVar*>* observables;
|
82 |
|
83 |
void test(string file);
|
84 |
|
85 |
|
86 |
private:
|
87 |
|
88 |
int n_channels;
|
89 |
int n_backgrounds;
|
90 |
int n_nuisances;
|
91 |
|
92 |
int range_nuisances;
|
93 |
int range_POI;
|
94 |
int range_n_obs;
|
95 |
|
96 |
bool use_nuisances;
|
97 |
bool corrupted;
|
98 |
|
99 |
RooRealVar* POI;
|
100 |
|
101 |
double sumB;
|
102 |
double sumS;
|
103 |
double sumBerr;
|
104 |
|
105 |
double lumiScale;
|
106 |
|
107 |
double test_Data;
|
108 |
double test_Bmean;
|
109 |
double test_Bup;
|
110 |
double test_Bdown;
|
111 |
double test_SBmean;
|
112 |
|
113 |
std::vector< std::vector<RooConstVar*>* >* background;
|
114 |
//std::vector< RooRealVar*>* observables;
|
115 |
std::vector<string> *nuisance_names;
|
116 |
std::vector<double> *nuisance_upper_limit;
|
117 |
std::vector<RooRealVar*> *nuisance_parameters;
|
118 |
std::vector<RooConstVar*> *nuisance_widths;
|
119 |
std::vector<RooFormulaVar*> *nuisance_means;
|
120 |
std::vector< std::vector< std::vector<RooConstVar*>* >* >* scaling_factors;
|
121 |
std::vector<RooFormulaVar*> *sb_means;
|
122 |
std::vector<RooFormulaVar*> *b_means;
|
123 |
std::vector<RooPoisson*> *sb_poissons;
|
124 |
std::vector<RooPoisson*> *b_poissons;
|
125 |
|
126 |
|
127 |
|
128 |
RooArgSet* POI_set;
|
129 |
RooArgSet* observable_set;
|
130 |
RooArgSet* nuisance_set;
|
131 |
|
132 |
std::vector<RooAbsPdf*> *nuisance_priors;
|
133 |
RooProdPdf* nuisance_prior_pdf;
|
134 |
RooProdPdf* POI_prior_pdf;
|
135 |
RooProdPdf* sb_likelihood;
|
136 |
RooProdPdf* b_likelihood;
|
137 |
RooDataSet* data;
|
138 |
|
139 |
|
140 |
RooArgSet* pseudo_b_obs_set;
|
141 |
RooArgSet* pseudo_bDN_obs_set;
|
142 |
RooArgSet* pseudo_bUP_obs_set;
|
143 |
RooArgSet* pseudo_sb_obs_set;
|
144 |
|
145 |
RooDataSet* pseudo_data_b;
|
146 |
RooDataSet* pseudo_data_b_minusSigma;
|
147 |
RooDataSet* pseudo_data_b_plusSigma;
|
148 |
RooDataSet* pseudo_data_sb;
|
149 |
|
150 |
|
151 |
|
152 |
bool check_input(std::vector<int>* n_input,std::vector<double>* signal_expectation,std::vector< std::vector<double>* >* background_expectation,std::vector< std::vector< std::vector<double>* >* >* systematic_uncertainties);
|
153 |
|
154 |
bool create_dataset(std::vector<int>* n_input);
|
155 |
|
156 |
bool create_pseudo_datasets(std::vector<double>* signal_expectation, std::vector< std::vector<double>* >* background_expectation, std::vector< std::vector< std::vector<double>* >* >* systematic_uncertainties);
|
157 |
|
158 |
void create_observables();
|
159 |
|
160 |
void create_signal_expectations(std::vector<double>* signal_expectation);
|
161 |
|
162 |
void create_background_expectations(std::vector< std::vector<double>* >* background_expectation);
|
163 |
|
164 |
void create_nuisances(std::vector< std::vector< std::vector<double>* >* >* systematic_uncertainties);
|
165 |
|
166 |
void create_scaling_factors(std::vector< std::vector< std::vector<double>* >* >* systematic_uncertainties);
|
167 |
|
168 |
void create_nuisance_priors();
|
169 |
|
170 |
void create_nuisance_priors_2();
|
171 |
|
172 |
void create_POI();
|
173 |
|
174 |
void create_POI_prior();
|
175 |
|
176 |
void create_sb_likelihood();
|
177 |
|
178 |
void create_b_likelihood();
|
179 |
|
180 |
void create_teststats();
|
181 |
|
182 |
void set_random_seed(int i);
|
183 |
|
184 |
|
185 |
|
186 |
};
|
187 |
|
188 |
#endif
|