-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatTools.h
More file actions
51 lines (33 loc) · 1.09 KB
/
StatTools.h
File metadata and controls
51 lines (33 loc) · 1.09 KB
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
#ifndef StatTools_h
#define StatTools_h
#include <string>
#include <vector>
class TF2;
class StatChannel {
public:
StatChannel(const std::string& name_t, float obs_t, float b_t, float b_err_t) {
name = name_t;
obs = obs_t;
b = b_t;
b_err = b_err_t;
}
std::string name;
float obs;
float b;
float b_err;
};
class StatTools {
public:
StatTools(){};
// in the following tau is the ratio between the sideband width
// and the signal width (1/alpha, in our notation)
static float computeZBiProper( float n_on, float n_off, float tau );
static float computeZBi( float obs, float b_pred, float b_pred_err );
static float computeZPL( float obs, float b_pred, float b_pred_err );
static float computeZPL( TF2* f2_likelihood );
static float computeZPL( const std::vector<StatChannel>& channels );
static TF2* getLikelihoodFunction( const std::string& name, int obs, float b, float b_err );
static float getLogLikelihoodRatio( const std::string& name, TF2* f2, int nsteps=1000 );
static float findMaximum2D( TF2* f2, int nsteps, bool fix_x=false );
};
#endif