24 #include "Riostream.h" 27 #include "RooAbsReal.h" 28 #include "RooAbsCategory.h" 45 RooAbsPdf(name,title),
47 mean(
"mean",
"mean",this,_mean),
48 width(
"width",
"width",this,_width),
49 nu(
"nu",
"nu",this,_nu),
50 tau(
"tau",
"tau",this,_tau)
56 RooAbsPdf(other,name),
58 mean(
"mean",this,other.mean),
59 width(
"width",this,other.width),
60 nu(
"nu",this,other.nu),
61 tau(
"tau",this,other.tau)
71 double w = exp(
tau *
tau);
72 double omega = -
nu *
tau;
73 double c = 0.5 * (w-1) * (w * TMath::CosH(2 * omega) + 1);
75 double z = (
x - (
mean + c *
width * sqrt(w) * TMath::SinH(omega) )) / c /
width;
76 double r = -
nu + TMath::ASinH(z) /
tau;
78 double val = 1. / (c *
width * 2 * TMath::Pi());
79 val *= 1. / (
tau * sqrt(z*z+1));
80 val *= exp(-0.5 * r * r);
89 if (matchArgs(allVars,analVars,
x))
return 1 ;
99 double w = exp(
tau *
tau);
100 double omega = -
nu *
tau;
101 double c = 0.5 * (w-1) * (w * TMath::CosH(2 * omega) + 1);
103 double zmax = (-
x.max(rangeName) + (
mean + c *
width * sqrt(w) * TMath::SinH(omega) )) / c /
width;
104 double zmin = (-
x.min(rangeName) + (
mean + c *
width * sqrt(w) * TMath::SinH(omega) )) / c /
width;
105 static const Double_t
pi = atan2(0.0,-1.0);
106 static const Double_t PiBy2 =
pi/2.0;
107 static const Double_t rootPiBy2 = sqrt(PiBy2);
113 ret = -0.25/rootPiBy2* ( RooMath::erf( (
nu*
tau + TMath::ASinH( zmax ) )/(sqrt(2)*
tau) )-
114 RooMath::erf( (
nu*
tau + TMath::ASinH( zmin ) )/(sqrt(2)*
tau) ) );
124 cout <<
"Error in RooJohnsonSU::analyticalIntegral" << endl;
Double_t evaluate() const
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const