1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include "CLHEP/Random/Randomize.h"
#include "CLHEP/Random/NonRandomEngine.h"
#include "CLHEP/Random/defs.h"
#include <iostream>
#include <iomanip>
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using namespace CLHEP;
//#ifndef _WIN32
//using std::exp;
//#endif
// ---------
// RandGauss
// ---------
int main() {
cout << "\n--------------------------------------------\n";
cout << "Test of Gauss distribution at small r \n\n";
cout << "\nInstantiating distribution utilizing NonRandomEngine...\n";
NonRandomEngine eng;
RandGauss dist (eng);
double r;
while (true) {
cout << "r -- ";
cin >> r;
eng.setNextRandom(r);
double x = dist.fire();
cout << " " << std::setprecision(16) << x << "\n";
if ( x > 1.0e15 ) break;
}
return 0;
}
|