]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TOF/pPb502/lib/RooGaussianTail.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TOF / pPb502 / lib / RooGaussianTail.cxx
1 /***************************************************************************** 
2  * Project: RooFit                                                           * 
3  *                                                                           * 
4  * This code was autogenerated by RooClassFactory                            * 
5  *****************************************************************************/ 
6
7 // Your description goes here... 
8
9 #include "Riostream.h" 
10
11 #include "RooGaussianTail.h" 
12 #include "RooAbsReal.h" 
13 #include "RooAbsCategory.h" 
14 #include <math.h> 
15 #include "TMath.h" 
16
17 ClassImp(RooGaussianTail) 
18
19  RooGaussianTail::RooGaussianTail(const char *name, const char *title, 
20                         RooAbsReal& _x,
21                         RooAbsReal& _mean,
22                         RooAbsReal& _sigma,
23                         RooAbsReal& _tail) :
24    RooAbsPdf(name,title), 
25    x("x","x",this,_x),
26    mean("mean","mean",this,_mean),
27    sigma("sigma","sigma",this,_sigma),
28    tail("tail","tail",this,_tail)
29  { 
30  } 
31
32
33  RooGaussianTail::RooGaussianTail(const RooGaussianTail& other, const char* name) :  
34    RooAbsPdf(other,name), 
35    x("x",this,other.x),
36    mean("mean",this,other.mean),
37    sigma("sigma",this,other.sigma),
38    tail("tail",this,other.tail)
39  { 
40  } 
41
42
43
44  Double_t RooGaussianTail::evaluate() const
45  { 
46    Double_t tail2 = tail * sigma;
47    if (x <= (tail2 + mean))
48      return TMath::Gaus(x, mean, sigma);
49    else
50      return TMath::Gaus(tail2 + mean, mean, sigma) * TMath::Exp(-tail2 * (x - tail2 - mean) / (sigma * sigma));
51  } 
52
53
54