Class Reference for E1039 Core & Analysis Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHG4PhenixEventAction.cc
Go to the documentation of this file.
2 #include "PHG4EventAction.h"
3 
4 const int VERBOSE = 0;
5 
7  _timer( PHTimeServer::get()->insert_new( "PHG4PhenixEventAction" ) )
8 {}
9 
11 {
12  while (actions_.begin() != actions_.end())
13  {
14  delete actions_.back();
15  actions_.pop_back();
16  }
17 }
18 
19 //_________________________________________________________________
20 void PHG4PhenixEventAction::BeginOfEventAction( const G4Event* event )
21 {
22  _timer.get()->restart();
23 
24  if ( VERBOSE ) std::cout << "PHG4PhenixEventAction::BeginOfEventAction" << std::endl;
25 
26  // loop over registered actions, and process
27  for( ActionList::const_iterator iter = actions_.begin(); iter != actions_.end(); ++iter )
28  {
29  if(*iter)
30  {
31  if ( VERBOSE ) std::cout << "PHG4PhenixEventAction::BeginOfEventAction - processing " << *iter << std::endl;
32  (*iter)->BeginOfEventAction( event );
33  }
34  }
35 
36 }
37 
38 //_________________________________________________________________
39 void PHG4PhenixEventAction::EndOfEventAction( const G4Event* event )
40 {
41 
42  if ( VERBOSE ) std::cout << "PHG4PhenixEventAction::EndOfEventAction" << std::endl;
43 
44  // loop over registered actions, and process
45  for( ActionList::const_iterator iter = actions_.begin(); iter != actions_.end(); ++iter )
46  {
47  if(*iter)
48  {
49  if ( VERBOSE ) std::cout << "PHG4PhenixEventAction::EndOfEventAction - processing " << *iter << std::endl;
50  (*iter)->EndOfEventAction( event );
51  }
52  }
53 
54  _timer.get()->stop();
55 }
const int VERBOSE
void EndOfEventAction(const G4Event *)
void BeginOfEventAction(const G4Event *)
PHTimer * get(void)
Definition: PHTimeServer.h:43
PHTimer server for accessing external information.
Definition: PHTimeServer.h:29
void restart()
Restart timer.
Definition: PHTimer.h:70
void stop()
stops the counter
Definition: PHTimer.h:61