Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env python
0002 """
0003 U4LogTest.py
0004 ==============
0005 
0006 See notes/issues/U4LogTest_maybe_replacing_G4Log_G4UniformRand_in_Absorption_and_Scattering_with_float_version_will_avoid_deviations.rst
0007 
0008 """
0009 import os, numpy as np
0010 
0011 
0012 if __name__ == '__main__':
0013 
0014     a_path = os.path.expandvars("/tmp/logTest.npy")   
0015     b_path = os.path.expandvars("/tmp/$USER/opticks/U4LogTest/scan.npy")
0016 
0017     a = np.load(a_path) if os.path.exists(a_path) else None
0018     b = np.load(b_path) if os.path.exists(b_path) else None
0019 
0020     if not a is None:print("a %s a_path %s " % (str(a.shape),a_path) )
0021     if not b is None:print("b %s b_path %s " % (str(b.shape),b_path) )
0022 
0023     U,D0,F0,D4,F4 = range(5)    
0024 
0025     print(a)
0026     print(b)
0027 
0028     cf = not a is None and not b is None 
0029     if cf and a.shape[0] == b.shape[0]:
0030         assert np.all( a[:,U] == b[:,U] ) 
0031     pass
0032 
0033 
0034 
0035 
0036    
0037