File indexing completed on 2026-05-22 07:49:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 def detector_Shelf(description, det):
0015
0016 plane = det.find('planes')
0017 mat = det.find('material')
0018
0019
0020 book = det.find('books')
0021
0022
0023 e_vol = Volume(description, 'ensemble',
0024 Box(description, 'box', plane.x, plane.y + book.y, plane.z),
0025 description.material('Air'))
0026 e_vol.setVisAttributes(description, 'InvisibleWithDaughters')
0027
0028
0029 p_vol = Volume(description, 'plane',
0030 Box(description, 'plane', plane.x, plane.y, plane.z),
0031 description.material(mat.name))
0032 p_vol.setVisAttributes(description, plane.vis)
0033 e_vol.placeVolume(p_vol, Position(0, -book.y, 0))
0034
0035
0036 b_vol = Volume(description, 'book',
0037 Box(description, 'book', book.x, book.y, book.z),
0038 description.material('Carbon'))
0039 b_vol.setVisAttributes(description, book.vis)
0040 x, y, z = plane.x - book.x, plane.y, -plane.z + book.z
0041 for _n in range(book.number):
0042 e_vol.placeVolume(b_vol, Position(x, y, z))
0043 z += 2 * book.z + book.getF('dz')
0044
0045
0046 g_x, g_y, g_z = plane.x, plane.number * plane.getF('dy'), plane.z
0047 g_vol = Volume(description, det.name,
0048 Box(description, 'box', g_x, g_y, g_z), description.material('Air'))
0049 g_vol.setVisAttributes(description, 'InvisibleWithDaughters')
0050 de = DetElement(description, det.name, det.type, det.id)
0051 phv = description.worldVolume().placeVolume(g_vol, Position(g_x, g_y, g_z))
0052 phv.addPhysVolID('id', det.id)
0053 de.addPlacement(phv)
0054 x, y, z = 0, book.y + plane.y - 2 * plane.getF('dy'), 0
0055 for _n in range(plane.number):
0056 g_vol.placeVolume(e_vol, Position(x, y, z))
0057 y += plane.getF('dy')
0058
0059 return de