Created EventAction class
This commit is contained in:
parent
92aa2e0199
commit
e39ae5befd
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// MedtechEventAction.hh
|
||||
// medtech
|
||||
//
|
||||
// Created by Baranyai David on 2018. 04. 01..
|
||||
//
|
||||
|
||||
#ifndef MedtechEventAction_hh
|
||||
#define MedtechEventAction_hh
|
||||
|
||||
#include <stdio.h>
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "G4Types.hh"
|
||||
#include "MedtechRunAction.hh"
|
||||
|
||||
class MedtechEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
MedtechEventAction(MedtechRunAction *runAction);
|
||||
virtual ~MedtechEventAction();
|
||||
|
||||
virtual void BeginOfEventAction(const G4Event* event);
|
||||
virtual void EndOfEventAction(const G4Event* event);
|
||||
|
||||
void AddEdep(G4double edep) { fEdep += edep; }
|
||||
|
||||
private:
|
||||
MedtechRunAction* fRunAction;
|
||||
G4double fEdep;
|
||||
};
|
||||
|
||||
#endif /* MedtechEventAction_hh */
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// MedtechEventAction.cc
|
||||
// medtech
|
||||
//
|
||||
// Created by Baranyai David on 2018. 04. 01..
|
||||
//
|
||||
|
||||
#include "MedtechEventAction.hh"
|
||||
|
||||
MedtechEventAction::MedtechEventAction(MedtechRunAction *runAction) : G4UserEventAction(), fRunAction(runAction), fEdep(0.)
|
||||
{
|
||||
}
|
||||
|
||||
MedtechEventAction::~MedtechEventAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MedtechEventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
fEdep = 0.;
|
||||
}
|
||||
|
||||
void MedtechEventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
// accumulate statistics in run action
|
||||
fRunAction->AddEdep(fEdep);
|
||||
}
|
Loading…
Reference in New Issue