Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
ExG4EventAction01 Class Reference

#include <ExG4EventAction01.hh>

Inheritance diagram for ExG4EventAction01:
G4UserEventAction

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)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
void SetEventManager (G4EventManager *value)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Event action class

It provides:

Definition at line 45 of file ExG4EventAction01.hh.

Constructor & Destructor Documentation

ExG4EventAction01::ExG4EventAction01 ( )

Standard constructor

Definition at line 47 of file ExG4EventAction01.cc.

49  fMessenger(this),
50  fVerboseLevel(fgkDefaultVerboseLevel),
51  fPrintModulo(fgkDefaultPrintModulo),
52  fSaveRndm(false)
53 {
54 /// Standard constructor
55 }
ExG4EventAction01::~ExG4EventAction01 ( )
virtual

Destructor

Definition at line 58 of file ExG4EventAction01.cc.

59 {
60 /// Destructor
61 }

Member Function Documentation

void ExG4EventAction01::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 64 of file ExG4EventAction01.cc.

References G4cout, and G4endl.

65 {
66  // Print event info
67  //
68  G4int eventNumber = event->GetEventID();
69  if ( eventNumber%fPrintModulo == 0 ) {
70  G4cout << "\n---> Begin of Event: " << eventNumber << G4endl;
71  }
72 
73  // Print verbose info
74  //
75  if ( fVerboseLevel > 1 ) {
76  G4cout << "<<< Event " << eventNumber << " started." << G4endl;
77  }
78 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void ExG4EventAction01::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 81 of file ExG4EventAction01.cc.

References G4cout, G4endl, G4RunManager::GetCurrentRun(), G4Run::GetRunID(), G4RunManager::GetRunManager(), CLHEP::HepRandom::saveEngineStatus(), and CLHEP::HepRandom::showEngineStatus().

82 {
83  // Print verbose info
84  //
85  if ( fVerboseLevel > 1 ) {
86  G4cout << "<<< Event " << event->GetEventID() << " ended." << G4endl;
87  }
88 
89  // Save rndm status
90  //
91  if ( fSaveRndm ) {
93  G4int runNumber = run->GetRunID();
94  G4int eventNumber = event->GetEventID();
95  std::ostringstream fileName;
96  fileName << "run" << runNumber << "event" << eventNumber << ".rndm";
97  CLHEP::HepRandom::saveEngineStatus(fileName.str().c_str());
98 
99  if ( eventNumber%fPrintModulo == 0 ) {
100  G4cout << "\n---> End of Event: " << eventNumber << G4endl;
102  }
103  }
104 }
int G4int
Definition: G4Types.hh:78
const G4Run * GetCurrentRun() const
G4GLOB_DLL std::ostream G4cout
G4int GetRunID() const
Definition: G4Run.hh:76
Definition: G4Run.hh:46
static void showEngineStatus()
Definition: Random.cc:203
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
static void saveEngineStatus(const char filename[]="Config.conf")
Definition: Random.cc:175
#define G4endl
Definition: G4ios.hh:61
void ExG4EventAction01::SetDrawFlag ( G4String  value)
void ExG4EventAction01::SetPrintModulo ( G4int  value)
inline

Definition at line 80 of file ExG4EventAction01.hh.

Referenced by ExG4EventAction01Messenger::SetNewValue().

80  {
81  fPrintModulo = value;
82 }
const XML_Char int const XML_Char * value
void ExG4EventAction01::SetSaveRndm ( G4bool  value)
inline

Definition at line 84 of file ExG4EventAction01.hh.

Referenced by ExG4EventAction01Messenger::SetNewValue().

84  {
85  fSaveRndm = value;
86 }
const XML_Char int const XML_Char * value
void ExG4EventAction01::SetVerboseLevel ( G4int  level)
inline

Definition at line 76 of file ExG4EventAction01.hh.

Referenced by ExG4EventAction01Messenger::SetNewValue().

76  {
77  fVerboseLevel = level;
78 }

The documentation for this class was generated from the following files: