00001
00002
00003 #include "musrEventAction.hh"
00004
00005 #include "G4Event.hh"
00006 #include "G4EventManager.hh"
00007 #include "G4TrajectoryContainer.hh"
00008 #include "G4Trajectory.hh"
00009 #include "G4VVisManager.hh"
00010 #include "G4ios.hh"
00011
00012
00013
00014 musrEventAction::musrEventAction()
00015 {}
00016
00017
00018
00019 musrEventAction::~musrEventAction()
00020 {}
00021
00022
00023
00024 void musrEventAction::BeginOfEventAction(const G4Event*)
00025 {}
00026
00027
00028
00029 void musrEventAction::EndOfEventAction(const G4Event* evt)
00030 {
00031 G4int event_id = evt->GetEventID();
00032
00033
00034
00035 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
00036 G4int n_trajectories = 0;
00037 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
00038
00039
00040
00041 if (event_id%100 == 0) {
00042 G4cout << ">>> Event " << evt->GetEventID() << G4endl;
00043
00044 }
00045
00046
00047
00048 if (G4VVisManager::GetConcreteInstance())
00049 {
00050 for (G4int i=0; i<n_trajectories; i++)
00051 { G4Trajectory* trj = (G4Trajectory*)
00052 ((*(evt->GetTrajectoryContainer()))[i]);
00053 trj->DrawTrajectory(1000);
00054 }
00055 }
00056 }
00057
00058