forked from JanFSchulte/CIAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RooCruijff.cxx
executable file
·60 lines (45 loc) · 1.3 KB
/
RooCruijff.cxx
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
#include "RooCruijff.h"
#include "Riostream.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#include "TMath.h"
ClassImp(RooCruijff)
RooCruijff::RooCruijff(const char *name, const char *title,
RooAbsReal& _x, RooAbsReal& _mean,
RooAbsReal& _sigmaL, RooAbsReal& _sigmaR,
RooAbsReal& _alphaL, RooAbsReal& _alphaR
):
RooAbsPdf(name, title),
x("x", "Observable", this, _x),
mean("mean", "Mean", this, _mean),
sigmaL("sigmaL", "sigmaL", this, _sigmaL),
sigmaR("sigmaR", "sigmaR", this, _sigmaR),
alphaL("alphaL", "alphaL", this, _alphaL),
alphaR("alphaR", "alphaR", this, _alphaR)
{
}
RooCruijff::RooCruijff(const RooCruijff& other, const char *name):
RooAbsPdf(other, name),
x("x", this, other.x),
mean("mean", this, other.mean),
sigmaL("sigmaL", this, other.sigmaL),
sigmaR("sigmaR", this, other.sigmaR),
alphaL("alphaL", this, other.alphaL),
alphaR("alphaR", this, other.alphaR)
{
}
Double_t RooCruijff::evaluate() const
{
Double_t sigma, alpha;
if(x < mean) {
sigma = sigmaL;
alpha = alphaL;
} else {
sigma = sigmaR;
alpha = alphaR;
}
Double_t delta_x = x - mean;
Double_t delta_x2 = delta_x * delta_x;
return exp(- delta_x2 / (2 * sigma * sigma + alpha * delta_x2));
}