|
Geant4 examples
|
Event action class. More...
#include <Doxymodules_common.h>
Public Member Functions | |
| ExG4EventAction01 () | |
| virtual | ~ExG4EventAction01 () |
| virtual void | BeginOfEventAction (const G4Event *event) |
| virtual void | EndOfEventAction (const G4Event *event) |
| void | SetVerboseLevel (G4int level) |
| void | SetPrintModulo (G4int value) |
| void | SetSaveRndm (G4bool value) |
| void | SetDrawFlag (G4String value) |
Private Attributes | |
| ExG4EventAction01Messenger | fMessenger |
| G4int | fVerboseLevel |
| G4int | fPrintModulo |
| G4bool | fSaveRndm |
Static Private Attributes | |
| static const G4int | fgkDefaultVerboseLevel = 1 |
| static const G4int | fgkDefaultPrintModulo = 10000 |
Event action class.
It provides:
Definition at line 63 of file Doxymodules_common.h.
| ExG4EventAction01::ExG4EventAction01 | ( | ) |
Standard constructor
Definition at line 47 of file ExG4EventAction01.cc.
: G4UserEventAction(), fMessenger(this), fVerboseLevel(fgkDefaultVerboseLevel), fPrintModulo(fgkDefaultPrintModulo), fSaveRndm(false) { }
| ExG4EventAction01::~ExG4EventAction01 | ( | ) | [virtual] |
Reimplemented from G4UserEventAction.
Definition at line 64 of file ExG4EventAction01.cc.
{
// Print event info
//
G4int eventNumber = event->GetEventID();
if ( eventNumber%fPrintModulo == 0 ) {
G4cout << "\n---> Begin of Event: " << eventNumber << G4endl;
}
// Print verbose info
//
if ( fVerboseLevel > 1 ) {
G4cout << "<<< Event " << eventNumber << " started." << G4endl;
}
}
Reimplemented from G4UserEventAction.
Definition at line 81 of file ExG4EventAction01.cc.
{
// Print verbose info
//
if ( fVerboseLevel > 1 ) {
G4cout << "<<< Event " << event->GetEventID() << " ended." << G4endl;
}
// Save rndm status
//
if ( fSaveRndm ) {
const G4Run* run = G4RunManager::GetRunManager()->GetCurrentRun();
G4int runNumber = run->GetRunID();
G4int eventNumber = event->GetEventID();
std::ostringstream fileName;
fileName << "run" << runNumber << "event" << eventNumber << ".rndm";
CLHEP::HepRandom::saveEngineStatus(fileName.str().c_str());
if ( eventNumber%fPrintModulo == 0 ) {
G4cout << "\n---> End of Event: " << eventNumber << G4endl;
CLHEP::HepRandom::showEngineStatus();
}
}
}
| void ExG4EventAction01::SetVerboseLevel | ( | G4int | level | ) | [inline] |
Definition at line 76 of file ExG4EventAction01.hh.
{
fVerboseLevel = level;
}
| void ExG4EventAction01::SetPrintModulo | ( | G4int | value | ) | [inline] |
Definition at line 80 of file ExG4EventAction01.hh.
{
fPrintModulo = value;
}
| void ExG4EventAction01::SetSaveRndm | ( | G4bool | value | ) | [inline] |
Definition at line 84 of file ExG4EventAction01.hh.
{
fSaveRndm = value;
}
| void ExG4EventAction01::SetDrawFlag | ( | G4String | value | ) |
const G4int ExG4EventAction01::fgkDefaultVerboseLevel = 1 [static, private] |
Definition at line 64 of file ExG4EventAction01.hh.
const G4int ExG4EventAction01::fgkDefaultPrintModulo = 10000 [static, private] |
Definition at line 65 of file ExG4EventAction01.hh.
Definition at line 68 of file ExG4EventAction01.hh.
G4int ExG4EventAction01::fVerboseLevel [private] |
Definition at line 69 of file ExG4EventAction01.hh.
G4int ExG4EventAction01::fPrintModulo [private] |
Definition at line 70 of file ExG4EventAction01.hh.
G4bool ExG4EventAction01::fSaveRndm [private] |
Definition at line 71 of file ExG4EventAction01.hh.
1.7.4