diff options
Diffstat (limited to 'detectors')
-rw-r--r-- | detectors/__init__.py | 9 | ||||
-rw-r--r-- | detectors/lbne.py | 22 | ||||
-rw-r--r-- | detectors/sno.py | 12 |
3 files changed, 15 insertions, 28 deletions
diff --git a/detectors/__init__.py b/detectors/__init__.py index 8550751..84e853b 100644 --- a/detectors/__init__.py +++ b/detectors/__init__.py @@ -1,15 +1,8 @@ from lbne import build_lbne from sno import build_sno as build_sno_detector - -import os -import sys +from chroma.view import buildable import inspect -dir = os.path.split(os.path.realpath(__file__))[0] -sys.path.append(dir + '/..') - -from view import buildable - # from LBNE document #3951 radius = 63.30/2 height = 76.60 diff --git a/detectors/lbne.py b/detectors/lbne.py index 8942cb2..ca13c2d 100644 --- a/detectors/lbne.py +++ b/detectors/lbne.py @@ -1,27 +1,21 @@ -import os -import sys import numpy as np - -dir = os.path.split(os.path.realpath(__file__))[0] -sys.path.append(dir + '/..') - -from geometry import * -from solids import build_12inch_pmt, build_12inch_pmt_with_lc, build_12inch_pmt_shell -from optics import * -from transform import rotate, make_rotation_matrix +from chroma.geometry import Solid, Geometry +import chroma.solids as solids +from chroma.optics import vacuum, water, water_wcsim, black_surface +from chroma.transform import rotate, make_rotation_matrix from itertools import product -from make import cylinder, segmented_cylinder +import chroma.make as make def build_lbne(radius, height, nstrings, pmts_per_string, endcap_spacing, physical_model=True): if physical_model: - pmt = build_12inch_pmt_with_lc(outer_material=water_wcsim) + pmt = solids.build_12inch_pmt_with_lc(outer_material=water_wcsim) else: - pmt = build_12inch_pmt_shell(outer_material=water_wcsim) + pmt = solids.build_12inch_pmt_shell(outer_material=water_wcsim) lbne = Geometry() # outer cylinder - cylinder_mesh = segmented_cylinder(radius, height+height/(pmts_per_string-1), nsteps=16*nstrings, nsegments=1200) + cylinder_mesh = make.segmented_cylinder(radius, height+height/(pmts_per_string-1), nsteps=16*nstrings, nsegments=1200) cylinder_mesh.vertices = rotate(cylinder_mesh.vertices, np.pi/2, (-1,0,0)) lbne.add_solid(Solid(cylinder_mesh, water_wcsim, vacuum, black_surface, 0xff0000ff)) diff --git a/detectors/sno.py b/detectors/sno.py index 3e748b4..d0334d3 100644 --- a/detectors/sno.py +++ b/detectors/sno.py @@ -1,12 +1,12 @@ import numpy as np import numpy.linalg import math -from make import rotate_extrude -from stl import mesh_from_stl -from geometry import * -from optics import * -from solids import build_8inch_pmt_with_lc -from transform import rotate, make_rotation_matrix +from chroma.make import rotate_extrude +from chroma.stl import mesh_from_stl +from chroma.geometry import * +from chroma.optics import * +from chroma.solids import build_8inch_pmt_with_lc +from chroma.transform import rotate, make_rotation_matrix import os def sno_vessel(sphere_radius, neck_radius, neck_top, nsteps=40): |