summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--detectors/sno.py5
-rwxr-xr-xsim.py4
-rw-r--r--tools.py3
3 files changed, 7 insertions, 5 deletions
diff --git a/detectors/sno.py b/detectors/sno.py
index d0334d3..d5c9ce9 100644
--- a/detectors/sno.py
+++ b/detectors/sno.py
@@ -75,16 +75,17 @@ def build_sno(real_av=False):
pmt = build_8inch_pmt_with_lc()
- geo = Geometry()
if real_av:
+ geo = Geometry(water)
real_av_mesh = mesh_from_stl(dir+'/sno_av_ascii.stl.bz2')
real_av_mesh.vertices *= 0.0254 # inch -> meter
geo.add_solid(Solid(real_av_mesh, glass, water, color=0xBBAAAAFF))
else:
+ geo = Geometry(water)
geo.add_solid(Solid(av_outside_mesh, acrylic_sno, water,
color=0xBBFFFFFF))
- geo.add_solid(Solid(av_inside_mesh, labppo_scintillator, acrylic_sno,
+ geo.add_solid(Solid(av_inside_mesh, water, acrylic_sno,
color=0xBB0000FF))
geo.pmtids = []
diff --git a/sim.py b/sim.py
index 53f7f9a..7ba6472 100755
--- a/sim.py
+++ b/sim.py
@@ -107,7 +107,7 @@ class Simulation(object):
self.gpu_pdf.clear_pdf()
if nreps > 1:
- iterable = repeating_iterator(iterable)
+ iterable = repeating_iterator(iterable, nreps)
for ev in iterable:
gpu_photons = gpu.GPUPhotons(ev.photons_beg)
@@ -138,7 +138,7 @@ class Simulation(object):
iterable = self.photon_generator.generate_events(iterable)
if nreps > 1:
- iterable = repeating_iterator(iterable)
+ iterable = repeating_iterator(iterable, nreps)
for ev in iterable:
gpu_photons = gpu.GPUPhotons(ev.photons_beg)
diff --git a/tools.py b/tools.py
index d6b71b1..a884db3 100644
--- a/tools.py
+++ b/tools.py
@@ -13,8 +13,9 @@ def progress(seq):
n = len(seq)
print '[' + ' '*21 + ']\r[',
sys.stdout.flush()
+ update_interval = max(n // 10, 1)
for i, item in enumerate(seq):
- if i % (n//10) == 0:
+ if i % update_interval == 0:
print '.',
sys.stdout.flush()
yield item