diff options
Diffstat (limited to 'track.py')
-rw-r--r-- | track.py | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -1,7 +1,7 @@ import numpy as np import pycuda.driver as cuda from gputhread import GPUThread -from detectors import LBNE +from detectors import minilbne from Queue import Queue from threadtest import create_job import matplotlib.pyplot as plt @@ -10,20 +10,18 @@ from color import map_wavelength from solids import r7081 from geometry import Geometry -nphotons = 100000 +nphotons = 1000 jobs = Queue() output = Queue() -#geometry = LBNE() -geometry = Geometry() -geometry.add_solid(r7081, displacement=(0,-1,0)) +geometry = minilbne geometry.build(bits=8) cuda.init() try: - gputhread = GPUThread(0, geometry, jobs, output, 64) + gputhread = GPUThread(5, geometry, jobs, output, 64) gputhread.start() job = create_job((0,0,0), nphotons) @@ -46,7 +44,7 @@ finally: gputhread.stop() gputhread.join() -mask = job.states != 0 +mask = job.states == 2 rgb = (map_wavelength(job.wavelengths[mask])*255).astype(np.uint32) @@ -56,5 +54,5 @@ def format_hex_string(s): colors = map(format_hex_string, map(hex, rgb[:,0] << 16 | rgb[:,1] << 8 | rgb[:,2])) plt.figure() -plt.plot(*roundrobin(x[mask,:,0], x[mask,:,1], colors)) +plt.plot(*roundrobin(x[mask,:,0], x[mask,:,2], colors)) plt.show() |