diff --git a/Simulation/G4Utilities/G4UserActions/python/PostIncludes.py b/Simulation/G4Utilities/G4UserActions/python/PostIncludes.py new file mode 100644 index 0000000000000000000000000000000000000000..4aa59d6c6cbec20cc03668503dddbf973fc23dba --- /dev/null +++ b/Simulation/G4Utilities/G4UserActions/python/PostIncludes.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + +def LengthIntegrator(configFlags, name="G4UA::ISFFullUserActionSvc", **kwargs): + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from AthenaConfiguration.ComponentFactory import CompFactory + + result = ComponentAccumulator() + + #Setting up the CA for the LengthIntegrator + from G4UserActions.G4UserActionsConfigNew import LengthIntegratorToolCfg + actionAcc = ComponentAccumulator() + actions = [] + actions += [actionAcc.popToolsAndMerge(LengthIntegratorToolCfg(configFlags))] + actionAcc.setPrivateTools(actions) + lengthIntegratorAction = result.popToolsAndMerge(actionAcc) + + actionList = lengthIntegratorAction + #Setting up UserActionsService + kwargs.setdefault("UserActionTools",actionList) + result.addService(CompFactory.G4UA.UserActionSvc(name, **kwargs)) + + return result diff --git a/Simulation/G4Utilities/G4UserActions/python/__init__.py b/Simulation/G4Utilities/G4UserActions/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..98644c0b5905ed734559cbf93f486ed777d033a9 --- /dev/null +++ b/Simulation/G4Utilities/G4UserActions/python/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + +from .PostIncludes import LengthIntegrator + +__all__ = ['LengthIntegrator']