File indexing completed on 2025-01-30 09:17:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 from __future__ import absolute_import, unicode_literals
0013
0014
0015 def detector_BoxSegment(description, det):
0016 box = det.find('box')
0017 mat = det.find('material')
0018 pos = det.find('position')
0019 rot = det.find('rotation')
0020 mother = description.worldVolume()
0021 de = DetElement(description, det.name, det.type, det.id)
0022 sha = Box(description, det.name + '_envelope', box.x, box.y, box.z)
0023 vol = Volume(description, det.name + '_envelope_volume', sha, description.material(mat.name))
0024 phv = mother.placeVolume(vol, Position(pos.x, pos.y, pos.z),
0025 Rotation(rot.x, rot.y, rot.z))
0026 vol.setVisAttributes(description, det.vis)
0027 phv.addPhysVolID('id', det.id)
0028 de.addPlacement(phv)
0029 return de