Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 07:50:28

0001 #include <iostream>
0002 #include <iomanip>
0003 
0004 #include "S4RandomArray.h"
0005 
0006 
0007 int main(int argc, char** argv)
0008 {
0009     S4RandomArray arr ; 
0010 
0011     for(int i=0 ; i < 10 ; i++)
0012     {
0013         double u = G4UniformRand() ; 
0014         std::cout << " u " << std::setw(10) << std::setprecision(5) << u << std::endl ;
0015     }
0016 
0017     double chk[10] ; 
0018     CLHEP::HepRandom::getTheEngine()->flatArray(10, &chk[0] ); 
0019     for(int i=0 ; i < 10 ; i++ ) std::cout << " flatArray chk " << std::setw(10) << std::setprecision(5) << chk[i] << std::endl ; 
0020 
0021 
0022     NP* a = arr.serialize(); 
0023     const char* path = "$TMP/S4RandomArrayTest/a.npy" ; 
0024     std::cout << " saving " << a->sstr() << " to " << path << std::endl ; 
0025     a->save(path); 
0026 
0027     return 0 ; 
0028 } 
0029 /**
0030 
0031   0.13049
0032    0.61775
0033    0.99595
0034     0.4959
0035    0.11292
0036    0.28987
0037    0.47304
0038    0.83762
0039    0.35936
0040    0.92694
0041 
0042 **/