CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 #include "CLHEP/Random/Randomize.h" 00002 #include "CLHEP/Random/NonRandomEngine.h" 00003 #include "CLHEP/Random/defs.h" 00004 #include <iostream> 00005 #include <iomanip> 00006 00007 using std::cin; 00008 using std::cout; 00009 using std::cerr; 00010 using std::endl; 00011 using namespace CLHEP; 00012 //#ifndef _WIN32 00013 //using std::exp; 00014 //#endif 00015 00016 00017 // --------- 00018 // RandGauss 00019 // --------- 00020 00021 int main() { 00022 00023 cout << "\n--------------------------------------------\n"; 00024 cout << "Test of Gauss distribution at small r \n\n"; 00025 00026 cout << "\nInstantiating distribution utilizing NonRandomEngine...\n"; 00027 NonRandomEngine eng; 00028 RandGauss dist (eng); 00029 00030 double r; 00031 while (true) { 00032 cout << "r -- "; 00033 cin >> r; 00034 eng.setNextRandom(r); 00035 double x = dist.fire(); 00036 cout << " " << std::setprecision(16) << x << "\n"; 00037 if ( x > 1.0e15 ) break; 00038 } 00039 return 0; 00040 }