27 #include "StGlobals.hh"
31 #include "JamesRandom.h"
32 #include "RanluxEngine.h"
36 #include "RandPoisson.h"
37 #include "RandExponential.h"
38 #include "RandGauss.h"
39 #include "RandBreitWigner.h"
47 const StInt numberOfNumbers = 5;
63 StDouble quasiRandomNumber =
65 PR(quasiRandomNumber);
67 int *vecI =
new int[size];
68 double *vec =
new double[size];
70 quasiRandom.flatArray(size,vec);
72 cout <<
"\nPseudo-Random numbers from a flat distribution." << endl;
73 for(
int ii=0; ii<size; ii++)
74 cout <<
"i " << *(vec+ii) << endl;
76 PR(quasiRandom.getTheSeed());
79 cout <<
"All these numbers are the same:" << endl;
80 for(
int iii=0; iii<size; iii++) {
86 cout <<
"\nDifferent distributions:" << endl;
97 cout <<
"Numbers from a Flat Distribution:" << endl;
98 for(jj=0; jj<numberOfNumbers; jj++) {
100 flatDistribution.fire(width,width+10);
104 cout <<
"\nNumbers from a Gaussian Distribution:" << endl;
105 for(jj=0; jj<numberOfNumbers; jj++) {
106 StDouble gaussNumber =
107 gaussDistribution.shoot();
111 cout <<
"\nNumbers from an Exponential Distribution:" << endl;
112 for(jj=0; jj<numberOfNumbers; jj++) {
113 StDouble exponentialNumber =
114 exponentialDistribution.shoot(&engine2, mean);
115 PR(exponentialNumber);
118 cout <<
"\nNumbers from a Poissonian Distribution:" << endl;
119 for(jj=0; jj<numberOfNumbers; jj++) {
120 StDouble poissonNumber =
121 poissonDistribution.shoot();
125 cout <<
"\nAn Array of Numbers from a Breit-Wigner Distribution:" << endl;
126 breitWignerDistribution.shootArray(size, vec);
128 for(i=0; i<size; i++)
129 cout <<
"(" << i <<
") " << *(vec+i) << endl;