Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:17:44

0001 # ==========================================================================
0002 #  AIDA Detector description implementation
0003 # --------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
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)  # noqa: F821
0022   sha = Box(description, det.name + '_envelope', box.x, box.y, box.z)  # noqa: F821
0023   vol = Volume(description, det.name + '_envelope_volume', sha, description.material(mat.name))  # noqa: F821
0024   phv = mother.placeVolume(vol, Position(pos.x, pos.y, pos.z),  # noqa: F821
0025                            Rotation(rot.x, rot.y, rot.z))  # noqa: F821
0026   vol.setVisAttributes(description, det.vis)
0027   phv.addPhysVolID('id', det.id)
0028   de.addPlacement(phv)
0029   return de