diff --git a/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessing.h b/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessing.h index e92fc4688fc4a7c527f787131cca869c956e23c8..fb23d77594afdc54e57f2b603de0a2ba33830454 100644 --- a/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessing.h +++ b/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessing.h @@ -30,18 +30,17 @@ class G4Step; class G4VSensitiveDetector; -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA { namespace CaloG4 { - class CalibrationDefaultProcessing: - public AthMessaging, public IBeginEventAction, public ISteppingAction + public AthMessaging, public G4UserEventAction, public G4UserSteppingAction { public: @@ -53,9 +52,9 @@ namespace G4UA { CalibrationDefaultProcessing(const Config& config); /// the BoE actions - virtual void beginOfEvent(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; /// the stepping action - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; /// Make the default sensitive detector available to other routines. G4VSensitiveDetector* GetDefaultSD() { return m_defaultSD; } @@ -71,6 +70,4 @@ namespace G4UA { } // namespace G4UA - - #endif // CaloG4_CalibrationDefaultProcessing_h diff --git a/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessingTool.h b/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessingTool.h index 755aa1588f71dda95ecd9c88c9148a0c90ce4139..588fe3ac16df7cf38414811ef95533cd7ec550bf 100644 --- a/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessingTool.h +++ b/Calorimeter/CaloG4Sim/CaloG4Sim/CalibrationDefaultProcessingTool.h @@ -2,37 +2,37 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef CALOG4SIM_G4UA_CALOG4_CALIBRATIONDEFAULTPROCESSINGTOOL_H -#define CALOG4SIM_G4UA_CALOG4_CALIBRATIONDEFAULTPROCESSINGTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#ifndef CALOG4SIM_G4UA_CALOG4_CALIBRATIONDEFAULTPROCESSINGTOOL_H +#define CALOG4SIM_G4UA_CALOG4_CALIBRATIONDEFAULTPROCESSINGTOOL_H +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "CaloG4Sim/CalibrationDefaultProcessing.h" -namespace G4UA{ - +namespace G4UA{ + namespace CaloG4 { - + /// @class CalibrationDefaultProcessingTool /// @brief Tool which manages CalibrationDefaultProcessing /// /// @author Andrea Di Simone /// - class CalibrationDefaultProcessingTool: - public ActionToolBase<CalibrationDefaultProcessing>, - public IBeginEventActionTool, public ISteppingActionTool + class CalibrationDefaultProcessingTool: + public ActionToolBase<CalibrationDefaultProcessing>, + public IG4EventActionTool, public IG4SteppingActionTool { - + public: /// Standard constructor CalibrationDefaultProcessingTool(const std::string& type, const std::string& name,const IInterface* parent); /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudi interface management virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: @@ -42,8 +42,8 @@ namespace G4UA{ /// python configuration CalibrationDefaultProcessing::Config m_config; }; // class CalibrationDefaultProcessingTool - + }// namespace CaloG4 - -} // namespace G4UA + +} // namespace G4UA #endif diff --git a/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessing.cc b/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessing.cc index 95103ac653f790eedeee87ab7e104f10cf4a83c7..4b3498a5ceae469f561fe2b3c0a4625420c4c344 100644 --- a/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessing.cc +++ b/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessing.cc @@ -41,7 +41,7 @@ namespace G4UA { CalibrationDefaultProcessing::CalibrationDefaultProcessing(const Config& config):AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"CalibrationDefaultProcessing"),m_config(config), m_defaultSD(0){; } - void CalibrationDefaultProcessing::beginOfEvent(const G4Event*){ + void CalibrationDefaultProcessing::BeginOfEventAction(const G4Event*){ // retrieve the SD from G4SDManager // done here instead of in initialize to leave more flexibility to the rest of the G4 init @@ -53,7 +53,7 @@ namespace G4UA { if(!m_defaultSD) ATH_MSG_ERROR("No valid SD name specified. The job will continue, but you should check your configuration"); } - void CalibrationDefaultProcessing::processStep(const G4Step* a_step){ + void CalibrationDefaultProcessing::UserSteppingAction(const G4Step* a_step){ // Do we have a sensitive detector? diff --git a/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessingTool.cxx b/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessingTool.cxx index 3618f7be53b2c1f02051bc9a90513dc4126ee7ef..b45f48a2849f2db028ec427fb1277d75d4f21009 100644 --- a/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessingTool.cxx +++ b/Calorimeter/CaloG4Sim/src/CalibrationDefaultProcessingTool.cxx @@ -23,13 +23,13 @@ namespace G4UA{ StatusCode CalibrationDefaultProcessingTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_ITk_jobOptions.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_ITk_jobOptions.py index b9e06b01f2e8d5245b1dc5f6688dfbed0f4ae51b..2b1ae6fc71d3dd581d6739377b357a9b4bd77759 100644 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_ITk_jobOptions.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_ITk_jobOptions.py @@ -104,7 +104,7 @@ ServiceMgr += myAtRndmGenSvc ## Add an action from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool'['BeginOfRun','EndOfRun','BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool'['Run','Event','Step']) ############### The Material hit collection ################## diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_jobOptionsOverride.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_jobOptionsOverride.py index 33ffa860f63931987500ec91eb240cfbf9f23dd4..1060c87f1581c0da24cb703fb06e617aad9ee8c5 100755 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_jobOptionsOverride.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/GeantinoMapping_jobOptionsOverride.py @@ -96,7 +96,7 @@ except: ## Add an action from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool'['BeginOfRun','EndOfRun','BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool'['Run','Event','Step']) # suppress the enormous amount of MC output from TruthExamples.TruthExamplesConf import DumpMC diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/jobOptions_XX0_GMX.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/jobOptions_XX0_GMX.py index 55ce158561b0ad3726a743597d2572f2611ef9af..45204d3f2f464c3c877ecbf618b518757e934286 100755 --- a/InnerDetector/InDetExample/InDetSLHC_Example/share/jobOptions_XX0_GMX.py +++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/jobOptions_XX0_GMX.py @@ -50,7 +50,7 @@ theApp.initialize() ## TODO Something like this should work with the appropriate CfgGetter method: from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('XX0_Tool',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step']) +simFlags.OptionalUserActionList.addAction('XX0_Tool',['Event','Run','Step']) simFlags.UserActionConfig.addConfig('XX0_Tool','volumePartsFile', "VolumeNameParts.txt") simFlags.UserActionConfig.addConfig('XX0_Tool','DoIntLength', False) simFlags.UserActionConfig.addConfig('XX0_Tool','DoEta', True) diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_VPTimer_EHist_jobOptions.py b/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_VPTimer_EHist_jobOptions.py index 5ea8f1df2ababb10c997977678c4ccff61b64e09..4db2144e9a4f01a9952c50d6c1adb72e8b66e5b8 100755 --- a/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_VPTimer_EHist_jobOptions.py +++ b/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_VPTimer_EHist_jobOptions.py @@ -19,7 +19,7 @@ actionProperties={ ## # volume/particle timing - prints cpu time spent per particle, per volume to outfile ## # DO NOT USE SIMULTANEOUSLY WITH EHistAction! from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::TestActionVPTimerTool',['BeginOfRun','EndOfRun','BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::TestActionVPTimerTool',['Run','Event','Step']) for key, value in actionProperties.iteritems(): simFlags.UserActionConfig.addConfig('G4UA::TestActionVPTimerTool',key,value) print "volume/particle timing ON (see stdout)" @@ -27,7 +27,7 @@ print "volume/particle timing ON (see stdout)" ## # energy histogramming - creates ROOT file with histograms of kinetic energy by particle, by volume ## EHist-only options: -#simFlags.OptionalUserActionList.addAction('G4UA::TestActionEHistTool',['BeginOfRun','EndOfRun','PreTracking','PostTracking','Step']) +#simFlags.OptionalUserActionList.addAction('G4UA::TestActionEHistTool',['Run','Tracking','Step']) #for key, value in actionProperties.iteritems(): # simFlags.UserActionConfig.addConfig('G4UA::TestActionEHistTool',key,value) #simFlags.UserActionConfig.addConfig('G4UA::TestActionEHistTool','ROOTFileName','top_ke_test.root') # name of .root file output diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_setupTimer_jobOptions.py b/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_setupTimer_jobOptions.py index b3d7078fcf9a0a37f4c39f287d640758f105541b..143b004d536cd902dc3e5c5799d58765ffa2d3a3 100755 --- a/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_setupTimer_jobOptions.py +++ b/LArCalorimeter/LArG4/LArG4FastSimulation/share/LArG4FastSimulation_setupTimer_jobOptions.py @@ -8,7 +8,7 @@ # Include this file in your simulation job options to apply the timer # from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::TestActionTimerTool',['BeginOfRun','EndOfRun','BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::TestActionTimerTool',['Run','Event','Step']) from AthenaCommon.AppMgr import ServiceMgr from GaudiSvc.GaudiSvcConf import THistSvc diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLib.h b/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLib.h index d27644445ae2e086e6f4077f91468854f6e9174c..e295676a72f94b004dc73fbc06a7885fa712ae00 100755 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLib.h +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLib.h @@ -39,11 +39,9 @@ class G4AffineTransform; */ -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" #include "LArG4Code/ILArCalculatorSvc.h" @@ -53,16 +51,16 @@ namespace G4UA{ class TestActionShowerLib: - public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public IEndRunAction, public ISteppingAction + public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: TestActionShowerLib(); - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLibTool.h b/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLibTool.h index 402e1e3bd0f1c890f0f7eb5bbe142101d1aed412..5275b0b91583af20dc8fcd8613225d6c036019ec 100644 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLibTool.h +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/LArG4GenShowerLib/TestActionShowerLibTool.h @@ -4,11 +4,9 @@ #ifndef LARG4GENSHOWERLIB_G4UA__TESTACTIONSHOWERLIBTOOL_H #define LARG4GENSHOWERLIB_G4UA__TESTACTIONSHOWERLIBTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "LArG4GenShowerLib/TestActionShowerLib.h" namespace G4UA{ @@ -22,27 +20,21 @@ namespace G4UA{ class TestActionShowerLibTool: public ActionToolBase<TestActionShowerLib>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public IEndRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// standard tool ctor TestActionShowerLibTool(const std::string& type, const std::string& name,const IInterface* parent); - /// retrieves the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// retrieves the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// retrieves the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// retrieves the EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// retrieves the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// retrieves the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// retrieves the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudi interface handling virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4GenerateShowerLib.py b/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4GenerateShowerLib.py index f4f0c39cdfe6391e7c87a49e956ddc3859eba1b7..840d708ad3e905c06e59b786eee9cb54b22815f2 100755 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4GenerateShowerLib.py +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4GenerateShowerLib.py @@ -79,7 +79,7 @@ simFlags.RandomSeedOffset = randint(1,443921180) #add G4 function from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::TestActionShowerLibTool',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::TestActionShowerLibTool',['Event','Run','Step']) topSeq += PyG4AtlasAlg() diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLib.cxx b/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLib.cxx index 795d42758a0af15466a503a21e4871573481b27a..71be25b436b45002860a9f33ca68b36a47adfe5b 100644 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLib.cxx +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLib.cxx @@ -53,7 +53,7 @@ namespace G4UA{ } - void TestActionShowerLib::beginOfEvent(const G4Event*){ + void TestActionShowerLib::BeginOfEventAction(const G4Event*){ if (m_current_transform == 0) m_current_transform = new G4AffineTransform (); @@ -69,7 +69,7 @@ namespace G4UA{ } - void TestActionShowerLib::endOfEvent(const G4Event*){ + void TestActionShowerLib::EndOfEventAction(const G4Event*){ #ifdef _myDEBUG_ G4cout << "#########################################" << G4endl << "## TestActionShowerLib - EndOfEvent ##" << G4endl @@ -128,7 +128,7 @@ namespace G4UA{ } - void TestActionShowerLib::beginOfRun(const G4Run*){ + void TestActionShowerLib::BeginOfRunAction(const G4Run*){ #ifdef _myDEBUG_ G4cout << "#########################################" << G4endl << "## TestActionShowerLib - BeginOfRun ##" << G4endl @@ -166,7 +166,7 @@ namespace G4UA{ return; } -void TestActionShowerLib::endOfRun(const G4Run*){ +void TestActionShowerLib::EndOfRunAction(const G4Run*){ #ifdef _myDEBUG_ G4cout << "#########################################" << G4endl @@ -178,7 +178,7 @@ void TestActionShowerLib::endOfRun(const G4Run*){ } -void TestActionShowerLib::processStep(const G4Step* aStep){ +void TestActionShowerLib::UserSteppingAction(const G4Step* aStep){ bool hasCalc=true; bool emptydet = (m_eventSteps->detector[0] == '\0'); //empty string. man, i hate pure C! diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLibTool.cxx b/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLibTool.cxx index ccaac264e3ea69925ec75a3a966e48b783d7078a..ee371e2e8b64f112c90fc386fe4d81a6db411baa 100644 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLibTool.cxx +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/src/TestActionShowerLibTool.cxx @@ -17,28 +17,18 @@ namespace G4UA{ } StatusCode TestActionShowerLibTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.cc index 36b860e945eb6f49c8877687866f09aee3f09e0b..39b81b0e40712ce800466c78b7d192e1abedc7ea 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.cc @@ -23,7 +23,7 @@ namespace G4UA //ATH_MSG_DEBUG ("LArGeoH62004EventAction::LArGeoH62004EventAction constructor"); } - void LArGeoH62004EventAction::endOfEvent(const G4Event * /*theEvent*/) + void LArGeoH62004EventAction::EndOfEventAction(const G4Event * /*theEvent*/) { //ATH_MSG_DEBUG ("LArGeoH62004EventAction::EndOfEventAction"); diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.h index 7c17d496461306cb26d37926895e3d194e13a1b9..bf11c2e26a0fbccf282c162aef347c0c96886bad 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventAction.h @@ -5,7 +5,7 @@ #ifndef LARG4H6SD_LArGeoH62004EventAction_h #define LARG4H6SD_LArGeoH62004EventAction_h 1 -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserEventAction.hh" // For the output write handle #include "StoreGate/WriteHandle.h" #include "TBEvent/TBEventInfo.h" @@ -16,7 +16,7 @@ class LArGeoTB2004Options; namespace G4UA { /// @brief NEEDS DOCUMENTATION - class LArGeoH62004EventAction final: public IEndEventAction + class LArGeoH62004EventAction final: public G4UserEventAction { public: struct Config @@ -27,7 +27,7 @@ namespace G4UA LArGeoH62004EventAction(const Config& config); - virtual void endOfEvent(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; private: static int m_evnum; diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.cc index 583c08f47ec8dfff7fb3f55a9aca67eee8393525..29119334488a941b628a178c46377add17c56b40 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.cc @@ -52,8 +52,8 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode LArGeoH62004EventActionTool::queryInterface(const InterfaceID& riid, void** ppvIf) { - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.h index 5c0975965fe1fb7d1a924d138ca2b9faea9cc7ec..319dac054a056540836aed11365729a015b484c2 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004EventActionTool.h @@ -9,7 +9,7 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -26,7 +26,7 @@ namespace G4UA /// @author Andrea Di Simone /// class LArGeoH62004EventActionTool : public ActionToolBase<LArGeoH62004EventAction>, - public IEndEventActionTool + public IG4EventActionTool { public: @@ -39,8 +39,8 @@ namespace G4UA StatusCode initialize() override final; /// Retrieve the event action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.cc index cbbc9c3365d6dd28cd6dcee88f7688b3b457ebf7..a97ecadc4173335bf5bc66ea85d7d7bf6ed6364e 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.cc @@ -28,7 +28,7 @@ namespace G4UA } - void LArGeoH62004SteppingAction::processStep(const G4Step * theStep) + void LArGeoH62004SteppingAction::UserSteppingAction(const G4Step * theStep) { // ADS: why are these static? diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.h index 8e005a171430414dc7eaa43fa2deace667052d79..f1bad2288731bf52185b0101ddbd4777367b3b83 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingAction.h @@ -10,12 +10,12 @@ #define LARG4H6SD_LArGeoH62004SteppingAction_h 1 -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserSteppingAction.hh" namespace G4UA { /// @brief NEEDS DOCUMENTATION - class LArGeoH62004SteppingAction final: public ISteppingAction + class LArGeoH62004SteppingAction final: public G4UserSteppingAction { public: @@ -27,7 +27,7 @@ namespace G4UA }; LArGeoH62004SteppingAction(const Config& config); - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; private: float m_yTable; diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.cc index 5228de2537a98887b96aa477477acf1b6e61431c..ef92856147210333f582d3e145a6ae6e26e77fcd 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.cc @@ -52,8 +52,8 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode LArGeoH62004SteppingActionTool::queryInterface(const InterfaceID& riid, void** ppvIf) { - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.h b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.h index 98bcd59f7670e25a9f06f2acac5b3a03aae28fb2..88aec52cb859e112ee573c435cf65c19b42718f2 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/LArGeoH62004SteppingActionTool.h @@ -9,7 +9,7 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -26,7 +26,7 @@ namespace G4UA /// @author Andrea Di Simone /// class LArGeoH62004SteppingActionTool : public ActionToolBase<LArGeoH62004SteppingAction>, - public ISteppingActionTool + public IG4SteppingActionTool { public: @@ -39,8 +39,8 @@ namespace G4UA StatusCode initialize() override final; /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.cc index fefec3a820af4b45294e75ca71802fdd567c6f82..af19e279f91d3bc808f0455cda692f20d6197562 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.cc @@ -24,7 +24,7 @@ namespace G4UA // ADS why not class members? static bool has_cryo, has_em, has_hec, has_fcal; - void RadLenNtuple::beginOfEvent(const G4Event* /*anEvent*/) + void RadLenNtuple::BeginOfEventAction(const G4Event* /*anEvent*/) { has_cryo = has_em = has_hec = has_fcal = false; // m_tot_x = m_cryo_x = m_em_x = m_hec_x = m_fcal_x = 0.; @@ -32,7 +32,7 @@ namespace G4UA // m_fcal_y = m_em_y = m_hec_y = m_cryo_y = 0.; } - void RadLenNtuple::endOfEvent(const G4Event* /*anEvent*/) + void RadLenNtuple::EndOfEventAction(const G4Event* /*anEvent*/) { m_xcoord = -10000.; @@ -103,7 +103,7 @@ namespace G4UA - void RadLenNtuple::processStep(const G4Step* aStep) + void RadLenNtuple::UserSteppingAction(const G4Step* aStep) { G4StepPoint *preStep=aStep->GetPreStepPoint(); diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.h b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.h index 80714119e13b7260c3338e8563c5e52f3ec89ac5..de535781bb3cf2902b2550eb12ce6f323c8595ae 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtuple.h @@ -5,9 +5,8 @@ #ifndef LARG4H6SD_RadLenNtuple_H #define LARG4H6SD_RadLenNtuple_H -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" #include <string> #include "GaudiKernel/NTuple.h" @@ -21,7 +20,7 @@ namespace G4UA { /// @brief NEEDS DOCUMENTATION - class RadLenNtuple final: public ISteppingAction, public IBeginEventAction, public IEndEventAction { + class RadLenNtuple final: public G4UserSteppingAction, public G4UserEventAction { public: @@ -32,9 +31,9 @@ namespace G4UA }; RadLenNtuple(const Config& config): m_mcEvtColl(config.mcEventCollName), m_verboseLevel(config.verboseLevel) {} - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; virtual StatusCode initialize(); diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.cc b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.cc index cc944d647a7207981755767b8c42eb49bad2cca5..15669fa95f5db88ff84a40ed1aa7cc0487f684fb 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.cc +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.cc @@ -45,20 +45,14 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode RadLenNtupleTool::queryInterface(const InterfaceID& riid, void** ppvIf) { - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.h b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.h index c5a7dba58b33cc5dcecd31f6d90004998e56d113..a4bc3c2edccfbcd27f5c6ae926ea8c11d899f8fa 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.h +++ b/LArCalorimeter/LArG4/LArG4H6SD/src/RadLenNtupleTool.h @@ -9,9 +9,8 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -27,9 +26,8 @@ namespace G4UA /// @author Andrea Di Simone /// class RadLenNtupleTool : public ActionToolBase<RadLenNtuple>, - public IBeginEventActionTool, - public IEndEventActionTool, - public ISteppingActionTool + public IG4EventActionTool, + public IG4SteppingActionTool { public: @@ -41,17 +39,13 @@ namespace G4UA /// Framework methods StatusCode initialize() override final; - /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - - /// Retrieve the end-event action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// Retrieve the event action interface + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode diff --git a/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfig.py b/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfig.py index 906ac630dd6a0b6c86b59ce3ff19763a623a656f..ff5e96c299f7d46d67ea591d71c368528ea625c9 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfig.py +++ b/Simulation/G4Atlas/G4AtlasAlg/python/G4AtlasAlgConfig.py @@ -6,7 +6,7 @@ def getAthenaStackingActionTool(name='G4UA::AthenaStackingActionTool', **kwargs) from G4AtlasApps.SimFlags import simFlags if "ATLAS" in simFlags.SimLayout(): kwargs.setdefault('KillAllNeutrinos', True) - return CfgMgr.G4UA__AthenaStackingActionTool(name,**kwargs) + return CfgMgr.G4UA__AthenaStackingActionTool(name, **kwargs) def getAthenaTrackingActionTool(name='G4UA::AthenaTrackingActionTool', **kwargs): kwargs.setdefault('SecondarySavingLevel', 2) diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.cxx index 68a1630ff94925fd086e0d673a662702db19c42e..e6d99eb0a654c910bfec56c250fe4cd807bfaa1b 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.cxx @@ -28,7 +28,6 @@ #include "G4Gamma.hh" - namespace G4UA { @@ -43,7 +42,7 @@ namespace G4UA // Classify a new track //--------------------------------------------------------------------------- G4ClassificationOfNewTrack - AthenaStackingAction::classifyNewTrack(const G4Track* track) + AthenaStackingAction::ClassifyNewTrack(const G4Track* track) { // Kill neutrinos if enabled if(m_config.killAllNeutrinos && isNeutrino(track)) { @@ -117,20 +116,6 @@ namespace G4UA return fUrgent; } - //--------------------------------------------------------------------------- - // New tracking stack - //--------------------------------------------------------------------------- - void AthenaStackingAction::newStage() - { - } - - //--------------------------------------------------------------------------- - // Prepare stacking for new event - //--------------------------------------------------------------------------- - void AthenaStackingAction::prepareNewEvent() - { - } - //--------------------------------------------------------------------------- // Identify track definition //--------------------------------------------------------------------------- diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.h b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.h index 89ca6d6a0a867ed340b59ffbb4be1741836cfb29..38211c4b082d46336a797c64e67b23b53c9e4d7f 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.h +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingAction.h @@ -2,11 +2,10 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - #ifndef G4ATLASALG_G4UA_ATHENASTACKINGACTION_H #define G4ATLASALG_G4UA_ATHENASTACKINGACTION_H -#include "G4AtlasInterfaces/IStackingAction.h" +#include "G4UserStackingAction.hh" namespace G4UA { @@ -18,7 +17,7 @@ namespace G4UA /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// - class AthenaStackingAction : public IStackingAction + class AthenaStackingAction : public G4UserStackingAction { public: @@ -38,15 +37,7 @@ namespace G4UA /// @brief Classify a new track. /// Result can be fUrgent, fWaiting, fPostpone, or fKill. virtual G4ClassificationOfNewTrack - classifyNewTrack(const G4Track* track) override; - - /// @brief Called when starting the next priority queue. - /// The waiting stack gets moved into the urgent stack. - virtual void newStage() override; - - /// @brief Invoked by stack manager at new event. - /// This method is possibly redundant so we could maybe remove it. - virtual void prepareNewEvent() override; + ClassifyNewTrack(const G4Track* track) override final; private: @@ -54,6 +45,7 @@ namespace G4UA /// It might be useful to move this kind of functionality /// into some standalong helper function(s). bool isNeutrino(const G4Track*) const; + /// @brief Identify track as a photon. bool isGamma(const G4Track*) const; diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.cxx index 3e024b2bab59c1c7f3cbc1dc6b319ebed5c310fa..ae58958514b48937cfbf0bc9c0d179df1612a180 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.cxx @@ -16,6 +16,7 @@ namespace G4UA : ActionToolBase<AthenaStackingAction>(type, name, parent), m_config { /*killAllNeutrinos*/ false, /*photonEnergyCut*/ -1.} { + declareInterface<IG4StackingActionTool>(this); declareProperty("KillAllNeutrinos", m_config.killAllNeutrinos, "Toggle killing of all neutrinos"); declareProperty("PhotonEnergyCut", m_config.photonEnergyCut, @@ -23,11 +24,11 @@ namespace G4UA } //--------------------------------------------------------------------------- - // Initialize - temporarily here for debugging + // Initialize //--------------------------------------------------------------------------- StatusCode AthenaStackingActionTool::initialize() { - ATH_MSG_DEBUG("initialize"); + ATH_MSG_DEBUG( "Initializing " << name() ); return StatusCode::SUCCESS; } @@ -37,23 +38,9 @@ namespace G4UA std::unique_ptr<AthenaStackingAction> AthenaStackingActionTool::makeAction() { - ATH_MSG_DEBUG("makeAction"); + ATH_MSG_DEBUG("Creating an AthenaStackingAction"); // Create and configure the action plugin. return std::make_unique<AthenaStackingAction>(m_config); } - //--------------------------------------------------------------------------- - // Query interface - //--------------------------------------------------------------------------- - StatusCode AthenaStackingActionTool::queryInterface(const InterfaceID& riid, - void** ppvIf) - { - if(riid == IStackingActionTool::interfaceID()) { - *ppvIf = (IStackingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - return ActionToolBase<AthenaStackingAction>::queryInterface(riid, ppvIf); - } - } diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.h b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.h index aa2b33c41f050e7153821d9cdda56e9cf186dacf..5dcbc00ad57adf9ad1b8bc1c12bd9dc21c4ecb09 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.h +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaStackingActionTool.h @@ -12,7 +12,7 @@ #include "AthenaStackingAction.h" // Infrastructure includes -#include "G4AtlasInterfaces/IStackingActionTool.h" +#include "G4AtlasInterfaces/IG4StackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" @@ -25,7 +25,7 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class AthenaStackingActionTool : public ActionToolBase<AthenaStackingAction>, - public IStackingActionTool + public IG4StackingActionTool { public: @@ -34,15 +34,12 @@ namespace G4UA AthenaStackingActionTool(const std::string& type, const std::string& name, const IInterface* parent); - /// Initialize the tool (just for debugging printout) - virtual StatusCode initialize() override; + /// Initialize the tool + virtual StatusCode initialize() override final; /// Retrieve the stepping action - virtual IStackingAction* getStackingAction() override final - { return static_cast<IStackingAction*>( getAction() ); } - - /// Query interface for gaudi - virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; + virtual G4UserStackingAction* getStackingAction() override final + { return static_cast<G4UserStackingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.cxx index 84713b7e619c506118cbfc7d5f845d258d6d9176..17d3a2e40a1e46fa9b9c66189bac73ae51c27c59 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.cxx @@ -6,15 +6,11 @@ #include <iostream> -#include "G4DynamicParticle.hh" -#include "G4PrimaryParticle.hh" #include "G4Event.hh" #include "G4EventManager.hh" #include "MCTruth/EventInformation.h" -#include "MCTruth/PrimaryParticleInformation.h" #include "MCTruth/TrackHelper.h" -#include "MCTruth/TrackInformation.h" #include "MCTruthBase/AtlasTrajectory.h" #include "AthenaBaseComps/AthMsgStreamMacros.h" @@ -24,9 +20,10 @@ namespace G4UA //--------------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------------- - AthenaTrackingAction::AthenaTrackingAction(MSG::Level lvl, int secondarySavingLevel) - : m_msg("AthenaTrackingAction") - , m_secondarySavingLevel(secondarySavingLevel) + AthenaTrackingAction::AthenaTrackingAction(MSG::Level lvl, + int secondarySavingLevel) + : m_msg("AthenaTrackingAction"), + m_secondarySavingLevel(secondarySavingLevel) { m_msg.get().setLevel(lvl); } @@ -34,7 +31,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Pre-tracking action. //--------------------------------------------------------------------------- - void AthenaTrackingAction::preTracking(const G4Track* track) + void AthenaTrackingAction::PreUserTrackingAction(const G4Track* track) { ATH_MSG_DEBUG("Starting to track a new particle"); @@ -79,7 +76,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Post-tracking action. //--------------------------------------------------------------------------- - void AthenaTrackingAction::postTracking(const G4Track* /*track*/) + void AthenaTrackingAction::PostUserTrackingAction(const G4Track* /*track*/) { ATH_MSG_DEBUG("Finished tracking a particle"); diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.h b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.h index 8b2386806ccbf38846767e1d5d748817ab6df553..c6abf3b1c3cf78814b1e5cee8370b586da6eab55 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.h +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingAction.h @@ -5,17 +5,9 @@ #ifndef G4AtlasAlg_AthenaTrackingAction_H #define G4AtlasAlg_AthenaTrackingAction_H -/// @class AthenaTrackingAction -/// @brief User action for pre/post tracking truth handling. -/// -/// This is the current implementation based on the (V1) user action design -/// as part of the simulation infrastructure migrations. The multi-threaded -/// (V2) design is still in the works. -/// - #include "AthenaKernel/MsgStreamMember.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" + +#include "G4UserTrackingAction.hh" namespace G4UA { @@ -23,10 +15,7 @@ namespace G4UA /// @class AthenaTrackingAction /// @brief User action for pre/post tracking truth handling. /// - /// This is the new/upcoming implementation for multi-threaded simulation. - /// - class AthenaTrackingAction : public IPreTrackingAction, - public IPostTrackingAction + class AthenaTrackingAction : public G4UserTrackingAction { public: @@ -39,12 +28,12 @@ namespace G4UA /// If the track meets certain conditions, we save it in the /// EventInformation and possibly construct a new AtlasTrajectory /// which will be used for writing out truth particles later. - virtual void preTracking(const G4Track*) override; + virtual void PreUserTrackingAction(const G4Track*) override final; /// @brief Called after tracking a particle. /// /// Here we reset the AtlasTrajectory if it was created. - virtual void postTracking(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override final; private: @@ -52,8 +41,10 @@ namespace G4UA MsgStream& msg( MSG::Level lvl ) const { return m_msg << lvl; } bool msgLvl( MSG::Level lvl ) const { return m_msg.get().level() <= lvl; } mutable Athena::MsgStreamMember m_msg; + /// The saving level for secondaries. int m_secondarySavingLevel; + }; // class AthenaTrackingAction } // namespace G4UA diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.cxx index d1834f60ca752a1a6c24a3e5002c1e6dbe67305c..6ffcf11fcbfa9cb8458374b4d0cfa038b2379121 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.cxx @@ -13,12 +13,12 @@ namespace G4UA AthenaTrackingActionTool:: AthenaTrackingActionTool(const std::string& type, const std::string& name, const IInterface* parent) - : ActionToolBase<AthenaTrackingAction>(type, name, parent) - , m_secondarySavingLevel(2) + : ActionToolBase<AthenaTrackingAction>(type, name, parent), + m_secondarySavingLevel(2) { - declareInterface<IPreTrackingActionTool>(this); - declareInterface<IPostTrackingActionTool>(this); - declareProperty("SecondarySavingLevel", m_secondarySavingLevel, "Three valid options: 1 - Primaries; 2 - StoredSecondaries(default); 3 - All"); + declareInterface<IG4TrackingActionTool>(this); + declareProperty("SecondarySavingLevel", m_secondarySavingLevel, + "Three valid options: 1 - Primaries; 2 - StoredSecondaries(default); 3 - All"); } //--------------------------------------------------------------------------- @@ -26,7 +26,7 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode AthenaTrackingActionTool::initialize() { - ATH_MSG_DEBUG("initialize"); + ATH_MSG_DEBUG( "Initializing " << name() ); return StatusCode::SUCCESS; } @@ -38,7 +38,8 @@ namespace G4UA { ATH_MSG_DEBUG("Constructing an AthenaTrackingAction"); // Create and configure the action plugin. - return std::make_unique<AthenaTrackingAction>( msg().level(), m_secondarySavingLevel ); + return std::make_unique<AthenaTrackingAction>( msg().level(), + m_secondarySavingLevel ); } } diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.h b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.h index 92ebd5a2bc044527eb46c9b80c40a492ba0db01f..52127484dd6cfc75c38e035adbd00e2b72a51248 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.h +++ b/Simulation/G4Atlas/G4AtlasAlg/src/AthenaTrackingActionTool.h @@ -6,8 +6,7 @@ #define G4AtlasAlg_AthenaTrackingActionTool_H // Infrastructure includes -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -22,8 +21,7 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class AthenaTrackingActionTool : public ActionToolBase<AthenaTrackingAction>, - public IPreTrackingActionTool, - public IPostTrackingActionTool + public IG4TrackingActionTool { public: @@ -36,20 +34,19 @@ namespace G4UA virtual StatusCode initialize() override; /// Retrieve the tracking action - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - - /// Retrieve the tracking action - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } protected: /// Create an action for this thread virtual std::unique_ptr<AthenaTrackingAction> makeAction() override final; - private: + + private: + /// The saving level for secondaries. int m_secondarySavingLevel; + }; // class AthenaTrackingActionTool } // namespace G4UA diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py index 235c59071e35efd137626683ad8f260e7904443e..ebc1a2c96adf6dad7afb9b414eee7b06749a708d 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py @@ -656,7 +656,7 @@ class OptionalUserActionList(JobProperty): statusOn = True allowedTypes = ['dict'] # not allowing stacking actions to be modified this way - StoredValue = {'BeginOfRun':[], 'BeginOfEvent':[], 'PreTracking':[], 'Step':['G4UA::LooperKillerTool'], 'PostTracking':[], 'EndOfRun':[], 'EndOfEvent':[]} + StoredValue = {'Run':[], 'Event':[], 'Tracking':[], 'Step':['G4UA::LooperKillerTool']} def addAction(self,actionTool,roles=[]): #Add the action to the end of the list of actions for each role. for role in roles: @@ -665,7 +665,7 @@ class OptionalUserActionList(JobProperty): except KeyError: print "WARNING Attempt to assign to action",actionTool,"a role ",role,"which is not allowed" - def removeAction(self,actionTool,roles=['BeginOfRun','BeginOfEvent', 'PreTracking', 'Step', 'PostTracking', 'EndOfRun', 'EndOfEvent']): + def removeAction(self, actionTool, roles=['Run', 'Event', 'Tracking', 'Step']): #Remove the action from the lists of actions for each role (remove from all by default) - no error if it isn't in the list. for role in roles: try: diff --git a/Simulation/G4Atlas/G4AtlasApps/python/callbacks.py b/Simulation/G4Atlas/G4AtlasApps/python/callbacks.py index c477d213dccd15ecfb72c03810047c396fdceb14..51f8f61c95c575828e9cdc3b51ea2ec03506a759 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/callbacks.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/callbacks.py @@ -45,4 +45,5 @@ def add_LLP_truth_strategies(): def add_EnergyConservationTest(): from G4AtlasApps.SimFlags import simFlags # Enable the energy conservation test action - simFlags.OptionalUserActionList.addAction('G4UA::EnergyConservationTestTool', ['BeginOfEvent','PreTracking','Step','PostTracking','EndOfEvent']) + simFlags.OptionalUserActionList.addAction( + 'G4UA::EnergyConservationTestTool', ['Event', 'Tracking', 'Step']) diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventAction.h deleted file mode 100644 index 87262319d64695160d0396ced0b01bfb7ecb3412..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IBEGINEVENTACTION_H -#define G4ATLASINTERFACES__G4UA_IBEGINEVENTACTION_H - -// Forward declarations -class G4Event; - -namespace G4UA -{ - - /// Simple interface for an ATLAS begin-of-event action - class IBeginEventAction - { - public: - /// Virtual destructor - virtual ~IBeginEventAction(){}; - /// Method called before simulating a G4 event - virtual void beginOfEvent(const G4Event*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventActionTool.h deleted file mode 100644 index 69892a9135f868b116d34901e77b5fc32cfaab61..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginEventActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IBEGINEVENTACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IBEGINEVENTACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IBeginEventAction.h" - -namespace G4UA -{ - - /// @class IBeginEventActionTool - /// @brief Abstract interface for tools that manage ATLAS begin-of-event - /// custom actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IBeginEventActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IBeginEventAction* getBeginEventAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IBeginEventTool("G4UA::IBeginEventActionTool", 1, 0); - return iid_IBeginEventTool; - } - - }; // class IBeginEventActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunAction.h deleted file mode 100644 index 99b42c46700360cfb47f9da490a040489c6ef2fd..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IBEGINRUNACTION_H -#define G4ATLASINTERFACES__G4UA_IBEGINRUNACTION_H - -// Forward declarations -class G4Run; - -namespace G4UA -{ - - /// Simple interface for an ATLAS begin-of-run action - class IBeginRunAction - { - public: - /// Virtual destructor - virtual ~IBeginRunAction(){}; - /// Method called before simulating a G4 run - virtual void beginOfRun(const G4Run*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunActionTool.h deleted file mode 100644 index c03a518b222b93691b71a6e54d09a87617eb9a7d..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IBeginRunActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IBEGINRUNACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IBEGINRUNACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IBeginRunAction.h" - -namespace G4UA -{ - - /// @class IBeginRunActionTool - /// @brief Abstract interface for tools that manage ATLAS begin-of-run - /// custom actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IBeginRunActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IBeginRunAction* getBeginRunAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IBeginRunTool("G4UA::IBeginRunActionTool", 1, 0); - return iid_IBeginRunTool; - } - - }; // class IBeginRunActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventAction.h deleted file mode 100644 index 55f8bee9ca0cfa6527ee1bfca72876bfaf0b331c..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IENDEVENTACTION_H -#define G4ATLASINTERFACES__G4UA_IENDEVENTACTION_H - -// Forward declarations -class G4Event; - -namespace G4UA -{ - - /// Simple interface for an ATLAS end-of-event action - class IEndEventAction - { - public: - /// Virtual destructor - virtual ~IEndEventAction(){}; - /// Method called after simulating a G4 event - virtual void endOfEvent(const G4Event*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventActionTool.h deleted file mode 100644 index 33c1a451fa56e5c4cdeeb32793739fd0898dc908..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndEventActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IENDEVENTACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IENDEVENTACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IEndEventAction.h" - -namespace G4UA -{ - - /// @class IEndEventActionTool - /// @brief Abstract interface for tools that manage ATLAS end-of-event - /// custom actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IEndEventActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IEndEventAction* getEndEventAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IEndEventTool("G4UA::IEndEventActionTool", 1, 0); - return iid_IEndEventTool; - } - - }; // class IEndEventActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunAction.h deleted file mode 100644 index bd4e3c55d12b71329994b2104668d490dcfdf509..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IENDRUNACTION_H -#define G4ATLASINTERFACES__G4UA_IENDRUNACTION_H - -// Forward declarations -class G4Run; - -namespace G4UA -{ - - /// Simple interface for an ATLAS end-of-run action - class IEndRunAction - { - public: - /// Virtual destructor - virtual ~IEndRunAction(){}; - /// Method called after simulating a G4 run - virtual void endOfRun(const G4Run*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunActionTool.h deleted file mode 100644 index b96629eee9e55ff5859c4e479618e3af099570fa..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IEndRunActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IENDRUNACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IENDRUNACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IEndRunAction.h" - -namespace G4UA -{ - - /// @class IEndRunActionTool - /// @brief Abstract interface for tools that manage ATLAS end-of-run - /// custom actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IEndRunActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IEndRunAction* getEndRunAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IEndRunTool("G4UA::IEndRunActionTool", 1, 0); - return iid_IEndRunTool; - } - - }; // class IEndRunActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4EventActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4EventActionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..1c48ccbad71defee74ae9529052e8ea012101e70 --- /dev/null +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4EventActionTool.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4ATLASINTERFACES__G4UA_IG4EVENTACTIONTOOL_H +#define G4ATLASINTERFACES__G4UA_IG4EVENTACTIONTOOL_H + +// Framework includes +#include "GaudiKernel/IAlgTool.h" + +// Forward declarations +class G4UserEventAction; + +namespace G4UA +{ + + /// @class IG4EventActionTool + /// @brief Abstract interface for tools that construct ATLAS G4 event actions. + /// + /// @author Steve Farrell <Steven.Farrell@cern.ch> + /// + class IG4EventActionTool : virtual public IAlgTool + { + + public: + + /// Return the action for current thread. + virtual G4UserEventAction* getEventAction() = 0; + + /// Interface declaration + static const InterfaceID& interfaceID() { + static const InterfaceID iid_IG4EventTool("G4UA::IG4EventActionTool", 1, 0); + return iid_IG4EventTool; + } + + }; // class IG4EventActionTool + +} // namespace G4UA + +#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4RunActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4RunActionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..fc1df11a65ef15d7b27d35e0f07091e0cfb9f2f0 --- /dev/null +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4RunActionTool.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4ATLASINTERFACES__G4UA_IG4RUNACTIONTOOL_H +#define G4ATLASINTERFACES__G4UA_IG4RUNACTIONTOOL_H + +// Framework includes +#include "GaudiKernel/IAlgTool.h" + +// Forward declarations +class G4UserRunAction; + +namespace G4UA +{ + + /// @class IG4RunActionTool + /// @brief Abstract interface for tools that construct G4 run actions. + /// + /// @author Steve Farrell <Steven.Farrell@cern.ch> + /// + class IG4RunActionTool : virtual public IAlgTool + { + + public: + + /// Return the action for current thread. + virtual G4UserRunAction* getRunAction() = 0; + + /// Interface declaration + static const InterfaceID& interfaceID() { + static const InterfaceID iid_IG4RunTool("G4UA::IG4RunActionTool", 1, 0); + return iid_IG4RunTool; + } + + }; // class IG4RunActionTool + +} // namespace G4UA + +#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4StackingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4StackingActionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..32ec73bacced6172451860874cedc232e6d7b6e0 --- /dev/null +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4StackingActionTool.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4ATLASINTERFACES__G4UA_IG4STACKINGACTIONTOOL_H +#define G4ATLASINTERFACES__G4UA_IG4STACKINGACTIONTOOL_H + +// Framework includes +#include "GaudiKernel/IAlgTool.h" + +// Forward declarations +class G4UserStackingAction; + +namespace G4UA +{ + + /// @class IG4StackingActionTool + /// @brief Abstract interface for tools that construct G4 stacking actions. + /// + /// @author Steve Farrell <Steven.Farrell@cern.ch> + /// + class IG4StackingActionTool : virtual public IAlgTool + { + + public: + + /// @brief Return the action for current thread. + virtual G4UserStackingAction* getStackingAction() = 0; + + /// Interface declaration + static const InterfaceID& interfaceID() { + static const InterfaceID iid_IStepTool("G4UA::IG4StackingActionTool", 1, 0); + return iid_IStepTool; + } + + }; // class IG4StackingActionTool + +} // namespace G4UA + +#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4SteppingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4SteppingActionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0e8567f44f49e75ddbcbd508b3e40f8c4fde8e2e --- /dev/null +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4SteppingActionTool.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4ATLASINTERFACES__G4UA_IG4STEPPINGACTIONTOOL_H +#define G4ATLASINTERFACES__G4UA_IG4STEPPINGACTIONTOOL_H + +// Framework includes +#include "GaudiKernel/IAlgTool.h" + +// Forward declarations +class G4UserSteppingAction; + +namespace G4UA +{ + + /// @class IG4SteppingActionTool + /// @brief Abstract interface for tools that construct G4 stepping actions. + /// + /// @author Steve Farrell <Steven.Farrell@cern.ch> + /// + class IG4SteppingActionTool : virtual public IAlgTool + { + + public: + + /// @brief Return the action for current thread. + virtual G4UserSteppingAction* getSteppingAction() = 0; + + /// Interface declaration + static const InterfaceID& interfaceID() { + static const InterfaceID iid_IStepTool("G4UA::IG4SteppingActionTool", 1, 0); + return iid_IStepTool; + } + + }; // class IG4SteppingActionTool + +} // namespace G4UA + +#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4TrackingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4TrackingActionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..d0797153f8d1f14cd6f8d3bfd386f3acd003195a --- /dev/null +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IG4TrackingActionTool.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef G4ATLASINTERFACES__G4UA_IG4TRACKINGACTIONTOOL_H +#define G4ATLASINTERFACES__G4UA_IG4TRACKINGACTIONTOOL_H + +// Framework includes +#include "GaudiKernel/IAlgTool.h" + +// Forward declarations +class G4UserTrackingAction; + +namespace G4UA +{ + + /// @class IG4TrackingActionTool + /// @brief Abstract interface for tools that construct G4 tracking actions. + /// + /// @author Steve Farrell <Steven.Farrell@cern.ch> + /// + class IG4TrackingActionTool : virtual public IAlgTool + { + + public: + + /// Return the action for current thread. + virtual G4UserTrackingAction* getTrackingAction() = 0; + + /// Interface declaration + static const InterfaceID& interfaceID() { + static const InterfaceID iid_IG4TrkTool("G4UA::IG4TrackingActionTool", 1, 0); + return iid_IG4TrkTool; + } + + }; // class IG4TrackingActionTool + +} // namespace G4UA + +#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingAction.h deleted file mode 100644 index 9e8a0a47d2864c7bec35261e7a0f1f88a322a7f6..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IPOSTTRACKINGACTION_H -#define G4ATLASINTERFACES__G4UA_IPOSTTRACKINGACTION_H - -// Forward declarations -class G4Track; - -namespace G4UA -{ - - /// Simple interface for an ATLAS post-tracking action - class IPostTrackingAction - { - public: - /// Virtual destructor - virtual ~IPostTrackingAction(){}; - /// Method called before tracking a particle - virtual void postTracking(const G4Track*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingActionTool.h deleted file mode 100644 index 02fc98529ee505a9866d7197205fcee8dca5ab6b..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPostTrackingActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IPOSTTRACKINGACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IPOSTTRACKINGACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IPostTrackingAction.h" - -namespace G4UA -{ - - /// @class IPostTrackingActionTool - /// @brief Abstract interface for tools that manage ATLAS post-tracking - /// actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IPostTrackingActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IPostTrackingAction* getPostTrackingAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IPostTrkTool("G4UA::IPostTrackingActionTool", 1, 0); - return iid_IPostTrkTool; - } - - }; // class IPostTrackingActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingAction.h deleted file mode 100644 index 1ae57e2e8af5ef65b6dd922c4fad4a675d3941a3..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IPRETRACKINGACTION_H -#define G4ATLASINTERFACES__G4UA_IPRETRACKINGACTION_H - -// Forward declarations -class G4Track; - -namespace G4UA -{ - - /// Simple interface for an ATLAS pre-tracking action - class IPreTrackingAction - { - public: - /// Virtual destructor - virtual ~IPreTrackingAction(){}; - /// Method called before tracking a particle - virtual void preTracking(const G4Track*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingActionTool.h deleted file mode 100644 index 90f45d729cb9d1f4ab264e1288517d6dd6157eab..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPreTrackingActionTool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_IPRETRACKINGACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_IPRETRACKINGACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IPreTrackingAction.h" - -namespace G4UA -{ - - /// @class IPreTrackingActionTool - /// @brief Abstract interface for tools that manage ATLAS pre-tracking - /// actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IPreTrackingActionTool : virtual public IAlgTool - { - - public: - - /// Return the action for current thread. - virtual IPreTrackingAction* getPreTrackingAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IPreTrkTool("G4UA::IPreTrackingActionTool", 1, 0); - return iid_IPreTrkTool; - } - - }; // class IPreTrackingActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingAction.h deleted file mode 100644 index 54e6be2ae0fa4d7581dcc18ddbd471f9e89244f8..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingAction.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_ISTACKINGACTION_H -#define G4ATLASINTERFACES__G4UA_ISTACKINGACTION_H - -// Geant4 includes -#include "G4ClassificationOfNewTrack.hh" - -// Forward declarations -class G4Track; - -namespace G4UA -{ - - /// @class IStackingAction - /// @brief Simple interface class for an ATLAS stacking action. - /// Controls the stacks (i.e. priority queues) of G4Track objects. - /// Follows the methodology of the G4UserStackingAction: - /// http://www-geant4.kek.jp/lxr/source/event/include/G4UserStackingAction.hh - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IStackingAction - { - public: - /// Virtual destructor - virtual ~IStackingAction(){}; - - /// @brief Assigns a classification to a new track. - /// Result can be fUrgent, fWaiting, fPostpone, or fKill. - virtual G4ClassificationOfNewTrack classifyNewTrack(const G4Track* track) = 0; - - /// @brief Called when starting the next priority queue. - /// The waiting stack gets moved into the urgent stack. - virtual void newStage() = 0; - - /// @brief Invoked by stack manager at new event. - /// This method is possibly redundant so we could maybe remove it. - virtual void prepareNewEvent() = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingActionTool.h deleted file mode 100644 index ffad671818e666b77eb4cd765c864a6c9852eefa..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IStackingActionTool.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_ISTACKINGACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_ISTACKINGACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/IStackingAction.h" - -namespace G4UA -{ - - /// @class IStackingActionTool - /// @brief Abstract interface for tools that manage ATLAS stacking actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class IStackingActionTool : virtual public IAlgTool - { - - public: - - /// @brief Return the action for current thread. - virtual IStackingAction* getStackingAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IStepTool("G4UA::IStackingActionTool", 1, 0); - return iid_IStepTool; - } - - }; // class IStackingActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingAction.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingAction.h deleted file mode 100644 index 60acb6e184e4a98c498faf17a680db2c487e243d..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingAction.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_ISTEPPINGACTION_H -#define G4ATLASINTERFACES__G4UA_ISTEPPINGACTION_H - -// Forward declarations -class G4Step; - -namespace G4UA -{ - - /// Simple interface class for an ATLAS stepping action - class ISteppingAction - { - public: - /// Virtual destructor - virtual ~ISteppingAction(){}; - /// Method called at every step for processing - virtual void processStep(const G4Step*) = 0; - }; - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingActionTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingActionTool.h deleted file mode 100644 index 47769b4d037bfb7758558a58700ffb9d3ce06822..0000000000000000000000000000000000000000 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/ISteppingActionTool.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef G4ATLASINTERFACES__G4UA_ISTEPPINGACTIONTOOL_H -#define G4ATLASINTERFACES__G4UA_ISTEPPINGACTIONTOOL_H - -// Framework includes -#include "GaudiKernel/IAlgTool.h" - -// Local includes -#include "G4AtlasInterfaces/ISteppingAction.h" - -namespace G4UA -{ - - /// @class ISteppingActionTool - /// @brief Abstract interface for tools that manage ATLAS stepping actions. - /// - /// @author Steve Farrell <Steven.Farrell@cern.ch> - /// - class ISteppingActionTool : virtual public IAlgTool - { - - public: - - /// @brief Return the action for current thread. - virtual ISteppingAction* getSteppingAction() = 0; - - /// Interface declaration - static const InterfaceID& interfaceID() { - static const InterfaceID iid_IStepTool("G4UA::ISteppingActionTool", 1, 0); - return iid_IStepTool; - } - - }; // class ISteppingActionTool - -} // namespace G4UA - -#endif diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfig.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfig.py index eedebe58c15a950ee26b1e30cd6c1fd08a4cc633..75fc32cf155988e8611177d7d509115acd593b9d 100644 --- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfig.py +++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfig.py @@ -4,8 +4,8 @@ from AthenaCommon import CfgGetter,CfgMgr,Logging # Common methods to return default UserAction(Tool)s -# actions to be run at begin of run -def getDefaultBoRActions(): +# actions to be run at begin/end of run +def getDefaultRunActions(): from G4AtlasApps.SimFlags import simFlags defaultUA=[] #if not simFlags.ISFRun: @@ -14,17 +14,8 @@ def getDefaultBoRActions(): defaultUA+=['G4UA::StoppedParticleActionTool'] return defaultUA -# actions to be run at end of run -def getDefaultEoRActions(): - from G4AtlasApps.SimFlags import simFlags - from AthenaCommon.BeamFlags import jobproperties - defaultUA=[] - if hasattr(simFlags, 'StoppedParticleFile') and simFlags.StoppedParticleFile.statusOn: - defaultUA+=['G4UA::StoppedParticleActionTool'] - return defaultUA - # begin of event -def getDefaultBoEActions(): +def getDefaultEventActions(): from G4AtlasApps.SimFlags import simFlags from AthenaCommon.BeamFlags import jobproperties defaultUA=[] @@ -32,29 +23,17 @@ def getDefaultBoEActions(): defaultUA+=['G4UA::G4SimTimerTool'] defaultUA+=['G4UA::MCTruthSteppingActionTool'] defaultUA+=['G4UA::G4TrackCounterTool'] - + if hasattr(simFlags, 'CavernBG') and simFlags.CavernBG.statusOn and simFlags.CavernBG.get_Value() == 'Read': + defaultUA+=['G4UA::HitWrapperTool'] if jobproperties.Beam.beamType() == 'cosmics' and hasattr(simFlags, 'CavernBG') and not simFlags.CavernBG.statusOn: defaultUA+=['G4UA::CosmicPerigeeActionTool'] if hasattr(simFlags, 'StoppedParticleFile') and simFlags.StoppedParticleFile.statusOn: defaultUA+=['G4UA::StoppedParticleActionTool'] - if hasattr(simFlags, 'CalibrationRun') and simFlags.CalibrationRun() == 'LAr+Tile': - defaultUA+=['G4UA::CaloG4::CalibrationDefaultProcessingTool'] - return defaultUA - -# end of event -def getDefaultEoEActions(): - from G4AtlasApps.SimFlags import simFlags - from AthenaCommon.BeamFlags import jobproperties - defaultUA=[] - if not simFlags.ISFRun: - defaultUA+=['G4UA::G4SimTimerTool'] - if hasattr(simFlags, 'CavernBG') and simFlags.CavernBG.statusOn and simFlags.CavernBG.get_Value() == 'Read': - defaultUA+=['G4UA::HitWrapperTool'] - if hasattr(simFlags,'StoppedParticleFile') and simFlags.StoppedParticleFile.statusOn: - defaultUA+=['G4UA::StoppedParticleActionTool'] defaultUA+=['G4UA::G4CosmicFilterTool'] if jobproperties.Beam.beamType() == 'cosmics' and not simFlags.ISFRun: defaultUA+=['G4UA::G4CosmicFilterTool'] + if hasattr(simFlags, 'CalibrationRun') and simFlags.CalibrationRun() == 'LAr+Tile': + defaultUA+=['G4UA::CaloG4::CalibrationDefaultProcessingTool'] return defaultUA # stepping @@ -72,8 +51,8 @@ def getDefaultSteppingActions(): defaultUA+=['G4UA::PhotonKillerTool'] return defaultUA -# PreUserTracking -def getDefaultBoTActions(): +# tracking +def getDefaultTrackingActions(): from G4AtlasApps.SimFlags import simFlags defaultUA=[] if not simFlags.ISFRun: @@ -81,29 +60,12 @@ def getDefaultBoTActions(): defaultUA+=['G4UA::G4TrackCounterTool'] return defaultUA -# PostUserTracking -def getDefaultEoTActions(): - from G4AtlasApps.SimFlags import simFlags - defaultUA=[] - if not simFlags.ISFRun: - defaultUA+=['G4UA::AthenaTrackingActionTool'] - return defaultUA - # Stacking Classification def getDefaultStackingActions(): defaultUA=[] defaultUA+=['G4UA::AthenaStackingActionTool'] return defaultUA -# Stacking PrepareNewEvent -def getDefaultStaPrepareActions(): - return [] - -# Stacking NewStage -def getDefaultStaNewStageActions(): - return [] - - def getUserActionSvc(name="G4UA::UserActionSvc", **kwargs): """ Get the standard UA svc configurable with all default actions added. @@ -112,13 +74,15 @@ def getUserActionSvc(name="G4UA::UserActionSvc", **kwargs): from G4AtlasApps.SimFlags import simFlags - kwargs.setdefault('BeginRunActionTools', getDefaultBoRActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfRun']) - kwargs.setdefault('EndRunActionTools', getDefaultEoRActions()+simFlags.OptionalUserActionList.get_Value()['EndOfRun']) - kwargs.setdefault('BeginEventActionTools', getDefaultBoEActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfEvent']) - kwargs.setdefault('EndEventActionTools', getDefaultEoEActions()+simFlags.OptionalUserActionList.get_Value()['EndOfEvent']) - kwargs.setdefault('SteppingActionTools', getDefaultSteppingActions()+simFlags.OptionalUserActionList.get_Value()['Step']) - kwargs.setdefault('PreTrackingActionTools', getDefaultBoTActions()+simFlags.OptionalUserActionList.get_Value()['PreTracking']) - kwargs.setdefault('PostTrackingActionTools', getDefaultEoTActions()+simFlags.OptionalUserActionList.get_Value()['PostTracking']) + optionalActions = simFlags.OptionalUserActionList + kwargs.setdefault('RunActionTools', + getDefaultRunActions() + optionalActions.get_Value()['Run']) + kwargs.setdefault('EventActionTools', + getDefaultEventActions() + optionalActions.get_Value()['Event']) + kwargs.setdefault('SteppingActionTools', + getDefaultSteppingActions() + optionalActions.get_Value()['Step']) + kwargs.setdefault('TrackingActionTools', + getDefaultTrackingActions() + optionalActions.get_Value()['Tracking']) # no optional actions for stacking kwargs.setdefault('StackingActionTools', getDefaultStackingActions()) @@ -127,13 +91,11 @@ def getUserActionSvc(name="G4UA::UserActionSvc", **kwargs): def getCTBUserActionSvc(name="G4UA::CTBUserActionSvc", **kwargs): from G4AtlasApps.SimFlags import simFlags - bor = getDefaultBoRActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfRun'] - eor = getDefaultEoRActions()+simFlags.OptionalUserActionList.get_Value()['EndOfRun'] - boe = getDefaultBoEActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfEvent'] - eoe = getDefaultEoEActions()+simFlags.OptionalUserActionList.get_Value()['EndOfEvent'] - bot = getDefaultBoTActions()+simFlags.OptionalUserActionList.get_Value()['PreTracking'] - eot = getDefaultEoTActions()+simFlags.OptionalUserActionList.get_Value()['PostTracking'] - stepping = getDefaultSteppingActions()+simFlags.OptionalUserActionList.get_Value()['Step'] + optionalActions = simFlags.OptionalUserActionList + run = getDefaultRunActions() + optionalActions.get_Value()['Run'] + event = getDefaultEventActions() + optionalActions.get_Value()['Event'] + tracking = getDefaultTrackingActions() + optionalActions.get_Value()['Tracking'] + stepping = getDefaultSteppingActions() + optionalActions.get_Value()['Step'] stacking = getDefaultStackingActions() # FIXME: ADS these actions are not yet migrated to Hive @@ -143,17 +105,14 @@ def getCTBUserActionSvc(name="G4UA::CTBUserActionSvc", **kwargs): # if simFlags.LArTB_H6Step.statusOn: # if simFlags.LArTB_H6Step.get_Value(): # stepping+=['LArGeoH62004SteppingAction'] - # boe+=['RadLenNtuple'] + # event+=['RadLenNtuple'] # eoe+=['RadLenNtuple'] # stepping+=['RadLenNtuple'] - kwargs.setdefault('BeginRunActionTools', bor) - kwargs.setdefault('EndRunActionTools', eor) - kwargs.setdefault('BeginEventActionTools', boe) - kwargs.setdefault('EndEventActionTools', eoe) + kwargs.setdefault('RunActionTools', run) + kwargs.setdefault('EventActionTools', event) kwargs.setdefault('SteppingActionTools', stepping) - kwargs.setdefault('PreTrackingActionTools', bot) - kwargs.setdefault('PostTrackingActionTools', eot) + kwargs.setdefault('TrackingActionTools', tracking) kwargs.setdefault('StackingActionTools', stacking) # placeholder for more advanced config, if needed @@ -166,22 +125,22 @@ def getISFUserActionSvc(name="G4UA::ISFUserActionSvc", **kwargs): MCTruthUserAction = kwargs.pop('MCTruthUserAction',['ISFMCTruthUserActionTool']) from G4AtlasApps.SimFlags import simFlags - bor = getDefaultBoRActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfRun'] + PhysicsValidationUserAction - eor = getDefaultEoRActions()+simFlags.OptionalUserActionList.get_Value()['EndOfRun'] - boe = getDefaultBoEActions()+simFlags.OptionalUserActionList.get_Value()['BeginOfEvent'] + TrackProcessorUserAction + PhysicsValidationUserAction - eoe = getDefaultEoEActions()+simFlags.OptionalUserActionList.get_Value()['EndOfEvent'] + TrackProcessorUserAction + PhysicsValidationUserAction - bot = TrackProcessorUserAction + MCTruthUserAction + getDefaultBoTActions()+simFlags.OptionalUserActionList.get_Value()['PreTracking'] + PhysicsValidationUserAction - eot = TrackProcessorUserAction + MCTruthUserAction + getDefaultEoTActions()+simFlags.OptionalUserActionList.get_Value()['PostTracking'] - stepping = getDefaultSteppingActions()+simFlags.OptionalUserActionList.get_Value()['Step'] + TrackProcessorUserAction + PhysicsValidationUserAction + optionalActions = simFlags.OptionalUserActionList + run = (getDefaultRunActions() + optionalActions.get_Value()['Run'] + + PhysicsValidationUserAction) + event = (getDefaultEventActions() + optionalActions.get_Value()['Event'] + + TrackProcessorUserAction + PhysicsValidationUserAction) + tracking = (TrackProcessorUserAction + MCTruthUserAction + + getDefaultTrackingActions() + optionalActions.get_Value()['Tracking'] + + PhysicsValidationUserAction) + stepping = (getDefaultSteppingActions() + optionalActions.get_Value()['Step'] + + TrackProcessorUserAction + PhysicsValidationUserAction) stacking = getDefaultStackingActions() - kwargs.setdefault('BeginRunActionTools', bor) - kwargs.setdefault('EndRunActionTools', eor) - kwargs.setdefault('BeginEventActionTools', boe) - kwargs.setdefault('EndEventActionTools', eoe) + kwargs.setdefault('RunActionTools', run) + kwargs.setdefault('EventActionTools', event) kwargs.setdefault('SteppingActionTools', stepping) - kwargs.setdefault('PreTrackingActionTools', bot) - kwargs.setdefault('PostTrackingActionTools', eot) + kwargs.setdefault('TrackingActionTools', tracking) kwargs.setdefault('StackingActionTools', stacking) return CfgMgr.G4UA__UserActionSvc(name, **kwargs) @@ -234,12 +193,9 @@ def addAction(actionTool, roles, systemAction=False): from AthenaCommon.AppMgr import theApp, AthAppMgr, ServiceMgr - roleMap={'BeginOfRun': 'BeginRunActionTools', - 'EndOfRun': 'EndRunActionTools', - 'BeginOfEvent': 'BeginEventActionTools', - 'EndOfEvent': 'EndEventActionTools', - 'BeginOfTracking': 'PreTrackingActionTools', - 'EndOfTracking': 'PostTrackingActionTools', + roleMap={'Run': 'RunActionTools', + 'Event': 'EventActionTools', + 'Tracking': 'TrackingActionTools', 'Step': 'SteppingActionTools', 'Stack': 'StackingActionTools'} diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.cxx index 8f161365acb313c879e40d01f6d797e69ddd48c2..0922c2350f1bfa65bc0f7fa65f0351554c192d2f 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.cxx @@ -21,8 +21,8 @@ namespace G4UA void G4AtlasEventAction::BeginOfEventAction(const G4Event* event) { // Loop over my pre-actions and apply each one in turn - for(IBeginEventAction* action : m_beginEventActions){ - action->beginOfEvent(event); + for(auto action : m_eventActions){ + action->BeginOfEventAction(event); } } @@ -32,25 +32,17 @@ namespace G4UA void G4AtlasEventAction::EndOfEventAction(const G4Event* event) { // Loop over my post-actions and apply each one in turn - for(IEndEventAction* action : m_endEventActions){ - action->endOfEvent(event); + for(auto action : m_eventActions){ + action->EndOfEventAction(event); } } //--------------------------------------------------------------------------- // Add one action to the list //--------------------------------------------------------------------------- - void G4AtlasEventAction::addBeginEventAction(IBeginEventAction* action) + void G4AtlasEventAction::addEventAction(G4UserEventAction* action) { - m_beginEventActions.push_back(action); - } - - //--------------------------------------------------------------------------- - // Add one action to the list - //--------------------------------------------------------------------------- - void G4AtlasEventAction::addEndEventAction(IEndEventAction* action) - { - m_endEventActions.push_back(action); + m_eventActions.push_back(action); } } // namespace G4UA diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.h index 749ebac839e23b88c1c081833020f947384f678e..65d1b6b2bcf00a52ab85f18d7b14d402726926e2 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasEventAction.h @@ -11,10 +11,6 @@ // Geant4 includes #include "G4UserEventAction.hh" -// Local includes -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" - namespace G4UA { @@ -25,6 +21,8 @@ namespace G4UA /// Maintains a list of custom actions for the beginning and end of an event /// and when invoked by Geant4 will forward the call to each of them in turn. /// + /// @todo TODO lifetime management of wrapper actions. + /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4AtlasEventAction : public G4UserEventAction @@ -46,18 +44,12 @@ namespace G4UA void EndOfEventAction(const G4Event* event) override final; /// Add one action to the list - void addBeginEventAction(IBeginEventAction* action); - - /// Add one action to the list - void addEndEventAction(IEndEventAction* action); + void addEventAction(G4UserEventAction* action); private: - /// List of ATLAS begin-event actions - std::vector<IBeginEventAction*> m_beginEventActions; - - /// List of ATLAS end-event actions - std::vector<IEndEventAction*> m_endEventActions; + /// List of ATLAS event actions + std::vector<G4UserEventAction*> m_eventActions; }; // class G4AtlasEventAction diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.cxx index 4761cfee7b70631385a5744bad0db37f38c6b141..152bfd10cf46daa5953b4cd9ada48f4a6c3815f4 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.cxx @@ -21,8 +21,8 @@ namespace G4UA void G4AtlasRunAction::BeginOfRunAction(const G4Run* run) { // Loop over my pre-actions and apply each one in turn - for(IBeginRunAction* action : m_beginRunActions){ - action->beginOfRun(run); + for(auto action : m_runActions){ + action->BeginOfRunAction(run); } } @@ -32,25 +32,17 @@ namespace G4UA void G4AtlasRunAction::EndOfRunAction(const G4Run* run) { // Loop over my post-actions and apply each one in turn - for(IEndRunAction* action : m_endRunActions){ - action->endOfRun(run); + for(auto action : m_runActions){ + action->EndOfRunAction(run); } } //--------------------------------------------------------------------------- // Add one action to the list //--------------------------------------------------------------------------- - void G4AtlasRunAction::addBeginRunAction(IBeginRunAction* action) + void G4AtlasRunAction::addRunAction(G4UserRunAction* action) { - m_beginRunActions.push_back(action); - } - - //--------------------------------------------------------------------------- - // Add one action to the list - //--------------------------------------------------------------------------- - void G4AtlasRunAction::addEndRunAction(IEndRunAction* action) - { - m_endRunActions.push_back(action); + m_runActions.push_back(action); } } // namespace G4UA diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.h index 86919ab6fb059a2bb2dbace38828a8ba842e40a0..6fe73d30e1df1f08b662d15951b53489d0e8f46e 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasRunAction.h @@ -11,10 +11,6 @@ // Geant4 includes #include "G4UserRunAction.hh" -// Local includes -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" - namespace G4UA { @@ -25,6 +21,8 @@ namespace G4UA /// Maintains a list of custom actions for the beginning and end of an run /// and when invoked by Geant4 will forward the call to each of them in turn. /// + /// @todo TODO lifetime management of wrapper actions. + /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4AtlasRunAction : public G4UserRunAction @@ -46,18 +44,12 @@ namespace G4UA void EndOfRunAction(const G4Run* run) override final; /// Add one action to the list - void addBeginRunAction(IBeginRunAction* action); - - /// Add one action to the list - void addEndRunAction(IEndRunAction* action); + void addRunAction(G4UserRunAction* action); private: - /// List of ATLAS begin-run actions - std::vector<IBeginRunAction*> m_beginRunActions; - - /// List of ATLAS end-run actions - std::vector<IEndRunAction*> m_endRunActions; + /// List of ATLAS run actions + std::vector<G4UserRunAction*> m_runActions; }; // class G4AtlasRunAction diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.cxx index 60f13c031b15c38235b897182a435c8b0940202f..a9f99e61ce5d51e148085687aadf3041e97347d9 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.cxx @@ -4,7 +4,6 @@ // Local includes #include "G4AtlasStackingAction.h" -#include "G4AtlasInterfaces/IStackingAction.h" namespace G4UA { @@ -26,8 +25,8 @@ namespace G4UA // TODO: decide how to properly handle multiple stacking action results. // Maybe we just need to forbid it. See ATLASSIM-2421. G4ClassificationOfNewTrack classification = fUrgent; - for(IStackingAction* action : m_actions){ - classification = action->classifyNewTrack(track); + for(auto action : m_actions){ + classification = action->ClassifyNewTrack(track); if(classification == fKill) return fKill; } return classification; @@ -39,8 +38,8 @@ namespace G4UA void G4AtlasStackingAction::NewStage() { // Loop over my actions and apply each one in turn - for(IStackingAction* action : m_actions){ - action->newStage(); + for(auto action : m_actions){ + action->NewStage(); } } @@ -50,15 +49,15 @@ namespace G4UA void G4AtlasStackingAction::PrepareNewEvent() { // Loop over my actions and apply each one in turn - for(IStackingAction* action : m_actions){ - action->prepareNewEvent(); + for(auto action : m_actions){ + action->PrepareNewEvent(); } } //--------------------------------------------------------------------------- // Add one action to the action list //--------------------------------------------------------------------------- - void G4AtlasStackingAction::addAction(IStackingAction* action) + void G4AtlasStackingAction::addAction(G4UserStackingAction* action) { m_actions.push_back(action); } diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.h index be581251ee71c0c43d7c102915ed779975fdf1e1..a8623f2d5908038a3594696b8b7e1100c8d93551 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasStackingAction.h @@ -15,16 +15,14 @@ namespace G4UA { - // Forward declarations - class IStackingAction; - - /// @class G4AtlasStackingAction /// @brief Atlas subclass of the G4 stacking action. /// /// This object maintains a list of custom actions and when invoked by /// Geant4 will forward the call to each of them in turn. /// + /// @todo TODO lifetime management of wrapper actions. + /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4AtlasStackingAction : public G4UserStackingAction @@ -50,12 +48,12 @@ namespace G4UA void PrepareNewEvent() override final; /// @brief Add one action to the list - void addAction(IStackingAction* action); + void addAction(G4UserStackingAction* action); private: /// List of ATLAS stacking actions - std::vector<IStackingAction*> m_actions; + std::vector<G4UserStackingAction*> m_actions; }; // class G4AtlasStackingAction diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.cxx index 72ab2b6a9bb098f0f99b0c606e4641ba458f0942..896dc01ae0ee695571851054daa6ef50c7f600d8 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.cxx @@ -4,7 +4,6 @@ // Local includes #include "G4AtlasSteppingAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" namespace G4UA { @@ -22,15 +21,15 @@ namespace G4UA void G4AtlasSteppingAction::UserSteppingAction(const G4Step* step) { // Loop over my actions and apply each one in turn - for(ISteppingAction* action : m_actions){ - action->processStep(step); + for(auto action : m_actions){ + action->UserSteppingAction(step); } } //--------------------------------------------------------------------------- // Add one action to the action list //--------------------------------------------------------------------------- - void G4AtlasSteppingAction::addAction(ISteppingAction* action) + void G4AtlasSteppingAction::addAction(G4UserSteppingAction* action) { m_actions.push_back(action); } diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.h index d8f902d9d12f8c62120f82b168bc7408f5355980..d2eaa567dacc7c3397171fa4edd95800e8037ffc 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSteppingAction.h @@ -15,16 +15,14 @@ namespace G4UA { - // Forward declarations - class ISteppingAction; - - /// @class G4AtlasSteppingAction /// @brief Atlas subclass of the G4 stepping action. /// /// This object maintains a list of custom actions and when invoked by /// Geant4 will forward the call to each of them in turn. /// + /// @todo TODO lifetime management of wrapper actions. + /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4AtlasSteppingAction : public G4UserSteppingAction @@ -41,12 +39,12 @@ namespace G4UA void UserSteppingAction(const G4Step* step) override final; /// @brief Add one action to the list - void addAction(ISteppingAction* action); + void addAction(G4UserSteppingAction* action); private: /// List of ATLAS stepping actions - std::vector<ISteppingAction*> m_actions; + std::vector<G4UserSteppingAction*> m_actions; }; // class G4AtlasSteppingAction diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.cxx index c3f6afebfb09c6630a490d4883316ac0510503a6..7e661d54914d0b5e1abeba580912b7aeaeee4edd 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.cxx @@ -21,8 +21,8 @@ namespace G4UA void G4AtlasTrackingAction::PreUserTrackingAction(const G4Track* trk) { // Loop over my pre-actions and apply each one in turn - for(IPreTrackingAction* action : m_preTrackActions){ - action->preTracking(trk); + for(auto action : m_trackActions){ + action->PreUserTrackingAction(trk); } } @@ -32,25 +32,17 @@ namespace G4UA void G4AtlasTrackingAction::PostUserTrackingAction(const G4Track* trk) { // Loop over my post-actions and apply each one in turn - for(IPostTrackingAction* action : m_postTrackActions){ - action->postTracking(trk); + for(auto action : m_trackActions){ + action->PostUserTrackingAction(trk); } } //--------------------------------------------------------------------------- // Add one action to the list //--------------------------------------------------------------------------- - void G4AtlasTrackingAction::addPreTrackAction(IPreTrackingAction* action) + void G4AtlasTrackingAction::addTrackAction(G4UserTrackingAction* action) { - m_preTrackActions.push_back(action); - } - - //--------------------------------------------------------------------------- - // Add one action to the list - //--------------------------------------------------------------------------- - void G4AtlasTrackingAction::addPostTrackAction(IPostTrackingAction* action) - { - m_postTrackActions.push_back(action); + m_trackActions.push_back(action); } } // namespace G4UA diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.h index b7c67958e8cd9219b8da073adae82d30c4f1bc12..2bd6a136f81a1bf629e13e6636e1bdab8e952dfd 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasTrackingAction.h @@ -11,11 +11,6 @@ // Geant4 includes #include "G4UserTrackingAction.hh" -// Local includes -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" - - namespace G4UA { @@ -25,6 +20,8 @@ namespace G4UA /// Maintains a list of custom tracking actions and when invoked by /// Geant4 will forard the call to each of them in turn. /// + /// @todo TODO lifetime management of wrapper actions. + /// /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4AtlasTrackingAction : public G4UserTrackingAction @@ -46,18 +43,12 @@ namespace G4UA void PostUserTrackingAction(const G4Track* trk) override final; /// @brief Add one action to the list - void addPreTrackAction(IPreTrackingAction* action); - - /// @brief Add one action to the list - void addPostTrackAction(IPostTrackingAction* action); + void addTrackAction(G4UserTrackingAction* action); private: - /// List of ATLAS pre-tracking actions - std::vector<IPreTrackingAction*> m_preTrackActions; - - /// List of ATLAS post-tracking actions - std::vector<IPostTrackingAction*> m_postTrackActions; + /// List of ATLAS actions + std::vector<G4UserTrackingAction*> m_trackActions; }; // class G4AtlasTrackingAction diff --git a/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.cxx b/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.cxx index daef32127b8797ebb8dda038c3a8a5364f169ddc..6d3fbe28e5d3a14232dfd5220730908dbb23bb91 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.cxx @@ -24,30 +24,16 @@ namespace G4UA UserActionSvc::UserActionSvc(const std::string& name, ISvcLocator* pSvcLocator) : AthService(name, pSvcLocator), - m_beginRunActionTools(), - m_endRunActionTools(), - m_beginEventActionTools(), - m_endEventActionTools(), + m_runActionTools(), + m_eventActionTools(), m_stackingActionTools(), - m_preTrackingActionTools(), - m_postTrackingActionTools(), + m_trackingActionTools(), m_steppingActionTools() - //m_beginRunActionTools(this), - //m_endRunActionTools(this), - //m_beginEventActionTools(this), - //m_endEventActionTools(this), - //m_stackingActionTools(this), - //m_preTrackingActionTools(this), - //m_postTrackingActionTools(this), - //m_steppingActionTools(this) { - declareProperty("BeginRunActionTools", m_beginRunActionTools); - declareProperty("EndRunActionTools", m_endRunActionTools); - declareProperty("BeginEventActionTools", m_beginEventActionTools); - declareProperty("EndEventActionTools", m_endEventActionTools); + declareProperty("RunActionTools", m_runActionTools); + declareProperty("EventActionTools", m_eventActionTools); declareProperty("StackingActionTools", m_stackingActionTools); - declareProperty("PreTrackingActionTools", m_preTrackingActionTools); - declareProperty("PostTrackingActionTools", m_postTrackingActionTools); + declareProperty("TrackingActionTools", m_trackingActionTools); declareProperty("SteppingActionTools", m_steppingActionTools); } @@ -58,45 +44,30 @@ namespace G4UA { ATH_MSG_INFO("Initializing. user action tools of each type, in order of execution:"); - ATH_MSG_INFO(" begin-run: " << m_beginRunActionTools.size()); - for(auto& action : m_beginRunActionTools) + ATH_MSG_INFO(" run: " << m_runActionTools.size()); + for(auto& action : m_runActionTools) ATH_MSG_INFO(" -> " << action.name()); - ATH_MSG_INFO(" end-run: " << m_endRunActionTools.size()); - for(auto& action : m_endRunActionTools) + ATH_MSG_INFO(" event: " << m_eventActionTools.size()); + for(auto& action : m_eventActionTools) ATH_MSG_INFO(" -> " << action.name()); - ATH_MSG_INFO(" begin-event: " << m_beginEventActionTools.size()); - for(auto& action : m_beginEventActionTools) - ATH_MSG_INFO(" -> " << action.name()); - - ATH_MSG_INFO(" end-event: " << m_endEventActionTools.size()); - for(auto& action : m_endEventActionTools) - ATH_MSG_INFO(" -> " << action.name()); - - ATH_MSG_INFO(" stacking: " << m_stackingActionTools.size()); + ATH_MSG_INFO(" stacking: " << m_stackingActionTools.size()); for(auto& action : m_stackingActionTools) ATH_MSG_INFO(" -> " << action.name()); - ATH_MSG_INFO(" pre-tracking: " << m_preTrackingActionTools.size()); - for(auto& action : m_preTrackingActionTools) + ATH_MSG_INFO(" tracking: " << m_trackingActionTools.size()); + for(auto& action : m_trackingActionTools) ATH_MSG_INFO(" -> " << action.name()); - ATH_MSG_INFO(" post-tracking: " << m_postTrackingActionTools.size()); - for(auto& action : m_postTrackingActionTools) - ATH_MSG_INFO(" -> " << action.name()); - - ATH_MSG_INFO(" stepping: " << m_steppingActionTools.size()); + ATH_MSG_INFO(" stepping: " << m_steppingActionTools.size()); for(auto& action : m_steppingActionTools) ATH_MSG_INFO(" -> " << action.name()); - ATH_CHECK( m_beginRunActionTools.retrieve() ); - ATH_CHECK( m_endRunActionTools.retrieve() ); - ATH_CHECK( m_beginEventActionTools.retrieve() ); - ATH_CHECK( m_endEventActionTools.retrieve() ); + ATH_CHECK( m_runActionTools.retrieve() ); + ATH_CHECK( m_eventActionTools.retrieve() ); ATH_CHECK( m_stackingActionTools.retrieve() ); - ATH_CHECK( m_preTrackingActionTools.retrieve() ); - ATH_CHECK( m_postTrackingActionTools.retrieve() ); + ATH_CHECK( m_trackingActionTools.retrieve() ); ATH_CHECK( m_steppingActionTools.retrieve() ); return StatusCode::SUCCESS; @@ -143,13 +114,9 @@ namespace G4UA return StatusCode::FAILURE; } auto runAction = CxxUtils::make_unique<G4AtlasRunAction>(); - // Assign begin-run plugins - for(auto& beginRunTool : m_beginRunActionTools) - runAction->addBeginRunAction( beginRunTool->getBeginRunAction() ); - // Assign end-run plugins - for(auto& endRunTool : m_endRunActionTools) - runAction->addEndRunAction( endRunTool->getEndRunAction() ); - + // Assign run plugins + for(auto& runTool : m_runActionTools) + runAction->addRunAction( runTool->getRunAction() ); G4RunManager::GetRunManager()->SetUserAction( runAction.get() ); m_runActions.set( std::move(runAction) ); @@ -159,12 +126,9 @@ namespace G4UA return StatusCode::FAILURE; } auto eventAction = CxxUtils::make_unique<G4AtlasEventAction>(); - // Assign begin-event plugins - for(auto& beginEventTool : m_beginEventActionTools) - eventAction->addBeginEventAction( beginEventTool->getBeginEventAction() ); - // Assign end-event plugins - for(auto& endEventTool : m_endEventActionTools) - eventAction->addEndEventAction( endEventTool->getEndEventAction() ); + // Assign event plugins + for(auto& eventTool : m_eventActionTools) + eventAction->addEventAction( eventTool->getEventAction() ); G4RunManager::GetRunManager()->SetUserAction( eventAction.get() ); m_eventActions.set( std::move(eventAction) ); @@ -188,12 +152,9 @@ namespace G4UA return StatusCode::FAILURE; } auto trackAction = CxxUtils::make_unique<G4AtlasTrackingAction>(); - // Assign pre-tracking plugins - for(auto& preTrackTool : m_preTrackingActionTools) - trackAction->addPreTrackAction( preTrackTool->getPreTrackingAction() ); - // Assign post-tracking plugins - for(auto& postTrackTool : m_postTrackingActionTools) - trackAction->addPostTrackAction( postTrackTool->getPostTrackingAction() ); + // Assign tracking plugins + for(auto& trackTool : m_trackingActionTools) + trackAction->addTrackAction( trackTool->getTrackingAction() ); G4RunManager::GetRunManager()->SetUserAction( trackAction.get() ); m_trackingActions.set( std::move(trackAction) ); diff --git a/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.h b/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.h index c6d576928af347045e2ec914c773282fd30b3e6b..7053a23fdb1264778351e00b2e2bbd81361df2bb 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/UserActionSvc.h @@ -20,14 +20,11 @@ #include "G4AtlasStackingAction.h" #include "G4AtlasTrackingAction.h" #include "G4AtlasSteppingAction.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IStackingActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4StackingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasInterfaces/IUserActionSvc.h" #include "G4AtlasTools/ThreadActionHolder.h" @@ -64,22 +61,16 @@ namespace G4UA /// @name Handles to ATLAS action tools /// @{ - /// Begin-run action tools - ToolHandleArray<IBeginRunActionTool> m_beginRunActionTools; - /// End-run action tools - ToolHandleArray<IEndRunActionTool> m_endRunActionTools; - /// Begin-event action tools - ToolHandleArray<IBeginEventActionTool> m_beginEventActionTools; - /// End-event action tools - ToolHandleArray<IEndEventActionTool> m_endEventActionTools; + /// Run action tools + ToolHandleArray<IG4RunActionTool> m_runActionTools; + /// Event action tools + ToolHandleArray<IG4EventActionTool> m_eventActionTools; /// Stacking action tools - ToolHandleArray<IStackingActionTool> m_stackingActionTools; - /// Pre-tracking action tools - ToolHandleArray<IPreTrackingActionTool> m_preTrackingActionTools; - /// Post-tracking action tools - ToolHandleArray<IPostTrackingActionTool> m_postTrackingActionTools; + ToolHandleArray<IG4StackingActionTool> m_stackingActionTools; + /// Tracking action tools + ToolHandleArray<IG4TrackingActionTool> m_trackingActionTools; /// Stepping action tools - ToolHandleArray<ISteppingActionTool> m_steppingActionTools; + ToolHandleArray<IG4SteppingActionTool> m_steppingActionTools; /// @} diff --git a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.StepVal.py b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.StepVal.py index 2930f5eb29e5f36cecb5ca3993ff592ba90d5fb1..51a411dfcb40be6b9628ee8479a0d9eb0beafa6e 100644 --- a/Simulation/G4Atlas/G4AtlasTests/share/postInclude.StepVal.py +++ b/Simulation/G4Atlas/G4AtlasTests/share/postInclude.StepVal.py @@ -6,6 +6,6 @@ if not hasattr(ServiceMgr, 'THistSvc'): ServiceMgr.THistSvc.Output += ["truth DATAFILE='stepping.root' OPT='NEW'"]; from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::SteppingValidationTool',['BeginOfRun','EndOfEvent','BeginOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::SteppingValidationTool',['Run','Event','Step']) diff --git a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.cxx b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.cxx index 4f4fbf03064d4943aa973c94ecf8e8c9f787bb8d..b5962e438564637bd7aea28a12dc56282a1885ac 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.cxx +++ b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.cxx @@ -21,7 +21,7 @@ namespace G4UA{ - void SteppingValidation::beginOfRun(const G4Run*){ + void SteppingValidation::BeginOfRunAction(const G4Run*){ m_path += "Stepping/"; // Set up all the histograms... @@ -45,7 +45,7 @@ namespace G4UA{ } - void SteppingValidation::endOfEvent(const G4Event*){ + void SteppingValidation::EndOfEventAction(const G4Event*){ // Fill lateral energy spread if (m_nsec>0){ m_latPhi->Fill( std::sqrt( m_dp2/m_nsec - std::pow(m_dp/m_nsec,2) ) ); @@ -53,14 +53,14 @@ namespace G4UA{ } } - void SteppingValidation::beginOfEvent(const G4Event*){ + void SteppingValidation::BeginOfEventAction(const G4Event*){ m_prim=m_sec=0; m_primH=m_primF=0; m_dh=m_dh2=m_dp=m_dp2=0; m_nsec=0; } - void SteppingValidation::processStep(const G4Step* aStep){ + void SteppingValidation::UserSteppingAction(const G4Step* aStep){ // Fill process type m_stepProc->Fill(aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType()); diff --git a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.h b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.h index 6abd452c894ae9ff5e33a25f18942e921f4d2a37..960fa30e75c27dc861f40281788c65b166a19ac3 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.h +++ b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidation.h @@ -17,15 +17,14 @@ class G4Track; // User action to do some basic step-based validation of G4 -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" namespace G4UA{ class SteppingValidation: - public IBeginRunAction, public IEndEventAction, public IBeginEventAction, public ISteppingAction, public SimTestHisto + public G4UserRunAction, public G4UserEventAction, public G4UserSteppingAction, public SimTestHisto { public: @@ -37,10 +36,10 @@ namespace G4UA{ m_primH(0),m_primF(0),m_dh(0),m_dh2(0),m_dp(0),m_dp2(0),m_nsec(0) {}; - virtual void beginOfRun(const G4Run*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: TH1 *m_stepL, *m_stepProc, *m_mscAngle, *m_stepELoss, *m_secE, *m_latPhi, *m_latEta; TH2 *m_EvsR; diff --git a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.cxx index 0b3878904f68facf61d4108f5318349e774d3352..cdab8dacf4a1974204745d7a15195de55686eadd 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.cxx +++ b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.cxx @@ -15,23 +15,18 @@ namespace G4UA{ } StatusCode SteppingValidationTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.h b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.h index e196c0708ad2f4d486f2f8ca84f137c6620be918..ff4c848c3422190d07fb9ab39c1038598bb2a668 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.h +++ b/Simulation/G4Atlas/G4AtlasTests/src/SteppingValidationTool.h @@ -4,10 +4,9 @@ #ifndef G4ATLASTESTS_G4UA__STEPPINGVALIDATIONTOOL_H #define G4ATLASTESTS_G4UA__STEPPINGVALIDATIONTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "SteppingValidation.h" namespace G4UA{ @@ -21,24 +20,21 @@ namespace G4UA{ class SteppingValidationTool: public ActionToolBase<SteppingValidation>, - public IBeginRunActionTool, public IEndEventActionTool, public IBeginEventActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4EventActionTool, public IG4SteppingActionTool { public: /// standard tool ctor SteppingValidationTool(const std::string& type, const std::string& name,const IInterface* parent); - /// gets the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// gets the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// gets the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + /// gets the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + /// gets the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// gets the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudi interface handling virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h index 5276dbd7d5bb0637866f3a97317a38bcc5c55b17..fe5f189bd3098fa35b1cb0c4a5c226c690842625 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h @@ -2,66 +2,64 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// an action to query the SD responsible for the storing of the -// TrackRecords *at the entrance of the ID* if no track it aborts -// the event - jamie boyd 15 nov 06 +#ifndef G4COSMICFILTER_G4CosmicAndFilter_H +#define G4COSMICFILTER_G4CosmicAndFilter_H - -#ifndef G4CosmicAndFilter_H -#define G4CosmicAndFilter_H - - -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserEventAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" -namespace G4UA{ - - -class G4CosmicAndFilter: - public AthMessaging, public IEndEventAction - { - - public: - - struct Config - { - std::string collectionName="TRTBarrelEntryLayer"; - std::string collectionName2="CaloEntryLayer"; - }; - - G4CosmicAndFilter(const Config& config); - - struct Report - { - int ntot=0; - int npass=0; - - void merge(const Report& rep){ - ntot+=rep.ntot; - npass+=rep.npass; - } - }; - - const Report& getReport() const - { return m_report; } - - virtual void endOfEvent(const G4Event*) override; - private: - Config m_config; - Report m_report; - - typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; - /// Pointer to StoreGate (event store by default) - mutable StoreGateSvc_t m_evtStore; - /// Pointer to StoreGate (detector store by default) - mutable StoreGateSvc_t m_detStore; - -}; // class G4CosmicFilter - - -} // namespace G4UA +namespace G4UA +{ + + /// @class G4CosmicAndFilter + /// an action to query the SD responsible for the storing of the + /// TrackRecords *at the entrance of the ID* if no track it aborts + /// the event - jamie boyd 15 nov 06 + /// + class G4CosmicAndFilter: public AthMessaging, public G4UserEventAction + { + + public: + + struct Config + { + std::string collectionName = "TRTBarrelEntryLayer"; + std::string collectionName2 = "CaloEntryLayer"; + }; + + G4CosmicAndFilter(const Config& config); + + struct Report + { + int ntot = 0; + int npass = 0; + + void merge(const Report& rep){ + ntot += rep.ntot; + npass += rep.npass; + } + }; + + const Report& getReport() const + { return m_report; } + + virtual void EndOfEventAction(const G4Event*) override; + + private: + Config m_config; + Report m_report; + + typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; + /// Pointer to StoreGate (event store by default) + mutable StoreGateSvc_t m_evtStore; + /// Pointer to StoreGate (detector store by default) + mutable StoreGateSvc_t m_detStore; + + }; // class G4CosmicFilter + +} // namespace G4UA #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilterTool.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilterTool.h index 1b6899986e189a3990fadced7d6433d80aa2f47b..c6f14c7242bf945d092bb4e521c5978cdb8b12d7 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilterTool.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilterTool.h @@ -2,36 +2,40 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef G4COSMICFILTER_G4UA__G4COSMICANDFILTERTOOL_H -#define G4COSMICFILTER_G4UA__G4COSMICANDFILTERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#ifndef G4COSMICFILTER_G4UA__G4COSMICANDFILTERTOOL_H +#define G4COSMICFILTER_G4UA__G4COSMICANDFILTERTOOL_H + +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4CosmicFilter/G4CosmicAndFilter.h" -namespace G4UA{ - - class G4CosmicAndFilterTool: - public ActionToolBaseReport<G4CosmicAndFilter>, - public IEndEventActionTool - { - +namespace G4UA +{ + + class G4CosmicAndFilterTool: public ActionToolBaseReport<G4CosmicAndFilter>, + public IG4EventActionTool + { + public: G4CosmicAndFilterTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; virtual StatusCode finalize() override; protected: + virtual std::unique_ptr<G4CosmicAndFilter> makeAction() override final; private: + G4CosmicAndFilter::Config m_config; - }; // class G4CosmicAndFilterTool - - -} // namespace G4UA + + }; // class G4CosmicAndFilterTool + +} // namespace G4UA + #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h old mode 100755 new mode 100644 index 51970ab7c5ff5dd0e75117d791a775fa066bf9bd..82bab432ee77d9fe3e4d659850790b76a0445c39 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h @@ -2,69 +2,65 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// an action to query the SD responsible for the storing of the -// TrackRecords *at the entrance of the ID* if no track it aborts -// the event - jamie boyd 15 nov 06 +#ifndef G4COSMICFILTER_G4CosmicFilter_H +#define G4COSMICFILTER_G4CosmicFilter_H - -#ifndef G4CosmicFilter_H -#define G4CosmicFilter_H - - -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserEventAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" -namespace G4UA{ - class G4CosmicFilter: - public AthMessaging, public IEndEventAction +namespace G4UA +{ + + /// @class G4CosmicFilter + /// an action to query the SD responsible for the storing of the + /// TrackRecords *at the entrance of the ID* if no track it aborts + /// the event - jamie boyd 15 nov 06 + class G4CosmicFilter: public AthMessaging, public G4UserEventAction { - - public: - - struct Config - { - std::string collectionName="CaloEntryLayer"; - int PDGId=0; - double ptMin=-1; - double ptMax=-1; - }; - - struct Report - { - - int ntot=0; - int npass=0; - void merge(const Report& rep){ - ntot+=rep.ntot; - ntot+=rep.npass; - } - }; - - G4CosmicFilter(const Config& config); - const Report& getReport() const - { return m_report; } - - virtual void endOfEvent(const G4Event*) override; - - private: - Config m_config; - Report m_report; - - typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; - /// Pointer to StoreGate (event store by default) - mutable StoreGateSvc_t m_evtStore; - /// Pointer to StoreGate (detector store by default) - mutable StoreGateSvc_t m_detStore; - - }; // class G4CosmicFilter - - -} // namespace G4UA + public: + + struct Config + { + std::string collectionName = "CaloEntryLayer"; + int PDGId = 0; + double ptMin = -1; + double ptMax = -1; + }; + + struct Report + { + int ntot = 0; + int npass = 0; + void merge(const Report& rep){ + ntot += rep.ntot; + ntot += rep.npass; + } + }; + + G4CosmicFilter(const Config& config); + const Report& getReport() const + { return m_report; } + + virtual void EndOfEventAction(const G4Event*) override; + + private: + + Config m_config; + Report m_report; + + typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; + /// Pointer to StoreGate (event store by default) + mutable StoreGateSvc_t m_evtStore; + /// Pointer to StoreGate (detector store by default) + mutable StoreGateSvc_t m_detStore; + + }; // class G4CosmicFilter +} // namespace G4UA #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilterTool.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilterTool.h index b99cfa51a6d2a85ef3de7e6dbf8f9ea1ff627ec5..1fa48ee029b0638b12a63ac746d0a6ed4fcbd080 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilterTool.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilterTool.h @@ -2,32 +2,40 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef G4COSMICFILTER_G4UA__G4COSMICFILTERTOOL_H -#define G4COSMICFILTER_G4UA__G4COSMICFILTERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#ifndef G4COSMICFILTER_G4UA__G4COSMICFILTERTOOL_H +#define G4COSMICFILTER_G4UA__G4COSMICFILTERTOOL_H + +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4CosmicFilter/G4CosmicFilter.h" -namespace G4UA{ +namespace G4UA +{ + + class G4CosmicFilterTool: public ActionToolBaseReport<G4CosmicFilter>, + public IG4EventActionTool + { + + public: + + G4CosmicFilterTool(const std::string& type, const std::string& name,const IInterface* parent); + + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + + virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; + virtual StatusCode finalize() override; + + protected: + + virtual std::unique_ptr<G4CosmicFilter> makeAction() override final; -class G4CosmicFilterTool: -public ActionToolBaseReport<G4CosmicFilter>, - public IEndEventActionTool - { + private: -public: -G4CosmicFilterTool(const std::string& type, const std::string& name,const IInterface* parent); -virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } -virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; -virtual StatusCode finalize() override; -protected: -virtual std::unique_ptr<G4CosmicFilter> makeAction() override final; -private: -G4CosmicFilter::Config m_config; + G4CosmicFilter::Config m_config; -}; // class G4CosmicFilterTool + }; // class G4CosmicFilterTool +} // namespace G4UA -} // namespace G4UA #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h index 5d88e28c654f38a8fceb56df0932fe15ff372e10..e85859c8df37e095b9bac19ee2072cdd3467cce7 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h @@ -2,68 +2,64 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// an action to query the SD responsible for the storing of the -// TrackRecords *at the entrance of the ID* if no track it aborts -// the event - jamie boyd 15 nov 06 +#ifndef G4COSMICFILTER_G4CosmicOrFilter_H +#define G4COSMICFILTER_G4CosmicOrFilter_H - -#ifndef G4CosmicOrFilter_H -#define G4CosmicOrFilter_H - - -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserEventAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" -namespace G4UA{ - +namespace G4UA +{ - class G4CosmicOrFilter: - public AthMessaging, public IEndEventAction + /// @class G4CosmicOrFilter + /// an action to query the SD responsible for the storing of the + /// TrackRecords *at the entrance of the ID* if no track it aborts + /// the event - jamie boyd 15 nov 06 + class G4CosmicOrFilter : public AthMessaging, public G4UserEventAction { - - public: - - struct Config - { - std::string collectionName="TRTBarrelEntryLayer"; - std::string collectionName2="CaloEntryLayer"; - std::string collectionName3="TRTBarrelEntryLayer"; - }; - - G4CosmicOrFilter(const Config& config); - - struct Report - { - int ntot=0; - int npass=0; - void merge(const Report& rep){ - ntot+=rep.ntot; - npass+=rep.npass; - } - }; - - const Report& getReport() const - { return m_report; } - - virtual void endOfEvent(const G4Event*) override; - private: - Config m_config; - Report m_report; - - typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; - /// Pointer to StoreGate (event store by default) - mutable StoreGateSvc_t m_evtStore; - /// Pointer to StoreGate (detector store by default) - mutable StoreGateSvc_t m_detStore; - -}; // class G4CosmicOrFilter - - -} // namespace G4UA + public: + + struct Config + { + std::string collectionName = "TRTBarrelEntryLayer"; + std::string collectionName2 = "CaloEntryLayer"; + std::string collectionName3 = "TRTBarrelEntryLayer"; + }; + + G4CosmicOrFilter(const Config& config); + + struct Report + { + int ntot = 0; + int npass = 0; + void merge(const Report& rep){ + ntot += rep.ntot; + npass += rep.npass; + } + }; + + const Report& getReport() const + { return m_report; } + + virtual void EndOfEventAction(const G4Event*) override; + + private: + + Config m_config; + Report m_report; + + typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; + /// Pointer to StoreGate (event store by default) + mutable StoreGateSvc_t m_evtStore; + /// Pointer to StoreGate (detector store by default) + mutable StoreGateSvc_t m_detStore; + + }; // class G4CosmicOrFilter +} // namespace G4UA #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilterTool.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilterTool.h index 3bb7b69b5437f1fbd5095a16b37b9d237798673a..2aa2662733f8e621b32cab656c4728b8ca873950 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilterTool.h +++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilterTool.h @@ -2,33 +2,33 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef G4COSMICFILTER_G4UA__G4COSMICORFILTERTOOL_H -#define G4COSMICFILTER_G4UA__G4COSMICORFILTERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#ifndef G4COSMICFILTER_G4UA__G4COSMICORFILTERTOOL_H +#define G4COSMICFILTER_G4UA__G4COSMICORFILTERTOOL_H + +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4CosmicFilter/G4CosmicOrFilter.h" -namespace G4UA{ - - class G4CosmicOrFilterTool: - public ActionToolBaseReport<G4CosmicOrFilter>, +namespace G4UA +{ - public IEndEventActionTool - { - + class G4CosmicOrFilterTool : public ActionToolBaseReport<G4CosmicOrFilter>, + public IG4EventActionTool + { public: G4CosmicOrFilterTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - + + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; virtual StatusCode finalize() override; protected: virtual std::unique_ptr<G4CosmicOrFilter> makeAction() override final; private: G4CosmicOrFilter::Config m_config; - }; // class G4CosmicOrFilterTool - - -} // namespace G4UA + }; // class G4CosmicOrFilterTool + +} // namespace G4UA + #endif diff --git a/Simulation/G4Extensions/G4CosmicFilter/cmt/requirements b/Simulation/G4Extensions/G4CosmicFilter/cmt/requirements old mode 100755 new mode 100644 diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx index 0999b63835eea0478e33a8c033ffdf039495f373..16d57f88b3d87cee8f129bdb242116a05c9b2f77 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx @@ -8,24 +8,25 @@ #include "G4RunManager.hh" #include "G4Event.hh" - #include "StoreGate/ReadHandle.h" #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IMessageSvc.h" -namespace G4UA{ - +namespace G4UA +{ - G4CosmicAndFilter::G4CosmicAndFilter(const Config& config): - AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"G4CosmicAndFilter"), - m_config(config),m_report(), - m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicAndFilter"), - m_detStore("StoreGateSvc/DetectorStore","G4CosmicAndFilter"){; + G4CosmicAndFilter::G4CosmicAndFilter(const Config& config) + : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ), "G4CosmicAndFilter"), + m_config(config), m_report(), + m_evtStore("StoreGateSvc/StoreGateSvc", "G4CosmicAndFilter"), + m_detStore("StoreGateSvc/DetectorStore", "G4CosmicAndFilter") + { } - void G4CosmicAndFilter::endOfEvent(const G4Event*){; + void G4CosmicAndFilter::EndOfEventAction(const G4Event*) + { m_report.ntot++; int counter(0); @@ -38,14 +39,14 @@ namespace G4UA{ { counter = coll->size(); } - + if (counter==0) { ATH_MSG_INFO("aborting event due to failing AND filter"); G4RunManager::GetRunManager()->AbortEvent(); return; } - + SG::ReadHandle <TrackRecordCollection> coll2(m_config.collectionName2); if (! coll2.isValid()) { @@ -62,11 +63,10 @@ namespace G4UA{ G4RunManager::GetRunManager()->AbortEvent(); return; } - + m_report.npass++; return; } - -} // namespace G4UA +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx index e107ed4a93b4f4299f56d353ac30a3bf333346d2..3846309dbd5b32810767ffbb6feb07c96be1624d 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx @@ -4,36 +4,41 @@ #include "CxxUtils/make_unique.h" #include "G4CosmicFilter/G4CosmicAndFilterTool.h" -namespace G4UA{ +namespace G4UA +{ - G4CosmicAndFilterTool::G4CosmicAndFilterTool(const std::string& type, const std::string& name,const IInterface* parent): - ActionToolBaseReport<G4CosmicAndFilter>(type, name, parent), m_config(){ - - + G4CosmicAndFilterTool::G4CosmicAndFilterTool(const std::string& type, + const std::string& name, + const IInterface* parent) + : ActionToolBaseReport<G4CosmicAndFilter>(type, name, parent), + m_config() + { declareProperty("CollectionName",m_config.collectionName); declareProperty("CollectionName2",m_config.collectionName2); - } - std::unique_ptr<G4CosmicAndFilter> G4CosmicAndFilterTool::makeAction(){ + + std::unique_ptr<G4CosmicAndFilter> G4CosmicAndFilterTool::makeAction() + { ATH_MSG_DEBUG("makeAction"); auto action = CxxUtils::make_unique<G4CosmicAndFilter>(m_config); return std::move(action); } - StatusCode G4CosmicAndFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + + StatusCode G4CosmicAndFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf) + { + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<G4CosmicAndFilter>::queryInterface(riid, ppvIf); } - - StatusCode G4CosmicAndFilterTool::finalize(){ + + StatusCode G4CosmicAndFilterTool::finalize() + { mergeReports(); ATH_MSG_INFO( "processed "<< m_report.ntot <<" events, "<< m_report.npass<<" events passed filter" ); return StatusCode::SUCCESS; } - -} // namespace G4UA +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx old mode 100755 new mode 100644 index c84f03d6d600ce28784a0e672515c59af8f060de..2d419bfefc907396caf1169d394137764b8dc4b8 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx @@ -11,27 +11,27 @@ #include "G4Event.hh" #include "StoreGate/ReadHandle.h" - #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IMessageSvc.h" -namespace G4UA{ +namespace G4UA +{ - G4CosmicFilter::G4CosmicFilter(const Config& config): - AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"G4CosmicFilter"), - m_config(config),m_report(), - m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicFilter"), - m_detStore("StoreGateSvc/DetectorStore","G4CosmicFilter"){ + G4CosmicFilter::G4CosmicFilter(const Config& config) + : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ), "G4CosmicFilter"), + m_config(config), m_report(), + m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicFilter"), + m_detStore("StoreGateSvc/DetectorStore","G4CosmicFilter") + { } - - void G4CosmicFilter::endOfEvent(const G4Event*){; - + void G4CosmicFilter::EndOfEventAction(const G4Event*) + { int counter(0); - + m_report.ntot++; - + SG::ReadHandle <TrackRecordCollection> coll(m_config.collectionName); if (! coll.isValid() ) { @@ -39,9 +39,9 @@ namespace G4UA{ G4RunManager::GetRunManager()->AbortEvent(); return; } - + counter = coll->size(); - + if (m_config.PDGId!=0 || m_config.ptMin>0 || m_config.ptMax>0) { counter=0; @@ -53,7 +53,7 @@ namespace G4UA{ counter++; } } - + //std::cout << "EndOfEventAction counter is "<<counter<<std::endl; if (counter==0) { @@ -61,10 +61,10 @@ namespace G4UA{ G4RunManager::GetRunManager()->AbortEvent(); return; } - + m_report.npass++; return; - + } -} // namespace G4UA +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx index b05d8fca8671c3dd7dcb73e9fe31fd1796796951..b3c5197c5279c442dc26a190536661a7be5e7a69 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx @@ -5,40 +5,44 @@ #include "CxxUtils/make_unique.h" #include "G4CosmicFilter/G4CosmicFilterTool.h" -namespace G4UA{ - - G4CosmicFilterTool::G4CosmicFilterTool(const std::string& type, const std::string& name,const IInterface* parent): - ActionToolBaseReport<G4CosmicFilter>(type, name, parent), m_config(){ - - declareProperty("CollectionName",m_config.collectionName); - declareProperty("PDGId",m_config.PDGId); - declareProperty("PtMin",m_config.ptMin); - declareProperty("PtMax",m_config.ptMax); - +namespace G4UA +{ + + G4CosmicFilterTool::G4CosmicFilterTool(const std::string& type, + const std::string& name, + const IInterface* parent) + : ActionToolBaseReport<G4CosmicFilter>(type, name, parent), + m_config() + { + declareProperty("CollectionName", m_config.collectionName); + declareProperty("PDGId", m_config.PDGId); + declareProperty("PtMin", m_config.ptMin); + declareProperty("PtMax", m_config.ptMax); } - std::unique_ptr<G4CosmicFilter> G4CosmicFilterTool::makeAction(){ + std::unique_ptr<G4CosmicFilter> G4CosmicFilterTool::makeAction() + { ATH_MSG_DEBUG("makeAction"); auto action = CxxUtils::make_unique<G4CosmicFilter>(m_config); return std::move(action); } - StatusCode G4CosmicFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + StatusCode G4CosmicFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf) + { + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<G4CosmicFilter>::queryInterface(riid, ppvIf); } - StatusCode G4CosmicFilterTool::finalize(){ + StatusCode G4CosmicFilterTool::finalize() + { mergeReports(); ATH_MSG_INFO( "processed "<< m_report.ntot <<" events, "<< m_report.npass<<" events passed filter" ); return StatusCode::SUCCESS; } - - -} // namespace G4UA + +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx index 55d3cecbe401641c8e6d5283bea2fc3e6ad153e9..3553e940a59176aa128382556dceaf0644db6461 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx @@ -9,72 +9,58 @@ #include "G4Event.hh" #include "StoreGate/ReadHandle.h" - #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IMessageSvc.h" -namespace G4UA{ - - - G4CosmicOrFilter::G4CosmicOrFilter(const Config& config): - AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"G4CosmicOrFilter"), - m_config(config),m_report(), - m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicOrFilter"), - m_detStore("StoreGateSvc/DetectorStore","G4CosmicOrFilter"){; +namespace G4UA +{ + + G4CosmicOrFilter::G4CosmicOrFilter(const Config& config) + : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >("MessageSvc"), "G4CosmicOrFilter"), + m_config(config), m_report(), + m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicOrFilter"), + m_detStore("StoreGateSvc/DetectorStore","G4CosmicOrFilter") + { } - - void G4CosmicOrFilter::endOfEvent(const G4Event*){; - + + void G4CosmicOrFilter::EndOfEventAction(const G4Event*) + { int counterOne(0), counterTwo(0), counterThree(0); //need way to get "and" or "or" in m_report.ntot++; - + SG::ReadHandle <TrackRecordCollection> coll(m_config.collectionName); - if (! coll.isValid()) - { + if (! coll.isValid()) { ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " ); } - else - { + else { counterOne = coll->size(); } - + SG::ReadHandle <TrackRecordCollection> coll2(m_config.collectionName2); - if (!coll2.isValid()) - { - ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " ); - } - else - { - counterTwo = coll2->size(); - } - - SG::ReadHandle <TrackRecordCollection> coll3(m_config.collectionName3); - if (! coll3.isValid()) - { - ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection" ); - } - else - { - counterThree = coll3->size(); - } - - if (counterOne==0 && counterTwo==0 && counterThree==0) - { - ATH_MSG_INFO("aborting event due to failing OR filter"); - G4RunManager::GetRunManager()->AbortEvent(); - } - else - { - m_report.npass++; + if (!coll2.isValid()) { + ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " ); + } + else { + counterTwo = coll2->size(); } - return; - - } - - + SG::ReadHandle <TrackRecordCollection> coll3(m_config.collectionName3); + if (! coll3.isValid()) { + ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection" ); + } + else { + counterThree = coll3->size(); + } + if (counterOne==0 && counterTwo==0 && counterThree==0) { + ATH_MSG_INFO("aborting event due to failing OR filter"); + G4RunManager::GetRunManager()->AbortEvent(); + } + else { + m_report.npass++; + } + } -} // namespace G4UA +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx index 680b74202db7d402d690a77631ffad3245ee8a06..b6a9bbc86a39bd8a809c096c7022ce3bbcffdc67 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx +++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx @@ -4,38 +4,43 @@ #include "CxxUtils/make_unique.h" #include "G4CosmicFilter/G4CosmicOrFilterTool.h" -namespace G4UA{ - - - G4CosmicOrFilterTool::G4CosmicOrFilterTool(const std::string& type, const std::string& name,const IInterface* parent): - ActionToolBaseReport<G4CosmicOrFilter>(type, name, parent), m_config(){ + +namespace G4UA +{ + + G4CosmicOrFilterTool::G4CosmicOrFilterTool(const std::string& type, + const std::string& name, + const IInterface* parent) + : ActionToolBaseReport<G4CosmicOrFilter>(type, name, parent), + m_config() + { declareProperty("CollectionName", m_config.collectionName); declareProperty("CollectionName2",m_config.collectionName2); declareProperty("CollectionName3",m_config.collectionName3); - } - - std::unique_ptr<G4CosmicOrFilter> G4CosmicOrFilterTool::makeAction(){ + + std::unique_ptr<G4CosmicOrFilter> G4CosmicOrFilterTool::makeAction() + { ATH_MSG_DEBUG("makeAction"); auto action = CxxUtils::make_unique<G4CosmicOrFilter>(m_config); return std::move(action); } - - StatusCode G4CosmicOrFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + + StatusCode G4CosmicOrFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf) + { + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<G4CosmicOrFilter>::queryInterface(riid, ppvIf); } - - StatusCode G4CosmicOrFilterTool::finalize(){ + + StatusCode G4CosmicOrFilterTool::finalize() + { mergeReports(); ATH_MSG_INFO( "processed "<< m_report.ntot <<" events, "<< m_report.npass<<" events passed filter" ); return StatusCode::SUCCESS; } - - -} // namespace G4UA + +} // namespace G4UA diff --git a/Simulation/G4Extensions/G4HitFilter/python/G4HitFilterConfig.py b/Simulation/G4Extensions/G4HitFilter/python/G4HitFilterConfig.py index de3b8122361ab8c44aa402d9872ff87ebe1e946d..7e91279de22d2492fb62169677f2b969e21372c9 100644 --- a/Simulation/G4Extensions/G4HitFilter/python/G4HitFilterConfig.py +++ b/Simulation/G4Extensions/G4HitFilter/python/G4HitFilterConfig.py @@ -8,4 +8,4 @@ def getG4HitFilterTool(name="G4UA::G4HitFilterTool", **kwargs): return G4UA__G4HitFilterTool(name, **kwargs) def addG4HitFilterTool(name="G4UA::G4HitFilterTool",system=False): - G4AtlasServicesConfig.addAction(name,['BeginOfRun','EndOfEvent'],system) + G4AtlasServicesConfig.addAction(name,['Run','Event'],system) diff --git a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.cxx b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.cxx index c0c7c90c42a485defc684ac6a89d2c8048641024..b5c1a40f5f7524e18d2c790adede055fcf7bd510 100755 --- a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.cxx +++ b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.cxx @@ -38,7 +38,7 @@ namespace G4UA{ } - void G4HitFilter::beginOfRun(const G4Run*){; + void G4HitFilter::BeginOfRunAction(const G4Run*){ if(m_config.volumenames.size()==0){ @@ -85,7 +85,7 @@ namespace G4UA{ } - void G4HitFilter::endOfEvent(const G4Event*){; + void G4HitFilter::EndOfEventAction(const G4Event*){ unsigned int counter = 0; m_report.ntot++; diff --git a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.h b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.h index 7288ee52c2a79e66e227f1a937e98b3bdc84ae75..497611a2bf39fde0e15dbabd8a8ceded4f7c9a03 100755 --- a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.h +++ b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilter.h @@ -12,8 +12,8 @@ #include <map> -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" @@ -22,7 +22,7 @@ namespace G4UA{ class G4HitFilter: - public AthMessaging, public IEndEventAction,public IBeginRunAction + public AthMessaging, public G4UserEventAction, public G4UserRunAction { public: @@ -49,8 +49,8 @@ namespace G4UA{ const Report& getReport() const { return m_report; } - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; private: enum hitCntainerTypes { diff --git a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.cxx b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.cxx index 98d5529951744e6b6f2bca2734b66984304cf09b..6411d9a7dd3ee35a5f1f478c90bf08a1dd0fcfca 100644 --- a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.cxx +++ b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.cxx @@ -18,14 +18,14 @@ namespace G4UA{ } StatusCode G4HitFilterTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.h b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.h index f375724aa5eae67fb4404a36168459b8cc29de8b..a20e768f2dd213a4cf74267666be2e11297cc000 100644 --- a/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.h +++ b/Simulation/G4Extensions/G4HitFilter/src/G4HitFilterTool.h @@ -4,8 +4,8 @@ #ifndef G4HITFILTER_G4UA__G4HITFILTERTOOL_H #define G4HITFILTER_G4UA__G4HITFILTERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4HitFilter.h" @@ -13,18 +13,18 @@ namespace G4UA{ class G4HitFilterTool: public ActionToolBaseReport<G4HitFilter>, - public IEndEventActionTool, - public IBeginRunActionTool + public IG4EventActionTool, + public IG4RunActionTool { public: G4HitFilterTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; virtual StatusCode finalize() override; diff --git a/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.cxx b/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.cxx index 21ea39768e58796a736388c3dce0f76457c318b5..e29e1999aaf3c3c409283800eb982b7c714b56ad 100755 --- a/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.cxx +++ b/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.cxx @@ -33,7 +33,7 @@ DebugSteppingAction::DebugSteppingAction(const Config& config):m_config(config) DebugSteppingAction::~DebugSteppingAction() {} - void DebugSteppingAction::processStep(const G4Step* step) { + void DebugSteppingAction::UserSteppingAction(const G4Step* step) { #ifndef QUIRKS_STANDALONE G4double m_step=m_config.step; G4int m_numSteps=m_config.numSteps; diff --git a/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.h b/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.h index 004f49a5a9d56473503ad0dae3db3004be1f1182..bf76e6950f97e6d53e3981fca758d88e383db0f6 100644 --- a/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.h +++ b/Simulation/G4Extensions/Quirks/src/DebugSteppingAction.h @@ -6,23 +6,13 @@ #define DEBUGSTEPPINGACTION_H #include "G4LorentzVector.hh" - -#ifdef QUIRKS_STANDALONE #include "G4UserSteppingAction.hh" -#else -#include "G4AtlasInterfaces/ISteppingAction.h" -#endif #ifndef QUIRKS_STANDALONE namespace G4UA{ #endif -class DebugSteppingAction : -#ifdef QUIRKS_STANDALONE - public G4UserSteppingAction -#else - public ISteppingAction -#endif +class DebugSteppingAction : public G4UserSteppingAction { public: #ifdef QUIRKS_STANDALONE @@ -39,8 +29,7 @@ public: virtual ~DebugSteppingAction(); - virtual void processStep(const G4Step* step) override; - virtual void UserSteppingAction(const G4Step* step) {processStep(step);} + virtual void UserSteppingAction(const G4Step* step) override; private: #ifndef QUIRKS_STANDALONE diff --git a/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.cxx b/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.cxx index 10e1f7cf086809d38b413e0c92c51bcc46a719f2..94a9d315b7dd9254ae092f6e5a9fd13800dc6aeb 100644 --- a/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.cxx +++ b/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.cxx @@ -18,8 +18,8 @@ namespace G4UA{ } StatusCode DebugSteppingActionTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.h b/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.h index 044007557af0faa78f9e99ed694985fd3ffedaab..9d4d825443af1771c7a7814ffd6a597edf1adfd2 100644 --- a/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.h +++ b/Simulation/G4Extensions/Quirks/src/DebugSteppingActionTool.h @@ -4,7 +4,7 @@ #ifndef QUIRKS_G4UA__DEBUGSTEPPINGACTIONTOOL_H #define QUIRKS_G4UA__DEBUGSTEPPINGACTIONTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "DebugSteppingAction.h" namespace G4UA{ @@ -14,14 +14,14 @@ namespace G4UA{ class DebugSteppingActionTool: public ActionToolBase<DebugSteppingAction>, - public ISteppingActionTool + public IG4SteppingActionTool { public: DebugSteppingActionTool(const std::string& type, const std::string& name,const IInterface* parent); /// retrieves the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// gaudi interface handling virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Extensions/RHadrons/share/SG_StepNtuple.py b/Simulation/G4Extensions/RHadrons/share/SG_StepNtuple.py index f4454490e5590c9fd15f4b3d0d1d675461bcea07..1fc9434f8fa93537c3a565e8af2f9ba5ce09e24c 100644 --- a/Simulation/G4Extensions/RHadrons/share/SG_StepNtuple.py +++ b/Simulation/G4Extensions/RHadrons/share/SG_StepNtuple.py @@ -1,6 +1,6 @@ from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::SG_StepNtupleTool',['BeginOfRun','BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::SG_StepNtupleTool',['Run','Event','Step']) theApp.HistogramPersistency = "ROOT" diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx index 8ce7393f846163064b4ba8fbf3a6c507891de3d2..23d7cd36c67758b8e317a59c61fef0d65b4150d4 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx @@ -22,7 +22,7 @@ namespace G4UA{ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"SG_StepNtuple"){; } - void SG_StepNtuple::beginOfRun(const G4Run*){ + void SG_StepNtuple::BeginOfRunAction(const G4Run*){ NTupleFilePtr file1(ntupleSvc(), "/NTUPLES/FILE1"); @@ -130,14 +130,14 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa } - void SG_StepNtuple::beginOfEvent(const G4Event*){ + void SG_StepNtuple::BeginOfEventAction(const G4Event*){ m_nsteps=0; rhid=0;//the rhadron index (either the first or second rhadon, usually) nevents++; m_evtid=nevents;//since it gets cleared out after every fill... } - void SG_StepNtuple::endOfEvent(const G4Event*){ + void SG_StepNtuple::EndOfEventAction(const G4Event*){ if(! ntupleSvc()->writeRecord("/NTUPLES/FILE1/StepNtuple/10").isSuccess()) ATH_MSG_ERROR( " failed to write record for this event" ); @@ -145,7 +145,7 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa //this also seems to zero out all the arrays... so beware! } - void SG_StepNtuple::processStep(const G4Step* aStep){ + void SG_StepNtuple::UserSteppingAction(const G4Step* aStep){ if(m_nsteps<50000){ int pdg = aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); bool rhad=false; diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h index 111bfa2cef2ac698f3a6099d7944af3eaf98825d..d72190d6f74ede94d2a6b44e2865fc3c3af21bbb 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h @@ -10,25 +10,24 @@ #include <vector> #include <set> -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA{ class SG_StepNtuple: - public AthMessaging, public IBeginRunAction, public IBeginEventAction, public IEndEventAction, public ISteppingAction + public AthMessaging, public G4UserRunAction, public G4UserEventAction, public G4UserSteppingAction { public: SG_StepNtuple(); - virtual void beginOfRun(const G4Run*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: bool isSUSYParticle(const int id) const; diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.cxx b/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.cxx index 5b10bdeb8fdeec6ad251d9b88d19a9925c79fbc9..5c17f08c17ef5772a17d8b4332fc5538e513852d 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.cxx +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.cxx @@ -18,23 +18,18 @@ namespace G4UA{ } StatusCode SG_StepNtupleTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.h b/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.h index f077eb0569c41229ce037647802b9f4464373c0e..319bf0177747810c3a3555c1918c00dfea39b2fe 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.h +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtupleTool.h @@ -5,10 +5,9 @@ #ifndef RHADRONS_G4UA__SG_STEPNTUPLETOOL_H #define RHADRONS_G4UA__SG_STEPNTUPLETOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "SG_StepNtuple.h" @@ -21,24 +20,21 @@ namespace G4UA{ class SG_StepNtupleTool: public ActionToolBase<SG_StepNtuple>, - public IBeginRunActionTool, public IBeginEventActionTool, public IEndEventActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4EventActionTool, public IG4SteppingActionTool { public: /// standard tool ctor SG_StepNtupleTool(const std::string& type, const std::string& name,const IInterface* parent); - /// retrieves BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// retrieves BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// retrieves EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// retrieves run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + /// retrieves event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// retrieves stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// gaudi interface manipulation virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.cxx b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.cxx index 1dd5dcca53455a46ef9a3a08ce4543c82737e9a3..b24007a58663243f73f7368369e06d37da630bfd 100644 --- a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.cxx +++ b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.cxx @@ -4,15 +4,11 @@ #include "MCTruthSteppingAction.h" #include "MCTruth/TrackHelper.h" -#include "RecordingEnvelope.h" #include "G4Step.hh" #include "G4StepPoint.hh" #include "G4TouchableHistory.hh" -#include "G4SDManager.hh" -#include <map> -#include <iostream> namespace G4UA { @@ -65,7 +61,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Beginning of event //--------------------------------------------------------------------------- - void MCTruthSteppingAction::beginOfEvent(const G4Event*) + void MCTruthSteppingAction::BeginOfEventAction(const G4Event*) { // First time initialization if(!m_isInitialized) { @@ -84,7 +80,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Process one tracking step //--------------------------------------------------------------------------- - void MCTruthSteppingAction::processStep(const G4Step* aStep) + void MCTruthSteppingAction::UserSteppingAction(const G4Step* aStep) { if (m_recordingEnvelopes.size() == 0) return; TrackHelper trackHelper(aStep->GetTrack()); diff --git a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.h b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.h index dd5a618cedce5e86359915d688ea4406aa6beccb..935d683efa8866bf701847ed57ad224320134c17 100644 --- a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.h +++ b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingAction.h @@ -5,29 +5,34 @@ #ifndef MCTruthBase_MCTruthSteppingAction_H #define MCTruthBase_MCTruthSteppingAction_H +// System includes #include <map> #include <string> #include <vector> +// Framework includes #include "GaudiKernel/ToolHandle.h" -#include "RecordingEnvelope.h" +#include "AthenaBaseComps/AthMessaging.h" +// Geant4 includes +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" + +// Local includes +#include "RecordingEnvelope.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "AthenaBaseComps/AthMessaging.h" namespace G4UA { /// @class MCTruthSteppingAction - /// @brief User action which recording-envelope truth tracks. + /// @brief User action which handles recording-envelope truth tracks. /// /// This user action utilizes RecordingEnvelope objects to save truth tracks /// at entry/exit layers of certain configured detector layers. /// - class MCTruthSteppingAction : public IBeginEventAction, - public ISteppingAction, + class MCTruthSteppingAction : public G4UserEventAction, + public G4UserSteppingAction, public AthMessaging { @@ -44,12 +49,12 @@ namespace G4UA /// Called at the start of each G4 event. Used to ensure that the /// TrackRecordCollection WriteHandles are valid. - virtual void beginOfEvent(const G4Event*) override final; + virtual void BeginOfEventAction(const G4Event*) override final; /// Process one particle step. If the step crosses a recording /// envelope volume boundary, passes the step to the corresponding /// RecordingEnvelope to add a TrackRecord. - virtual void processStep(const G4Step*) override final; + virtual void UserSteppingAction(const G4Step*) override final; private: diff --git a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.cxx b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.cxx index c38bba43e466f7ccc50b40cdacc73445ae26dc5a..f99c60a74c6093d30e68427141384b1471f46721 100644 --- a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.cxx +++ b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.cxx @@ -3,6 +3,8 @@ */ #include "MCTruthSteppingActionTool.h" +#include "CxxUtils/make_unique.h" + namespace G4UA { @@ -15,8 +17,8 @@ namespace G4UA const IInterface* parent) : ActionToolBase<MCTruthSteppingAction>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); - declareInterface<IBeginEventActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); declareProperty("VolumeCollectionMap", m_volumeCollectionMap, "Map of volume name to output collection name"); } @@ -26,7 +28,7 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode MCTruthSteppingActionTool::initialize() { - ATH_MSG_DEBUG("initializing MCTruthSteppingActionTool"); + ATH_MSG_DEBUG( "Initializing " << name() ); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.h b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.h index eeb6c4fe13e364873aaccda9ed689431cde6f1ff..ab9a09972f950fcfb1bcceb887e09fae3724e248 100644 --- a/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.h +++ b/Simulation/G4Sim/MCTruthBase/src/MCTruthSteppingActionTool.h @@ -10,8 +10,8 @@ // Infrastructure includes #include "G4AtlasTools/ActionToolBase.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" // STL includes #include <string> @@ -26,8 +26,8 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class MCTruthSteppingActionTool : public ActionToolBase<MCTruthSteppingAction>, - public IBeginEventActionTool, - public ISteppingActionTool + public IG4EventActionTool, + public IG4SteppingActionTool { public: @@ -36,16 +36,16 @@ namespace G4UA MCTruthSteppingActionTool(const std::string& type, const std::string& name, const IInterface* parent); - /// Initialize the tool - just for debug printing - virtual StatusCode initialize() override; + /// Initialize the tool + virtual StatusCode initialize() override final; /// Retrieve the begin-event action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } private: diff --git a/Simulation/G4Utilities/G4DebuggingTools/python/G4DebuggingToolsConfig.py b/Simulation/G4Utilities/G4DebuggingTools/python/G4DebuggingToolsConfig.py index 2da18166b06c75c3290360c6995a7cca252bf469..795df6923266a450634b2d0dd142dc931b4e260a 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/python/G4DebuggingToolsConfig.py +++ b/Simulation/G4Utilities/G4DebuggingTools/python/G4DebuggingToolsConfig.py @@ -13,7 +13,7 @@ def getVerboseSelectorTool(name="G4UA::VerboseSelectorTool", **kwargs): def addVerboseSelectorTool(name="G4UA::VerboseSelectorTool",system=False): - G4AtlasServicesConfig.addAction(name,['BeginOfEvent','Step','BeginOfTracking','EndOfTracking'],system) + G4AtlasServicesConfig.addAction(name,['Event','Step','Tracking'],system) def getG4AtlantisDumperTool(name="G4UA::G4AtlantisDumperTool", **kwargs): @@ -21,7 +21,7 @@ def getG4AtlantisDumperTool(name="G4UA::G4AtlantisDumperTool", **kwargs): def addG4AtlantisDumperTool(name="G4UA::G4AtlantisDumperTool",system=False): - G4AtlasServicesConfig.addAction(name,['EndOfEvent','Step','BeginOfEvent'],system) + G4AtlasServicesConfig.addAction(name,['Event','Step','Event'],system) def getEnergyConservationTestTool(name="G4UA::EnergyConservationTestTool", **kwargs): @@ -29,7 +29,7 @@ def getEnergyConservationTestTool(name="G4UA::EnergyConservationTestTool", **kwa def addEnergyConservationTestTool(name="G4UA::EnergyConservationTestTool",system=False): - G4AtlasServicesConfig.addAction(name,['EndOfEvent','Step','BeginOfTracking','EndOfTracking'],system) + G4AtlasServicesConfig.addAction(name,['Event','Step','Tracking'],system) def getHyperspaceCatcherTool(name="G4UA::HyperspaceCatcherTool", **kwargs): @@ -42,7 +42,7 @@ def getHyperspaceCatcherTool(name="G4UA::HyperspaceCatcherTool", **kwargs): def addHyperspaceCatcherTool(name="G4UA::HyperspaceCatcherTool",system=False): - G4AtlasServicesConfig.addAction(name,['BeginOfRun','Step'],system) + G4AtlasServicesConfig.addAction(name,['Run','Step'],system) def getStepNtupleTool(name="G4UA::StepNtupleTool", **kwargs): diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/EnergyConservation_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/EnergyConservation_options.py index 10e6b943ee0700d38dadd115c7c425a49e41f52d..1a3f06c938a31a8624513ebb3dcaf507ef29ff90 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/EnergyConservation_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/EnergyConservation_options.py @@ -1,4 +1,4 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::EnergyConservationTestTool',['PreTracking','Step','PostTracking','EndOfEvent']) +simFlags.OptionalUserActionList.addAction('G4UA::EnergyConservationTestTool',['Tracking','Step','Event']) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/G4AtlantisDumper_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/G4AtlantisDumper_options.py index 65cab5582ebc0a2932fe78e6601246853641cb76..411ccb1e1bcc62a13770ded07816f590206ba77f 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/G4AtlantisDumper_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/G4AtlantisDumper_options.py @@ -1,4 +1,4 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::G4AtlantisDumperTool',[ 'BeginOfEvent', 'EndOfEvent', 'Step']) +simFlags.OptionalUserActionList.addAction('G4UA::G4AtlantisDumperTool', ['Event', 'Step']) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/Geant4SetupChecker_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/Geant4SetupChecker_options.py index e4ee58b6e8dcea29c70a1754accb4e5292c69b8b..5aa00dcd46adb9c5e33d2bd4701b0ede8d597ec0 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/Geant4SetupChecker_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/Geant4SetupChecker_options.py @@ -1,6 +1,6 @@ # Job options to configure the Geant4 setup checker tool from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::Geant4SetupCheckerTool',['BeginOfRun']) +simFlags.OptionalUserActionList.addAction('G4UA::Geant4SetupCheckerTool',['Run']) # This flag disables checking so that you can write your own reference file #simFlags.UserActionConfig.addConfig('G4UA::Geant4SetupCheckerTool','RunTest',False) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/HyperspaceCatcher_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/HyperspaceCatcher_options.py index 3ffdbb106e2933c0790e61ad56b2f9397ae7d175..b900af612f75f964fde0726cc48eaf0d6607cad2 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/HyperspaceCatcher_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/HyperspaceCatcher_options.py @@ -1,4 +1,4 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::HyperspaceCatcherTool',['BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::HyperspaceCatcherTool',['Run','Step']) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/StepNtuple_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/StepNtuple_options.py index d972a7e2aa285130937eb7bdffdc3cbb761f5643..e5f33606bf3286d2143e17c7b6045097d061954d 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/StepNtuple_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/StepNtuple_options.py @@ -1,6 +1,6 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::StepNtupleTool',['BeginOfEvent','EndOfEvent','BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::StepNtupleTool',['Event','Run','Step']) # configure the NTupleSvc theApp.HistogramPersistency = "ROOT" svcMgr.NTupleSvc = Service( "NTupleSvc" ) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/VerboseSelector_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/VerboseSelector_options.py index 5eb60ec373843c6a23e0c231efdd92c8cd6989db..835e4444cb6f12fb755ff13d79c69edfd69fef60 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/VerboseSelector_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/VerboseSelector_options.py @@ -1,5 +1,5 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['EndOfEvent','BeginOfTracking','EndOfTracking']) +simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['Event','Tracking']) diff --git a/Simulation/G4Utilities/G4DebuggingTools/share/VolumeDebugger_options.py b/Simulation/G4Utilities/G4DebuggingTools/share/VolumeDebugger_options.py index ee53ce0f1580beaf08a0b66bc0f2bf74b5c57d4e..61688b1d4539dcb543ede468c894abc2b884e43a 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/share/VolumeDebugger_options.py +++ b/Simulation/G4Utilities/G4DebuggingTools/share/VolumeDebugger_options.py @@ -6,5 +6,5 @@ from G4AtlasApps.SimFlags import simFlags # new MT actions. Note that this will only work with one thread. -simFlags.OptionalUserActionList.addAction('G4UA::VolumeDebuggerTool',['BeginOfRun']) +simFlags.OptionalUserActionList.addAction('G4UA::VolumeDebuggerTool',['Run']) diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.cxx index 1636183750bb3c9c443d5e4301ce3e0112ba65f6..e58bdcb5168d75045460e647e778b10755a64082 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.cxx @@ -13,7 +13,7 @@ namespace G4UA{ CheckActivation::CheckActivation(){; } -void CheckActivation::beginOfEvent(const G4Event*){ +void CheckActivation::BeginOfEventAction(const G4Event*){ G4TransportationManager *tm = G4TransportationManager::GetTransportationManager(); tm->GetNavigatorForTracking()->CheckMode(true); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.h b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.h index 496e3535e00379c0c0c73e69a79124a05cff0419..a3ce7c9d640b6b1d50618aa7d808ed197445be79 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivation.h @@ -4,16 +4,16 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__CHECKACTIVATION_H #define G4DEBUGGINGTOOLS_G4UA__CHECKACTIVATION_H -#include "G4AtlasInterfaces/IBeginEventAction.h" +#include "G4UserEventAction.hh" namespace G4UA{ class CheckActivation: - public IBeginEventAction + public G4UserEventAction { public: CheckActivation(); - virtual void beginOfEvent(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; private: }; // class CheckActivation diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.cxx index 03291f50a989b4dee4964ebdcf7e834aa972d19d..a77238e2b8d41c90b33ea00e454502bb45a9e2d8 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.cxx @@ -20,8 +20,8 @@ namespace G4UA{ StatusCode CheckActivationTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.h index 7b1d101e36dbd92c3bc1c4693fdee79c50bcf7e5..856b63d29c9ea7c31b13abe7d22a09c20dfc2c2c 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/CheckActivationTool.h @@ -4,7 +4,7 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__CHECKACTIVATIONTOOL_H #define G4DEBUGGINGTOOLS_G4UA__CHECKACTIVATIONTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "CheckActivation.h" @@ -19,15 +19,15 @@ namespace G4UA{ class CheckActivationTool: public ActionToolBase<CheckActivation>, - public IBeginEventActionTool + public IG4EventActionTool { public: /// Standard constructor CheckActivationTool(const std::string& type, const std::string& name,const IInterface* parent); /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Gaudi interface management virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.cxx index 82d18000a46cc3d79247df385f599c1a2b57ae21..3a3a3915928467ae0ef25b9832e04dcdb46ce5d9 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.cxx @@ -30,17 +30,17 @@ namespace G4UA{ m_detStore("StoreGateSvc/DetectorStore","EnergyConservationTest"), e_in(0), e_out(0), e_dep(0){} - void EnergyConservationTest::preTracking(const G4Track* t){ + void EnergyConservationTest::PreUserTrackingAction(const G4Track* t){ TrackHelper theHelper(t); if(theHelper.IsPrimary()) e_in += t->GetTotalEnergy(); } - void EnergyConservationTest::postTracking(const G4Track* t){ + void EnergyConservationTest::PostUserTrackingAction(const G4Track* t){ // If it has any energy left *after* being tracked, it should have left the world if (!t->GetNextVolume()) e_out += t->GetTotalEnergy(); } - void EnergyConservationTest::endOfEvent(const G4Event*){; + void EnergyConservationTest::EndOfEventAction(const G4Event*){ ATH_MSG_DEBUG( "Event info: " << e_in << " in, " << e_out << " out, " << e_dep << " deposited." ); if ( std::fabs( e_in-e_out-e_dep ) > 10000. ) { // 10 GeV threshold, which is really pretty generous! @@ -56,17 +56,17 @@ namespace G4UA{ ei->setErrorState(EventInfo::Core,EventInfo::Error); ATH_MSG_WARNING( "Set error state in event info!" ); } - } + } - // reset - e_in=0.; - e_out=0.; - e_dep=0.; + // reset + e_in=0.; + e_out=0.; + e_dep=0.; } - void EnergyConservationTest::processStep(const G4Step* s){ - e_dep += s->GetTotalEnergyDeposit(); + void EnergyConservationTest::UserSteppingAction(const G4Step* s){ + e_dep += s->GetTotalEnergyDeposit(); } } // namespace G4UA diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.h b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.h index 4fc60e36848f55aca7ce449322522f8b83221245..89c6e4d570ee6ea40ce12b6430a691925145c99f 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTest.h @@ -8,24 +8,25 @@ #include <string> -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserTrackingAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" namespace G4UA{ - class EnergyConservationTest: - public AthMessaging, public IPreTrackingAction, public IPostTrackingAction, public IEndEventAction, public ISteppingAction + class EnergyConservationTest : public AthMessaging, + public G4UserTrackingAction, + public G4UserEventAction, + public G4UserSteppingAction { public: EnergyConservationTest(); - virtual void preTracking(const G4Track*) override; - virtual void postTracking(const G4Track*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void PreUserTrackingAction(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.cxx index 347c926c50f917b2335c9bc8302fb691063bf0ba..7f45b9aa1b749ae8c750b71150a8ffd20db6a83c 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.cxx @@ -20,20 +20,16 @@ namespace G4UA{ StatusCode EnergyConservationTestTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; + } if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + } if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<EnergyConservationTest>::queryInterface(riid, ppvIf); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.h index 520442ec0b3bf4c7ad9d92bbd68ec546068c660b..f8c1f20bbe8bd091bb0b8b2b4a51ffc05e4ebbf5 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/EnergyConservationTestTool.h @@ -5,10 +5,9 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__ENERGYCONSERVATIONTESTTOOL_H #define G4DEBUGGINGTOOLS_G4UA__ENERGYCONSERVATIONTESTTOOL_H -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "EnergyConservationTest.h" @@ -16,19 +15,17 @@ namespace G4UA{ class EnergyConservationTestTool: public ActionToolBase<EnergyConservationTest>, - public IPreTrackingActionTool, public IPostTrackingActionTool, public IEndEventActionTool, public ISteppingActionTool + public IG4TrackingActionTool, public IG4EventActionTool, public IG4SteppingActionTool { public: EnergyConservationTestTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: virtual std::unique_ptr<EnergyConservationTest> makeAction() override final; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.cxx index 343fc3fc136acf8abe5ee54c94141e0943d02850..9fb35ffb23cfe7ae5f0361a7820f211e303b3569 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.cxx @@ -33,7 +33,7 @@ namespace G4UA{ m_file(NULL){ } - void G4AtlantisDumper::processStep(const G4Step* aStep){ + void G4AtlantisDumper::UserSteppingAction(const G4Step* aStep){ const G4Track *t=aStep->GetTrack(); //if(m_nsteps>40) return; @@ -101,7 +101,7 @@ namespace G4UA{ } - void G4AtlantisDumper::endOfEvent(const G4Event* event){ + void G4AtlantisDumper::EndOfEventAction(const G4Event* event){ ATH_MSG_INFO( "Goodbye from G4AtlantisDumper, event "<<event->GetEventID()); m_file->close(); @@ -112,7 +112,7 @@ namespace G4UA{ } - void G4AtlantisDumper::beginOfEvent(const G4Event*){ + void G4AtlantisDumper::BeginOfEventAction(const G4Event*){ m_nsteps=0; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.h b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.h index a746c1f29fd07e7ffa66624863a930e1fac22810..5250a403eab6a2864b24f9b6c4cfc231d8d2e77b 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumper.h @@ -9,9 +9,8 @@ #include <fstream> #include <string> -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "StoreGate/StoreGateSvc.h" @@ -19,8 +18,9 @@ namespace G4UA{ - class G4AtlantisDumper: - public AthMessaging, public ISteppingAction, public IEndEventAction, public IBeginEventAction + class G4AtlantisDumper : public AthMessaging, + public G4UserSteppingAction, + public G4UserEventAction { public: @@ -34,9 +34,9 @@ namespace G4UA{ }; G4AtlantisDumper(const Config& config); - virtual void processStep(const G4Step*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfEvent(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; private: Config m_config; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.cxx index 806f679f4b95ed32982b39ced6e2c47b946f69b1..49a4cff99d05bed7525f24ca16ff45d4447d6194 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.cxx @@ -25,16 +25,12 @@ G4AtlantisDumperTool::G4AtlantisDumperTool } StatusCode G4AtlantisDumperTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + } if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<G4AtlantisDumper>::queryInterface(riid, ppvIf); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.h index c132b4998739ac30fd1c6043519e3a983132f709..43f6b524d50a0b04982607b9f47e2cbcbce520d9 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/G4AtlantisDumperTool.h @@ -4,27 +4,24 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__G4ATLANTISDUMPERTOOL_H #define G4DEBUGGINGTOOLS_G4UA__G4ATLANTISDUMPERTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4AtlantisDumper.h" namespace G4UA{ - class G4AtlantisDumperTool: - public ActionToolBase<G4AtlantisDumper>, - public ISteppingActionTool, public IEndEventActionTool, public IBeginEventActionTool + class G4AtlantisDumperTool : public ActionToolBase<G4AtlantisDumper>, + public IG4SteppingActionTool, + public IG4EventActionTool { public: G4AtlantisDumperTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: virtual std::unique_ptr<G4AtlantisDumper> makeAction() override final; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.cxx index 77067e79990ae61a1bdf974e23d3de696aa96d42..8d898afed132eb0cd538a30138bf10c67d6947ee 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.cxx @@ -22,7 +22,7 @@ namespace G4UA{ Geant4SetupChecker::Geant4SetupChecker(const std::string& file_location, const bool test=true) : m_file_location(file_location) , m_test(test) {; } -void Geant4SetupChecker::beginOfRun(const G4Run*){ +void Geant4SetupChecker::BeginOfRunAction(const G4Run*){ // Print the sizes of several stores G4LogicalVolumeStore* g4_logical_volume_store = G4LogicalVolumeStore::GetInstance(); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.h b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.h index 0fd0c35482c35bebf816b4935047a59ed5d32877..40e109322d258fc26e00ce1ba21bd748dceadf3b 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupChecker.h @@ -5,18 +5,18 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__GEANT4SETUPCHECKER_H #define G4DEBUGGINGTOOLS_G4UA__GEANT4SETUPCHECKER_H -#include "G4AtlasInterfaces/IBeginRunAction.h" +#include "G4UserRunAction.hh" #include <string> namespace G4UA{ class Geant4SetupChecker: - public IBeginRunAction + public G4UserRunAction { public: Geant4SetupChecker(const std::string&,const bool); - virtual void beginOfRun(const G4Run*) override; + virtual void BeginOfRunAction(const G4Run*) override; private: /// File location for reference file std::string m_file_location; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.cxx index 8b2da4ecf73d5546653893361555b09fef9c2473..845a95acc4194bd77c8d84a638cfaed92f170aa1 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.cxx @@ -23,8 +23,8 @@ namespace G4UA{ } StatusCode Geant4SetupCheckerTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.h index 3c6022c0ade8b609fcd38f705b34af7294184793..e0cf374a21a4e60ab5d95f76f3971f2492902d45 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/Geant4SetupCheckerTool.h @@ -4,7 +4,7 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__GEANT4SETUPCHECKERTOOL_H #define G4DEBUGGINGTOOLS_G4UA__GEANT4SETUPCHECKERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "Geant4SetupChecker.h" @@ -19,15 +19,15 @@ namespace G4UA{ class Geant4SetupCheckerTool: public ActionToolBase<Geant4SetupChecker>, - public IBeginRunActionTool + public IG4RunActionTool { public: /// Standard constructor Geant4SetupCheckerTool(const std::string& type, const std::string& name,const IInterface* parent); /// Retrieve the BoE action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Gaudi interface management virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.cxx index c714dfe4869b0165b9168e80ef94a419caa31efa..1de8dab7d69309d1309008be9b8b8f3675fc6b37 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.cxx @@ -30,7 +30,7 @@ namespace G4UA{ m_world(0),m_killCount(0){; } - void HyperspaceCatcher::beginOfRun(const G4Run*){ + void HyperspaceCatcher::BeginOfRunAction(const G4Run*){ // Highest level implemented is 2 at the moment if (m_config.treatmentLevel>2) m_config.treatmentLevel=2; @@ -53,7 +53,7 @@ namespace G4UA{ } - void HyperspaceCatcher::processStep(const G4Step* aStep){ + void HyperspaceCatcher::UserSteppingAction(const G4Step* aStep){ bool hs = false; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.h b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.h index 5add7cc2171b29d2d919b2b9dcc815f403cb8bf0..f0d78b9bb485bb7b310aea13958a5b0c6d1dfd0b 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcher.h @@ -12,14 +12,14 @@ class G4VSolid; class G4Track; -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA{ class HyperspaceCatcher: - public AthMessaging, public IBeginRunAction, public ISteppingAction + public AthMessaging, public G4UserRunAction, public G4UserSteppingAction { public: @@ -30,8 +30,8 @@ namespace G4UA{ }; HyperspaceCatcher(const Config& config); - virtual void beginOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.cxx index 0f1162bfd09f56bec845ef1eab36de23023e2496..cc9432c6f21dd185cd6f2ef2480f77a64678c39f 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.cxx @@ -22,12 +22,12 @@ namespace G4UA{ } StatusCode HyperspaceCatcherTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + } if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } return ActionToolBase<HyperspaceCatcher>::queryInterface(riid, ppvIf); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.h index c5f54a3fb1fa5482e05f3f1caa934686a0bcdda6..180c9faa33fffed678c7c724779042fb2802a722 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/HyperspaceCatcherTool.h @@ -5,8 +5,8 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__HYPERSPACECATCHERTOOL_H #define G4DEBUGGINGTOOLS_G4UA__HYPERSPACECATCHERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "HyperspaceCatcher.h" @@ -14,14 +14,14 @@ namespace G4UA{ class HyperspaceCatcherTool: public ActionToolBase<HyperspaceCatcher>, - public IBeginRunActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4SteppingActionTool { public: HyperspaceCatcherTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: virtual std::unique_ptr<HyperspaceCatcher> makeAction() override final; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.cxx index 10715d16c12f082be053aa5c6faa88f9db9173d1..14113425d8b0819bc9d02fbef08b77a5760e34fa 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.cxx @@ -24,13 +24,13 @@ namespace G4UA{ StepNtuple::StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"StepNtuple"){; } - void StepNtuple::beginOfEvent(const G4Event*){ + void StepNtuple::BeginOfEventAction(const G4Event*){ eventSteps.clear(); } - void StepNtuple::endOfEvent(const G4Event*){ + void StepNtuple::EndOfEventAction(const G4Event*){ //std::cout<<"start end of event, size is "<<eventSteps.size()<<std::endl; @@ -59,7 +59,7 @@ namespace G4UA{ } - void StepNtuple::processStep(const G4Step* aStep){ + void StepNtuple::UserSteppingAction(const G4Step* aStep){ if(eventSteps.size()<49000){ @@ -82,7 +82,7 @@ namespace G4UA{ } - void StepNtuple::beginOfRun(const G4Run*){ + void StepNtuple::BeginOfRunAction(const G4Run*){ NTupleFilePtr file1(ntupleSvc(), "/NTUPLES/FILE1"); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.h b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.h index 09e82d409bc8ca4f566fbe764195532a12fef0e4..c6ac811274a58a4f6d9d27c4dcf2afece9568209 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtuple.h @@ -12,17 +12,18 @@ #include <vector> -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" +#include "G4UserRunAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA{ - class StepNtuple: - public AthMessaging, public IBeginEventAction, public IEndEventAction, public ISteppingAction, public IBeginRunAction + class StepNtuple : public AthMessaging, + public G4UserEventAction, + public G4UserSteppingAction, + public G4UserRunAction { /// simple struct to hold step information struct stepdata{ @@ -34,10 +35,10 @@ namespace G4UA{ StepNtuple(); /// the hooks for G4 UA handling - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; - virtual void beginOfRun(const G4Run*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; private: diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.cxx index e26ea11467212bd730bd750102844bdd93caf0d0..78aaa525e3b22f79df096aa780044469d64558eb 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.cxx @@ -17,23 +17,18 @@ namespace G4UA{ } StatusCode StepNtupleTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.h index c5e5b7279fe7a95070131f80e7200fdf64e09458..43562f15c89866ca53975646a0f55f3ba985ca32 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/StepNtupleTool.h @@ -4,10 +4,9 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__STEPNTUPLETOOL_H #define G4DEBUGGINGTOOLS_G4UA__STEPNTUPLETOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "StepNtuple.h" @@ -22,26 +21,24 @@ namespace G4UA{ /// @author Andrea Di Simone /// - class StepNtupleTool: - public ActionToolBase<StepNtuple>, - public IBeginEventActionTool, public IEndEventActionTool, public ISteppingActionTool, public IBeginRunActionTool + class StepNtupleTool : public ActionToolBase<StepNtuple>, + public IG4EventActionTool, + public IG4SteppingActionTool, + public IG4RunActionTool { public: /// standard tool ctor StepNtupleTool(const std::string& type, const std::string& name,const IInterface* parent); - /// return the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// return the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// return the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// return the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - /// return the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + /// return the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// gaudi's interface handling virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.cxx index 6269105300e093313757552b60857f8cbef96d24..e92ec75709aeafe135031df34aab5ece8e42af12 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.cxx @@ -40,7 +40,7 @@ namespace G4UA{ m_config(config),m_evtCount(0){; } - void VerboseSelector::beginOfEvent(const G4Event*){ + void VerboseSelector::BeginOfEventAction(const G4Event*){ SG::ReadHandle<EventInfo> eic("McEventInfo"); if (!eic.isValid()){ @@ -53,7 +53,7 @@ namespace G4UA{ } } - void VerboseSelector::processStep(const G4Step* aStep){ + void VerboseSelector::UserSteppingAction(const G4Step* aStep){ if(m_evtCount==(uint64_t)m_config.targetEvent||m_config.targetEvent<0){ @@ -103,7 +103,7 @@ namespace G4UA{ } - void VerboseSelector::preTracking(const G4Track* aTrack){ + void VerboseSelector::PreUserTrackingAction(const G4Track* aTrack){ if(m_evtCount==(uint64_t)m_config.targetEvent||m_config.targetEvent<0) { @@ -139,7 +139,7 @@ namespace G4UA{ } - void VerboseSelector::postTracking(const G4Track* aTrack){ + void VerboseSelector::PostUserTrackingAction(const G4Track* aTrack){ if(m_evtCount==(uint64_t)m_config.targetEvent||m_config.targetEvent<0){ if(aTrack->GetTrackID()==m_config.targetTrack||m_config.targetTrack<0) G4EventManager::GetEventManager()->GetTrackingManager()->SetVerboseLevel(0); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.h b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.h index 49f776ea2a64a64700cb39367a6731084a6e104d..a9258c34edfa31d3204d18b4be23ec485816c838 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelector.h @@ -9,10 +9,9 @@ #include <string> -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" +#include "G4UserSteppingAction.hh" +#include "G4UserTrackingAction.hh" +#include "G4UserEventAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "GaudiKernel/ServiceHandle.h" #include "StoreGate/StoreGateSvc.h" @@ -20,7 +19,7 @@ namespace G4UA{ class VerboseSelector: - public AthMessaging, public IBeginEventAction, public ISteppingAction, public IPreTrackingAction, public IPostTrackingAction + public AthMessaging, public G4UserEventAction, public G4UserSteppingAction, public G4UserTrackingAction { public: @@ -40,10 +39,10 @@ class VerboseSelector: }; VerboseSelector(const Config& config); - virtual void processStep(const G4Step*) override; - virtual void preTracking(const G4Track*) override; - virtual void postTracking(const G4Track*) override; - virtual void beginOfEvent(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void PreUserTrackingAction(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override; + virtual void BeginOfEventAction(const G4Event*) override; private: typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.cxx index a33e2a7d53f472bb88539d6e21d2322279a039be..87bf445d1b806b5db3d72ebcdc570931d9a02494 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.cxx @@ -35,20 +35,16 @@ namespace G4UA{ StatusCode VerboseSelectorTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + } if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; - } if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + } if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.h index ec926c2eda274bf9ff4781ffef66ab1dd5ba2de3..23d0746de313c8c08d42ce6ef215d86313d7c3bf 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VerboseSelectorTool.h @@ -5,30 +5,28 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__VERBOSESELECTORTOOL_H #define G4DEBUGGINGTOOLS_G4UA__VERBOSESELECTORTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "VerboseSelector.h" namespace G4UA{ - class VerboseSelectorTool: - public ActionToolBase<VerboseSelector>, public IBeginEventActionTool, - public ISteppingActionTool, public IPreTrackingActionTool, public IPostTrackingActionTool + class VerboseSelectorTool : public ActionToolBase<VerboseSelector>, + public IG4EventActionTool, + public IG4SteppingActionTool, + public IG4TrackingActionTool { public: VerboseSelectorTool(const std::string& type, const std::string& name,const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.cxx index 56fcbb7fc4f10b4be1efe096151d23f4e57d99a5..abba23da1b51ed220a7b0a62759ba7a9be918d8f 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.cxx @@ -103,7 +103,7 @@ namespace G4UA{ } - void VolumeDebugger::beginOfRun(const G4Run*){ + void VolumeDebugger::BeginOfRunAction(const G4Run*){ std::call_once(VolumeDebugger_DumpGeometryOnce,&G4UA::VolumeDebugger::DumpGeometry,this); diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.h b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.h index 6c7fafcbc3887139357ae9dff5bcd18b858b7b94..6f8ddd589df66a6b21314dd69f972f72ab4340b4 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebugger.h @@ -11,7 +11,7 @@ class G4LogicalVolume; class G4VPhysicalVolume; -#include "G4AtlasInterfaces/IBeginRunAction.h" +#include "G4UserRunAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA{ @@ -33,7 +33,7 @@ namespace G4UA{ static std::once_flag VolumeDebugger_DumpGeometryOnce; class VolumeDebugger: - public AthMessaging, public IBeginRunAction + public AthMessaging, public G4UserRunAction { public: @@ -53,7 +53,7 @@ namespace G4UA{ VolumeDebugger(const Config& config); /// hook for G4 UA functionality - virtual void beginOfRun(const G4Run*) override; + virtual void BeginOfRunAction(const G4Run*) override; private: /// configuration data diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.cxx index 2c40bb645251284426e9c317435837f84d787e0e..03100373a06000eb0df63da3357834d784c282e3 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.cxx @@ -28,8 +28,8 @@ namespace G4UA{ } StatusCode VolumeDebuggerTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.h b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.h index 6d211a419c06389a87e51141cf6e1444d8d4fd34..41a0b12ed8f48f800d5baf537308216c4c51493a 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.h +++ b/Simulation/G4Utilities/G4DebuggingTools/src/VolumeDebuggerTool.h @@ -4,7 +4,7 @@ #ifndef G4DEBUGGINGTOOLS_G4UA__VOLUMEDEBUGGERTOOL_H #define G4DEBUGGINGTOOLS_G4UA__VOLUMEDEBUGGERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "./VolumeDebugger.h" @@ -20,15 +20,15 @@ namespace G4UA{ class VolumeDebuggerTool: public ActionToolBase<VolumeDebugger>, - public IBeginRunActionTool + public IG4RunActionTool { public: /// standard tool constructor VolumeDebuggerTool(const std::string& type, const std::string& name,const IInterface* parent); /// returns the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: /// builds the action for a thread diff --git a/Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py b/Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py index 5938d31cc7bd10ef7ceb5f62cdd752a3b3621593..f30f1c7534511113d6c09c093efdf46b949894ce 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py +++ b/Simulation/G4Utilities/G4ProfilingTools/share/postInclude.G4ProfilingTools.py @@ -9,7 +9,6 @@ print ServiceMgr.THistSvc from G4AtlasApps.SimFlags import simFlags # configuration for MT actions -simFlags.OptionalUserActionList.addAction('G4UA::TestActionTimerTool',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step']) -simFlags.OptionalUserActionList.addAction('G4UA::TestActionVPTimerTool',['BeginOfEvent','EndOfEvent','EndOfRun','BeginOfRun','Step']) -simFlags.OptionalUserActionList.addAction('G4UA::TestActionEHistTool',['BeginOfRun','EndOfRun','Step','BeginOfTracking','EndOfTracking']) - +simFlags.OptionalUserActionList.addAction('G4UA::TestActionTimerTool',['Event','Run','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::TestActionVPTimerTool',['Event','Run','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::TestActionEHistTool',['Run','Step','Tracking']) diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.cxx index be116a00ba979bffd925b673323099297b291411..4e9c31f5c2600ef59788f48ba4d2f41cb402be34 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.cxx @@ -46,7 +46,7 @@ namespace G4UA{ } - void TestActionEHist::preTracking(const G4Track* aTrack){ + void TestActionEHist::PreUserTrackingAction(const G4Track* aTrack){ if (aTrack) { // Set Particle label and empty trajectory @@ -61,21 +61,21 @@ namespace G4UA{ return; } - void TestActionEHist::postTracking(const G4Track* aTrack){ + void TestActionEHist::PostUserTrackingAction(const G4Track* aTrack){ if (aTrack) { m_trajectory.clear(); } return; } - void TestActionEHist::beginOfRun(const G4Run*){ + void TestActionEHist::BeginOfRunAction(const G4Run*){ // initialize histogramming file (DON'T USE GAUDI) & directories m_world = new TFile(m_config.name.c_str(), "RECREATE"); G4cout<<m_config.name<<" initialized, in directory "<<gDirectory->GetPath()<<G4endl; } - void TestActionEHist::endOfRun(const G4Run*){ + void TestActionEHist::EndOfRunAction(const G4Run*){ m_world->Write(); m_world->Close(); @@ -85,7 +85,7 @@ namespace G4UA{ return; } - void TestActionEHist::processStep(const G4Step* aStep){ + void TestActionEHist::UserSteppingAction(const G4Step* aStep){ if (aStep) { diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.h index ed4726834d71ae0a6d226d7c45cdd87a91b0edbe..1daebd48f1ad8cac866abb193eb0046e1c5bd3bd 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHist.h @@ -37,15 +37,13 @@ class IMessageSvc; class TFile; -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserTrackingAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" namespace G4UA{ class TestActionEHist: - public IPreTrackingAction, public IPostTrackingAction, public IBeginRunAction, public IEndRunAction, public ISteppingAction + public G4UserTrackingAction, public G4UserRunAction, public G4UserSteppingAction { public: @@ -63,11 +61,11 @@ namespace G4UA{ }; TestActionEHist(const Config& config); - virtual void preTracking(const G4Track*) override; - virtual void postTracking(const G4Track*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void PreUserTrackingAction(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; //!< holds the python configuration diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.cxx index 1264831b6f6ffe4dd1075f6e08b56cafe4dcea92..d8297a5cbcd0d9134328b2dde1f2700fa572c29b 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.cxx @@ -29,28 +29,18 @@ namespace G4UA{ StatusCode TestActionEHistTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.h index db2830061cd4a19f5f4c7a8e5dfeb46587c20170..e1f075af783a3cb74667e157d38c68a1b4027d52 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionEHistTool.h @@ -6,11 +6,9 @@ #ifndef G4PROFILINGTOOLS_G4UA__TESTACTIONEHISTTOOL_H #define G4PROFILINGTOOLS_G4UA__TESTACTIONEHISTTOOL_H -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TestActionEHist.h" @@ -26,27 +24,21 @@ namespace G4UA{ class TestActionEHistTool: public ActionToolBase<TestActionEHist>, - public IPreTrackingActionTool, public IPostTrackingActionTool, public IBeginRunActionTool, public IEndRunActionTool, public ISteppingActionTool + public IG4TrackingActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// Standard constructor TestActionEHistTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the begin of tracking action interface - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - /// Retrieve the end of tracking action interface - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } - /// Retrieve the BoR action interface - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// Retrieve the EoR action interface - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// Retrieve the tracking action interface + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } + /// Retrieve the run action interface + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudis query interface virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx index 4c3252e60446e6177a5d1e9e85aa4f9a898ce2c3..ff91a6fa9af5a013a443f8a2150074f82db9a964 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx @@ -100,7 +100,7 @@ namespace G4UA{ } - void TestActionTimer::beginOfEvent(const G4Event*){ + void TestActionTimer::BeginOfEventAction(const G4Event*){ m_report.nev++; @@ -117,7 +117,7 @@ namespace G4UA{ return; } - void TestActionTimer::endOfEvent(const G4Event*){ + void TestActionTimer::EndOfEventAction(const G4Event*){ m_report.runTime += TimerSum(m_runTimer); m_eventTime = TimerSum(m_eventTimer); @@ -129,7 +129,7 @@ namespace G4UA{ } - void TestActionTimer::beginOfRun(const G4Run*){ + void TestActionTimer::BeginOfRunAction(const G4Run*){ m_report.runTime=0.; @@ -138,14 +138,14 @@ namespace G4UA{ return; } - void TestActionTimer::endOfRun(const G4Run*){ - std::cerr<<"TestActionTimer::endOfRun "<< m_report.runTime <<std::endl; + void TestActionTimer::EndOfRunAction(const G4Run*){ + std::cerr<<"TestActionTimer::EndOfRunAction "<< m_report.runTime <<std::endl; m_report.runTime += TimerSum(m_runTimer); VPanic(); PPanic(); } - void TestActionTimer::processStep(const G4Step* aStep){ + void TestActionTimer::UserSteppingAction(const G4Step* aStep){ // HERE IS WHERE WE BEGIN OUR CLOCKING diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h index 55a4b21df4e1abcdc23243e2598c06fc6084c99a..e736983c6caeed98356baa2a52a38ea33b6460aa 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h @@ -35,11 +35,9 @@ class G4Timer; class ITHistSvc; -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" namespace G4UA{ /// @class TestActionTimer @@ -50,7 +48,7 @@ namespace G4UA{ /// @author Wolfgang Ehrenfeld, University of Hamburg, Germany class TestActionTimer: - public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public IEndRunAction, public ISteppingAction + public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: @@ -82,11 +80,11 @@ namespace G4UA{ const Report& getReport() const { return m_report; } - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; /* Enumeration for timers to be used First timers are by subdetector, second few are by particle diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx index 3c8db679ce9a8534d67f46014e584c66b03ba5d2..d6f85490aca778965309df35f1e5c0466fb9dd0b 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx @@ -20,28 +20,18 @@ namespace G4UA{ } StatusCode TestActionTimerTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.h index ca34d8dff53529ff34758df0980e70642c9af391..8da591871c47c5ba671a0b5e67b6b509cc786714 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.h @@ -4,11 +4,9 @@ #ifndef G4PROFILINGTOOLS_G4UA__TESTACTIONTIMERTOOL_H #define G4PROFILINGTOOLS_G4UA__TESTACTIONTIMERTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TestActionTimer.h" @@ -25,27 +23,21 @@ namespace G4UA{ /// class TestActionTimerTool: public ActionToolBaseReport<TestActionTimer>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public IEndRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// Standard constructor TestActionTimerTool(const std::string& type, const std::string& name,const IInterface* parent); - /// retrieve BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// retrieve EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// retrieve BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// retrieve EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// retrieve event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// retrieve run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// retrieve stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.cxx index a30f57c1e20a10d2356ea99ef70892382dd7b861..b9f8e7db517f63e00aeffc679ff7df8357f4f327 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.cxx @@ -59,29 +59,29 @@ namespace G4UA{ } - void TestActionVPTimer::beginOfEvent(const G4Event*){ + void TestActionVPTimer::BeginOfEventAction(const G4Event*){ m_report.nev++; m_eventTimer->Start(); } - void TestActionVPTimer::endOfEvent(const G4Event*){ + void TestActionVPTimer::EndOfEventAction(const G4Event*){ // this function also stops the timer. it will be restarted at BoE m_eventTime += TimerSum(m_eventTimer); } - void TestActionVPTimer::beginOfRun(const G4Run*){; + void TestActionVPTimer::BeginOfRunAction(const G4Run*){; m_runTimer->Start(); } - void TestActionVPTimer::endOfRun(const G4Run*){ + void TestActionVPTimer::EndOfRunAction(const G4Run*){ // this also stops the timer m_report.runTime += TimerSum(m_runTimer); } - void TestActionVPTimer::processStep(const G4Step* aStep){ + void TestActionVPTimer::UserSteppingAction(const G4Step* aStep){ // HERE IS WHERE WE BEGIN OUR CLOCKING -- ONLY IF // TIMERS ARE NOT VALID diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.h index 13f2d27e6c54c4ddea3e637c61ae867b008b0d98..01f90b7a220b7c6e3840e5fa2811b7d6654a7ffd 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimer.h @@ -44,16 +44,14 @@ class G4Step; class Algorithm; -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" namespace G4UA{ class TestActionVPTimer: - public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public IEndRunAction, public ISteppingAction + public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: @@ -143,11 +141,11 @@ namespace G4UA{ const Report& getReport() const { return m_report; } - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.cxx index 347ecbfa244a502bccf873cac04dbbb956b30f39..6252366626d54ae17671f36ea1226a8b38e3c7db 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.cxx @@ -49,28 +49,18 @@ namespace G4UA{ } StatusCode TestActionVPTimerTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } @@ -81,12 +71,10 @@ namespace G4UA{ StatusCode TestActionVPTimerTool::finalize(){ for(auto tidAction : this->actions()) { - ((IEndRunAction*)tidAction.second)->endOfRun(0); + ((G4UserRunAction*)tidAction.second)->EndOfRunAction(0); } - - - mergeReports(); + mergeReports(); if(m_report.time_index.size()){ diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.h index a0eeccbfb209e347eb0ebca75ece6d9890dd0fb5..7cc539a3bb08f0f5e9fedd0b43b299902c440bb6 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionVPTimerTool.h @@ -4,11 +4,9 @@ #ifndef G4PROFILINGTOOLS_G4UA__TESTACTIONVPTIMERTOOL_H #define G4PROFILINGTOOLS_G4UA__TESTACTIONVPTIMERTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TestActionVPTimer.h" @@ -26,27 +24,21 @@ namespace G4UA{ class TestActionVPTimerTool: public ActionToolBaseReport<TestActionVPTimer>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public IEndRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// constructor TestActionVPTimerTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// Retrieve the BoR action interface - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// Retrieve the EoR action interface - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// Retrieve the event action interface + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// Retrieve the run action interface + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// gaudi interface query virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; /// triggers report merging from threads diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeAction.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeAction.h index 2cf9c6788bbdc149365722a65596d355054473e6..de883f00d89e26c88f041049452c33a8d1eb7de0 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeAction.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeAction.h @@ -8,10 +8,9 @@ #include "StoreGate/WriteHandle.h" #include "TrackRecord/TrackRecordCollection.h" // Can't be forward declared - it's a type def -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserTrackingAction.hh" #include "CLHEP/Units/SystemOfUnits.h" @@ -19,8 +18,9 @@ namespace G4UA { /// @brief NEEDS DOCUMENTATION - class CosmicPerigeeAction final : public ISteppingAction, public IEndEventAction, - public IBeginEventAction, public IPreTrackingAction + class CosmicPerigeeAction final : public G4UserSteppingAction, + public G4UserEventAction, + public G4UserTrackingAction { public: @@ -32,10 +32,10 @@ namespace G4UA CosmicPerigeeAction(const Config& config); - virtual void processStep(const G4Step*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void preTracking(const G4Track*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void PreUserTrackingAction(const G4Track*) override; private: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeActionTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeActionTool.h index a9f6a5e1d2967d8f456ee574dcb384c2787ce1ab..a74cfb697bca3ad9b989f833e2cd5fd4b1a39125 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeActionTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/CosmicPerigeeActionTool.h @@ -9,10 +9,9 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -29,10 +28,9 @@ namespace G4UA /// @author Andrea Di Simone /// class CosmicPerigeeActionTool : public ActionToolBase<CosmicPerigeeAction>, - public ISteppingActionTool, - public IEndEventActionTool, - public IBeginEventActionTool, - public IPreTrackingActionTool + public IG4SteppingActionTool, + public IG4EventActionTool, + public IG4TrackingActionTool { public: @@ -43,20 +41,16 @@ namespace G4UA /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } - /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - - /// Retrieve the end-event action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// Retrieve the event action interface + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the preTracking action interface - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKiller.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKiller.h index 010a8852fc9f0d8f79b3a11f439208558f913950..271ed7cf4089f5c7f7a9c1640c278df42d8d5ac9 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKiller.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKiller.h @@ -6,15 +6,16 @@ #define G4UserActions_FastIDKiller_H -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA { /// @brief NEEDS DOCUMENTATION - class FastIDKiller : public IBeginRunAction, public ISteppingAction, + class FastIDKiller : public G4UserRunAction, + public G4UserSteppingAction, public AthMessaging { @@ -43,8 +44,8 @@ namespace G4UA const Report& getReport() const { return m_report; } - virtual void beginOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKillerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKillerTool.h index 50a58d2de79179e775a2b72cc67aa99658e50255..075f8ce7e8a8c5a4d46eb1d76ff5623c85b62bb0 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKillerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/FastIDKillerTool.h @@ -5,8 +5,8 @@ #ifndef G4USERACTIONS_G4UA__FASTIDKILLERTOOL_H #define G4USERACTIONS_G4UA__FASTIDKILLERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/FastIDKiller.h" @@ -15,8 +15,8 @@ namespace G4UA /// @brief NEEDS DOCUMENTATION class FastIDKillerTool: public ActionToolBaseReport<FastIDKiller>, - public IBeginRunActionTool, - public ISteppingActionTool + public IG4RunActionTool, + public IG4SteppingActionTool { public: @@ -25,11 +25,11 @@ namespace G4UA FastIDKillerTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode finalize() override; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorder.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorder.h index dbf1b28ca7f3be35d80f15527ade021b1ab53f6d..2359d92bc0fc33cd99c7469e13158ba47b47d93a 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorder.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorder.h @@ -7,10 +7,9 @@ -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include <vector> @@ -20,16 +19,17 @@ class TH1D; namespace G4UA { - class FluxRecorder : public IBeginRunAction, public IEndRunAction, - public IEndEventAction, public ISteppingAction + class FluxRecorder : public G4UserRunAction, + public G4UserEventAction, + public G4UserSteppingAction { public: FluxRecorder(); - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: enum scoringVolume {RPCOlz,RPCOmz,RPCOhz,RPCMlz,RPCMmz,RPCMhz,MDTIlz,MDTImz,MDTIhz, LMDTo,LMDTm,LMDTi,BMDTo,BMDTm,BMDTi,SWo,SWm,SWi,SWc,SWt, diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorderTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorderTool.h index 9b33acb058db542f38e1d609c2771ada9be426a6..8fa62f0cdb9d768d1cf24373f58b6a1f54d49da6 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorderTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/FluxRecorderTool.h @@ -5,10 +5,9 @@ #ifndef G4USERACTIONS_G4UA__FLUXRECORDERTOOL_H #define G4USERACTIONS_G4UA__FLUXRECORDERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/FluxRecorder.h" @@ -24,29 +23,29 @@ namespace G4UA /// @author Andrea Di Simone /// class FluxRecorderTool : public ActionToolBase<FluxRecorder>, - public IBeginRunActionTool, public IEndRunActionTool, - public IEndEventActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4EventActionTool, + public IG4SteppingActionTool { public: + /// standard tool ctor FluxRecorderTool(const std::string& type, const std::string& name,const IInterface* parent); - /// retrieves the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// retrieves the EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } - /// retrieves the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// retrieves the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + /// retrieves the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// retrieves the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + protected: + /// create action for this thread virtual std::unique_ptr<FluxRecorder> makeAction() override final; - private: + }; // class FluxRecorderTool } // namespace G4UA diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimer.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimer.h index 7220c968c8cbfac5b65cbd768066dc8e103b5f97..b7c0a49bd6cd7ccdd96568ace07ce6b03a9b5d11 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimer.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimer.h @@ -2,17 +2,15 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - #ifndef G4USERACTIONS_G4UA_G4SIMTIMER_H #define G4USERACTIONS_G4UA_G4SIMTIMER_H // Infrastructure includes #include "AthenaKernel/MsgStreamMember.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" // Geant4 includes #include "G4Timer.hh" +#include "G4UserEventAction.hh" // Forward declarations class G4Event; @@ -24,7 +22,7 @@ namespace G4UA /// @class G4SimTimer /// @brief A user action for monitoring G4 runtime at event and run level. /// - /// This class implements the BeginEvent and EndEvent, and BeginRun actions. + /// This class implements the event and run action interfaces. /// The implementation was mostly taken from the previous G4SimTimer design. /// Results across worker threads are merged in finalize method of the /// G4SimTimerTool. @@ -40,7 +38,7 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell> /// @author ??? /// - class G4SimTimer : public IBeginEventAction, public IEndEventAction + class G4SimTimer : public G4UserEventAction { public: @@ -61,9 +59,9 @@ namespace G4UA std::pair<double, double> meanAndSigma(); void merge(const Report& rep){ - nEvent+=rep.nEvent; - eventTime+=rep.eventTime; - eventTimeSquared+=rep.eventTimeSquared; + nEvent += rep.nEvent; + eventTime += rep.eventTime; + eventTimeSquared += rep.eventTimeSquared; } }; @@ -71,10 +69,10 @@ namespace G4UA G4SimTimer(); /// Start timing this Geant4 event. - virtual void beginOfEvent(const G4Event* event) override; + virtual void BeginOfEventAction(const G4Event* event) override final; /// Finish timing this Geant4 event. - virtual void endOfEvent(const G4Event* event) override; + virtual void EndOfEventAction(const G4Event* event) override final; /// Retrieve my timing results const Report& getReport() const diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimerTool.h index 74c3828d7d301ea1a6bfb93669026ab2daa8786a..b734a014ecee4a2f6c54f69e741d2f37b6221e26 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4SimTimerTool.h @@ -9,8 +9,7 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -28,7 +27,7 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4SimTimerTool : public ActionToolBaseReport<G4SimTimer>, - public IBeginEventActionTool, public IEndEventActionTool + public IG4EventActionTool { public: @@ -44,12 +43,8 @@ namespace G4UA virtual StatusCode finalize() override; /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - - /// Retreive the end-event action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounter.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounter.h index 9aae4a366d5d9d3fb78d4097595682f6926791cd..5fe848167e09032ed24c86330ce9b9d1885959de 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounter.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounter.h @@ -5,10 +5,9 @@ #ifndef G4USERACTIONS__G4UA_G4TRACKCOUNTER_H #define G4USERACTIONS__G4UA_G4TRACKCOUNTER_H -// Infrastructure includes -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" +// Geant4 includes +#include "G4UserEventAction.hh" +#include "G4UserTrackingAction.hh" namespace G4UA @@ -17,14 +16,10 @@ namespace G4UA /// @class G4TrackCounter /// @brief A simple action which counts tracks. /// - /// This action currently implements BeginEvent, EndRun, and PreTracking - /// interfaces. It's not clear if we really want to implement EndRun here. - /// Presumably we'll need to merge the counter results across threads, so it - /// might make sense to move some of that functionality in the finalize - /// method of the corresponding tool. + /// This action currently implements BeginEvent and PreTracking interfaces. /// - class G4TrackCounter : public IBeginEventAction, - public IPreTrackingAction + class G4TrackCounter : public G4UserEventAction, + public G4UserTrackingAction { public: @@ -50,10 +45,10 @@ namespace G4UA /// @brief Increments event counter. /// I feel like there must be a better way to get this info. /// Hmm, the G4Run has a numberOfEvent field... - virtual void beginOfEvent(const G4Event* event) override; + virtual void BeginOfEventAction(const G4Event* event) override final; /// Increments the track counters - virtual void preTracking(const G4Track* track) override; + virtual void PreUserTrackingAction(const G4Track* track) override final; /// Retrieve my counts const Report& getReport() const diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounterTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounterTool.h index d0f61a9b171a94897adb953728a0cb3be951ecd5..5fd9d688a7a70d65b8b1cb78c35a23ea3813e610 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounterTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/G4TrackCounterTool.h @@ -5,12 +5,9 @@ #ifndef G4USERACTIONS__G4UA_G4TRACKCOUNTERTOOL_H #define G4USERACTIONS__G4UA_G4TRACKCOUNTERTOOL_H -// STL includes -#include <string> - // Infrastructure includes -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -27,8 +24,8 @@ namespace G4UA /// @author Steve Farrell <Steven.Farrell@cern.ch> /// class G4TrackCounterTool : public ActionToolBaseReport<G4TrackCounter>, - public IBeginEventActionTool, - public IPreTrackingActionTool + public IG4EventActionTool, + public IG4TrackingActionTool { public: @@ -37,19 +34,19 @@ namespace G4UA G4TrackCounterTool(const std::string& type, const std::string& name, const IInterface* parent); - /// Initialize tool - temporarily just for debugging - virtual StatusCode initialize() override; + /// Initialize tool + virtual StatusCode initialize() override final; /// Finalize and merge results from all threads - virtual StatusCode finalize() override; + virtual StatusCode finalize() override final; - /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } + /// Retrieve the event action interface + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } - /// Retrieve the pre-tracking action interface - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } + /// Retrieve the tracking action interface + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKiller.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKiller.h index 1262107b5bf2c6c0beaf534017b56c9b1fd9475b..4064e0b8b74b1d7052dc7f21c6858f7ba7bad21f 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKiller.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKiller.h @@ -5,18 +5,18 @@ #ifndef G4UserActions_HIPKiller_H #define G4UserActions_HIPKiller_H -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA { /// @brief Kills Monopoles and QBalls with energy < 1 MeV - class HIPKiller : public ISteppingAction, public AthMessaging + class HIPKiller : public G4UserSteppingAction, public AthMessaging { public: HIPKiller(); - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; private: }; // class HIPKiller diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKillerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKillerTool.h index 0db4ca79f495692d338bfa787d1e1140d98239ab..2fbc4bac1b5f35cdbefaf50a7e367b61b6ae79ae 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKillerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPKillerTool.h @@ -4,7 +4,7 @@ #ifndef G4USERACTIONS_G4UA__HIPKILLERTOOL_H #define G4USERACTIONS_G4UA__HIPKILLERTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/HIPKiller.h" @@ -13,7 +13,7 @@ namespace G4UA /// @brief Tool which manages the HIPKiller user action. /// - class HIPKillerTool: public ActionToolBase<HIPKiller>, public ISteppingActionTool + class HIPKillerTool: public ActionToolBase<HIPKiller>, public IG4SteppingActionTool { public: @@ -22,8 +22,8 @@ namespace G4UA HIPKillerTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAccept.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAccept.h index d00d046684dd0d19b0c0edc5ab34ef8c5a629299..0c522e2059cc2ce392d64110f5664d75e0fb16e3 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAccept.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAccept.h @@ -5,11 +5,9 @@ #ifndef G4UserActions_HIPLArVolumeAccept_H #define G4UserActions_HIPLArVolumeAccept_H -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" #include "AthenaBaseComps/AthMessaging.h" #include "GaudiKernel/ServiceHandle.h" @@ -18,8 +16,9 @@ namespace G4UA { /// @brief NEEDS DOCUMENTATION - class HIPLArVolumeAccept : public AthMessaging, public ISteppingAction, - public IBeginEventAction, public IEndEventAction + class HIPLArVolumeAccept : public AthMessaging, + public G4UserSteppingAction, + public G4UserEventAction { public: HIPLArVolumeAccept(); @@ -38,9 +37,9 @@ namespace G4UA const Report& getReport() const { return m_report; } - virtual void processStep(const G4Step*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; private: Report m_report; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAcceptTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAcceptTool.h index 4b9ecf03573185d2cdcc22b173f6cde5753fceb9..a6544d213f0d2254b57c07181875642c8c067f1d 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAcceptTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HIPLArVolumeAcceptTool.h @@ -5,9 +5,8 @@ #ifndef G4USERACTIONS_G4UA__HIPLARVOLUMEACCEPTTOOL_H #define G4USERACTIONS_G4UA__HIPLARVOLUMEACCEPTTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/HIPLArVolumeAccept.h" @@ -17,9 +16,8 @@ namespace G4UA /// Tool which manages the HIPLArVolumeAccept action /// class HIPLArVolumeAcceptTool : public ActionToolBaseReport<HIPLArVolumeAccept>, - public ISteppingActionTool, - public IBeginEventActionTool, - public IEndEventActionTool + public IG4SteppingActionTool, + public IG4EventActionTool { public: @@ -28,14 +26,11 @@ namespace G4UA HIPLArVolumeAcceptTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } virtual StatusCode finalize() override; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapper.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapper.h index f52c144191fe1256689c2ecddbed0ebccc07b82e..b0e00f1c57dd6da0e3c983cff41b05d69fa5fc02 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapper.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapper.h @@ -6,7 +6,7 @@ #define G4UserActions_HitWrapper_H -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserEventAction.hh" #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" #include "AthenaBaseComps/AthMessaging.h" @@ -15,7 +15,7 @@ namespace G4UA { /// @brief NEEDS DOCUMENTATION - class HitWrapper : public AthMessaging, public IEndEventAction + class HitWrapper : public AthMessaging, public G4UserEventAction { public: @@ -25,7 +25,7 @@ namespace G4UA }; HitWrapper(const Config& config); - virtual void endOfEvent(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; private: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapperTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapperTool.h index 41f16c50ce0e74f3b5ee36be3db2f12f6aa96022..52054f8764b3369c67ab0cdbb480bd028a769089 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapperTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/HitWrapperTool.h @@ -5,7 +5,7 @@ #ifndef G4USERACTIONS_G4UA__HITWRAPPERTOOL_H #define G4USERACTIONS_G4UA__HITWRAPPERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/HitWrapper.h" @@ -14,15 +14,15 @@ namespace G4UA /// @brief A tool which manages the HitWrapper user action. class HitWrapperTool : public ActionToolBase<HitWrapper>, - public IEndEventActionTool + public IG4EventActionTool { public: /// Standard constructor HitWrapperTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } protected: virtual std::unique_ptr<HitWrapper> makeAction() override final; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegrator.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegrator.h index c34fb2d50219a703ae492c02d2e4c7e76d149997..eaab8edbcf9162284740a32252a99def1f7f7157 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegrator.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegrator.h @@ -8,22 +8,19 @@ #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/ServiceHandle.h" -#include <string> -#include <map> - #include "G4Pow.hh" #include "TString.h" -class TProfile; -class TProfile2D; +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" +#include <string> +#include <map> -// User action to evaluate the thickness (in %r.l. or i.l.) of all detectors -// traversed by outgoing particles +// Forward declarations +class TProfile; +class TProfile2D; -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" namespace G4UA { @@ -41,9 +38,8 @@ namespace G4UA /// that each instance has its own copy of the histograms which get merged in /// finalization of the LengthIntegratorTool. /// - class LengthIntegrator final : public IBeginEventAction, - public IEndEventAction, - public ISteppingAction + class LengthIntegrator final : public G4UserEventAction, + public G4UserSteppingAction { public: @@ -53,13 +49,13 @@ namespace G4UA /// Called at beginning of G4 event to cache some details about the /// current primary vertex and particle. Also resets some measurements. - virtual void beginOfEvent(const G4Event*) override; + virtual void BeginOfEventAction(const G4Event*) override; /// Called at end of G4 event to finalize measurements and fill hists - virtual void endOfEvent(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; /// Called at every particle step to accumulate thickness. - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; private: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegratorTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegratorTool.h index 15c9c73df74cf8ebda29f69618a765c7293e6ecd..b1489cd892687605c4dd01a270997d4446b6d132 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegratorTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/LengthIntegratorTool.h @@ -10,9 +10,8 @@ #include "GaudiKernel/ITHistSvc.h" // User action infrastructure includes -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -27,9 +26,8 @@ namespace G4UA /// Creates the LengthIntegrator for each worker thread. /// class LengthIntegratorTool : public ActionToolBase<LengthIntegrator>, - public IBeginEventActionTool, - public IEndEventActionTool, - public ISteppingActionTool + public IG4EventActionTool, + public IG4SteppingActionTool { public: @@ -41,17 +39,13 @@ namespace G4UA /// Initialize the tool virtual StatusCode initialize() override; - /// Retrieve the begin-event action interface - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - - /// Retrieve the end-event action interface - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// Retrieve the event action interface + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the stepping action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKiller.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKiller.h index 2cdb28c650b30c0ea2bf2377114568763be0e02d..c8abd6e369fea7beb6c90b13d9c83ae845a87e85 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKiller.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKiller.h @@ -9,7 +9,7 @@ // Infrastructure includes #include "AthenaKernel/MsgStreamMember.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" class StoreGateSvc; @@ -20,7 +20,7 @@ namespace G4UA /// @class LooperKiller /// @brief A user action to kill looping tracks. /// - class LooperKiller final : public ISteppingAction, public AthMessaging + class LooperKiller final : public G4UserSteppingAction, public AthMessaging { public: @@ -44,7 +44,7 @@ namespace G4UA LooperKiller(const Config& config); - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; /// Retrieve results const Report& getReport() const { return m_report; } diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKillerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKillerTool.h index 7809c6f54084b5543eb48a4a5391359c819008c4..b8c923590c66e671f1e602f3d9f6fb17d16f187b 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKillerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/LooperKillerTool.h @@ -9,7 +9,7 @@ #include <string> // Infrastructure includes -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" // Local includes @@ -26,7 +26,7 @@ namespace G4UA /// @author Andrea Di Simone /// class LooperKillerTool : public ActionToolBaseReport<LooperKiller>, - public ISteppingActionTool + public IG4SteppingActionTool { public: @@ -40,8 +40,8 @@ namespace G4UA virtual StatusCode finalize() override; /// Retrieve the begin-event action interface - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservation.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservation.h index 16246fcaba238e666be760796c38f8a5982eaffb..5f82593d4f89ba096c89bb0b3ecd0753cc9e4e1a 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservation.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservation.h @@ -5,9 +5,8 @@ #ifndef G4UserActions_MomentumConservation_H #define G4UserActions_MomentumConservation_H - -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaKernel/MsgStreamMember.h" #include <iostream> @@ -17,7 +16,7 @@ namespace G4UA /// @class MomentumConservation /// @brief checks momentum conservation - class MomentumConservation : public IEndEventAction, public ISteppingAction + class MomentumConservation : public G4UserEventAction, public G4UserSteppingAction { public: @@ -25,8 +24,8 @@ namespace G4UA : m_msg("MomentumConservation"), _sum_edep(0), _sum_eesc(0) {} - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservationTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservationTool.h index e775ad3155a944fbf877a7bdd8630cd0977e9b34..4cf2c23352884f541433c3a7652083db6734bd29 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservationTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/MomentumConservationTool.h @@ -5,8 +5,8 @@ #ifndef G4USERACTIONS_G4UA__MOMENTUMCONSERVATIONTOOL_H #define G4USERACTIONS_G4UA__MOMENTUMCONSERVATIONTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/MomentumConservation.h" @@ -16,8 +16,8 @@ namespace G4UA /// @brief Tool which manages the MomentumConservation user action. /// class MomentumConservationTool : public ActionToolBase<MomentumConservation>, - public IEndEventActionTool, - public ISteppingActionTool + public IG4EventActionTool, + public IG4SteppingActionTool { public: @@ -26,11 +26,11 @@ namespace G4UA MomentumConservationTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKiller.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKiller.h index 03b2aa284a18d152c77f76d818ca0f887250a278..6650e2b4cf4e841f362d011804ce27f9b462bcdd 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKiller.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKiller.h @@ -5,19 +5,20 @@ #ifndef G4UserActions_PhotonKiller_H #define G4UserActions_PhotonKiller_H -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" +// Geant4 includes +#include "G4UserSteppingAction.hh" +#include "G4UserTrackingAction.hh" namespace G4UA { /// @brief NEEDS DOCUMENTATION - class PhotonKiller : public ISteppingAction, public IPreTrackingAction + class PhotonKiller : public G4UserSteppingAction, public G4UserTrackingAction { public: PhotonKiller(); - virtual void processStep(const G4Step*) override; - virtual void preTracking(const G4Track*) override; + virtual void UserSteppingAction(const G4Step*) override final; + virtual void PreUserTrackingAction(const G4Track*) override final; private: int m_count; float m_energy; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKillerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKillerTool.h index 694e52e3ec5acd7c1c1cb6c605a7e4193b9e4362..0cfc6998bd9892f9e677a9c6c8d49a5899c77d89 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKillerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/PhotonKillerTool.h @@ -5,9 +5,9 @@ #ifndef G4USERACTIONS_G4UA__PHOTONKILLERTOOL_H #define G4USERACTIONS_G4UA__PHOTONKILLERTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasTools/ActionToolBase.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/PhotonKiller.h" namespace G4UA @@ -16,7 +16,7 @@ namespace G4UA /// @brief Tool which manages the PhotonKiller user action. /// class PhotonKillerTool : public ActionToolBase<PhotonKiller>, - public ISteppingActionTool, public IPreTrackingActionTool + public IG4SteppingActionTool, public IG4TrackingActionTool { public: @@ -25,11 +25,11 @@ namespace G4UA PhotonKillerTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlane.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlane.h index 34c33b17985a06de33f649f9f78bfdd40ed8559a..3a804bcec33865871d61e2aa0014bd988cd892ce 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlane.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlane.h @@ -5,11 +5,9 @@ #ifndef G4UserActions_ScoringPlane_H #define G4UserActions_ScoringPlane_H -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" #include <string> @@ -21,9 +19,9 @@ namespace G4UA /// @class ScoringPlane /// @todo TODO NEEDS DOCUMENTATION - class ScoringPlane : public IBeginRunAction, public IEndRunAction, - public ISteppingAction, public IBeginEventAction, - public IEndEventAction + class ScoringPlane : public G4UserRunAction, + public G4UserSteppingAction, + public G4UserEventAction { public: @@ -36,11 +34,11 @@ namespace G4UA }; ScoringPlane(const Config& config); - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; private: Config m_config; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlaneTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlaneTool.h index 20f2897cb4f7d37801d5e6da679cae720f5cb87a..2cb591aefd4dc3ae252a17a19d387cc78ca00e4a 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlaneTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringPlaneTool.h @@ -4,11 +4,9 @@ #ifndef G4USERACTIONS_G4UA__SCORINGPLANETOOL_H #define G4USERACTIONS_G4UA__SCORINGPLANETOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/ScoringPlane.h" @@ -23,33 +21,32 @@ namespace G4UA /// @author Andrea Di Simone /// class ScoringPlaneTool : public ActionToolBase<ScoringPlane>, - public IBeginRunActionTool, public IEndRunActionTool, - public ISteppingActionTool, public IBeginEventActionTool, - public IEndEventActionTool + public IG4RunActionTool, + public IG4SteppingActionTool, + public IG4EventActionTool { public: + /// standard tool ctor ScoringPlaneTool(const std::string& type, const std::string& name,const IInterface* parent); - /// retrieves BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// retrieves EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// retrieves run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// retrieves stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - /// retrieves BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// retrieves EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + /// retrieves event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + protected: + /// creates the action instances virtual std::unique_ptr<ScoringPlane> makeAction() override final; + private: + /// holds the python configuration ScoringPlane::Config m_config; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKiller.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKiller.h index e27577c4a277c78b88af578bf739f0a497844584..6ea12305e6d199d6f2b6481572887fb3c3f0e2d8 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKiller.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKiller.h @@ -5,21 +5,21 @@ #ifndef G4UserActions_ScoringVolumeTrackKiller_H #define G4UserActions_ScoringVolumeTrackKiller_H -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA { /// @brief NEEDS DOCUMENTATION - class ScoringVolumeTrackKiller : public AthMessaging, public IEndEventAction, - public ISteppingAction + class ScoringVolumeTrackKiller : public AthMessaging, public G4UserEventAction, + public G4UserSteppingAction { public: ScoringVolumeTrackKiller(); - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: unsigned long m_killCount; }; // class ScoringVolumeTrackKiller diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKillerTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKillerTool.h index 8f2ddd1c4752c7d603640debea9f11528ddf3ab6..bd9102806dcbfd54ca07fddfba460c3dfdbc83da 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKillerTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/ScoringVolumeTrackKillerTool.h @@ -4,8 +4,8 @@ #ifndef G4USERACTIONS_G4UA__SCORINGVOLUMETRACKKILLERTOOL_H #define G4USERACTIONS_G4UA__SCORINGVOLUMETRACKKILLERTOOL_H -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/ScoringVolumeTrackKiller.h" @@ -15,8 +15,8 @@ namespace G4UA /// @brief Tool which manages the ScoringVolumeTrackKiller user action. /// class ScoringVolumeTrackKillerTool : public ActionToolBase<ScoringVolumeTrackKiller>, - public IEndEventActionTool, - public ISteppingActionTool + public IG4EventActionTool, + public IG4SteppingActionTool { public: @@ -25,10 +25,10 @@ namespace G4UA ScoringVolumeTrackKillerTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleAction.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleAction.h index 51bf4a44b315dd344bd952eaa155fb08cbdb8bb5..f976ac5ed629a593e9922fe8aca3b1a9448b86c2 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleAction.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleAction.h @@ -7,7 +7,7 @@ #include <string> -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" class TrackFastSimSD; @@ -16,11 +16,11 @@ namespace G4UA { /// @brief NEEDS DOCUMENTATION - class StoppedParticleAction : public AthMessaging, public ISteppingAction + class StoppedParticleAction : public AthMessaging, public G4UserSteppingAction { public: StoppedParticleAction(); - virtual void processStep(const G4Step*) override; + virtual void UserSteppingAction(const G4Step*) override; private: bool isSUSYParticle(const int) const; TrackFastSimSD * m_fsSD; diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleActionTool.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleActionTool.h index 2a256bae7168e6149f0e6d6d4ef562482467d8bb..ea14a25da1e9d06ecbe96e752d2c0d5d796a295d 100644 --- a/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleActionTool.h +++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/StoppedParticleActionTool.h @@ -5,7 +5,7 @@ #ifndef G4USERACTIONS_G4UA__STOPPEDPARTICLEACTIONTOOL_H #define G4USERACTIONS_G4UA__STOPPEDPARTICLEACTIONTOOL_H -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "G4UserActions/StoppedParticleAction.h" @@ -15,7 +15,7 @@ namespace G4UA /// @brief Tool which manages the StoppedParticleAction /// class StoppedParticleActionTool: public ActionToolBase<StoppedParticleAction>, - public ISteppingActionTool + public IG4SteppingActionTool { public: @@ -24,8 +24,8 @@ namespace G4UA StoppedParticleActionTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } protected: diff --git a/Simulation/G4Utilities/G4UserActions/python/G4UserActionsConfig.py b/Simulation/G4Utilities/G4UserActions/python/G4UserActionsConfig.py index e8802dd2a1ed6570ebab89e23785e3d01db9f6bc..453d79875293d29b78700ea7a209262a524211a2 100644 --- a/Simulation/G4Utilities/G4UserActions/python/G4UserActionsConfig.py +++ b/Simulation/G4Utilities/G4UserActions/python/G4UserActionsConfig.py @@ -29,7 +29,7 @@ def getFastMBKillerTool(name="G4UA::FastMBKillerTool", **kwargs): def addFastIDKillerTool(name="G4UA::FastIDKillerTool",system=False): - G4AtlasServicesConfig.addAction(name,['BeginOfRun','Step'],system) + G4AtlasServicesConfig.addAction(name,['Run','Step'],system) def getHIPKillerTool(name="G4UA::HIPKillerTool", **kwargs): @@ -45,7 +45,7 @@ def getHIPLArVolumeAcceptTool(name="G4UA::HIPLArVolumeAcceptTool", **kwargs): def addHIPLArVolumeAcceptTool(name="G4UA::HIPLArVolumeAcceptTool", system=False): - G4AtlasServicesConfig.addAction(theTool,['Step','BeginOfEvent','EndOfEvent'],system) + G4AtlasServicesConfig.addAction(theTool,['Step','Event'],system) def getLooperKillerTool(name="G4UA::LooperKillerTool", **kwargs): @@ -77,7 +77,7 @@ def getMomentumConservationTool(name="G4UA::MomentumConservationTool", **kwargs) def addMomentumConservationTool(name="G4UA::MomentumConservationTool", system=False): - G4AtlasServicesConfig.addAction(name,['Step','EndOfEvent'],system) + G4AtlasServicesConfig.addAction(name,['Step','Event'],system) def getScoringVolumeTrackKillerTool(name="G4UA::ScoringVolumeTrackKillerTool", **kwargs): @@ -85,7 +85,7 @@ def getScoringVolumeTrackKillerTool(name="G4UA::ScoringVolumeTrackKillerTool", * def addScoringVolumeTrackKillerTool(name="G4UA::ScoringVolumeTrackKillerTool", system=False): - G4AtlasServicesConfig.addAction(theTool,['Step','EndOfEvent'],system) + G4AtlasServicesConfig.addAction(theTool,['Step','Event'],system) def getScoringPlaneTool(name="G4UA::ScoringPlaneTool", **kwargs): diff --git a/Simulation/G4Utilities/G4UserActions/share/LengthIntegrator_options.py b/Simulation/G4Utilities/G4UserActions/share/LengthIntegrator_options.py index 41c6cf41eac0b900f80d665e2c26d164aeccbc48..bb8be99530f12fcf7d2b31cde0eaa435c46c425a 100644 --- a/Simulation/G4Utilities/G4UserActions/share/LengthIntegrator_options.py +++ b/Simulation/G4Utilities/G4UserActions/share/LengthIntegrator_options.py @@ -1,6 +1,6 @@ ## Add RadLengthIntegrator to the UserActions, and produce a histogram from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::LengthIntegratorTool',['BeginOfEvent','EndOfEvent','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::LengthIntegratorTool',['Event','Step']) from AthenaCommon.AppMgr import ServiceMgr diff --git a/Simulation/G4Utilities/G4UserActions/share/jobOptions.FastIDKiller.py b/Simulation/G4Utilities/G4UserActions/share/jobOptions.FastIDKiller.py index 94c2ed656465f09f22fbe00682d634367ef50d93..a5270fa479f215251a7177e444f19f721d9d528a 100644 --- a/Simulation/G4Utilities/G4UserActions/share/jobOptions.FastIDKiller.py +++ b/Simulation/G4Utilities/G4UserActions/share/jobOptions.FastIDKiller.py @@ -9,7 +9,7 @@ __version__="$Revision: 1.3 $" #============================================================== from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::FastIDKillerTool',['BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::FastIDKillerTool',['Run','Step']) #--- End jobOptions.FastIDKiller.py file ------------------------------ diff --git a/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeAction.cxx b/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeAction.cxx index a4a85f7d1a34cbbc226562334a07667ad1191358..bf26bd9b8ae61ef8d3252fc1b799f11df8edb5fb 100644 --- a/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeAction.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeAction.cxx @@ -29,7 +29,7 @@ namespace G4UA } //--------------------------------------------------------------------------- - void CosmicPerigeeAction::beginOfEvent(const G4Event*) + void CosmicPerigeeAction::BeginOfEventAction(const G4Event*) { if (!m_trackRecordCollection.isValid()) { m_trackRecordCollection = CxxUtils::make_unique<TrackRecordCollection>( @@ -43,19 +43,19 @@ namespace G4UA } //--------------------------------------------------------------------------- - void CosmicPerigeeAction::endOfEvent(const G4Event*) + void CosmicPerigeeAction::EndOfEventAction(const G4Event*) { } //--------------------------------------------------------------------------- - void CosmicPerigeeAction::preTracking(const G4Track*) + void CosmicPerigeeAction::PreUserTrackingAction(const G4Track*) { // reset the field m_hasBeenSaved = false; } //--------------------------------------------------------------------------- - void CosmicPerigeeAction::processStep(const G4Step* aStep) + void CosmicPerigeeAction::UserSteppingAction(const G4Step* aStep) { // See if this is a new track if (aStep->GetPreStepPoint()->GetStepStatus() == fUndefined) diff --git a/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeActionTool.cxx b/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeActionTool.cxx index 9c735ff8aaffa567459b78332515defc151c05c0..84ed3d8f2c677f803708f067fda9e8d3b12bea56 100644 --- a/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeActionTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/CosmicPerigeeActionTool.cxx @@ -15,10 +15,9 @@ namespace G4UA const IInterface* parent) : ActionToolBase<CosmicPerigeeAction>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); - declareInterface<IBeginEventActionTool>(this); - declareInterface<IEndEventActionTool>(this); - declareInterface<IPreTrackingActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4TrackingActionTool>(this); declareProperty("pMinPrimary", m_config.pMinPrimary); } diff --git a/Simulation/G4Utilities/G4UserActions/src/FastIDKiller.cxx b/Simulation/G4Utilities/G4UserActions/src/FastIDKiller.cxx index 863a86a42e902a7b748bd0cdd544843c36b32cc9..e258299d5899f8a3899836fa8de3fb002c9a0d92 100644 --- a/Simulation/G4Utilities/G4UserActions/src/FastIDKiller.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/FastIDKiller.cxx @@ -32,7 +32,7 @@ namespace G4UA } //--------------------------------------------------------------------------- - void FastIDKiller::beginOfRun(const G4Run*) + void FastIDKiller::BeginOfRunAction(const G4Run*) { ATH_MSG_INFO( "Including the Fast Inner Detector Killer." << std::endl << "\t This piece of code will kill all particles leaving the" << std::endl @@ -73,7 +73,7 @@ namespace G4UA //--------------------------------------------------------------------------- - void FastIDKiller::processStep(const G4Step* aStep){ + void FastIDKiller::UserSteppingAction(const G4Step* aStep){ if (msgLvl(MSG::VERBOSE)){ ATH_MSG_DEBUG( " ===================================================== " ); diff --git a/Simulation/G4Utilities/G4UserActions/src/FastIDKillerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/FastIDKillerTool.cxx index b906d6becd6fca4ecf66a3dc2ee27e3143addfe0..35ebcd12f3f8124d7128c6bb1b21384f2d71d5aa 100644 --- a/Simulation/G4Utilities/G4UserActions/src/FastIDKillerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/FastIDKillerTool.cxx @@ -12,8 +12,8 @@ namespace G4UA const IInterface* parent) : ActionToolBaseReport<FastIDKiller>(type, name, parent) { - declareInterface<IBeginRunActionTool>(this); - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4RunActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); declareProperty("R", m_config.R); declareProperty("Z", m_config.Z); diff --git a/Simulation/G4Utilities/G4UserActions/src/FluxRecorder.cxx b/Simulation/G4Utilities/G4UserActions/src/FluxRecorder.cxx index f394339c470ed1acc8c674599ce57394765399d9..e623057b1b9d42222bfa9a787be30d411b8761ce 100644 --- a/Simulation/G4Utilities/G4UserActions/src/FluxRecorder.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/FluxRecorder.cxx @@ -28,7 +28,7 @@ namespace G4UA { } - void FluxRecorder::beginOfRun(const G4Run*) + void FluxRecorder::BeginOfRunAction(const G4Run*) { char nom[120]; double timebins[101],ebins[101]; @@ -49,12 +49,12 @@ namespace G4UA } - void FluxRecorder::endOfEvent(const G4Event*) + void FluxRecorder::EndOfEventAction(const G4Event*) { m_nev+=1.; } - void FluxRecorder::endOfRun(const G4Run*){ + void FluxRecorder::EndOfRunAction(const G4Run*){ TFile * f = new TFile("flux.root","RECREATE"); f->cd(); char nom[80]; @@ -73,7 +73,7 @@ namespace G4UA f->Close(); } - void FluxRecorder::processStep(const G4Step* aStep){ + void FluxRecorder::UserSteppingAction(const G4Step* aStep){ int pdgid = 8, energy=(aStep->GetTrack()->GetKineticEnergy()>10.)?1:0; if (aStep->GetTrack()->GetDefinition()==G4Gamma::Definition()){ pdgid=0; diff --git a/Simulation/G4Utilities/G4UserActions/src/FluxRecorderTool.cxx b/Simulation/G4Utilities/G4UserActions/src/FluxRecorderTool.cxx index 864a6a788dea8b0ca88fada493704d6dceec2e01..57340673d127c08fdbc931b7c3a6a04e51604e26 100644 --- a/Simulation/G4Utilities/G4UserActions/src/FluxRecorderTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/FluxRecorderTool.cxx @@ -12,10 +12,9 @@ namespace G4UA const IInterface* parent) : ActionToolBase<FluxRecorder>(type, name, parent) { - declareInterface<IBeginRunActionTool>(this); - declareInterface<IEndRunActionTool>(this); - declareInterface<IEndEventActionTool>(this); - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4RunActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); } std::unique_ptr<FluxRecorder> FluxRecorderTool::makeAction() diff --git a/Simulation/G4Utilities/G4UserActions/src/G4SimTimer.cxx b/Simulation/G4Utilities/G4UserActions/src/G4SimTimer.cxx index 78ede7add5888e61c84d77f4acbf3db33bb8acda..b4ec16aa95f1a576dfe3c1edfb6f56008b1233ef 100644 --- a/Simulation/G4Utilities/G4UserActions/src/G4SimTimer.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/G4SimTimer.cxx @@ -2,7 +2,6 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ - // Local includes #include "G4UserActions/G4SimTimer.h" @@ -41,7 +40,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Begin-event action //--------------------------------------------------------------------------- - void G4SimTimer::beginOfEvent(const G4Event* /*event*/) + void G4SimTimer::BeginOfEventAction(const G4Event* /*event*/) { //ATH_MSG_INFO("beginOfEvent"); m_eventTimer.Start(); @@ -50,7 +49,7 @@ namespace G4UA //--------------------------------------------------------------------------- // End-event action //--------------------------------------------------------------------------- - void G4SimTimer::endOfEvent(const G4Event* /*event*/) + void G4SimTimer::EndOfEventAction(const G4Event* /*event*/) { m_eventTimer.Stop(); // We define time as user+system time. diff --git a/Simulation/G4Utilities/G4UserActions/src/G4SimTimerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/G4SimTimerTool.cxx index 4f7ab09a3632357c80ac0211f5690755f85c5aee..c449fe576d8ad3fc76cb2b9ed69b3bbf57ced3cd 100644 --- a/Simulation/G4Utilities/G4UserActions/src/G4SimTimerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/G4SimTimerTool.cxx @@ -15,8 +15,7 @@ namespace G4UA const IInterface* parent) : ActionToolBaseReport<G4SimTimer>(type, name, parent) { - declareInterface<IBeginEventActionTool>(this); - declareInterface<IEndEventActionTool>(this); + declareInterface<IG4EventActionTool>(this); } //--------------------------------------------------------------------------- @@ -24,7 +23,7 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode G4SimTimerTool::initialize() { - ATH_MSG_DEBUG("initialize"); + ATH_MSG_DEBUG( "Initializing " << name() ); return StatusCode::SUCCESS; } @@ -33,14 +32,14 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode G4SimTimerTool::finalize() { - ATH_MSG_DEBUG("finalize"); + ATH_MSG_DEBUG( "Finalizing " << name() ); mergeReports(); // Report the results auto meanSigma = m_report.meanAndSigma(); ATH_MSG_INFO("Finalized timing results for " << m_report.nEvent << - " events (will be less than total)"); + " events (not all events used)"); ATH_MSG_INFO("Average time per event was " << std::setprecision(4) << meanSigma.first << " +- " << std::setprecision(4) << meanSigma.second); @@ -53,7 +52,7 @@ namespace G4UA std::unique_ptr<G4SimTimer> G4SimTimerTool::makeAction() { - ATH_MSG_DEBUG("makeAction"); + ATH_MSG_DEBUG("Making a G4SimTimer action"); return std::make_unique<G4SimTimer>(); } diff --git a/Simulation/G4Utilities/G4UserActions/src/G4TrackCounter.cxx b/Simulation/G4Utilities/G4UserActions/src/G4TrackCounter.cxx index 35eba5526049d6a71131fe70a2bb8a1d7a496cd0..fb168284ad391c24bced9785eaecf121f6301be4 100644 --- a/Simulation/G4Utilities/G4UserActions/src/G4TrackCounter.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/G4TrackCounter.cxx @@ -5,6 +5,7 @@ #include "G4UserActions/G4TrackCounter.h" #include "MCTruth/TrackHelper.h" + namespace G4UA { @@ -23,7 +24,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Increment event counter //--------------------------------------------------------------------------- - void G4TrackCounter::beginOfEvent(const G4Event* /*event*/) + void G4TrackCounter::BeginOfEventAction(const G4Event* /*event*/) { m_report.nEvents++; } @@ -31,7 +32,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Increment track counters //--------------------------------------------------------------------------- - void G4TrackCounter::preTracking(const G4Track* track) + void G4TrackCounter::PreUserTrackingAction(const G4Track* track) { m_report.nTotalTracks++; TrackHelper helper(track); diff --git a/Simulation/G4Utilities/G4UserActions/src/G4TrackCounterTool.cxx b/Simulation/G4Utilities/G4UserActions/src/G4TrackCounterTool.cxx index 00b991f57feea8768d0fab452a26f7b61cbefca0..cdbd563400c13bf18800760e0404c639d04894a9 100644 --- a/Simulation/G4Utilities/G4UserActions/src/G4TrackCounterTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/G4TrackCounterTool.cxx @@ -15,16 +15,16 @@ namespace G4UA const IInterface* parent) : ActionToolBaseReport<G4TrackCounter>(type, name, parent) { - declareInterface<IBeginEventActionTool>(this); - declareInterface<IPreTrackingActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4TrackingActionTool>(this); } //--------------------------------------------------------------------------- - // Initialize - temporarily here for debugging + // Initialize //--------------------------------------------------------------------------- StatusCode G4TrackCounterTool::initialize() { - ATH_MSG_DEBUG("initialize"); + ATH_MSG_DEBUG( "Initializing " << name() ); return StatusCode::SUCCESS; } @@ -33,7 +33,7 @@ namespace G4UA //--------------------------------------------------------------------------- StatusCode G4TrackCounterTool::finalize() { - ATH_MSG_DEBUG("finalize"); + ATH_MSG_DEBUG( "Finalizing " << name() ); mergeReports(); @@ -52,7 +52,7 @@ namespace G4UA std::unique_ptr<G4TrackCounter> G4TrackCounterTool::makeAction() { - ATH_MSG_DEBUG("makeAction"); + ATH_MSG_DEBUG("Making a G4TrackCounter action"); return std::make_unique<G4TrackCounter>(); } diff --git a/Simulation/G4Utilities/G4UserActions/src/HIPKiller.cxx b/Simulation/G4Utilities/G4UserActions/src/HIPKiller.cxx index 91ac66e54b7f5882872d381ae93bc6ebba4a95ef..a782400a8c93621df72aeae48d4c1fd61bc2ccda 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HIPKiller.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HIPKiller.cxx @@ -26,7 +26,7 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void HIPKiller::processStep(const G4Step* aStep) + void HIPKiller::UserSteppingAction(const G4Step* aStep) { int PDGcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); diff --git a/Simulation/G4Utilities/G4UserActions/src/HIPKillerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/HIPKillerTool.cxx index 558a97a0c2a678c738eab5a8d6f38763328a175f..5bd1dd4bff6a0b9c251e03ac09464c992d7bca06 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HIPKillerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HIPKillerTool.cxx @@ -12,7 +12,7 @@ namespace G4UA const IInterface* parent) : ActionToolBase<HIPKiller>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); } //--------------------------------------------------------------------------- diff --git a/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAccept.cxx b/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAccept.cxx index e30a168d676940a5971791d8cc5a9d87835a7c86..8022964697f2c955feba279497f2a1721535898a 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAccept.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAccept.cxx @@ -22,7 +22,7 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void HIPLArVolumeAccept::processStep(const G4Step* aStep) + void HIPLArVolumeAccept::UserSteppingAction(const G4Step* aStep) { int PDGcode=aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); @@ -52,12 +52,12 @@ namespace G4UA } //--------------------------------------------------------------------------- - void HIPLArVolumeAccept::beginOfEvent(const G4Event*){ + void HIPLArVolumeAccept::BeginOfEventAction(const G4Event*){ m_HIPacc = false; } //--------------------------------------------------------------------------- - void HIPLArVolumeAccept::endOfEvent(const G4Event*) + void HIPLArVolumeAccept::EndOfEventAction(const G4Event*) { m_report.HIPevts++; if(!m_HIPacc) diff --git a/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAcceptTool.cxx b/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAcceptTool.cxx index f0de154ee2e2ebe54dff542677b7876b71575d86..e5b3836afd8f75906a49631f42a954c2a69cb8db 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAcceptTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HIPLArVolumeAcceptTool.cxx @@ -13,9 +13,8 @@ namespace G4UA const IInterface* parent) : ActionToolBaseReport<HIPLArVolumeAccept>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); - declareInterface<IBeginEventActionTool>(this); - declareInterface<IEndEventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); } //--------------------------------------------------------------------------- diff --git a/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx b/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx index 2b071fc9d3a4073d3e65c7c82fae072d80e4682c..c9a9098de627632801b02e1f237c79254b9f15be 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HitWrapper.cxx @@ -35,7 +35,7 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void HitWrapper::endOfEvent(const G4Event*) + void HitWrapper::EndOfEventAction(const G4Event*) { SG::WriteHandle<CSCSimHitCollection> csc("CSC_Hits"); diff --git a/Simulation/G4Utilities/G4UserActions/src/HitWrapperTool.cxx b/Simulation/G4Utilities/G4UserActions/src/HitWrapperTool.cxx index 536bc0c54763011d83494ad1f40cf6cd93b17b8a..0ce2be8c3b9d4d9da04a836f9e1a8a6bf6f10d06 100644 --- a/Simulation/G4Utilities/G4UserActions/src/HitWrapperTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/HitWrapperTool.cxx @@ -12,7 +12,7 @@ namespace G4UA const IInterface* parent) : ActionToolBase<HitWrapper>(type, name, parent) { - declareInterface<IEndEventActionTool>(this); + declareInterface<IG4EventActionTool>(this); declareProperty("Time", m_config.time); } diff --git a/Simulation/G4Utilities/G4UserActions/src/LengthIntegrator.cxx b/Simulation/G4Utilities/G4UserActions/src/LengthIntegrator.cxx index f5fd91b18d4c029e9b391961567390d9bb38bbea..889a324893db1693196209bcde1a0763a6535dc3 100644 --- a/Simulation/G4Utilities/G4UserActions/src/LengthIntegrator.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/LengthIntegrator.cxx @@ -100,7 +100,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Cache primary info at beginning of event //--------------------------------------------------------------------------- - void LengthIntegrator::beginOfEvent(const G4Event* event) + void LengthIntegrator::BeginOfEventAction(const G4Event* event) { m_detThickMap.clear(); G4PrimaryVertex* vert = event->GetPrimaryVertex(0); @@ -113,7 +113,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Finalize event measurements //--------------------------------------------------------------------------- - void LengthIntegrator::endOfEvent(const G4Event*) + void LengthIntegrator::EndOfEventAction(const G4Event*) { // Lazily protect this whole code from concurrent access std::lock_guard<std::mutex> lock(gHistSvcMutex); @@ -216,7 +216,7 @@ namespace G4UA //--------------------------------------------------------------------------- // Accumulate results from one step //--------------------------------------------------------------------------- - void LengthIntegrator::processStep(const G4Step* aStep) + void LengthIntegrator::UserSteppingAction(const G4Step* aStep) { G4TouchableHistory* touchHist = (G4TouchableHistory*) aStep->GetPreStepPoint()->GetTouchable(); diff --git a/Simulation/G4Utilities/G4UserActions/src/LengthIntegratorTool.cxx b/Simulation/G4Utilities/G4UserActions/src/LengthIntegratorTool.cxx index bab22d05211bf9ae5cb0d3d900a4891590d4c3d3..61befb4572797d07fc276c376d2550af297153ab 100644 --- a/Simulation/G4Utilities/G4UserActions/src/LengthIntegratorTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/LengthIntegratorTool.cxx @@ -16,9 +16,8 @@ namespace G4UA : ActionToolBase<LengthIntegrator>(type, name, parent), m_hSvc("THistSvc", name) { - declareInterface<IBeginEventActionTool>(this); - declareInterface<IEndEventActionTool>(this); - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); declareProperty("HistoSvc", m_hSvc); } diff --git a/Simulation/G4Utilities/G4UserActions/src/LooperKiller.cxx b/Simulation/G4Utilities/G4UserActions/src/LooperKiller.cxx index e86ff8af6a893d2faaa7c11a9ab19f9565257084..451a8f5f4d61dc5cdff2144b02c8a380fd3b9e89 100644 --- a/Simulation/G4Utilities/G4UserActions/src/LooperKiller.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/LooperKiller.cxx @@ -37,7 +37,7 @@ namespace G4UA } //--------------------------------------------------------------------------- - void LooperKiller::processStep(const G4Step* aStep) + void LooperKiller::UserSteppingAction(const G4Step* aStep) { if (aStep->GetTrack()->GetCurrentStepNumber() < m_config.MaxSteps) { diff --git a/Simulation/G4Utilities/G4UserActions/src/LooperKillerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/LooperKillerTool.cxx index 175e7f683a21ff06f1ae4571db7c20037140a25d..ee46aa9d43175bbdd30e6b3ea36d41b4275239de 100644 --- a/Simulation/G4Utilities/G4UserActions/src/LooperKillerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/LooperKillerTool.cxx @@ -14,7 +14,7 @@ namespace G4UA const IInterface* parent) : ActionToolBaseReport<LooperKiller>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); declareProperty("MaxSteps", m_config.MaxSteps); declareProperty("PrintSteps",m_config.PrintSteps); declareProperty("VerboseLevel", m_config.VerboseLevel); diff --git a/Simulation/G4Utilities/G4UserActions/src/MomentumConservation.cxx b/Simulation/G4Utilities/G4UserActions/src/MomentumConservation.cxx index d9a5359735cf2b8faccac69e8453ea79926e1764..86126f87ef111ce5d64ced9d2bc4ab068a7228c7 100644 --- a/Simulation/G4Utilities/G4UserActions/src/MomentumConservation.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/MomentumConservation.cxx @@ -15,7 +15,7 @@ namespace G4UA { - void MomentumConservation::endOfEvent(const G4Event* anEvent) + void MomentumConservation::EndOfEventAction(const G4Event* anEvent) { // Energy conservation: @@ -53,7 +53,7 @@ namespace G4UA } - void MomentumConservation::processStep(const G4Step* aStep){ + void MomentumConservation::UserSteppingAction(const G4Step* aStep){ if (aStep->GetPostStepPoint()->GetPhysicalVolume() != 0) { const double edep = aStep->GetTotalEnergyDeposit(); diff --git a/Simulation/G4Utilities/G4UserActions/src/MomentumConservationTool.cxx b/Simulation/G4Utilities/G4UserActions/src/MomentumConservationTool.cxx index 7a9bb0fddb95aa086919463697e7e25cfb8f1e41..c11db30199282b8d79a56f23c509c711d33b7c42 100644 --- a/Simulation/G4Utilities/G4UserActions/src/MomentumConservationTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/MomentumConservationTool.cxx @@ -13,8 +13,8 @@ namespace G4UA const IInterface* parent) : ActionToolBase<MomentumConservation>(type, name, parent) { - declareInterface<IEndEventActionTool>(this); - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); } //--------------------------------------------------------------------------- diff --git a/Simulation/G4Utilities/G4UserActions/src/PhotonKiller.cxx b/Simulation/G4Utilities/G4UserActions/src/PhotonKiller.cxx index 42b084a3d15fb4112ad43928625286b2aa16e223..331bbf0ebd77e92e461556e2df8b6290de6b5dd7 100644 --- a/Simulation/G4Utilities/G4UserActions/src/PhotonKiller.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/PhotonKiller.cxx @@ -3,8 +3,6 @@ */ #include "G4UserActions/PhotonKiller.h" -#include <iostream> -#include <cmath> #include "G4Step.hh" #include "G4Event.hh" @@ -21,7 +19,7 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void PhotonKiller::preTracking(const G4Track*) + void PhotonKiller::PreUserTrackingAction(const G4Track*) { // reset counters m_count=0; @@ -29,7 +27,7 @@ namespace G4UA } //--------------------------------------------------------------------------- - void PhotonKiller::processStep(const G4Step* aStep) + void PhotonKiller::UserSteppingAction(const G4Step* aStep) { if ( fabs(m_energy-aStep->GetTrack()->GetKineticEnergy())<0.00001 ){ // same energy as last time @@ -53,7 +51,6 @@ namespace G4UA rmk->GetEventManager()->AbortCurrentEvent(); rmk->GetEventManager()->GetNonconstCurrentEvent()->SetEventAborted(); } - } } // namespace G4UA diff --git a/Simulation/G4Utilities/G4UserActions/src/PhotonKillerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/PhotonKillerTool.cxx index 14f7d4b1975dc4fb2a8f295a94ec988b9a17ffcb..aae9470c18ed5141a6e37a81202a02717b8a93ac 100644 --- a/Simulation/G4Utilities/G4UserActions/src/PhotonKillerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/PhotonKillerTool.cxx @@ -13,14 +13,14 @@ namespace G4UA const IInterface* parent) : ActionToolBase<PhotonKiller>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); - declareInterface<IPreTrackingActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); + declareInterface<IG4TrackingActionTool>(this); } //--------------------------------------------------------------------------- std::unique_ptr<PhotonKiller> PhotonKillerTool::makeAction() { - ATH_MSG_DEBUG("makeAction"); + ATH_MSG_DEBUG("Making a PhotonKiller action"); return std::make_unique<PhotonKiller>(); } diff --git a/Simulation/G4Utilities/G4UserActions/src/ScoringPlane.cxx b/Simulation/G4Utilities/G4UserActions/src/ScoringPlane.cxx index 8afcf54b7dfcc4780782cc24bae963da6e491682..d60cd4d86d7a22746b15f9ec307a8fcd7fd342e5 100644 --- a/Simulation/G4Utilities/G4UserActions/src/ScoringPlane.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/ScoringPlane.cxx @@ -28,7 +28,7 @@ namespace G4UA { } - void ScoringPlane::beginOfRun(const G4Run*) + void ScoringPlane::BeginOfRunAction(const G4Run*) { m_tree0 = new TTree("t0", "ATHENA event tree"); @@ -71,7 +71,7 @@ namespace G4UA G4cout<<"ScoringPlane: output root filename: " << m_config.fname << G4endl;; } - void ScoringPlane::endOfRun(const G4Run*){ + void ScoringPlane::EndOfRunAction(const G4Run*){ TFile* file = new TFile(m_config.fname.c_str(), "RECREATE", "ATHENA ufo simulation"); m_tree0->Write(); @@ -80,7 +80,7 @@ namespace G4UA file->Close(); } - void ScoringPlane::processStep(const G4Step* aStep) + void ScoringPlane::UserSteppingAction(const G4Step* aStep) { m_z0 = aStep->GetPreStepPoint()->GetPosition().z(); m_z1 = aStep->GetPostStepPoint()->GetPosition().z(); @@ -134,13 +134,13 @@ namespace G4UA } - void ScoringPlane::beginOfEvent(const G4Event*) + void ScoringPlane::BeginOfEventAction(const G4Event*) { m_evt++; m_ntr = 0; } - void ScoringPlane::endOfEvent(const G4Event*) + void ScoringPlane::EndOfEventAction(const G4Event*) { m_tree0->Fill(); } diff --git a/Simulation/G4Utilities/G4UserActions/src/ScoringPlaneTool.cxx b/Simulation/G4Utilities/G4UserActions/src/ScoringPlaneTool.cxx index 71354bf271ebce650d820f204388b1136b04948a..073c72ebc4b167cac68faf9ebe3b5ca943292a9c 100644 --- a/Simulation/G4Utilities/G4UserActions/src/ScoringPlaneTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/ScoringPlaneTool.cxx @@ -13,11 +13,9 @@ namespace G4UA const IInterface* parent) : ActionToolBase<ScoringPlane>(type, name, parent) { - declareInterface<IBeginRunActionTool>(this); - declareInterface<IEndRunActionTool>(this); - declareInterface<ISteppingActionTool>(this); - declareInterface<IBeginEventActionTool>(this); - declareInterface<IEndEventActionTool>(this); + declareInterface<IG4RunActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); declareProperty("Plane", m_config.plane); declareProperty("PKill", m_config.pkill); declareProperty("FName", m_config.fname); diff --git a/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKiller.cxx b/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKiller.cxx index 9b7a188bfa0410db70fda0b16a1901e30e4d7a07..b6aba0039d1bb04ace3a7b9dd246593519fd5697 100644 --- a/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKiller.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKiller.cxx @@ -25,14 +25,14 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void ScoringVolumeTrackKiller::endOfEvent(const G4Event*) + void ScoringVolumeTrackKiller::EndOfEventAction(const G4Event*) { ATH_MSG_INFO( m_killCount << " tracks killed in this event " ); m_killCount = 0; } //--------------------------------------------------------------------------- - void ScoringVolumeTrackKiller::processStep(const G4Step* aStep) + void ScoringVolumeTrackKiller::UserSteppingAction(const G4Step* aStep) { G4StepPoint* preStep = aStep->GetPreStepPoint(); const G4VTouchable* preTouchable = preStep->GetTouchable(); diff --git a/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKillerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKillerTool.cxx index 256d16c3d5641310d112af1da1b90635a6f93e9d..48ffecba065a478ac3f9a8876885ce8143533c08 100644 --- a/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKillerTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/ScoringVolumeTrackKillerTool.cxx @@ -13,8 +13,8 @@ namespace G4UA const IInterface* parent) : ActionToolBase<ScoringVolumeTrackKiller>(type, name, parent) { - declareInterface<IEndEventActionTool>(this); - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4EventActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); } //--------------------------------------------------------------------------- diff --git a/Simulation/G4Utilities/G4UserActions/src/StoppedParticleAction.cxx b/Simulation/G4Utilities/G4UserActions/src/StoppedParticleAction.cxx index 670de83b88901ccd79e0f15dd61dc3f175c439b8..fbe46636c8720156ed694bc60b9a30d422da449f 100644 --- a/Simulation/G4Utilities/G4UserActions/src/StoppedParticleAction.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/StoppedParticleAction.cxx @@ -48,7 +48,7 @@ namespace G4UA {} //--------------------------------------------------------------------------- - void StoppedParticleAction::processStep(const G4Step* aStep) + void StoppedParticleAction::UserSteppingAction(const G4Step* aStep) { // Trigger if the energy is below our threshold or if the time is over 150 ns diff --git a/Simulation/G4Utilities/G4UserActions/src/StoppedParticleActionTool.cxx b/Simulation/G4Utilities/G4UserActions/src/StoppedParticleActionTool.cxx index 6e09d0166e706181811479814b4591a8720f6fb5..937926e4aee427c732fb3036d09453283137ee42 100644 --- a/Simulation/G4Utilities/G4UserActions/src/StoppedParticleActionTool.cxx +++ b/Simulation/G4Utilities/G4UserActions/src/StoppedParticleActionTool.cxx @@ -13,7 +13,7 @@ namespace G4UA const IInterface* parent) : ActionToolBase<StoppedParticleAction>(type, name, parent) { - declareInterface<ISteppingActionTool>(this); + declareInterface<IG4SteppingActionTool>(this); } //--------------------------------------------------------------------------- diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude.py index 6851aa7e8a02dffeae56a9c0a13c9a4e293f3d10..2d1cf6aa835503616f2881c67a1b3eeec2eb0234 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude.py @@ -1,4 +1,4 @@ from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::FastCaloSimParamActionTool',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::FastCaloSimParamActionTool',['Event','Run','Step']) simFlags.UserActionConfig.addConfig('G4UA::FastCaloSimParamActionTool',"shift_lar_subhit",True) simFlags.UserActionConfig.addConfig('G4UA::FastCaloSimParamActionTool',"shorten_lar_step",True) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude_1mm.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude_1mm.py index d76093ff85f05199fca2d01ed678203a58186dcc..208baab991cee88d38f273a0ca278d65bc2160f5 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude_1mm.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_FastCaloSimParametrization_SimPreInclude_1mm.py @@ -1,5 +1,5 @@ from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::FastCaloSimParamActionTool',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::FastCaloSimParamActionTool',['Event','Run','Step']) simFlags.UserActionConfig.addConfig('G4UA::FastCaloSimParamActionTool',"shift_lar_subhit",True) simFlags.UserActionConfig.addConfig('G4UA::FastCaloSimParamActionTool',"shorten_lar_step",True) simFlags.UserActionConfig.addConfig('G4UA::FastCaloSimParamActionTool',"maxRadiusLAr",1) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py index 2b4a3e2feb390128ccb093905f0798859480c72f..692695c599d9cb0500cc14a65c86a2acec7ae4a7 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py @@ -12,7 +12,7 @@ def getMCTruthUserActionTool(name='ISFMCTruthUserActionTool', **kwargs): def addMCTruthUserActionTool(name="ISFMCTruthUserActionTool",system=False): from G4AtlasServices import G4AtlasServicesConfig - G4AtlasServicesConfig.addAction(name,['BeginOfRun','BeginOfTracking','EndOfTracking'],system) + G4AtlasServicesConfig.addAction(name,['Run','Tracking'],system) ## ----------------------------------------------------------------------------- ### Base Version @@ -74,7 +74,7 @@ def getAFII_G4TrackProcessorUserActionTool(name='AFII_G4TrackProcessorUserAction def addTrackProcessorTool(name,system=False): from G4AtlasServices import G4AtlasServicesConfig - G4AtlasServicesConfig.addAction(name,['BeginOfRun','BeginOfTracking','BeginOfEvent','Step'],system) + G4AtlasServicesConfig.addAction(name,['Run','Tracking','Event','Step'],system) ## ----------------------------------------------------------------------------- ### Base Version diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.cxx index 2e095163ca3443f2768e7d75a8b2d843b86f0f74..d98a4aee16523044848b8a88ab022dcb88de13cf 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.cxx @@ -59,7 +59,7 @@ namespace G4UA{ m_truthRecordSvcQuick = &(*(m_config.truthRecordSvc)); } - void MCTruthUserAction::preTracking(const G4Track* inTrack){; + void MCTruthUserAction::PreUserTrackingAction(const G4Track* inTrack){ //ATH_MSG_DEBUG("Starting to track a new particle"); //m_sHelper.ResetNrOfSecondaries(); @@ -82,7 +82,7 @@ namespace G4UA{ } - void MCTruthUserAction::postTracking(const G4Track*){ + void MCTruthUserAction::PostUserTrackingAction(const G4Track*){ //ATH_MSG_DEBUG("Finished tracking a particle"); G4EventManager::GetEventManager()->GetTrackingManager()->SetStoreTrajectory(false); } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.h index 7f0fc88c9f112398e4fa1f00370b06d9fd324274..2198a804109665fed9828a38bfc22c1b27287677 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserAction.h @@ -33,12 +33,11 @@ Thus it is defined as a AlgTool, to get these assigned easily via python. */ -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" +#include "G4UserTrackingAction.hh" namespace G4UA{ namespace iGeant4 { - class MCTruthUserAction: public IPreTrackingAction, public IPostTrackingAction + class MCTruthUserAction: public G4UserTrackingAction { public: @@ -51,8 +50,8 @@ namespace G4UA{ }; MCTruthUserAction(const Config& config); - virtual void preTracking(const G4Track*) override; - virtual void postTracking(const G4Track*) override; + virtual void PreUserTrackingAction(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override; private: Config m_config; ISF::ITruthSvc *m_truthRecordSvcQuick; //!< used for faster access diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.cxx index 15fe415a548364b6b216f3a4fa3e8926a4a20eb8..382e0af4f22ec675915ee205b1897a1b148a6ff3 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.cxx @@ -26,13 +26,8 @@ namespace G4UA{ } StatusCode MCTruthUserActionTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.h index ddfeb6ae0aed00411db0e45ae5f2797a80419c32..df34c4b2f6b1f4ad7519f7dda79acefd9a26d1fd 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/MCTruthUserActionTool.h @@ -4,8 +4,7 @@ #ifndef ISF_GEANT4TOOLS_G4UA__MCTRUTHUSERACTIONTOOL_H #define ISF_GEANT4TOOLS_G4UA__MCTRUTHUSERACTIONTOOL_H -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "MCTruthUserAction.h" @@ -22,18 +21,15 @@ namespace G4UA{ class MCTruthUserActionTool: public ActionToolBase<MCTruthUserAction>, - public IPreTrackingActionTool, public IPostTrackingActionTool + public IG4TrackingActionTool { public: /// Standard constructor MCTruthUserActionTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the preTracking action - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - /// Retrieve the postTracking action - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } + /// Retrieve the tracking action + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx index 4cdb56d7276c71578d0c8733dbce13107ab1a013..f3edbaac0dfd6ab6299511e6fdc5ddff8e09b8f1 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.cxx @@ -70,7 +70,7 @@ namespace G4UA{ } } - void PhysicsValidationUserAction::beginOfEvent(const G4Event*) + void PhysicsValidationUserAction::BeginOfEventAction(const G4Event*) { @@ -87,7 +87,7 @@ namespace G4UA{ } - void PhysicsValidationUserAction::endOfEvent(const G4Event*) + void PhysicsValidationUserAction::EndOfEventAction(const G4Event*) { m_X0=0.; @@ -100,7 +100,7 @@ namespace G4UA{ return; } - void PhysicsValidationUserAction::beginOfRun(const G4Run*) + void PhysicsValidationUserAction::BeginOfRunAction(const G4Run*) { if (m_config.particleBroker.retrieve().isFailure()) { @@ -213,8 +213,8 @@ namespace G4UA{ } } - - void PhysicsValidationUserAction::processStep(const G4Step* aStep) + + void PhysicsValidationUserAction::UserSteppingAction(const G4Step* aStep) { //std::cout<<"PhysicsValidationUserAction::SteppingAction"<<std::endl; @@ -526,8 +526,8 @@ namespace G4UA{ } } - - void PhysicsValidationUserAction::preTracking(const G4Track*) + + void PhysicsValidationUserAction::PreUserTrackingAction(const G4Track*) { m_sHelper.ResetNrOfSecondaries(); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.h index 77d72bfdf053543a149b99b8cfc643df8ccf05a2..b93c11e9098ea09397adf4d83968e5fdb372a131 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserAction.h @@ -36,16 +36,15 @@ namespace ISF { class IParticleBroker; } -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IPreTrackingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" +#include "G4UserTrackingAction.hh" #include "AthenaBaseComps/AthMessaging.h" namespace G4UA{ namespace iGeant4 { - class PhysicsValidationUserAction: public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public ISteppingAction, public IPreTrackingAction, public AthMessaging + class PhysicsValidationUserAction: public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction, public G4UserTrackingAction, public AthMessaging { public: @@ -77,11 +76,11 @@ namespace G4UA{ }; PhysicsValidationUserAction(const Config& config); - virtual void beginOfEvent(const G4Event*) override final; - virtual void endOfEvent(const G4Event*) override final; - virtual void beginOfRun(const G4Run*) override final; - virtual void processStep(const G4Step*) override final; - virtual void preTracking(const G4Track*) override final; + virtual void BeginOfEventAction(const G4Event*) override final; + virtual void EndOfEventAction(const G4Event*) override final; + virtual void BeginOfRunAction(const G4Run*) override final; + virtual void UserSteppingAction(const G4Step*) override final; + virtual void PreUserTrackingAction(const G4Track*) override final; private: Config m_config; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.cxx index 9a17c5eafff0970e9d11be051a5158d8f37c761f..9412c69a25aaad7650ced5950c92a1eb947e33af 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.cxx @@ -45,30 +45,25 @@ namespace G4UA{ return std::move(action); } - StatusCode PhysicsValidationUserActionTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + StatusCode PhysicsValidationUserActionTool::queryInterface(const InterfaceID& riid, void** ppvIf) + { + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.h index 32401815201449e66699a55323222c7d1bdf564b..ccc1d21bbf98feef2b650d327cc5c6f9f2bb47e7 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/PhysicsValidationUserActionTool.h @@ -4,11 +4,10 @@ #ifndef ISF_GEANT4TOOLS_G4UA__PHYSICSVALIATIONUSERACTIONTOOL_H #define ISF_GEANT4TOOLS_G4UA__PHYSICSVALIATIONUSERACTIONTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "PhysicsValidationUserAction.h" @@ -25,27 +24,24 @@ namespace G4UA{ class PhysicsValidationUserActionTool: public ActionToolBase<PhysicsValidationUserAction>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public ISteppingActionTool, public IPreTrackingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool, public IG4TrackingActionTool { public: /// Standard constructor PhysicsValidationUserActionTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// Retrieve the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// Retrieve the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - /// Retrieve the preTracking action - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + /// Retrieve the tracking action + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx index b359cfa98237ff7a18970632b8382f3a19660e27..be9e0bcba3cfaf99b9b863875e25f5773d3679c0 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.cxx @@ -55,21 +55,21 @@ TrackProcessorUserActionBase::TrackProcessorUserActionBase(): {; } -void TrackProcessorUserActionBase::beginOfEvent(const G4Event*) +void TrackProcessorUserActionBase::BeginOfEventAction(const G4Event*) { m_curBaseISP = nullptr; m_eventInfo = ::iGeant4::ISFG4Helper::getEventInformation(); return; } -void TrackProcessorUserActionBase::endOfEvent(const G4Event*) +void TrackProcessorUserActionBase::EndOfEventAction(const G4Event*) { m_curBaseISP = nullptr; m_eventInfo = nullptr; return; } -void TrackProcessorUserActionBase::processStep(const G4Step* aStep) +void TrackProcessorUserActionBase::UserSteppingAction(const G4Step* aStep) { // get geoID from parent //TODO ELLI AtlasDetDescr::AtlasRegion curGeoID = m_curBaseISP->nextGeoID(); @@ -105,7 +105,7 @@ void TrackProcessorUserActionBase::processStep(const G4Step* aStep) return; } -void TrackProcessorUserActionBase::preTracking(const G4Track* aTrack) +void TrackProcessorUserActionBase::PreUserTrackingAction(const G4Track* aTrack) { bool isPrimary = ! aTrack->GetParentID(); if (isPrimary) { @@ -234,7 +234,7 @@ TrackClassification TrackProcessorUserActionBase::classify(const HepMC::GenParti -void TrackProcessorUserActionBase::postTracking(const G4Track*) +void TrackProcessorUserActionBase::PostUserTrackingAction(const G4Track*) { m_curBaseISP = nullptr; return; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h index 8e95e581b16e424cfb58c6fcf56cc422cbb6c43c..43ddce5efa49eae810285548eae90066f5a4f5a6 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionBase.h @@ -9,11 +9,9 @@ #include <string> -#include "G4AtlasInterfaces/IPreTrackingAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IPostTrackingAction.h" +#include "G4UserTrackingAction.hh" +#include "G4UserSteppingAction.hh" +#include "G4UserEventAction.hh" #include "MCTruth/VTrackInformation.h" @@ -34,20 +32,20 @@ namespace G4UA{ namespace iGeant4 { -class TrackProcessorUserActionBase: public IPreTrackingAction, public ISteppingAction, - public IBeginEventAction, public IEndEventAction, - public IPostTrackingAction +class TrackProcessorUserActionBase: public G4UserTrackingAction, + public G4UserSteppingAction, + public G4UserEventAction { public: TrackProcessorUserActionBase(); - virtual void beginOfEvent(const G4Event*) override final; - virtual void endOfEvent(const G4Event*) override final; + virtual void BeginOfEventAction(const G4Event*) override final; + virtual void EndOfEventAction(const G4Event*) override final; - virtual void preTracking(const G4Track*) override; - virtual void postTracking(const G4Track*) override final; + virtual void PreUserTrackingAction(const G4Track*) override; + virtual void PostUserTrackingAction(const G4Track*) override final; - virtual void processStep(const G4Step*) override final; + virtual void UserSteppingAction(const G4Step*) override final; protected: EventInformation* m_eventInfo; //!< event-global G4 UserInformation diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx index 8ae9fb8eabe2811b9298f65cf7c3595fc82d09e3..68adb16ebbf7da765955962ae31ba96ecbb52aa2 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx @@ -218,11 +218,11 @@ namespace G4UA{ return layer; } - void TrackProcessorUserActionFullG4::preTracking(const G4Track* aTrack){ + void TrackProcessorUserActionFullG4::PreUserTrackingAction(const G4Track* aTrack){ // reset geoId, call upstream method m_nextGeoID = m_config.truthVolLevel>1?AtlasDetDescr::fAtlasCavern:AtlasDetDescr::fUndefinedAtlasRegion; m_currentTrack = aTrack; - TrackProcessorUserActionBase::preTracking(aTrack); + TrackProcessorUserActionBase::PreUserTrackingAction(aTrack); return; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h index b90df01e748e43b7ef72f80f01f6eb45feeb0857..91088c41fefd4ae46e86e9931c8184919a08dabe 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h @@ -52,7 +52,7 @@ namespace G4UA{ TrackProcessorUserActionFullG4(const Config& config); virtual ~TrackProcessorUserActionFullG4() {} - virtual void preTracking(const G4Track*) override final; + virtual void PreUserTrackingAction(const G4Track*) override final; private: /** Called by the base class after the G4Track->ISFParticle association * has been established */ diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx index d768a63539f88505876be8eb6472f10bb54e11e5..bd4744ee663f4e5017e94b380e747067968dad8d 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx @@ -27,28 +27,18 @@ namespace G4UA{ StatusCode TrackProcessorUserActionFullG4Tool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.h index c9563ce751d8fd194b597bea78c1f6dd6eee5549..1f47ce24fae5554971c59e320d5259e2e2895120 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.h @@ -4,11 +4,9 @@ #ifndef ISF_GEANT4TOOLS_G4UA__TRACKPROCESSORUSERACTIONFULLG4TOOL_H #define ISF_GEANT4TOOLS_G4UA__TRACKPROCESSORUSERACTIONFULLG4TOOL_H -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrackProcessorUserActionFullG4.h" @@ -25,28 +23,22 @@ namespace G4UA{ class TrackProcessorUserActionFullG4Tool: public ActionToolBase<TrackProcessorUserActionFullG4>, - public IPreTrackingActionTool, public IPostTrackingActionTool, public ISteppingActionTool, public IBeginEventActionTool, public IEndEventActionTool + public IG4TrackingActionTool, public IG4SteppingActionTool, public IG4EventActionTool { public: /// Standard constructor TrackProcessorUserActionFullG4Tool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the preTracking action - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - /// Retrieve the postTracking action - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } + /// Retrieve the tracking action + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.cxx index d3e61769f0852e1a4d9aa0e5e36f73a10553f8a1..25a041fb5085733bdc96dc01de612ec7c0a6e80e 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.cxx @@ -36,28 +36,18 @@ namespace G4UA{ StatusCode TrackProcessorUserActionPassBackTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IPreTrackingActionTool::interfaceID()) { - *ppvIf = (IPreTrackingActionTool*) this; + if(riid == IG4TrackingActionTool::interfaceID()) { + *ppvIf = (IG4TrackingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IPostTrackingActionTool::interfaceID()) { - *ppvIf = (IPostTrackingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.h index 55d26e1bf3fec9370c763ce260d32c108b6eb0b0..c3169223ed6abbad37ba3df7cc88850ea061a146 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionPassBackTool.h @@ -4,11 +4,9 @@ #ifndef ISF_GEANT4TOOLS_G4UA__TRACKPROCESSORUSERACTIONPASSBACKTOOL_H #define ISF_GEANT4TOOLS_G4UA__TRACKPROCESSORUSERACTIONPASSBACKTOOL_H -#include "G4AtlasInterfaces/IPreTrackingActionTool.h" -#include "G4AtlasInterfaces/IPostTrackingActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" +#include "G4AtlasInterfaces/IG4TrackingActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrackProcessorUserActionPassBack.h" @@ -24,28 +22,22 @@ namespace G4UA{ class TrackProcessorUserActionPassBackTool: public ActionToolBase<TrackProcessorUserActionPassBack>, - public IPreTrackingActionTool, public IPostTrackingActionTool, public ISteppingActionTool, public IBeginEventActionTool, public IEndEventActionTool + public IG4TrackingActionTool, public IG4SteppingActionTool, public IG4EventActionTool { public: /// Standard constructor TrackProcessorUserActionPassBackTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the preTracking action - virtual IPreTrackingAction* getPreTrackingAction() override final - { return static_cast<IPreTrackingAction*>( getAction() ); } - /// Retrieve the postTracking action - virtual IPostTrackingAction* getPostTrackingAction() override final - { return static_cast<IPostTrackingAction*>( getAction() ); } + /// Retrieve the tracking action + virtual G4UserTrackingAction* getTrackingAction() override final + { return static_cast<G4UserTrackingAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Query interface for gaudi virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamAction.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamAction.h index bdf107b6c91b587d00dc2560beda3fd03c24dd0a..24d33e57603b138081300078be98dbf8191f3306 100755 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamAction.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamAction.h @@ -53,11 +53,9 @@ class Hep3Vector; * */ -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" #include "StoreGate/StoreGateSvc.h" @@ -68,7 +66,7 @@ namespace G4UA{ class FastCaloSimParamAction: - public IBeginRunAction, public IEndRunAction, public IBeginEventAction, public IEndEventAction, public ISteppingAction + public G4UserRunAction, public G4UserEventAction, public G4UserSteppingAction { public: @@ -111,11 +109,11 @@ namespace G4UA{ }; FastCaloSimParamAction(const Config& config); - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamActionTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamActionTool.h index 030c596b53d3351c272bac9664759109eb789107..b280c1a493f0da248d83d6758d169512e7b252d8 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamActionTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/ISF_Geant4UserActions/FastCaloSimParamActionTool.h @@ -4,11 +4,9 @@ #ifndef ISF_GEANT4USERACTIONS_G4UA__FASTCALOSIMPARAMACTIONTOOL_H #define ISF_GEANT4USERACTIONS_G4UA__FASTCALOSIMPARAMACTIONTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" @@ -27,7 +25,7 @@ namespace G4UA{ class FastCaloSimParamActionTool: public ActionToolBase<FastCaloSimParamAction>, - public IBeginRunActionTool, public IEndRunActionTool, public IBeginEventActionTool, public IEndEventActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4EventActionTool, public IG4SteppingActionTool { public: @@ -35,21 +33,15 @@ namespace G4UA{ FastCaloSimParamActionTool(const std::string& type, const std::string& name,const IInterface* parent); /// Intialize Athena components StatusCode initialize() override final; - /// Retrieve the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// Retrieve the EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// Retrieve the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: /// Create an action for this thread diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/python/ISF_Geant4UserActionsConfig.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/python/ISF_Geant4UserActionsConfig.py index 56e4801963b40e1f16d25ec481646e8a85a4cd1b..550c154aa8c6927339e67feb928e71de67d5f42d 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/python/ISF_Geant4UserActionsConfig.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/python/ISF_Geant4UserActionsConfig.py @@ -13,7 +13,7 @@ def getFastCaloSimParamActionTool(name='G4UA::FastCaloSimParamActionTool', **kwa def addFastCaloSimParamActionTool(name='G4UA::FastCaloSimParamActionTool',system=False): from G4AtlasServices import G4AtlasServicesConfig - G4AtlasServicesConfig.addAction(name,['BeginOfRun','EndOfRun','BeginOfEvent','EndOfEvent','Step'],system) + G4AtlasServicesConfig.addAction(name,['Run','Event','Step'],system) def getTestBoundariesUserActionTool(name='G4UA::iGeant4::TestBoundariesUserActionTool', **kwargs): diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamAction.cxx index b843d092868aa118d030ecd3dccfed168fb5844f..91c3398b13f20ef0ec3484a67c2f7a712cfe1858 100755 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamAction.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamAction.cxx @@ -63,7 +63,7 @@ namespace G4UA{ } - void FastCaloSimParamAction::beginOfRun(const G4Run*){ + void FastCaloSimParamAction::BeginOfRunAction(const G4Run*){ //G4cout << "############################################" << G4endl // << "## FastCaloSimParamAction - BeginOfRun ##" << G4endl @@ -88,7 +88,7 @@ namespace G4UA{ return; } - void FastCaloSimParamAction::endOfRun(const G4Run*){ + void FastCaloSimParamAction::EndOfRunAction(const G4Run*){ G4cout << "############################################" << G4endl @@ -117,7 +117,7 @@ namespace G4UA{ return; } - void FastCaloSimParamAction::beginOfEvent(const G4Event*) + void FastCaloSimParamAction::BeginOfEventAction(const G4Event*) { //G4cout << "############################################" << G4endl @@ -136,7 +136,7 @@ namespace G4UA{ return; } - void FastCaloSimParamAction::endOfEvent(const G4Event*){ + void FastCaloSimParamAction::EndOfEventAction(const G4Event*){ //G4cout << "############################################" << G4endl // << "## FastCaloSimParamAction - EndOfEvent ##" << G4endl @@ -173,7 +173,7 @@ namespace G4UA{ return; } - void FastCaloSimParamAction::processStep(const G4Step* aStep) + void FastCaloSimParamAction::UserSteppingAction(const G4Step* aStep) { //G4cout <<"FastCaloSimParamAction - SteppingAction"<<G4endl; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamActionTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamActionTool.cxx index ad2e4d684ace51b03674d276edbf76c10b97d289..db4a0f028794dd46b707ce2beab41f3d5c845b33 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamActionTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/FastCaloSimParamActionTool.cxx @@ -85,28 +85,18 @@ namespace G4UA{ StatusCode FastCaloSimParamActionTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.cxx index b89569a8ddf4c9483c915b60dc5c4a0fea040052..b7396be5f99513e8843963ba25bca0411b053a63 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.cxx @@ -25,7 +25,7 @@ namespace G4UA{ TestBoundariesUserAction::TestBoundariesUserAction():AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"TestBoundariesUserAction"){; } - void TestBoundariesUserAction::beginOfRun(const G4Run*){; + void TestBoundariesUserAction::BeginOfRunAction(const G4Run*){; file = TFile::Open("points.root","RECREATE"); ATH_MSG_INFO("Open file points.root, create tree"); file->cd(); @@ -41,7 +41,7 @@ namespace G4UA{ return; } - void TestBoundariesUserAction::endOfRun(const G4Run*){ + void TestBoundariesUserAction::EndOfRunAction(const G4Run*){ ATH_MSG_INFO("Writing file points.root"); file->cd(); tree->Write(); @@ -51,7 +51,7 @@ namespace G4UA{ tree=0; } - void TestBoundariesUserAction::processStep(const G4Step* aStep){ + void TestBoundariesUserAction::UserSteppingAction(const G4Step* aStep){ G4StepPoint * preStep = aStep->GetPreStepPoint(); G4StepPoint *postStep = aStep->GetPostStepPoint(); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.h index 8d7837e8e52181c01f35f5dde39afa7e4203e0d3..59cdd411b23d233d1081224a5dcb1d0c02ed2a0c 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserAction.h @@ -14,9 +14,8 @@ class TFile; #include "TMath.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" #include "AthenaBaseComps/AthMessaging.h" @@ -25,14 +24,14 @@ namespace G4UA{ namespace iGeant4{ class TestBoundariesUserAction: - public AthMessaging, public IBeginRunAction, public IEndRunAction, public ISteppingAction + public AthMessaging, public G4UserRunAction, public G4UserSteppingAction { public: TestBoundariesUserAction(); - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: typedef std::map<std::string,int> SMap; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.cxx index 0a50098b36f3230bb73b41fa0d87d2906a63a674..c5d367c7457bacf41a2e4ed1a2f9eeaee6951fd2 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.cxx @@ -19,18 +19,13 @@ namespace G4UA{ } StatusCode TestBoundariesUserActionTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.h index 6bc0a76d1ae9b2314e17b42b4006560c1c7b37f8..d23c0fba7598d38cecb7d7f5ff1b50c28293eda3 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/src/TestBoundariesUserActionTool.h @@ -4,9 +4,8 @@ #ifndef ISF_GEANT4USERACTIONS_G4UA_IGEANT4_TESTBOUNDARIESUSERACTIONTOOL_H #define ISF_GEANT4USERACTIONS_G4UA_IGEANT4_TESTBOUNDARIESUSERACTIONTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TestBoundariesUserAction.h" @@ -24,21 +23,18 @@ namespace G4UA{ class TestBoundariesUserActionTool: public ActionToolBase<TestBoundariesUserAction>, - public IBeginRunActionTool, public IEndRunActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4SteppingActionTool { public: /// standard tool ctor TestBoundariesUserActionTool(const std::string& type, const std::string& name,const IInterface* parent); - /// gets the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// gets the EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } + /// gets the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// gets the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudi interface handling virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastIDKiller.py b/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastIDKiller.py index cfdca70217488c04f3e84ca7cec00ae6ece2c5f2..614b664efd93a9c6214dc2ada9ff6aa49766b11a 100644 --- a/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastIDKiller.py +++ b/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastIDKiller.py @@ -11,4 +11,4 @@ ######################################################### from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::FastIDKillerTool', ['BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::FastIDKillerTool', ['Run','Step']) diff --git a/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastMBKiller.py b/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastMBKiller.py index c8611bac8ab5a97507bb3df2b92c4db78e06fb16..42b665e579f04cc93ef42db50d8e8a43292ca2dd 100644 --- a/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastMBKiller.py +++ b/Simulation/SimulationJobOptions/share/atlfast2/preInclude.FastMBKiller.py @@ -7,4 +7,4 @@ ######################################################### from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::FastMBKillerTool', ['BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::FastMBKillerTool', ['Run','Step']) diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern150.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern150.py index 0f5fa997283858ba6bfd46ef0602472b277733d3..28686cbfdba305330b1c1561863a9dc5c8c80e15 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern150.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern150.py @@ -1,11 +1,7 @@ # Modify the hit wrapping action to wrap on 150 ns -try: - from G4AtlasServices.G4AtlasUserActionConfig import UAStore -except ImportError: - from G4AtlasServices.UserActionStore import UAStore -from AthenaCommon.CfgGetter import getPublicTool - -getPublicTool('HitWrapper',tryDefaultConfigurable=True).WrapTime=150 -UAStore.addAction('HitWrapper',['EndOfEvent']) +from G4AtlasApps.SimFlags import simFlags +# new MT actions. Note that this will only work with one thread. +simFlags.OptionalUserActionList.addAction('G4UA::HitWrapperTool',['Event']) +simFlags.UserActionConfig.addConfig('G4UA::HitWrapperTool','WrapTime',150) diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern1600.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern1600.py index be9b71a892e6e03fcee9cef27b570be6eca51e32..3ac0b65033691bbd2f141e1f5a485f85d2cd81cd 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern1600.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern1600.py @@ -1,12 +1,7 @@ # Modify the hit wrapping action to wrap on 1600 ns - -try: - from G4AtlasServices.G4AtlasUserActionConfig import UAStore -except ImportError: - from G4AtlasServices.UserActionStore import UAStore -from AthenaCommon.CfgGetter import getPublicTool - -getPublicTool('HitWrapper',tryDefaultConfigurable=True).WrapTime=1600 -UAStore.addAction('HitWrapper',['EndOfEvent']) +from G4AtlasApps.SimFlags import simFlags +# new MT actions. Note that this will only work with one thread. +simFlags.OptionalUserActionList.addAction('G4UA::HitWrapperTool',['Event']) +simFlags.UserActionConfig.addConfig('G4UA::HitWrapperTool','WrapTime',1600) diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern50.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern50.py index 2d85250f4fe79eb48af3e6ddd43f97c61e3c71fa..dc7fd79c693183aadf8b5137c808460aa97d7745 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern50.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern50.py @@ -1,11 +1,7 @@ # Modify the hit wrapping action to wrap on 50 ns -try: - from G4AtlasServices.G4AtlasUserActionConfig import UAStore -except ImportError: - from G4AtlasServices.UserActionStore import UAStore -from AthenaCommon.CfgGetter import getPublicTool - -getPublicTool('HitWrapper',tryDefaultConfigurable=True).WrapTime=50 -UAStore.addAction('HitWrapper',['EndOfEvent']) +from G4AtlasApps.SimFlags import simFlags +# new MT actions. Note that this will only work with one thread. +simFlags.OptionalUserActionList.addAction('G4UA::HitWrapperTool',['Event']) +simFlags.UserActionConfig.addConfig('G4UA::HitWrapperTool','WrapTime',50) diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern75.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern75.py index 5a90a6a25b462ad5f566de34bb0e978610797eed..572581df76a689046c2be4ea8ba5b86e47c92eed 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern75.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern75.py @@ -1,10 +1,6 @@ # Modify the hit wrapping action to wrap on 75 ns -try: - from G4AtlasServices.G4AtlasUserActionConfig import UAStore -except ImportError: - from G4AtlasServices.UserActionStore import UAStore -from AthenaCommon.CfgGetter import getPublicTool - -getPublicTool('HitWrapper',tryDefaultConfigurable=True).WrapTime=75 -UAStore.addAction('HitWrapper',['EndOfEvent']) +from G4AtlasApps.SimFlags import simFlags +# new MT actions. Note that this will only work with one thread. +simFlags.OptionalUserActionList.addAction('G4UA::HitWrapperTool',['Event']) +simFlags.UserActionConfig.addConfig('G4UA::HitWrapperTool','WrapTime',75) diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern900.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern900.py index 344a8d3aaf5fcaab2ea6c3680ef26232b6343f8a..3e349849f7c4468696e54636747dea893e43f150 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern900.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4ReadCavern900.py @@ -1,12 +1,7 @@ # Modify the hit wrapping action to wrap on 50 ns - -try: - from G4AtlasServices.G4AtlasUserActionConfig import UAStore -except ImportError: - from G4AtlasServices.UserActionStore import UAStore -from AthenaCommon.CfgGetter import getPublicTool - -getPublicTool('HitWrapper',tryDefaultConfigurable=True).WrapTime=900 -UAStore.addAction('HitWrapper',['EndOfEvent']) +from G4AtlasApps.SimFlags import simFlags +# new MT actions. Note that this will only work with one thread. +simFlags.OptionalUserActionList.addAction('G4UA::HitWrapperTool',['Event']) +simFlags.UserActionConfig.addConfig('G4UA::HitWrapperTool','WrapTime',900) diff --git a/Simulation/SimulationJobOptions/share/g4/preInclude.HyperspaceCatcher.py b/Simulation/SimulationJobOptions/share/g4/preInclude.HyperspaceCatcher.py index 8fa77959d7f25e4a0ab559c7ff6e933a981198a8..b8cd9c6bedc91e321298e9fba0ddfdb2e0e8ef01 100644 --- a/Simulation/SimulationJobOptions/share/g4/preInclude.HyperspaceCatcher.py +++ b/Simulation/SimulationJobOptions/share/g4/preInclude.HyperspaceCatcher.py @@ -4,6 +4,6 @@ # Set "killAfter" in order to crash the job after a certain number of hyperspace particles from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::HyperspaceCatcherTool', ['BeginOfRun','Step']) +simFlags.OptionalUserActionList.addAction('G4UA::HyperspaceCatcherTool', ['Run','Step']) simFlags.UserActionConfig.addConfig('G4UA::HyperspaceCatcherTool', 'TreatmentLevel',1) simFlags.UserActionConfig.addConfig('G4UA::HyperspaceCatcherTool', 'KillAfter',-1) diff --git a/Simulation/SimulationJobOptions/share/g4/preInclude.ScoringVolumeKiller.py b/Simulation/SimulationJobOptions/share/g4/preInclude.ScoringVolumeKiller.py index 2e956b535237280bfab5311c64e7508f167babb8..acb94cb5f1fb8483ab5ba4bbe2516b59746ef795 100644 --- a/Simulation/SimulationJobOptions/share/g4/preInclude.ScoringVolumeKiller.py +++ b/Simulation/SimulationJobOptions/share/g4/preInclude.ScoringVolumeKiller.py @@ -13,4 +13,4 @@ from G4AtlasApps.SimFlags import simFlags simFlags.NeutronTimeCut = int(2**31 - 1) #probably not required. simFlags.NeutronTimeCut.set_Off() -simFlags.OptionalUserActionList.addAction('G4UA::ScoringVolumeTrackKillerTool',['EndOfEvent', 'Step']) +simFlags.OptionalUserActionList.addAction('G4UA::ScoringVolumeTrackKillerTool',['Event', 'Step']) diff --git a/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelector.py b/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelector.py index fe528fce24a33bf3932ef2606ff4105d77adea50..156a6d5d78148b260e15e34f6935a6e7171f5f93 100644 --- a/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelector.py +++ b/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelector.py @@ -3,7 +3,7 @@ # Most powerful in conjunction with the verbose selector area from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['BeginOfEvent','PreTracking','Step','PostTracking']) +simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['Event','Tracking','Step']) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','TargetEvent',1) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','TargetTrack',15932) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','VerboseLevel',2) diff --git a/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelectorArea.py b/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelectorArea.py index 7ad00c0d19bc26a05a7facee2992891b39b0e30e..235bb0ef20d2c7edcd6c6df12e5891c087a615b3 100644 --- a/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelectorArea.py +++ b/Simulation/SimulationJobOptions/share/g4/preInclude.VerboseSelectorArea.py @@ -5,7 +5,7 @@ # Note that the event number is the number of events into the G4 run, rather than the ATLAS event number. from G4AtlasApps.SimFlags import simFlags -simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['BeginOfEvent','PreTracking','Step','PostTracking']) +simFlags.OptionalUserActionList.addAction('G4UA::VerboseSelectorTool',['Event','Tracking','Step']) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','Xmin',-25000) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','Xmax',25000) simFlags.UserActionConfig.addConfig('G4UA::VerboseSelectorTool','Ymin',-25000) diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorder.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorder.h index e6679013edcd80780da8d77c75f0b1135d5c5d75..d87934ffe326d7fa588deaa30b2ae5b9f5855234 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorder.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorder.h @@ -12,11 +12,9 @@ #include <string> #include <vector> -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/IEndRunAction.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserRunAction.hh" +#include "G4UserEventAction.hh" +#include "G4UserSteppingAction.hh" /** @class EnergyLossRecorder @@ -36,7 +34,7 @@ namespace Trk { namespace G4UA{ - class EnergyLossRecorder: public IBeginRunAction, public IEndRunAction, public IBeginEventAction, public IEndEventAction, public ISteppingAction + class EnergyLossRecorder: public G4UserRunAction, public G4UserEventAction, public G4UserSteppingAction { public: @@ -47,11 +45,11 @@ namespace G4UA{ }; EnergyLossRecorder(const Config& config); - virtual void beginOfRun(const G4Run*) override; - virtual void endOfRun(const G4Run*) override; - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void EndOfRunAction(const G4Run*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; unsigned int m_entries; diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorderTool.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorderTool.h index d8dddc3f7e3b03c56a5ed54bc0db017ff6c5277a..7773a5d576e52ed70d524147273b801d6f8f291d 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorderTool.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/EnergyLossRecorderTool.h @@ -4,11 +4,9 @@ #ifndef TRKG4USERACTIONS_G4UA__ENERGYLOSSRECORDERTOOL_H #define TRKG4USERACTIONS_G4UA__ENERGYLOSSRECORDERTOOL_H -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/IEndRunActionTool.h" -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrkG4UserActions/EnergyLossRecorder.h" namespace Trk { @@ -28,7 +26,7 @@ namespace G4UA{ class EnergyLossRecorderTool: public ActionToolBase<EnergyLossRecorder>, - public IBeginRunActionTool, public IEndRunActionTool, public IBeginEventActionTool, public IEndEventActionTool, public ISteppingActionTool + public IG4RunActionTool, public IG4EventActionTool, public IG4SteppingActionTool { public: @@ -36,21 +34,15 @@ namespace G4UA{ EnergyLossRecorderTool(const std::string& type, const std::string& name,const IInterface* parent); /// Athena initialize method virtual StatusCode initialize() override final; - /// gets the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } - /// gets the EoR action - virtual IEndRunAction* getEndRunAction() override final - { return static_cast<IEndRunAction*>( getAction() ); } - /// gets the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// gets the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } + /// gets the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } + /// gets the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } /// gets the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } /// Gaudi interface manipulation virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollower.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollower.h index 3ebdf21640c09abb578b16c1beae4893719444b1..79fd91f756bca52d68cfd16bcb0e0ebd85180375 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollower.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollower.h @@ -23,14 +23,13 @@ namespace Trk { class IGeantFollowerHelper; } -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" namespace G4UA{ - class GeantFollower: public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public ISteppingAction + class GeantFollower: public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: @@ -41,10 +40,10 @@ namespace G4UA{ }; GeantFollower(const Config& config); - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMS.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMS.h index bb667456c8ec2c6fb07ce4ec4414898f2b0c585a..0393a76481369e7592a099f14fcde272134f5cca 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMS.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMS.h @@ -15,10 +15,9 @@ #include <string> #include <vector> -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" /** @class GeantFollowerMS @@ -33,7 +32,7 @@ namespace Trk { namespace G4UA{ - class GeantFollowerMS: public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public ISteppingAction + class GeantFollowerMS: public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: @@ -45,10 +44,10 @@ namespace G4UA{ }; GeantFollowerMS(const Config& config); - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: Config m_config; /** tracking geometry */ diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMSTool.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMSTool.h index e1324c761cd70f0df8953a05d4b1d0dfc7b41ad3..7359610ef8e5008959342d824e2486626f4bd200 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMSTool.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerMSTool.h @@ -4,16 +4,15 @@ #ifndef TRKG4USERACTIONS_G4UA__GEANTFOLLOWERMSTOOL_H #define TRKG4USERACTIONS_G4UA__GEANTFOLLOWERMSTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrkG4UserActions/GeantFollowerMS.h" namespace G4UA{ - /// @class AthenaStackingActionTool + /// @class GeantFollowerMSTool /// @brief Tool which manages the GeantFollowerMS action /// /// @author Andrea Di Simone @@ -21,24 +20,21 @@ namespace G4UA{ class GeantFollowerMSTool: public ActionToolBase<GeantFollowerMS>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// Standard constructor GeantFollowerMSTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// Retrieve the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// Retrieve the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: /// Create an action for this thread diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerTool.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerTool.h index c2bae8627b892ec4bc9c0131994f0e7dd821d8f5..5360a513562906fb920928a526aeedc935900dd9 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerTool.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/GeantFollowerTool.h @@ -4,16 +4,15 @@ #ifndef TRKG4USERACTIONS_G4UA__GEANTFOLLOWERTOOL_H #define TRKG4USERACTIONS_G4UA__GEANTFOLLOWERTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrkG4UserActions/GeantFollower.h" namespace G4UA{ - /// @class AthenaStackingActionTool + /// @class GeantFollowerTool /// @brief Tool which manages the GeantFollower action /// /// @author Andrea Di Simone @@ -21,24 +20,21 @@ namespace G4UA{ class GeantFollowerTool: public ActionToolBase<GeantFollower>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// Standard constructor GeantFollowerTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// Retrieve the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// Retrieve the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: /// Create an action for this thread diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorder.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorder.h index 6bf8f4ef5a1bb1c0bf869b72b1a605bd51b70ae8..b28bd75b71f7316f82d4b9926c858ad86ad13c25 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorder.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorder.h @@ -26,10 +26,9 @@ namespace Trk { #include "AthenaBaseComps/AthMessaging.h" -#include "G4AtlasInterfaces/IBeginEventAction.h" -#include "G4AtlasInterfaces/IEndEventAction.h" -#include "G4AtlasInterfaces/IBeginRunAction.h" -#include "G4AtlasInterfaces/ISteppingAction.h" +#include "G4UserEventAction.hh" +#include "G4UserRunAction.hh" +#include "G4UserSteppingAction.hh" #include "TrkGeometry/MaterialStepCollection.h" #include "TrkGeometry/ElementTable.h" @@ -38,15 +37,15 @@ namespace Trk { namespace G4UA{ - class MaterialStepRecorder: public AthMessaging, public IBeginEventAction, public IEndEventAction, public IBeginRunAction, public ISteppingAction + class MaterialStepRecorder: public AthMessaging, public G4UserEventAction, public G4UserRunAction, public G4UserSteppingAction { public: MaterialStepRecorder(); - virtual void beginOfEvent(const G4Event*) override; - virtual void endOfEvent(const G4Event*) override; - virtual void beginOfRun(const G4Run*) override; - virtual void processStep(const G4Step*) override; + virtual void BeginOfEventAction(const G4Event*) override; + virtual void EndOfEventAction(const G4Event*) override; + virtual void BeginOfRunAction(const G4Run*) override; + virtual void UserSteppingAction(const G4Step*) override; private: typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t; diff --git a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorderTool.h b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorderTool.h index 95fd060f83c9554acb18a46838aae1f543439421..489c9bb2003de748d90bbdd46bb067547a37d3e6 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorderTool.h +++ b/Tracking/TrkG4Components/TrkG4UserActions/TrkG4UserActions/MaterialStepRecorderTool.h @@ -5,10 +5,9 @@ #ifndef TRKG4USERACTIONS_G4UA__MATERIALSTEPRECORDERTOOL_H #define TRKG4USERACTIONS_G4UA__MATERIALSTEPRECORDERTOOL_H -#include "G4AtlasInterfaces/IBeginEventActionTool.h" -#include "G4AtlasInterfaces/IEndEventActionTool.h" -#include "G4AtlasInterfaces/IBeginRunActionTool.h" -#include "G4AtlasInterfaces/ISteppingActionTool.h" +#include "G4AtlasInterfaces/IG4EventActionTool.h" +#include "G4AtlasInterfaces/IG4RunActionTool.h" +#include "G4AtlasInterfaces/IG4SteppingActionTool.h" #include "G4AtlasTools/ActionToolBase.h" #include "TrkG4UserActions/MaterialStepRecorder.h" @@ -22,24 +21,21 @@ namespace G4UA{ class MaterialStepRecorderTool: public ActionToolBase<MaterialStepRecorder>, - public IBeginEventActionTool, public IEndEventActionTool, public IBeginRunActionTool, public ISteppingActionTool + public IG4EventActionTool, public IG4RunActionTool, public IG4SteppingActionTool { public: /// Standard constructor MaterialStepRecorderTool(const std::string& type, const std::string& name,const IInterface* parent); - /// Retrieve the BoE action - virtual IBeginEventAction* getBeginEventAction() override final - { return static_cast<IBeginEventAction*>( getAction() ); } - /// Retrieve the EoE action - virtual IEndEventAction* getEndEventAction() override final - { return static_cast<IEndEventAction*>( getAction() ); } - /// Retrieve the BoR action - virtual IBeginRunAction* getBeginRunAction() override final - { return static_cast<IBeginRunAction*>( getAction() ); } + /// Retrieve the event action + virtual G4UserEventAction* getEventAction() override final + { return static_cast<G4UserEventAction*>( getAction() ); } + /// Retrieve the run action + virtual G4UserRunAction* getRunAction() override final + { return static_cast<G4UserRunAction*>( getAction() ); } /// Retrieve the stepping action - virtual ISteppingAction* getSteppingAction() override final - { return static_cast<ISteppingAction*>( getAction() ); } + virtual G4UserSteppingAction* getSteppingAction() override final + { return static_cast<G4UserSteppingAction*>( getAction() ); } virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override; protected: /// Create an action for this thread diff --git a/Tracking/TrkG4Components/TrkG4UserActions/share/EnergyLossSimulation_jobOptions.py b/Tracking/TrkG4Components/TrkG4UserActions/share/EnergyLossSimulation_jobOptions.py index c163ac1fd28032e639eef76382aab2470b9001be..b71d6d9652cc83cf532120cc48247dff9ad2edd2 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/share/EnergyLossSimulation_jobOptions.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/share/EnergyLossSimulation_jobOptions.py @@ -115,10 +115,8 @@ from G4AtlasApps.PyG4Atlas import PyG4AtlasAlg topSeq += PyG4AtlasAlg() from AthenaCommon.CfgGetter import getPublicTool -ServiceMgr.UserActionSvc.BeginOfRunActions += [getPublicTool("EnergyLossRecorder")] -ServiceMgr.UserActionSvc.EndOfRunActions += [getPublicTool("EnergyLossRecorder")] -ServiceMgr.UserActionSvc.BeginOfEventActions += [getPublicTool("EnergyLossRecorder")] -ServiceMgr.UserActionSvc.EndOfEventActions += [getPublicTool("EnergyLossRecorder")] +ServiceMgr.UserActionSvc.RunActions += [getPublicTool("EnergyLossRecorder")] +ServiceMgr.UserActionSvc.EventActions += [getPublicTool("EnergyLossRecorder")] ServiceMgr.UserActionSvc.SteppingActions += [getPublicTool("EnergyLossRecorder")] #--- End jobOptions.GeantinoMapping.py file ------------------------------ diff --git a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowingMS_jobOptions.py b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowingMS_jobOptions.py index 92e2495c49be90bea80b5ccefd227256abc40934..931c332ab511c5d2fd79a66f1237146758949cc1 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowingMS_jobOptions.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowingMS_jobOptions.py @@ -329,8 +329,7 @@ ToolSvc += GeantFollowerMSHelper # higher precision for stepping SimFlags.TightMuonStepping=True -SimFlags.UseV2UserActions = True -SimFlags.OptionalUserActionList.addAction('G4UA::GeantFollowerMSTool',['Step','BeginOfEvent','EndOfEvent','BeginOfRun']) +SimFlags.OptionalUserActionList.addAction('G4UA::GeantFollowerMSTool',['Step','Event','Run']) ############### The output collection ####################### diff --git a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowing_jobOptions.py b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowing_jobOptions.py index 769f6d83c5c19bececa008149ea347022832ae3d..124770bd511dbc79907cd860e1e68bb9d7f63abb 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowing_jobOptions.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantFollowing_jobOptions.py @@ -326,8 +326,7 @@ GeantFollowerHelper.ExtrapolateIncrementally = True GeantFollowerHelper.OutputLevel = VERBOSE ToolSvc += GeantFollowerHelper -SimFlags.UseV2UserActions = True -SimFlags.OptionalUserActionList.addAction('G4UA::GeantFollowerTool',['Step','BeginOfEvent','EndOfEvent','BeginOfRun']) +SimFlags.OptionalUserActionList.addAction('G4UA::GeantFollowerTool',['Step','Event','Run']) ############### The output collection ####################### diff --git a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantinoMapping_jobOptions.py b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantinoMapping_jobOptions.py index 3f6c7ba95f42190506f51145293597db4e362c4c..88dbbce5fb7db53556d591ccb36710c9f7f93b9d 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/share/GeantinoMapping_jobOptions.py +++ b/Tracking/TrkG4Components/TrkG4UserActions/share/GeantinoMapping_jobOptions.py @@ -96,8 +96,7 @@ myAtRndmGenSvc.EventReseeding = False ServiceMgr += myAtRndmGenSvc ## add the material step recording action -SimFlags.UseV2UserActions = True -SimFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool',['BeginOfRun','BeginOfEvent','EndOfEvent','Step']) +SimFlags.OptionalUserActionList.addAction('G4UA::MaterialStepRecorderTool',['Run','Event','Step']) #SimFlags.UserActionConfig.addConfig('G4UA::MaterialStepRecorderTool','verboseLevel',1) #SimFlags.UserActionConfig.addConfig('G4UA::MaterialStepRecorderTool','recordELoss',1) #SimFlags.UserActionConfig.addConfig('G4UA::MaterialStepRecorderTool','recordMSc',1) @@ -125,10 +124,8 @@ from G4AtlasApps.PyG4Atlas import PyG4AtlasAlg topSeq += PyG4AtlasAlg() from AthenaCommon.CfgGetter import getPublicTool -ServiceMgr.UserActionSvc.BeginOfRunActions += [getPublicTool("MaterialStepRecorder")] -ServiceMgr.UserActionSvc.EndOfRunActions += [getPublicTool("MaterialStepRecorder")] -ServiceMgr.UserActionSvc.BeginOfEventActions += [getPublicTool("MaterialStepRecorder")] -ServiceMgr.UserActionSvc.EndOfEventActions += [getPublicTool("MaterialStepRecorder")] +ServiceMgr.UserActionSvc.RunActions += [getPublicTool("MaterialStepRecorder")] +ServiceMgr.UserActionSvc.EventActions += [getPublicTool("MaterialStepRecorder")] ServiceMgr.UserActionSvc.SteppingActions += [getPublicTool("MaterialStepRecorder")] #--- End jobOptions.GeantinoMapping.py file ------------------------------ diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorder.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorder.cxx index e2d9ae86d0464ed49ca748bf2527c890c730135e..329f8750fb4b0e3da62e526ea99e7ad5d6b234cd 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorder.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorder.cxx @@ -31,22 +31,22 @@ namespace G4UA } - void EnergyLossRecorder::beginOfRun(const G4Run*) + void EnergyLossRecorder::BeginOfRunAction(const G4Run*) { return; } - void EnergyLossRecorder::endOfRun(const G4Run*) + void EnergyLossRecorder::EndOfRunAction(const G4Run*) { return; } - void EnergyLossRecorder::beginOfEvent(const G4Event*) + void EnergyLossRecorder::BeginOfEventAction(const G4Event*) { return; } - void EnergyLossRecorder::endOfEvent(const G4Event*) + void EnergyLossRecorder::EndOfEventAction(const G4Event*) { if (m_config.pmWriter) { @@ -56,7 +56,7 @@ namespace G4UA return; } - void EnergyLossRecorder::processStep(const G4Step* aStep) + void EnergyLossRecorder::UserSteppingAction(const G4Step* aStep) { // kill secondary particles if (aStep->GetTrack()->GetParentID()) diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorderTool.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorderTool.cxx index 764d6c11f599bf9bdfa8f2ef18840a0cb5355b0c..5d7acaac3284632afa774d704674c735c11c4c3c 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorderTool.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/EnergyLossRecorderTool.cxx @@ -31,28 +31,18 @@ namespace G4UA{ } StatusCode EnergyLossRecorderTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndRunActionTool::interfaceID()) { - *ppvIf = (IEndRunActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollower.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollower.cxx index c7b16adb2098d93ec45ac7b446c49217352fa7cd..e23c646b922395e92a3056ad8734979793b5e248 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollower.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollower.cxx @@ -35,17 +35,17 @@ namespace G4UA{ , m_helperPointer(nullptr) {} - void GeantFollower::beginOfEvent(const G4Event*) + void GeantFollower::BeginOfEventAction(const G4Event*) { m_helperPointer->beginEvent(); } - void GeantFollower::endOfEvent(const G4Event*) + void GeantFollower::EndOfEventAction(const G4Event*) { m_helperPointer->endEvent(); } - void GeantFollower::beginOfRun(const G4Run*) + void GeantFollower::BeginOfRunAction(const G4Run*) { if(m_config.helper.retrieve()!=StatusCode::SUCCESS) { @@ -60,7 +60,7 @@ namespace G4UA{ return; } - void GeantFollower::processStep(const G4Step* aStep) + void GeantFollower::UserSteppingAction(const G4Step* aStep) { // kill secondaries if (aStep->GetTrack()->GetParentID()) diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMS.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMS.cxx index 6762b37831628aa03344d94cb47596a589d5f319..bd81d8572e81a4297aa2b26f65e7530ce5c25f57 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMS.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMS.cxx @@ -37,17 +37,17 @@ namespace G4UA{ , m_helperPointer(nullptr) {} - void GeantFollowerMS::beginOfEvent(const G4Event*) + void GeantFollowerMS::BeginOfEventAction(const G4Event*) { m_helperPointer->beginEvent(); } - void GeantFollowerMS::endOfEvent(const G4Event*) + void GeantFollowerMS::EndOfEventAction(const G4Event*) { m_helperPointer->endEvent(); } - void GeantFollowerMS::beginOfRun(const G4Run*) + void GeantFollowerMS::BeginOfRunAction(const G4Run*) { if(m_config.helper.retrieve()!=StatusCode::SUCCESS) { @@ -69,7 +69,7 @@ namespace G4UA{ return; } - void GeantFollowerMS::processStep(const G4Step* aStep) + void GeantFollowerMS::UserSteppingAction(const G4Step* aStep) { // kill secondaries if (aStep->GetTrack()->GetParentID()) diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSTool.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSTool.cxx index aac628ea659c179229a9e66314bc32c46ded4b5d..5a9469f8c924add2b4c6376629d582622d72a823 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSTool.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSTool.cxx @@ -22,23 +22,18 @@ namespace G4UA{ StatusCode GeantFollowerMSTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerTool.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerTool.cxx index a4ec9ba79e817ed357ec52a5e205ad990ce46181..9a462fc2b1da49e56cb5f2a37502067f64d34509 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerTool.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerTool.cxx @@ -21,23 +21,18 @@ namespace G4UA{ StatusCode GeantFollowerTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; } diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorder.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorder.cxx index 7287dc232ccddf5a551bb4412b76d9c2e0e1cee6..c8bd6a1d127612a7ee240c709d5360db2e5a2dc9 100755 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorder.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorder.cxx @@ -47,7 +47,7 @@ namespace G4UA{ { } - void MaterialStepRecorder::beginOfEvent(const G4Event*){ + void MaterialStepRecorder::BeginOfEventAction(const G4Event*){ ATH_MSG_DEBUG(" BeginOfEventAction"); @@ -59,7 +59,7 @@ namespace G4UA{ } - void MaterialStepRecorder::endOfEvent(const G4Event*){ + void MaterialStepRecorder::EndOfEventAction(const G4Event*){ ATH_MSG_DEBUG(" EndOfEventAction"); @@ -79,7 +79,7 @@ namespace G4UA{ } - void MaterialStepRecorder::beginOfRun(const G4Run*){ + void MaterialStepRecorder::BeginOfRunAction(const G4Run*){ ATH_MSG_DEBUG(" BeginOfRunAction"); @@ -89,7 +89,7 @@ namespace G4UA{ } - void MaterialStepRecorder::processStep(const G4Step* aStep) + void MaterialStepRecorder::UserSteppingAction(const G4Step* aStep) { // kill secondaries if (aStep->GetTrack()->GetParentID()) { diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorderTool.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorderTool.cxx index ea99a1fb79f2a553c165d9e1a63ed1ed8ca9ed41..0c8c3f0253f46691515f28abf9aaab1d027bf06e 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorderTool.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/MaterialStepRecorderTool.cxx @@ -17,23 +17,18 @@ namespace G4UA{ } StatusCode MaterialStepRecorderTool::queryInterface(const InterfaceID& riid, void** ppvIf){ - if(riid == IBeginEventActionTool::interfaceID()) { - *ppvIf = (IBeginEventActionTool*) this; + if(riid == IG4EventActionTool::interfaceID()) { + *ppvIf = (IG4EventActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IEndEventActionTool::interfaceID()) { - *ppvIf = (IEndEventActionTool*) this; + if(riid == IG4RunActionTool::interfaceID()) { + *ppvIf = (IG4RunActionTool*) this; addRef(); return StatusCode::SUCCESS; } - if(riid == IBeginRunActionTool::interfaceID()) { - *ppvIf = (IBeginRunActionTool*) this; - addRef(); - return StatusCode::SUCCESS; - } - if(riid == ISteppingActionTool::interfaceID()) { - *ppvIf = (ISteppingActionTool*) this; + if(riid == IG4SteppingActionTool::interfaceID()) { + *ppvIf = (IG4SteppingActionTool*) this; addRef(); return StatusCode::SUCCESS; }