#include <EventAction.hh>
Public Member Functions | |
EventAction () | |
virtual | ~EventAction () |
virtual void | BeginOfEventAction (const G4Event *) |
virtual void | EndOfEventAction (const G4Event *) |
void | SetPrintModulo (G4int val) |
void | AddEventToDebug (G4int val) |
Private Member Functions | |
EventAction & | operator= (const EventAction &right) |
EventAction (const EventAction &) | |
Private Attributes | |
EventActionMessenger * | fEventMessenger |
G4UImanager * | UI |
std::vector< G4int > | fSelectedEvents |
G4int | fPrintModulo |
G4int | fSelected |
G4bool | fDebugStarted |
Definition at line 55 of file EventAction.hh.
EventAction::EventAction | ( | ) |
Definition at line 51 of file EventAction.cc.
References fEventMessenger, fSelectedEvents, and UI.
00051 : 00052 fPrintModulo(100), 00053 fSelected(0), 00054 fDebugStarted(false) 00055 { 00056 fEventMessenger = new EventActionMessenger(this); 00057 UI = G4UImanager::GetUIpointer(); 00058 fSelectedEvents.clear(); 00059 }
EventAction::~EventAction | ( | ) | [virtual] |
Definition at line 63 of file EventAction.cc.
References fEventMessenger.
00064 { 00065 delete fEventMessenger; 00066 }
EventAction::EventAction | ( | const EventAction & | ) | [private] |
void EventAction::AddEventToDebug | ( | G4int | val | ) | [inline] |
Definition at line 89 of file EventAction.hh.
References fSelected, and fSelectedEvents.
Referenced by EventActionMessenger::SetNewValue().
00090 { 00091 fSelectedEvents.push_back(val); 00092 ++fSelected; 00093 }
void EventAction::BeginOfEventAction | ( | const G4Event * | evt | ) | [virtual] |
Definition at line 70 of file EventAction.cc.
References fDebugStarted, fPrintModulo, fSelected, fSelectedEvents, and UI.
00071 { 00072 // New event 00073 G4int nEvt = evt->GetEventID(); 00074 00075 if(fSelected>0) { 00076 for(G4int i=0; i<fSelected; ++i) { 00077 if(nEvt == fSelectedEvents[i]) { 00078 UI->ApplyCommand("/random/saveThisEvent"); 00079 UI->ApplyCommand("/tracking/verbose 2"); 00080 fDebugStarted = true; 00081 break; 00082 } 00083 } 00084 } 00085 00086 // Initialize user actions 00087 if(G4int(nEvt/fPrintModulo)*fPrintModulo == nEvt) { 00088 G4cout << "EventAction: Event # " 00089 << nEvt << " started" << G4endl; 00090 } 00091 }
void EventAction::EndOfEventAction | ( | const G4Event * | ) | [virtual] |
Definition at line 95 of file EventAction.cc.
References fDebugStarted, and UI.
00096 { 00097 if(fDebugStarted) { 00098 UI->ApplyCommand("/tracking/verbose 0"); 00099 fDebugStarted = false; 00100 G4cout << "EventAction: Event ended" << G4endl; 00101 } 00102 }
EventAction& EventAction::operator= | ( | const EventAction & | right | ) | [private] |
void EventAction::SetPrintModulo | ( | G4int | val | ) | [inline] |
Definition at line 84 of file EventAction.hh.
References fPrintModulo.
Referenced by EventActionMessenger::SetNewValue().
00085 { 00086 fPrintModulo = val; 00087 }
G4bool EventAction::fDebugStarted [private] |
Definition at line 80 of file EventAction.hh.
Referenced by BeginOfEventAction(), and EndOfEventAction().
EventActionMessenger* EventAction::fEventMessenger [private] |
Definition at line 73 of file EventAction.hh.
Referenced by EventAction(), and ~EventAction().
G4int EventAction::fPrintModulo [private] |
Definition at line 77 of file EventAction.hh.
Referenced by BeginOfEventAction(), and SetPrintModulo().
G4int EventAction::fSelected [private] |
Definition at line 78 of file EventAction.hh.
Referenced by AddEventToDebug(), and BeginOfEventAction().
std::vector<G4int> EventAction::fSelectedEvents [private] |
Definition at line 75 of file EventAction.hh.
Referenced by AddEventToDebug(), BeginOfEventAction(), and EventAction().
G4UImanager* EventAction::UI [private] |
Definition at line 74 of file EventAction.hh.
Referenced by BeginOfEventAction(), EndOfEventAction(), and EventAction().