Geant4 examples
Public Member Functions | Private Attributes | Static Private Attributes
ExG4EventAction01 Class Reference

Event action class. More...

#include <Doxymodules_common.h>

Inheritance diagram for ExG4EventAction01:
G4UserEventAction

List of all members.

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

Detailed Description

Event action class.

It provides:

Definition at line 63 of file Doxymodules_common.h.


Constructor & Destructor Documentation

ExG4EventAction01::ExG4EventAction01 ( )

Standard constructor

Definition at line 47 of file ExG4EventAction01.cc.

ExG4EventAction01::~ExG4EventAction01 ( ) [virtual]

Destructor

Definition at line 58 of file ExG4EventAction01.cc.

{
}

Member Function Documentation

void ExG4EventAction01::BeginOfEventAction ( const G4Event event) [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;
  }   
}
void ExG4EventAction01::EndOfEventAction ( const G4Event event) [virtual]

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)

Member Data Documentation

Definition at line 64 of file ExG4EventAction01.hh.

Definition at line 65 of file ExG4EventAction01.hh.

Definition at line 68 of file ExG4EventAction01.hh.

Definition at line 69 of file ExG4EventAction01.hh.

Definition at line 70 of file ExG4EventAction01.hh.

Definition at line 71 of file ExG4EventAction01.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines