Geant4  10.02.p03
ExG4EventAction01 Class Reference

#include <ExG4EventAction01.hh>

Inheritance diagram for ExG4EventAction01:
Collaboration diagram for ExG4EventAction01:

Public Member Functions

 ExG4EventAction01 ()
 
virtual ~ExG4EventAction01 ()
 
virtual void BeginOfEventAction (const G4Event *event)
 
virtual void EndOfEventAction (const G4Event *event)
 
void SetVerboseLevel (G4int level)
 
void SetSaveRndm (G4bool value)
 
void SetDrawFlag (G4String value)
 
 ExG4EventAction01 ()
 
virtual ~ExG4EventAction01 ()
 
virtual void BeginOfEventAction (const G4Event *event)
 
virtual void EndOfEventAction (const G4Event *event)
 
void SetVerboseLevel (G4int level)
 
void SetSaveRndm (G4bool value)
 
void SetDrawFlag (G4String value)
 
 ExG4EventAction01 ()
 
virtual ~ExG4EventAction01 ()
 
virtual void BeginOfEventAction (const G4Event *event)
 
virtual void EndOfEventAction (const G4Event *event)
 
void SetVerboseLevel (G4int level)
 
void SetSaveRndm (G4bool value)
 
void SetDrawFlag (G4String value)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Private Attributes

ExG4EventAction01Messenger fMessenger
 
G4int fVerboseLevel
 
G4bool fSaveRndm
 

Static Private Attributes

static const G4int fgkDefaultVerboseLevel = 1
 
static const G4int fgkDefaultPrintModulo = 10000
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Event action class

It provides:

  • setting verbose level and event modulo pronting
  • option to save random number status at the end of event

Definition at line 45 of file common/include/ExG4EventAction01.hh.

Constructor & Destructor Documentation

◆ ExG4EventAction01() [1/3]

ExG4EventAction01::ExG4EventAction01 ( )

Standard constructor

Definition at line 50 of file common/src/ExG4EventAction01.cc.

◆ ~ExG4EventAction01() [1/3]

ExG4EventAction01::~ExG4EventAction01 ( )
virtual

Destructor

Definition at line 61 of file common/src/ExG4EventAction01.cc.

62 {
64 }

◆ ExG4EventAction01() [2/3]

ExG4EventAction01::ExG4EventAction01 ( )

◆ ~ExG4EventAction01() [2/3]

virtual ExG4EventAction01::~ExG4EventAction01 ( )
virtual

◆ ExG4EventAction01() [3/3]

ExG4EventAction01::ExG4EventAction01 ( )

◆ ~ExG4EventAction01() [3/3]

virtual ExG4EventAction01::~ExG4EventAction01 ( )
virtual

Member Function Documentation

◆ BeginOfEventAction() [1/3]

void ExG4EventAction01::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 68 of file common/src/ExG4EventAction01.cc.

69 {
70  // Print event info
71  //
72  G4int eventNumber = event->GetEventID();
73 
74  // Print verbose info
75  //
76  if ( fVerboseLevel > 1 ) {
77  G4cout << "<<< Event " << eventNumber << " started." << G4endl;
78  }
79 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ BeginOfEventAction() [2/3]

virtual void ExG4EventAction01::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

◆ BeginOfEventAction() [3/3]

virtual void ExG4EventAction01::BeginOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

◆ EndOfEventAction() [1/3]

void ExG4EventAction01::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

Definition at line 83 of file common/src/ExG4EventAction01.cc.

84 {
85  // Print verbose info
86  //
87  if ( fVerboseLevel > 1 ) {
88  G4cout << "<<< Event " << event->GetEventID() << " ended." << G4endl;
89  }
90 
91  // Save rndm status
92  //
93  if ( fSaveRndm ) {
95  G4int runNumber = run->GetRunID();
96  G4int eventNumber = event->GetEventID();
97  std::ostringstream fileName;
98  fileName << "run" << runNumber << "event" << eventNumber << ".rndm";
99  CLHEP::HepRandom::saveEngineStatus(fileName.str().c_str());
100  }
101 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
Definition: G4Run.hh:46
const G4Run * GetCurrentRun() const
G4int GetRunID() const
Definition: G4Run.hh:76
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static void saveEngineStatus(const char filename[]="Config.conf")
Definition: Random.cc:176
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ EndOfEventAction() [2/3]

virtual void ExG4EventAction01::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

◆ EndOfEventAction() [3/3]

virtual void ExG4EventAction01::EndOfEventAction ( const G4Event event)
virtual

Reimplemented from G4UserEventAction.

◆ SetDrawFlag() [1/3]

void ExG4EventAction01::SetDrawFlag ( G4String  value)

◆ SetDrawFlag() [2/3]

void ExG4EventAction01::SetDrawFlag ( G4String  value)

◆ SetDrawFlag() [3/3]

void ExG4EventAction01::SetDrawFlag ( G4String  value)

◆ SetSaveRndm() [1/3]

void ExG4EventAction01::SetSaveRndm ( G4bool  value)

◆ SetSaveRndm() [2/3]

void ExG4EventAction01::SetSaveRndm ( G4bool  value)
inline

Definition at line 78 of file common/include/ExG4EventAction01.hh.

78  {
79  fSaveRndm = value;
80 }
Here is the caller graph for this function:

◆ SetSaveRndm() [3/3]

void ExG4EventAction01::SetSaveRndm ( G4bool  value)

◆ SetVerboseLevel() [1/3]

void ExG4EventAction01::SetVerboseLevel ( G4int  level)
inline

Definition at line 74 of file common/include/ExG4EventAction01.hh.

74  {
75  fVerboseLevel = level;
76 }
Here is the caller graph for this function:

◆ SetVerboseLevel() [2/3]

void ExG4EventAction01::SetVerboseLevel ( G4int  level)

◆ SetVerboseLevel() [3/3]

void ExG4EventAction01::SetVerboseLevel ( G4int  level)

Member Data Documentation

◆ fgkDefaultPrintModulo

const G4int ExG4EventAction01::fgkDefaultPrintModulo = 10000
staticprivate

Definition at line 64 of file common/include/ExG4EventAction01.hh.

◆ fgkDefaultVerboseLevel

const G4int ExG4EventAction01::fgkDefaultVerboseLevel = 1
staticprivate

Definition at line 63 of file common/include/ExG4EventAction01.hh.

◆ fMessenger

ExG4EventAction01Messenger ExG4EventAction01::fMessenger
private

Definition at line 67 of file common/include/ExG4EventAction01.hh.

◆ fSaveRndm

G4bool ExG4EventAction01::fSaveRndm
private

Definition at line 69 of file common/include/ExG4EventAction01.hh.

◆ fVerboseLevel

G4int ExG4EventAction01::fVerboseLevel
private

Definition at line 68 of file common/include/ExG4EventAction01.hh.


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