CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

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 
7 using std::cin;
8 using std::cout;
9 using std::cerr;
10 using std::endl;
11 using namespace CLHEP;
12 //#ifndef _WIN32
13 //using std::exp;
14 //#endif
15 
16 
17 // ---------
18 // RandGauss
19 // ---------
20 
21 int 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";
27  NonRandomEngine eng;
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: testBug66214.cc:30