diff --git a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py index 9857b10511cfe3fc01bf1311ed097c241aa4396c..0511d71cdcf89a0712e198477da054f444d2ae4d 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py @@ -8,3 +8,13 @@ def getMaterialStepRecorderTool(name="G4UA::MaterialStepRecorderTool", **kwargs) kwargs.setdefault(prop,value) from TrkG4UserActions.TrkG4UserActionsConf import G4UA__MaterialStepRecorderTool return G4UA__MaterialStepRecorderTool(name, **kwargs) + + +def getEnergyLossRecorderTool(name="G4UA::EnergyLossRecorderTool", **kwargs): + from G4AtlasApps.SimFlags import simFlags + # example custom configuration + if name in simFlags.UserActionConfig.get_Value().keys(): + for prop,value in simFlags.UserActionConfig.get_Value()[name].iteritems(): + kwargs.setdefault(prop,value) + from TrkG4UserActions.TrkG4UserActionsConf import G4UA__EnergyLossRecorderTool + return G4UA__EnergyLossRecorderTool(name, **kwargs) diff --git a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py index 7f7be15fc4bc0b44eac50ff24be57c3020e88ed2..01bdc574274cbaa0f23fe7eeaeaa273df061244b 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py @@ -2,4 +2,5 @@ from AthenaCommon.CfgGetter import addTool addTool("TrkG4UserActions.TrkG4UserActionsConfig.getMaterialStepRecorderTool", "G4UA::MaterialStepRecorderTool") +addTool("TrkG4UserActions.TrkG4UserActionsConfig.getEnergyLossRecorderTool", "G4UA::EnergyLossRecorderTool") diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx index 999ba821d762eb0b006909d64ac1f433a492ad8f..d93038996651770ae9f02f75a990cf1ceed3e29c 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx @@ -1,12 +1,12 @@ #include "TrkG4UserActions/MaterialStepRecorderTool.h" -//#include "TrkG4UserActions/EnergyLossRecorderTool.h" +#include "TrkG4UserActions/EnergyLossRecorderTool.h" #include "TrkG4UserActions/GeantFollowerTool.h" #include "TrkG4UserActions/GeantFollowerHelper.h" #include "TrkG4UserActions/GeantFollowerMSTool.h" #include "TrkG4UserActions/GeantFollowerMSHelper.h" DECLARE_COMPONENT( G4UA::MaterialStepRecorderTool ) -//DECLARE_COMPONENT( G4UA::EnergyLossRecorderTool ) +DECLARE_COMPONENT( G4UA::EnergyLossRecorderTool ) DECLARE_COMPONENT( Trk::GeantFollowerHelper ) DECLARE_COMPONENT( G4UA::GeantFollowerTool ) DECLARE_COMPONENT( Trk::GeantFollowerMSHelper )