]>
Commit | Line | Data |
---|---|---|
aa54def0 | 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 "AliLnM2.h" | |
12 | #include "RooAbsReal.h" | |
13 | #include "RooAbsCategory.h" | |
14 | #include <math.h> | |
15 | #include "TMath.h" | |
16 | ||
17 | ClassImp(AliLnM2) | |
18 | ||
19 | AliLnM2::AliLnM2(const char *name, const char *title, | |
20 | RooAbsReal& _x, | |
21 | RooAbsReal& _mu, | |
22 | RooAbsReal& _sigma, | |
23 | RooAbsReal& _tau, | |
24 | RooAbsReal& _p) : | |
25 | RooAbsPdf(name,title), | |
26 | x("x","x",this,_x), | |
27 | mu("mu","mu",this,_mu), | |
28 | sigma("sigma","sigma",this,_sigma), | |
29 | tau("tau","tau",this,_tau), | |
30 | p("p","p",this,_p) | |
31 | { | |
32 | } | |
33 | ||
34 | ||
35 | AliLnM2::AliLnM2(const AliLnM2& other, const char* name) : | |
36 | RooAbsPdf(other,name), | |
37 | x("x",this,other.x), | |
38 | mu("mu",this,other.mu), | |
39 | sigma("sigma",this,other.sigma), | |
40 | tau("tau",this,other.tau), | |
41 | p("p",this,other.p) | |
42 | { | |
43 | } | |
44 | ||
45 | Double_t AliLnM2::evaluate() const | |
46 | { | |
47 | // | |
48 | // m^2 shape | |
49 | // | |
50 | if( x <= mu + tau) | |
51 | { | |
52 | return TMath::Exp(-(x-mu)*(x-mu)/(2.*sigma*sigma)); | |
53 | } | |
54 | ||
55 | Double_t lambda = 2.*tau*TMath::Sqrt(p*p+mu+tau)/(sigma*sigma); | |
56 | Double_t a = TMath::Exp(-tau*tau/(2.*sigma*sigma)+2.*tau*(p*p+mu+tau)/(sigma*sigma)); | |
57 | ||
58 | return a*TMath::Exp(-lambda*TMath::Sqrt(p*p + x)); | |
59 | } |