W pliku MyRunAction.hh
(zmiany kolorem czerwonym)
.................................................................
class G4Run;
class MyRunAction : public G4UserRunAction {
..............................................................................................
// Destructor
virtual ~MyRunAction();
//
Method
void BeginOfRunAction(const G4Run* );
void EndOfRunAction(const G4Run* );
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
W pliku MyRunAction.cc
(zmiany kolorem czerwonym)
.............................................................................................
#include "MyRunAction.hh"
#include
"G4Run.hh"
#include
"globals.hh"
MyRunAction::MyRunAction()
{}
MyRunAction::~MyRunAction()
{}
void
MyRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout
<< "MyLog: Begin of run" << G4endl;
}
void
MyRunAction::EndOfRunAction(const G4Run* aRun)
{
G4cout <<"MyLog: Number of processed
events:"
<< aRun->GetNumberOfEvent()
<< " events. " <<G4endl;
G4cout
<<
"MyLog: End of run" << G4endl;
}
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
W pliku
My.cc
(zmiany kolorem czerwonym)
.................................................................
#include
"MyPrimaryGeneratorAction.hh"
#include
"MyRunAction.hh"
#include "G4RunManager.hh"
.................................................................
// User action classes
runManager->SetUserAction(new MyPrimaryGeneratorAction());
runManager->SetUserAction(new
MyRunAction());