Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -23,9 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field04/src/F04EventAction.cc
/// \brief Implementation of the F04EventAction class
//
//
#include "F04EventAction.hh"
#include "F04RunAction.hh"
@@ -39,28 +40,36 @@
#include "G4VVisManager.hh"
#include "Randomize.hh"
F04EventAction::F04EventAction(F04RunAction* RA)
: runaction(RA), verboselevel(0),
printModulo(10), drawFlag("all")
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
F04EventAction::F04EventAction(F04RunAction* runAction)
: fRunaction(runAction), fVerboselevel(0),
fPrintModulo(10), fDrawFlag("all")
{
eventMessenger = new F04EventActionMessenger(this);
fEventMessenger = new F04EventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
F04EventAction::~F04EventAction()
{
delete eventMessenger;
delete fEventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void F04EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
if (evtNb%fPrintModulo == 0)
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
if(verboselevel>0)
if(fVerboselevel>0)
G4cout << "<<< Event " << evtNb << " started." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void F04EventAction::EndOfEventAction(const G4Event* evt)
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
@@ -71,37 +80,42 @@ void F04EventAction::EndOfEventAction(const G4Event* evt)
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for(G4int i=0; i<n_trajectories; i++)
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
if (drawFlag == "all") trj->DrawTrajectory(50);
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(50);
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for(G4int i=0; i<n_trajectories; i++)
{ G4Trajectory* trj =
(G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
if (fDrawFlag == "all") trj->DrawTrajectory(50);
else if ((fDrawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(50);
}
}
}
if (verboselevel>0)
if (fVerboselevel>0)
G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
if (runaction->GetRndmFreq() == 2)
{
CLHEP::HepRandom::saveEngineStatus("endOfEvent.rndm");
if (fRunaction->GetRndmFreq() == 2)
{
CLHEP::HepRandom::saveEngineStatus("endOfEvent.rndm");
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
{
if (evtNb%fPrintModulo == 0)
{
G4cout << "\n---> End of Event: " << evtNb << G4endl;
CLHEP::HepRandom::showEngineStatus();
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int F04EventAction::GetEventNo()
{
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID();
return evno ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void F04EventAction::SetEventVerbose(G4int level)
{
verboselevel = level ;
fVerboselevel = level ;
}