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
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042