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

#include <F04EventAction.hh>

Inheritance diagram for F04EventAction:
G4UserEventAction

Public Member Functions

 F04EventAction (F04RunAction *)
 
virtual ~F04EventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
G4int GetEventNo ()
 
void SetEventVerbose (G4int)
 
void SetDrawFlag (G4String val)
 
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 41 of file F04EventAction.hh.

Constructor & Destructor Documentation

F04EventAction::F04EventAction ( F04RunAction runAction)

Definition at line 47 of file F04EventAction.cc.

48  : fRunaction(runAction), fVerboselevel(0),
49  fPrintModulo(10), fDrawFlag("all")
50 {
51  fEventMessenger = new F04EventActionMessenger(this);
52 }
F04EventAction::~F04EventAction ( )
virtual

Definition at line 56 of file F04EventAction.cc.

57 {
58  delete fEventMessenger;
59 }

Member Function Documentation

void F04EventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 63 of file F04EventAction.cc.

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

64 {
65  G4int evtNb = evt->GetEventID();
66  if (evtNb%fPrintModulo == 0)
67  G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
68 
69  if(fVerboselevel>0)
70  G4cout << "<<< Event " << evtNb << " started." << G4endl;
71 }
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:140
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void F04EventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 76 of file F04EventAction.cc.

References G4cout, G4endl, G4Threading::G4GetThreadId(), G4Event::GetEventID(), and F04RunAction::GetRndmFreq().

77 {
78 // G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
79 //
80 // if(pVVisManager)
81 // {
82 // G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
83 //
84 // G4int n_trajectories = 0;
85 //
86 // if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
87 // for(G4int i=0; i<n_trajectories; i++)
88 // { G4Trajectory* trj =
89 // (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
90 // if (fDrawFlag == "all") trj->DrawTrajectory();
91 // else if ((fDrawFlag == "charged")&&(trj->GetCharge() != 0.))
92 // trj->DrawTrajectory();
93 // }
94 // }
95 
96  if (fVerboselevel>0)
97  G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
98 
99  if (fRunaction->GetRndmFreq() == 2)
100  {
101  std::ostringstream os;
102  os<<"endOfEvent_"<<G4Threading::G4GetThreadId()<<".rndm";
103  G4Random::saveEngineStatus(os.str().c_str());
104  G4int evtNb = evt->GetEventID();
105  if (evtNb%fPrintModulo == 0)
106  {
107  G4cout << "\n---> End of Event: " << evtNb << G4endl;
108  G4Random::showEngineStatus();
109  }
110  }
111 }
G4int GetRndmFreq()
Definition: F04RunAction.hh:55
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:140
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int G4GetThreadId()
Definition: G4Threading.cc:103
G4int F04EventAction::GetEventNo ( )

Definition at line 115 of file F04EventAction.cc.

References G4UserEventAction::fpEventManager, G4EventManager::GetConstCurrentEvent(), and G4Event::GetEventID().

116 {
118  return evno ;
119 }
G4EventManager * fpEventManager
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:140
const G4Event * GetConstCurrentEvent()
void F04EventAction::SetDrawFlag ( G4String  val)
inline

Definition at line 56 of file F04EventAction.hh.

Referenced by F04EventActionMessenger::SetNewValue().

56 { fDrawFlag = val; };
void F04EventAction::SetEventVerbose ( G4int  level)

Definition at line 123 of file F04EventAction.cc.

Referenced by F04EventActionMessenger::SetNewValue().

124 {
125  fVerboselevel = level ;
126 }
void F04EventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 57 of file F04EventAction.hh.

Referenced by F04EventActionMessenger::SetNewValue().

57 { fPrintModulo = val; };

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