Skip to content
Snippets Groups Projects
Commit e5188642 authored by Mark Hodgkinson's avatar Mark Hodgkinson
Browse files

Add celeritas event action code

parent a8c541e8
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,7 @@ namespace G4UA {
void CeleritasRunAction::BeginOfRunAction(const G4Run*) {};
void CeleritasRunAction::EndOfRunAction(const G4Run*) {};
void CeleritasEventAction::BeginOfEventAction(const G4Event*) {};
void CeleritasEventAction::EndOfEventAction(const G4Event*) {};
}
#ifndef G4USERACTIONS_CELERITASOFFLOAD_H
#define G4USERACTIONS_CELERITASOFFLOAD_H
#include "G4UserEventAction.hh"
#include "G4UserRunAction.hh"
namespace G4UA {
......@@ -11,5 +12,12 @@ namespace G4UA {
virtual void BeginOfRunAction(const G4Run*) override;
virtual void EndOfRunAction(const G4Run*) override;
};
class CeleritasEventAction : public G4UserEventAction {
public:
CeleritasEventAction();
virtual void BeginOfEventAction(const G4Event*) override;
virtual void EndOfEventAction(const G4Event*) override;
};
}
#endif
\ No newline at end of file
......@@ -22,4 +22,25 @@ namespace G4UA {
return action;
}
CeleritasEventActionTool::CeleritasEventActionTool(const std::string& type, const std::string& name, const IInterface* parent)
: UserActionToolBase(type, name, parent) {}
StatusCode CeleritasEventActionTool::initialize() {
ATH_MSG_DEBUG("initialize");
return StatusCode::SUCCESS;
}
StatusCode CeleritasEventActionTool::finalize() {
ATH_MSG_DEBUG("finalize");
return StatusCode::SUCCESS;
}
std::unique_ptr<CeleritasEventAction> CeleritasEventActionTool::makeAndFillAction(G4AtlasUserActions& actionList) {
ATH_MSG_DEBUG("makeAction");
auto action = std::make_unique<CeleritasEventAction>();
actionList.eventActions.push_back( action.get() );
return action;
}
}
\ No newline at end of file
......@@ -22,5 +22,20 @@ namespace G4UA {
};
class CeleritasEventActionTool : public UserActionToolBase<CeleritasEventAction> {
public:
CeleritasEventActionTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual StatusCode initialize() override;
virtual StatusCode finalize() override;
protected:
virtual std::unique_ptr<CeleritasEventAction> makeAndFillAction(G4AtlasUserActions&) override final;
};
}
#endif
\ No newline at end of file
......@@ -52,3 +52,4 @@ DECLARE_COMPONENT( G4UA::VolumeDumperTool )
DECLARE_COMPONENT( G4UA::AthenaStackingActionTool )
DECLARE_COMPONENT( G4UA::AthenaTrackingActionTool )
DECLARE_COMPONENT( G4UA::CeleritasRunActionTool )
DECLARE_COMPONENT( G4UA::CeleritasEventActionTool )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment