BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BabayagaNLORandom Class Reference

#include <BabayagaNLORandom.h>

Static Public Member Functions

static double Flat (double min, double max)
static double Flat (double max)
static double Flat ()
static void FlatArray (double *vect, const int size)
static void FlatArrayF (float *vect, const int size)
static double random ()
static void setRandomEngine (CLHEP::HepRandomEngine *randomEngine)

Detailed Description

Definition at line 26 of file BabayagaNLORandom.h.

Member Function Documentation

◆ Flat() [1/3]

double BabayagaNLORandom::Flat ( )
static

Definition at line 62 of file BabayagaNLORandom.cxx.

62{ return BabayagaNLORandom::random(); }
static double random()

◆ Flat() [2/3]

double BabayagaNLORandom::Flat ( double max)
static

Definition at line 60 of file BabayagaNLORandom.cxx.

60{ return max * BabayagaNLORandom::random(); }
#define max(a, b)

◆ Flat() [3/3]

double BabayagaNLORandom::Flat ( double min,
double max )
static

Definition at line 47 of file BabayagaNLORandom.cxx.

47 {
48
49 if ( min > max )
50 {
51 cerr << "min>max in BabayagaNLORandom::Flat(" << min << "," << max << ")" << endl;
52 double tmp = min;
53 min = max;
54 max = tmp;
55 }
56
57 return BabayagaNLORandom::random() * ( max - min ) + min;
58}
#define min(a, b)

◆ FlatArray()

void BabayagaNLORandom::FlatArray ( double * vect,
const int size )
static

Definition at line 64 of file BabayagaNLORandom.cxx.

64 {
65 if ( _randomEngine == 0 )
66 cout << "Can not get randomEngine pointer in BabayagaNLORandom::FlatArray" << endl;
67 else { _randomEngine->flatArray( size, vect ); }
68}

Referenced by babayaga_ranluxd_().

◆ FlatArrayF()

void BabayagaNLORandom::FlatArrayF ( float * vect,
const int size )
static

Definition at line 70 of file BabayagaNLORandom.cxx.

70 {
71
72 if ( _randomEngine == 0 )
73 {
74 cout << "Can not get randomEngine pointer in BabayagaNLORandom::FlatArray" << endl;
75 return;
76 }
77 else
78 {
79 for ( int ir = 0; ir < size; ir++ ) vect[ir] = _randomEngine->flat();
80 }
81}

Referenced by babayaga_ranlux_().

◆ random()

double BabayagaNLORandom::random ( )
static

Definition at line 36 of file BabayagaNLORandom.cxx.

36 {
37
38 if ( _randomEngine == 0 )
39 {
40 cerr << "No random engine available in "
41 << "BabayagaNLORandom::random()." << endl;
42 }
43
44 return _randomEngine->flat();
45}

Referenced by Flat(), Flat(), and Flat().

◆ setRandomEngine()

void BabayagaNLORandom::setRandomEngine ( CLHEP::HepRandomEngine * randomEngine)
static

Definition at line 32 of file BabayagaNLORandom.cxx.

32 {
33 _randomEngine = randomEngine;
34}

Referenced by BabayagaNLO::initialize().


The documentation for this class was generated from the following files: