-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRooCBPdf.cxx
78 lines (65 loc) · 2.18 KB
/
RooCBPdf.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*****************************************************************************
* Project: RooFit *
* *
* This code was autogenerated by RooClassFactory *
*****************************************************************************/
// Your description goes here...
#include "/afs/cern.ch/cms/slc5_amd64_gcc462/lcg/root/5.32.00-cms5/include/Riostream.h"
#include "RooCBPdf.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#include "TMath.h"
ClassImp(RooCBPdf)
RooCBPdf::RooCBPdf(const char *name, const char *title,
RooAbsReal& _m,
RooAbsReal& _m0,
RooAbsReal& _sigma,
RooAbsReal& _alpha1,
RooAbsReal& _alpha2,
RooAbsReal& _n1,
RooAbsReal& _n2) :
RooAbsPdf(name,title),
m("m","m",this,_m),
m0(" m0"," m0",this,_m0),
sigma(" sigma"," sigma",this,_sigma),
alpha1(" alpha1"," alpha1",this,_alpha1),
alpha2(" alpha2"," alpha2",this,_alpha2),
n1(" n1"," n1",this,_n1),
n2(" n2"," n2",this,_n2)
{
}
RooCBPdf::RooCBPdf(const RooCBPdf& other, const char* name) :
RooAbsPdf(other,name),
m(" m","m",this,_m),
m0(" m0"," m0",this,_m0),
sigma(" sigma"," sigma",this,_sigma),
alpha1(" alpha1"," alpha1",this,_alpha1),
alpha2(" alpha2"," alpha2",this,_alpha2),
n1(" n1"," n1",this,_n1),
n2(" n2"," n2",this,_n2)
{
}
Double_t RooCBPdf::evaluate() const
{
double dx = (m-m0) ;
double val;
if(dx>0) {
if(dx/sigma1 < alpha1) {
val = exp(-dx*dx/2./sigma1/sigma1);
} else {
double A = pow(n1/fabs(alpha1),n1)*exp(-pow(alpha1,2.)/2.);
double B = n1/fabs(alpha1)-fabs(alpha1);
val = A*pow(B+dx/sigma1,-n1);
}
}else{
if(dx/sigma2 > alpha2) {
val = exp(-dx*dx/2./sigma2/sigma2);
} else {
double A = pow(n2/fabs(alpha2),n2)*exp(-pow(alpha2,2.)/2.);
double B = n2/fabs(alpha2)-fabs(alpha2);
val = A*pow(B+dx/sigma2,-n2);
}
}
return val;
}