29 if (prob < 0 || prob > 1)
return 0;
31 for (Int_t i=0;i<ntot;i++) {
32 if (Rndm() > prob)
continue;
80 double x = z * 6.28318530717958623;
83 return mean + g * sigma;
98 const Double_t kC1 = 1.448242853;
99 const Double_t kC2 = 3.307147487;
100 const Double_t kC3 = 1.46754004;
101 const Double_t kD1 = 1.036467755;
102 const Double_t kD2 = 5.295844968;
103 const Double_t kD3 = 3.631288474;
104 const Double_t kHm = 0.483941449;
105 const Double_t kZm = 0.107981933;
106 const Double_t kHp = 4.132731354;
107 const Double_t kZp = 18.52161694;
108 const Double_t kPhln = 0.4515827053;
109 const Double_t kHm1 = 0.516058551;
110 const Double_t kHp1 = 3.132731354;
111 const Double_t kHzm = 0.375959516;
112 const Double_t kHzmp = 0.591923442;
115 const Double_t kAs = 0.8853395638;
116 const Double_t kBs = 0.2452635696;
117 const Double_t kCs = 0.2770276848;
118 const Double_t kB = 0.5029324303;
119 const Double_t kX0 = 0.4571828819;
120 const Double_t kYm = 0.187308492 ;
121 const Double_t kS = 0.7270572718 ;
122 const Double_t kT = 0.03895759111;
131 result = kHp*y-kHp1;
break; }
135 result = (rn>0) ? (1+rn) : (-1+rn);
142 z = (rn>0) ? 2-rn : -2-rn;
143 if ((kC1-y)*(kC3+TMath::Abs(z))<kC2) {
147 if ((y+kD1)*(kD3+
x)<kD2) {
148 result = rn;
break; }
149 else if (kHzmp-y<
exp(-(z*z+kPhln)/2)) {
151 else if (y+kHzm<
exp(-(x+kPhln)/2)) {
152 result = rn;
break; }
167 if ((y-kAs+x)*(kCs+
x)+kBs<0) {
168 result = rn;
break; }
170 if (rn*rn<4*(kB-
log(x))) {
171 result = rn;
break; }
175 return mean + sigma * result;
193 if (sigma <= 0)
return 0;
216 if (mean <= 0)
return 0;
224 if (pir <= expmean)
break;
229 else if (mean < 1E9) {
231 Double_t sq, alxm, g;
245 t = 0.9*(1.0 + y*
y)*
TMath::Exp(em*alxm - TMath::LnGamma(em + 1.0) - g);
246 }
while( Rndm() > t );
248 return static_cast<Int_t
> (
em);
268 if (mean <= 0)
return 0;
276 if (pir <= expmean)
break;
278 return static_cast<Double_t
>(n);
281 else if (mean < 1E9) {
283 Double_t sq, alxm, g;
297 t = 0.9*(1.0 + y*
y)*
TMath::Exp(em*alxm - TMath::LnGamma(em + 1.0) - g);
298 }
while( Rndm() > t );
318 x = z * 6.28318530717958623;
334 Double_t a=0,
b=0,r2=1;
340 z = r* ( -1. + 8.0 * r2 );
352 Double_t ans = Rndm();
360 return (b-a) * Rndm() + a;
Double_t Landau(Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
The LANDAU function.
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculate a Breit Wigner function with mean and gamma.
Double_t Floor(Double_t x)
Namespace for new ROOT classes and functions.
constexpr Double_t TwoPi()
you should not use this method at all Int_t y
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t tau
you should not use this method at all Int_t Int_t Double_t Double_t em
Double_t Binomial(Int_t n, Int_t k)
Calculate the binomial coefficient n over k.
* x
Deprecated and error prone model selection interface.
Double_t Poisson(Double_t x, Double_t par)
Compute the Poisson distribution function for (x,par) The Poisson PDF is implemented by means of Eule...
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculate a gaussian function with mean and sigma.
Namespace for new Math classes and functions.
you should not use this method at all Int_t Int_t z
double landau_quantile(double z, double xi=1)
Inverse ( ) of the cumulative distribution function of the lower tail of the Landau distribution (lan...
Definition of the generic impelmentation class for the RandomFunctions.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Double_t Sqrt(Double_t x)
constexpr Double_t PiOver2()