22 lines
520 B
C++
22 lines
520 B
C++
#include "EventAction.hh"
|
||
|
||
#include "G4Event.hh"
|
||
#include "G4RunManager.hh"
|
||
#include "RunAction.hh"
|
||
|
||
namespace B1 {
|
||
|
||
// 初始化 fEventAction,即获取到当前 Event 所在的 Run
|
||
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
|