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

#include <F01EventAction.hh>

Inheritance diagram for F01EventAction:
G4UserEventAction

Public Member Functions

 F01EventAction (F01RunAction *F01RA)
 
virtual ~F01EventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
void SetEventVerbose (G4int level)
 
void SetPrintModulo (G4int val)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
void SetEventManager (G4EventManager *value)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 47 of file F01EventAction.hh.

Constructor & Destructor Documentation

F01EventAction::F01EventAction ( F01RunAction F01RA)

Definition at line 52 of file F01EventAction.cc.

54  fCalorimeterCollID(-1),
55  fEventMessenger(0),
56  fRunAction(action),
57  fVerboseLevel(0),
58  fPrintModulo(10000)
59 {
60  fEventMessenger = new F01EventActionMessenger(this);
61 }
F01EventAction::~F01EventAction ( )
virtual

Definition at line 65 of file F01EventAction.cc.

66 {
67  delete fEventMessenger;
68 }

Member Function Documentation

void F01EventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 72 of file F01EventAction.cc.

References G4cout, G4endl, G4SDManager::GetCollectionID(), G4Event::GetEventID(), and G4SDManager::GetSDMpointer().

73 {
74  G4int evtNb = evt->GetEventID();
75  if (evtNb%fPrintModulo == 0)
76  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
77 
78  if (fVerboseLevel>1)
79  G4cout << "<<< Event " << evtNb << " started." << G4endl;
80 
81  if (fCalorimeterCollID==-1)
82  {
84  fCalorimeterCollID = sdManager->GetCollectionID("CalCollection");
85  }
86 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:131
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:140
G4GLOB_DLL std::ostream G4cout
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
void F01EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 90 of file F01EventAction.cc.

References G4cout, G4endl, G4Event::GetEventID(), and F01RunAction::GetRndmFreq().

91 {
92  if (fVerboseLevel>0)
93  G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
94 
95  // save rndm status
96  if (fRunAction->GetRndmFreq() == 2)
97  {
98  G4Random::saveEngineStatus("endOfEvent.rndm");
99  G4int evtNb = evt->GetEventID();
100  if (evtNb%fPrintModulo == 0)
101  {
102  G4cout << "\n---> End of Event: " << evtNb << G4endl;
103  G4Random::showEngineStatus();
104  }
105  }
106 }
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:140
G4GLOB_DLL std::ostream G4cout
G4int GetRndmFreq() const
Definition: F01RunAction.hh:57
#define G4endl
Definition: G4ios.hh:61
void F01EventAction::SetEventVerbose ( G4int  level)
inline

Definition at line 57 of file F01EventAction.hh.

Referenced by F01EventActionMessenger::SetNewValue().

57 {fVerboseLevel = level;}
void F01EventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 58 of file F01EventAction.hh.

Referenced by F01EventActionMessenger::SetNewValue().

58 {fPrintModulo = val;}

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