diff --git a/Generators/GeneratorUtils/python/ShiftLOS.py b/Generators/GeneratorUtils/python/ShiftLOS.py index f1010367869d449b29b80e1d10dde1f0f14758b9..fb6180b4787e94ebe86d6833ed8c70c6f05cf8c4 100644 --- a/Generators/GeneratorUtils/python/ShiftLOS.py +++ b/Generators/GeneratorUtils/python/ShiftLOS.py @@ -40,17 +40,17 @@ class ShiftLOS(PyAthena.Alg): # Shift x or y by appropriate crossing angle if self.xcross: x += dz * self.xcross - self.msg.debug(f"Shifting x by {self.xcross} over {dz}: {pos.x()} -> {x} ") + self.msg.debug(f"Shifting x by {self.xcross} urad over {dz}: {pos.x()} -> {x} ") elif self.ycross: y += dz * self.ycross - self.msg.debug(f"Shifting y by {self.ycross} over {dz}: {pos.y()} -> {y} ") + self.msg.debug(f"Shifting y by {self.ycross} urad over {dz}: {pos.y()} -> {y} ") if self.xshift: x += self.xshift - self.msg.debug(f"Shifting x by {self.xshift}: {pos.x()} -> {x} ") + self.msg.debug(f"Shifting x by {self.xshift} mm: {pos.x()} -> {x} ") elif self.yshift: y += self.yshift - self.msg.debug(f"Shifting x by {self.yshift}: {pos.y()} -> {y} ") + self.msg.debug(f"Shifting x by {self.yshift} mm: {pos.y()} -> {y} ") v.set_position(HepMC.FourVector(x, y, z, pos.t())) diff --git a/Generators/GeneratorUtils/python/ShiftLOSConfig.py b/Generators/GeneratorUtils/python/ShiftLOSConfig.py index 5aece64bfec84c06279b6d1d22d66c0e1a012024..4d7f02d59d93591aa6c0e26156ce9a07e10e445d 100644 --- a/Generators/GeneratorUtils/python/ShiftLOSConfig.py +++ b/Generators/GeneratorUtils/python/ShiftLOSConfig.py @@ -4,7 +4,7 @@ # import sys from AthenaConfiguration.MainServicesConfig import AthSequencer -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, ConfigurationError from AthenaConfiguration.ComponentFactory import CompFactory from GeneratorUtils.ShiftLOS import ShiftLOS @@ -21,6 +21,12 @@ def ShiftLOSCfg(ConfigFlags, **kwargs) : shift.ycross = kwargs.setdefault("ycross", 0) shift.xshift = kwargs.setdefault("xshift", 0) shift.yshift = kwargs.setdefault("yshift", 0) - cfg.addEventAlgo(shift, sequenceName = "AthBeginSeq", primary = True) # to run *before* G4 + try: + # Run for PG + cfg.addEventAlgo(shift, sequenceName = "AthBeginSeq", primary = True) # to run *before* G4 + except ConfigurationError: + # Run for pool or hepmc + cfg.addEventAlgo(shift, sequenceName = "AthAlgSeq", primary = True) # to run *before* G4 + return cfg