CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RooCBExGaussShape.cc
Go to the documentation of this file.
2 
3 ClassImp(RooCBExGaussShape)
4 
6  RooAbsReal& _m,
7  RooAbsReal& _m0,
8  RooAbsReal& _sigma,
9  RooAbsReal& _alpha,
10  RooAbsReal& _n,
11  RooAbsReal& _sigma_2,
12  RooAbsReal& _frac
13 ) :
14  RooAbsPdf(name,title),
15  m("m","m",this,_m),
16  m0(" m0"," m0",this,_m0),
17  sigma(" sigma"," sigma",this,_sigma),
18  alpha(" alpha"," alpha",this,_alpha),
19  n(" n"," n",this,_n),
20  sigma_2(" sigma_2"," sigma_2",this,_sigma_2),
21  frac(" frac"," frac",this,_frac)
22 { }
23 
25  RooAbsPdf(other,name),
26  m("m",this,other.m),
27  m0(" m0",this,other. m0),
28  sigma(" sigma",this,other. sigma),
29  alpha(" alpha",this,other. alpha),
30  n(" n",this,other. n),
31  sigma_2(" sigma_2",this,other. sigma_2),
32  frac(" frac",this,other. frac)
33 { }
34 
35 
36  Double_t RooCBExGaussShape::evaluate() const
37  {
38  Double_t rval=0;
39 
40  Double_t t = (m-m0)/sigma;
41  Double_t t0 = (m-m0)/sigma_2;
42  if (alpha < 0){
43  t = -t;
44  t0 = -t0;
45  }
46 
47  Double_t absAlpha = fabs((Double_t)alpha);
48 
49  if (t >= -absAlpha) {
50  rval= frac*exp(-0.5*t*t) + (1.0-frac)*exp(-0.5*t0*t0);
51  }
52  else {
53  Double_t a = TMath::Power(n/absAlpha,n)*exp(-0.5*absAlpha*absAlpha);
54  Double_t b= n/absAlpha - absAlpha;
55  rval= a/TMath::Power(b - t, n);
56  }
57 
58  //std::cout<<"RooCBExGaussShape: m, evaluate= "<<m<<", "<<rval<<std::endl;
59  return rval;
60  }
float alpha
Definition: AMPTWrapper.h:95
Double_t evaluate() const
RooRealProxy sigma_2
unsigned long long int rval
Definition: vlib.h:23
double b
Definition: hdecay.h:120
string const
Definition: compareJSON.py:14
double a
Definition: hdecay.h:121