-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExpGaussExp.cxx
66 lines (56 loc) · 1.37 KB
/
ExpGaussExp.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
/*****************************************************************************
* Project: RooFit *
* *
* This code was autogenerated by RooClassFactory *
*****************************************************************************/
// Gaussian core + exponential tail on high side + exponential tail on low side
// Souvik Das
// 8/23/2013
#include "Riostream.h"
#include "ExpGaussExp.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#include "TMath.h"
ClassImp(ExpGaussExp)
ExpGaussExp::ExpGaussExp(const char *name, const char *title,
RooAbsReal& _x,
RooAbsReal& _p0,
RooAbsReal& _p1,
RooAbsReal& _p2,
RooAbsReal& _p3) :
RooAbsPdf(name,title),
x("x","x",this,_x),
p0("p0","p0",this,_p0),
p1("p1","p1",this,_p1),
p2("p2","p2",this,_p2),
p3("p3","p3",this,_p3)
{
}
ExpGaussExp::ExpGaussExp(const ExpGaussExp& other, const char* name) :
RooAbsPdf(other,name),
x("x",this,other.x),
p0("p0",this,other.p0),
p1("p1",this,other.p1),
p2("p2",this,other.p2),
p3("p3",this,other.p3)
{
}
Double_t ExpGaussExp::evaluate() const
{
Double_t std=(x-p0)/p1;
Double_t result=0;
if (std>p2)
{
result=exp(p2*p2/2.-p2*std);
}
else if (std<=p2 && std>-p3)
{
result=exp(-0.5*pow(std, 2));
}
else if (std<=-p3)
{
result=exp(p3*p3/2.+p3*std);
}
return result;
}