diff --git a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfig.py index 9857b10511cfe3fc01bf1311ed097c241aa4396c..cd07c2c1313ce04ed73311bb868024424f50f9f7 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..8705fd34279b1b2e55f0fae351d13bb9bf67b2b0 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigDb.py @@ -2,4 +2,4 @@ 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 bd0499f5f6f44d3c7a18899166507265d748c6dd..1576bf336622a377fd8df9a7c05e96aa7bf7f380 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/components/TrkG4UserActions_entries.cxx @@ -1,13 +1,13 @@ #include "GaudiKernel/DeclareFactoryEntries.h" #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_TOOL_FACTORY( G4UA::MaterialStepRecorderTool ) -//DECLARE_TOOL_FACTORY( G4UA::EnergyLossRecorderTool ) +DECLARE_TOOL_FACTORY( G4UA::EnergyLossRecorderTool ) DECLARE_NAMESPACE_TOOL_FACTORY( Trk , GeantFollowerHelper ) DECLARE_TOOL_FACTORY( G4UA::GeantFollowerTool ) DECLARE_NAMESPACE_TOOL_FACTORY( Trk , GeantFollowerMSHelper ) @@ -15,7 +15,7 @@ DECLARE_TOOL_FACTORY( G4UA::GeantFollowerMSTool ) DECLARE_FACTORY_ENTRIES( TrkG4UserActions ) { DECLARE_TOOL( G4UA::MaterialStepRecorderTool ) - // DECLARE_TOOL( G4UA::EnergyLossRecorderTool ) + DECLARE_TOOL( G4UA::EnergyLossRecorderTool ) DECLARE_TOOL( G4UA::GeantFollowerTool ) DECLARE_NAMESPACE_TOOL( Trk , GeantFollowerHelper ) DECLARE_TOOL( G4UA::GeantFollowerMSTool )