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