G4-ExampleB1/src/EventAction.cc

21 lines
453 B
C++

#include "EventAction.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
#include "RunAction.hh"
namespace B1 {
EventAction::EventAction(RunAction* runAction) : fRunAction(runAction) {}
EventAction::~EventAction() {}
void EventAction::BeginOfEventAction(const G4Event*) { fEdep = 0.; }
void EventAction::EndOfEventAction(const G4Event*) {
// 将 event 中的沉积能量返回给 run
fRunAction->AddEdep(fEdep);
}
} // namespace B1