214 if (prob < 0 || prob > 1)
return 0;
216 for (
Int_t i=0;i<ntot;i++) {
217 if (
Rndm() > prob)
continue;
287 const Double_t kPhln = 0.4515827053;
314 result = (rn>0) ? (1+rn) : (-1+rn);
321 z = (rn>0) ? 2-rn : -2-rn;
326 if ((
y+kD1)*(kD3+
x)<kD2) {
328 else if (kHzmp-
y<exp(-(z*z+kPhln)/2)) {
330 else if (
y+kHzm<exp(-(
x+kPhln)/2)) {
346 if ((
y-kAs+
x)*(kCs+
x)+kBs<0) {
349 if (rn*rn<4*(kB-log(
x))) {
383 if (
sigma <= 0)
return 0;
407 if (mean <= 0)
return 0;
415 if (pir <= expmean)
break;
420 else if (mean < 1E9) {
437 }
while(
Rndm() > t );
446 Error(
"Poisson",
"Overflow in return value. Use PoissonD instead.");
464 if (mean <= 0)
return 0;
472 if (pir <= expmean)
break;
477 else if (mean < 1E9) {
494 }
while(
Rndm() > t );
513 x = z * 6.28318530717958623;
528 x = z * 6.28318530717958623;
561#ifdef OLD_TRANDOM_IMPL
562 const Double_t kCONS = 4.6566128730774E-10;
563 const Int_t kMASK24 = 2147483392;
567 if (jy)
return kCONS*jy;
572 const Double_t kCONS = 4.6566128730774E-10;
573 fSeed = (1103515245 *
fSeed + 12345) & 0x7fffffffUL;
584 const Double_t kCONS = 4.6566128730774E-10;
587 fSeed = (1103515245 *
fSeed + 12345) & 0x7fffffffUL;
597 const Double_t kCONS = 4.6566128730774E-10;
600 fSeed = (1103515245 *
fSeed + 12345) & 0x7fffffffUL;
672 z =
r* ( -1. + 8.0 * r2 );
unsigned long long ULong64_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
Describe directory structure in memory.
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
Write an object with proper type checking.
virtual TFile * GetFile() const
virtual Int_t ReadTObject(TObject *, const char *)
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual void WriteRandom(const char *filename) const
Writes random generator status to filename.
Double_t Rndm() override
Machine independent random number generator.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual Double_t PoissonD(Double_t mean)
Generates a random number according to a Poisson law.
virtual void ReadRandom(const char *filename)
Reads saved random generator status from filename.
virtual UInt_t GetSeed() const
Get the random generator seed.
virtual ULong64_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Double_t Exp(Double_t tau)
Returns an exponential deviate.
virtual void Circle(Double_t &x, Double_t &y, Double_t r)
Generates random vectors, uniformly distributed over a circle of given radius.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual void Sphere(Double_t &x, Double_t &y, Double_t &z, Double_t r)
Generates random vectors, uniformly distributed over the surface of a sphere of given radius.
virtual Double_t Landau(Double_t mean=0, Double_t sigma=1)
Generate a random number following a Landau distribution with location parameter mu and scale paramet...
TRandom(UInt_t seed=65539)
Default constructor. For seed see SetSeed().
virtual Int_t Binomial(Int_t ntot, Double_t prob)
Generates a random integer N according to the binomial law.
virtual Double_t BreitWigner(Double_t mean=0, Double_t gamma=1)
Return a number distributed following a BreitWigner function with mean and gamma.
~TRandom() override
Default destructor.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
void GetUUID(UChar_t uuid[16]) const
Return uuid in specified buffer (16 byte = 128 bits).
double landau_quantile(double z, double xi=1)
Inverse ( ) of the cumulative distribution function of the lower tail of the Landau distribution (lan...
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
constexpr Double_t PiOver2()
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()
static T Max()
Returns minimum double representation.