diff --git a/DDSim/DD4hepSimulation.py b/DDSim/DD4hepSimulation.py index 164d323b4e1bc5610eca7c6ce59558ae1fce1b5c..94f3b972687dfd08f8f494c4459f74ae84114537 100644 --- a/DDSim/DD4hepSimulation.py +++ b/DDSim/DD4hepSimulation.py @@ -439,6 +439,18 @@ class DD4hepSimulation(object): gun.position = self.gun.position gun.isotrop = self.gun.isotrop gun.direction = self.gun.direction + if self.gun.thetaMin is not None: + gun.ThetaMin = self.gun.thetaMin + gun.isotrop = True + if self.gun.thetaMax is not None: + gun.ThetaMax = self.gun.thetaMax + gun.isotrop = True + if self.gun.phiMin is not None: + gun.PhiMin = self.gun.phiMin + gun.isotrop = True + if self.gun.phiMax is not None: + gun.PhiMax = self.gun.phiMax + gun.isotrop = True except Exception as e: #pylint: disable=W0703 print "ERROR: parsing gun options:\n%s\nException: %s " % (self.gun, e ) exit(1) diff --git a/DDSim/Helper/Gun.py b/DDSim/Helper/Gun.py index 8fb4db5ca43766b560a6a5699aa5bf1f482d6019..a4cce5d7d6c5cd9634c742d2df3aeb8efc39162c 100644 --- a/DDSim/Helper/Gun.py +++ b/DDSim/Helper/Gun.py @@ -13,6 +13,10 @@ class Gun( ConfigHelper ): self._position = (0.0,0.0,0.0) self._isotrop = False self._direction = (0,0,1) + self.phiMin = None + self.phiMax = None + self.thetaMin = None + self.thetaMax = None @property def isotrop( self ):