W pliku MyRun.cc (zmiany kolorem czerwonym)
............................................................
#include "G4TrajectoryContainer.hh"
#include
"G4VTrajectory.hh"
#include
<iomanip>
................................................................
void MyRun::RecordEvent(const G4Event* evt)
{
numberOfEvent++;
G4TrajectoryContainer* container =
evt->GetTrajectoryContainer();
G4cout << "MyLog: number of particles processed in this
event "
<<
container->size() << G4endl;
for
(G4int i = 0; i < container->size(); i++)
{
G4VTrajectory*
traj = (*container)[i];
G4cout
<< "MyLog: particle name " << std::setw(8) <<
traj->GetParticleName()
<<
" initial momentum: " <<
std::setprecision(2) << std::setw(4) <<
traj->GetInitialMomentum() << G4endl;
}
}