/* Author: Glen Cowan Date: 30 October 2001 Test program for Poisson random number generator and histogram software. Must be linked with ranpois, random and with the HBOOK routines (part of PACKLIB in the CERN program library). */ #include #include #include "cfortran/cfortran.h" #include "cfortran/hbook.h" #include "ranpois.h" // prototype for Poisson random function used below // define array used for hbook memory #define PAWC_SIZE 50000 float pawc_[PAWC_SIZE]; int main(){ // Initialize HBOOK HLIMIT(PAWC_SIZE); // Open histogram file int lun = 20; int istat = 0; int lrec = 1024; char* outfile = "test_ranpois.his"; HROPEN (lun, "histog", outfile, "N", lrec, istat); if (istat != 0){ std::cout << "HROPEN error, istat = " << istat << std::endl; exit(istat); } // Book histogram HBOOK1 (1, "Poisson", 100, -0.5, 99.5, 0.); int num_values; double nu; int seed = 12345; cout << "Enter number of values to generate" << endl; cin >> num_values; cout << "Enter Poisson mean" << endl; cin >> nu; for (int i = 0; i