diff options
Diffstat (limited to 'detectors')
-rw-r--r-- | detectors/lbne.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/detectors/lbne.py b/detectors/lbne.py index 7940f43..4473084 100644 --- a/detectors/lbne.py +++ b/detectors/lbne.py @@ -5,21 +5,22 @@ from chroma import * models_directory = os.path.split(os.path.realpath(__file__))[0] + '/../models' -strings = 100 -pmts_per_string = 100 -radius = 50.0 -height = 100.0 +strings = 10 +pmts_per_string = 10 +radius = 10.0 +height = 20.0 def build_lbne(bits=4): lbne = geometry.Geometry() - sphere_mesh = stl.read_stl(models_directory + '/sphere.stl') + sphere_mesh = stl.read_stl(models_directory + '/hamamatsu_12inch.stl') + sphere_mesh /= 1000.0 solids = [] for i in range(pmts_per_string): for j in range(strings): sphere = np.copy(sphere_mesh) - sphere += (radius,0,i*(height/pmts_per_string)) + sphere += (-radius,0,i*(height/pmts_per_string)) sphere = transform.rotate(sphere, j*2*np.pi/strings, (0,0,1)) lbne.add_solid(geometry.Solid(sphere, materials.vacuum, materials.h2o)) @@ -35,6 +36,9 @@ def cache_lbne(filename): def load_lbne(filename): f = open(filename, 'rb') - lbne = pickle.load(filename) + lbne = pickle.load(f) f.close() return lbne + +if __name__ == '__main__': + build_lbne() |