forked from SusyRa2b/Statistics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ra2bRoostatsClass2.h
349 lines (225 loc) · 8.69 KB
/
ra2bRoostatsClass2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
#ifndef ra2bRoostatsClass2_h
#define ra2bRoostatsClass2_h
#include "RooRealVar.h"
#include "RooFormulaVar.h"
#include "RooWorkspace.h"
#include "RooPoisson.h"
#include "RooGaussian.h"
#include "RooProdPdf.h"
#include "RooWorkspace.h"
#include "RooDataSet.h"
#include "RooFitResult.h"
//
// Owen Long, UCR
// Harrison Prosper, FSU
// Sezen Sekmen, FSU
//
class ra2bRoostatsClass2 {
public :
ra2bRoostatsClass2( bool ArgUseSigBgVars=false ) ;
virtual ~ra2bRoostatsClass2();
bool initialize( const char* infile ) ;
bool reinitialize( ) ;
// bool readTextDataset( const char* inputTextFile ) ;
// bool generateToyDatasetsFromLikelihood( const char* outputRootFile, int nToys ) ;
// bool generateToyDatasetsFromNVals( const char* outputRootFile, int nToys ) ;
// bool readToyDataset( const char* inputRootFile, int dsIndex ) ;
bool doFit() ;
// bool doToyStudy( const char* inputRootFile, const char* outputRootFile, int dsFirst, int nToys ) ;
bool susyScanNoContam( const char* inputScanFile, double dataLumi ) ;
bool susyScanWithContam( const char* inputScanFile, double dataLumi ) ;
bool setSusyScanPoint( const char* inputScanFile, double dataLumi, double m0, double m12 ) ;
// bool sbPlotsUniformBins( const char* plotBaseName ) ;
// bool sbPlotsVariableBins( const char* plotBaseName ) ;
bool profileSusySig( float& susySigLow, float& susySigHigh, bool makePlot=true ) ;
bool profileTtbarSig( float& ttbarSigLow, float& ttbarSigHigh ) ;
bool profileQcdSig( float& qcdSigLow, float& qcdSigHigh ) ;
void parameterSnapshot() ;
bool fitQualityPlot( bool doNorm=false, double hmax=1.5 ) ;
void setAndFixSusySig( double setVal = 0. ) ;
void freeSusySig() ;
private :
char initializeFile[10000] ;
bool varsAtFitVals ;
bool useSigBgVars ;
bool initialized ;
double toy_mu0_ttbar_sig ;
double toy_mu0_qcd_sig ;
double toy_mu0_ttbar_sb ;
double toy_mu0_qcd_sb ;
double toy_mu0_susy_sig ;
double toy_mu0_allbg_sig ;
//======= Observables ==============================================================
//-- data counts in signal region, A, and D, SB, SIG-SL, SB-SL.
RooRealVar* rv_Nsig ;
RooRealVar* rv_Na ;
RooRealVar* rv_Nd ;
RooRealVar* rv_Nsb ;
RooRealVar* rv_Nslsig ;
RooRealVar* rv_Nslsb ;
//-- QCD MC counts
RooRealVar* rv_Nqcdmca ;
RooRealVar* rv_Nqcdmcd ;
RooRealVar* rv_Nqcdmcsig ;
RooRealVar* rv_Nqcdmcsb ;
//-- EW MC counts
RooRealVar* rv_NWJmcsig ;
RooRealVar* rv_NWJmca ;
RooRealVar* rv_NWJmcd ;
RooRealVar* rv_NWJmcsb ;
RooRealVar* rv_NWJmcslsig ;
RooRealVar* rv_NWJmcslsb ;
RooRealVar* rv_NZnnmcsig ;
RooRealVar* rv_NZnnmca ;
RooRealVar* rv_NZnnmcd ;
RooRealVar* rv_NZnnmcsb ;
RooRealVar* rv_NZnnmcslsig ;
RooRealVar* rv_NZnnmcslsb ;
RooRealVar* rv_NEwomcsig ;
RooRealVar* rv_NEwomca ;
RooRealVar* rv_NEwomcd ;
RooRealVar* rv_NEwomcsb ;
RooRealVar* rv_NEwomcslsig ;
RooRealVar* rv_NEwomcslsb ;
//========= Parameters ==============================================================
//-- Counts in SIG, signal selection.
RooAbsArg* rv_mu_ttbar_sig ;
RooRealVar* rrv_mu_ttbar_sig ;
RooFormulaVar* rfv_mu_ttbar_sig ;
RooRealVar* rv_mu_qcd_sig ;
RooFormulaVar* rv_mu_ew_sig ;
RooRealVar* rv_mu_susymc_sig ;
RooRealVar* rv_mu_susy_sig ;
//-- Counts in SB, signal selection.
RooAbsArg* rv_mu_ttbar_sb ;
RooRealVar* rrv_mu_ttbar_sb ;
RooFormulaVar* rfv_mu_ttbar_sb ;
RooRealVar* rv_mu_qcd_sb ;
RooFormulaVar* rv_mu_ew_sb ;
RooRealVar* rv_mu_susymc_sb ;
RooFormulaVar* rv_mu_susy_sb ;
//-- Counts in A, signal selection
RooRealVar* rv_mu_ttbar_a ;
RooFormulaVar* rv_mu_qcd_a ;
RooFormulaVar* rv_mu_ew_a ;
RooRealVar* rv_mu_susymc_a ;
RooFormulaVar* rv_mu_susy_a ;
//-- Counts in D, signal selection
RooRealVar* rv_mu_ttbar_d ;
RooFormulaVar* rv_mu_qcd_d ;
RooFormulaVar* rv_mu_ew_d ;
RooRealVar* rv_mu_susymc_d ;
RooFormulaVar* rv_mu_susy_d ;
//-- Single Lepton (SL) counts, SIG region
RooRealVar* rv_mu_sl_ttbar_sig ;
//-- ignoring qcd in SL, SIG
RooFormulaVar* rv_mu_sl_ew_sig ;
RooRealVar* rv_mu_sl_susymc_sig ;
RooFormulaVar* rv_mu_sl_susy_sig ;
//-- Single Lepton (SL) counts, SIG region
RooRealVar* rv_mu_sl_ttbar_sb ;
//-- ignoring qcd in SL, SIG
RooFormulaVar* rv_mu_sl_ew_sb ;
RooRealVar* rv_mu_sl_susymc_sb ;
RooFormulaVar* rv_mu_sl_susy_sb ;
//-- QCD MC, SIG,SB,A,D counts, signal selection
RooRealVar* rv_mu_qcdmc_sig ;
RooRealVar* rv_mu_qcdmc_sb ;
RooRealVar* rv_mu_qcdmc_a ;
RooRealVar* rv_mu_qcdmc_d ;
RooRealVar* rv_mu_wjmc_sig ;
RooRealVar* rv_mu_wjmc_a ;
RooRealVar* rv_mu_wjmc_d ;
RooRealVar* rv_mu_wjmc_sb ;
RooRealVar* rv_mu_wjmc_slsig ;
RooRealVar* rv_mu_wjmc_slsb ;
RooRealVar* rv_mu_znnmc_sig ;
RooRealVar* rv_mu_znnmc_a ;
RooRealVar* rv_mu_znnmc_d ;
RooRealVar* rv_mu_znnmc_sb ;
RooRealVar* rv_mu_znnmc_slsig ;
RooRealVar* rv_mu_znnmc_slsb ;
RooRealVar* rv_mu_ewomc_sig ;
RooRealVar* rv_mu_ewomc_a ;
RooRealVar* rv_mu_ewomc_d ;
RooRealVar* rv_mu_ewomc_sb ;
RooRealVar* rv_mu_ewomc_slsig ;
RooRealVar* rv_mu_ewomc_slsb ;
//-- Efficiency scale factor
RooRealVar* rv_eff_sf ;
RooRealVar* rv_lsf_wjmc ;
RooRealVar* rv_lsf_znnmc ;
RooRealVar* rv_lsf_ewomc ;
//========= Expected counts for observables in terms of parameters ============================
RooFormulaVar* rv_n_sig ;
RooFormulaVar* rv_n_sb ;
RooFormulaVar* rv_n_a ;
RooFormulaVar* rv_n_d ;
RooFormulaVar* rv_n_sl_sig ;
RooFormulaVar* rv_n_sl_sb ;
RooFormulaVar* rv_n_wjmc_sig ;
RooFormulaVar* rv_n_wjmc_a ;
RooFormulaVar* rv_n_wjmc_d ;
RooFormulaVar* rv_n_wjmc_sb ;
RooFormulaVar* rv_n_wjmc_sl_sig ;
RooFormulaVar* rv_n_wjmc_sl_sb ;
RooFormulaVar* rv_n_znnmc_sig ;
RooFormulaVar* rv_n_znnmc_a ;
RooFormulaVar* rv_n_znnmc_d ;
RooFormulaVar* rv_n_znnmc_sb ;
RooFormulaVar* rv_n_znnmc_sl_sig ;
RooFormulaVar* rv_n_znnmc_sl_sb ;
RooFormulaVar* rv_n_ewomc_sig ;
RooFormulaVar* rv_n_ewomc_a ;
RooFormulaVar* rv_n_ewomc_d ;
RooFormulaVar* rv_n_ewomc_sb ;
RooFormulaVar* rv_n_ewomc_sl_sig ;
RooFormulaVar* rv_n_ewomc_sl_sb ;
//=========== PDFs for the likelihood ============================================================
RooPoisson* pdf_Nsig ;
RooPoisson* pdf_Na ;
RooPoisson* pdf_Nd ;
RooPoisson* pdf_Nsb ;
RooPoisson* pdf_Nsl_sig ;
RooPoisson* pdf_Nsl_sb ;
RooPoisson* pdf_NWJmcsig ;
RooPoisson* pdf_NWJmca ;
RooPoisson* pdf_NWJmcd ;
RooPoisson* pdf_NWJmcsb ;
RooPoisson* pdf_NWJmcsl_sig ;
RooPoisson* pdf_NWJmcsl_sb ;
RooPoisson* pdf_NZnnmcsig ;
RooPoisson* pdf_NZnnmca ;
RooPoisson* pdf_NZnnmcd ;
RooPoisson* pdf_NZnnmcsb ;
RooPoisson* pdf_NZnnmcsl_sig ;
RooPoisson* pdf_NZnnmcsl_sb ;
RooPoisson* pdf_NEwomcsig ;
RooPoisson* pdf_NEwomca ;
RooPoisson* pdf_NEwomcd ;
RooPoisson* pdf_NEwomcsb ;
RooPoisson* pdf_NEwomcsl_sig ;
RooPoisson* pdf_NEwomcsl_sb ;
RooGaussian* pdf_Nqcdmc_sig ;
RooGaussian* pdf_Nqcdmc_sb ;
RooGaussian* pdf_Nqcdmc_a ;
RooGaussian* pdf_Nqcdmc_d ;
RooGaussian* pdf_Eff_sf ;
RooGaussian* pdf_lsf_WJmc ;
RooGaussian* pdf_lsf_Znnmc ;
RooGaussian* pdf_lsf_Ewomc ;
RooProdPdf* likelihood ;
//============ Other things =================================================================
float Nqcdmcsigerr, Nqcdmcsberr, Nqcdmcaerr, Nqcdmcderr ; //-- QCD MC uncertainties in SIG, SB, A, and D.
float EffScaleFactor, EffScaleFactorErr ;
float lsf_WJmc, lsf_WJmc_err ;
float lsf_Znnmc, lsf_Znnmc_err ;
float lsf_Ewomc, lsf_Ewomc_err ;
RooArgSet observedParametersList ;
RooDataSet* dsObserved ;
RooWorkspace* workspace ;
RooFitResult* fitResult ;
float qcdCorrection ;
float qcdCorrectionErr ;
} ;
#endif