Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/usr/bin/env python
0002 
0003 
0004 import os, numpy as np
0005 from opticks.ana.fold import Fold
0006 from opticks.ana.pvplt import *
0007 
0008 X,Y,Z = 0,1,2
0009 H,V = X,Z
0010 
0011 if __name__ == '__main__':
0012     t = Fold.Load(symbol="t")
0013     print(repr(t))
0014     print("MODE:%d" % MODE)
0015 
0016     pl = plotter(label="U4SimtracePlot.py")  # MODE:2 (fig,ax)  MODE:3 pv plotter
0017 
0018     if MODE == 2:
0019         fig, axs = pl
0020         assert len(axs) == 1
0021         ax = axs[0]
0022     elif MODE == 3:
0023         pass
0024     pass
0025 
0026     color = "red"
0027     label = "klop"
0028     SZ = 1
0029  
0030 
0031     inrm = t.simtrace[:,0].copy()  # normal at intersect (not implemented)
0032     inrm[:,3] = 0
0033 
0034     lpos = t.simtrace[:,1].copy()  # intersect position 
0035     lpos[:,3] = 1
0036 
0037     tpos = t.simtrace[:,2].copy()  # trace origin
0038     tpos[:,3] = 1 
0039 
0040     tdir = t.simtrace[:,3].copy()  # trace direction
0041     tdir[:,3] = 0 
0042 
0043 
0044 
0045     if MODE == 2:
0046         ax.scatter( lpos[:,H], lpos[:,V], s=SZ, color=color, label=label )
0047         ax.scatter( tpos[:,H], tpos[:,V], s=SZ, color=color, label=label )
0048     elif MODE == 3:
0049         pl.add_points( gpos[:,:3], color=color, label=label)
0050     pass
0051 
0052 
0053     if MODE == 2:
0054         fig.show()
0055     elif MODE == 3:
0056         pl.show()
0057     pass
0058 
0059 pass
0060 
0061