Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+32 -21
View File
@@ -23,19 +23,22 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: exampleB4a.cc 75215 2013-10-29 16:07:06Z gcosmo $
//
/// \file exampleB4a.cc
/// \brief Main program of the B4a example
#include "B4DetectorConstruction.hh"
#include "B4PrimaryGeneratorAction.hh"
#include "B4RunAction.hh"
#include "B4aEventAction.hh"
#include "B4aSteppingAction.hh"
#include "B4aActionInitialization.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4UImanager.hh"
#include "G4UIcommand.hh"
#include "FTFP_BERT.hh"
#include "Randomize.hh"
@@ -53,7 +56,9 @@
namespace {
void PrintUsage() {
G4cerr << " Usage: " << G4endl;
G4cerr << " exampleB4a [-m macro ] [-u UIsession]" << G4endl;
G4cerr << " exampleB4a [-m macro ] [-u UIsession] [-t nThreads]" << G4endl;
G4cerr << " note: -t option is available only for multi-threaded mode."
<< G4endl;
}
}
@@ -63,16 +68,24 @@ int main(int argc,char** argv)
{
// Evaluate arguments
//
if ( argc > 5 ) {
if ( argc > 7 ) {
PrintUsage();
return 1;
}
G4String macro;
G4String session;
#ifdef G4MULTITHREADED
G4int nThreads = 0;
#endif
for ( G4int i=1; i<argc; i=i+2 ) {
if ( G4String(argv[i]) == "-m" ) macro = argv[i+1];
else if ( G4String(argv[i]) == "-u" ) session = argv[i+1];
#ifdef G4MULTITHREADED
else if ( G4String(argv[i]) == "-t" ) {
nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
}
#endif
else {
PrintUsage();
return 1;
@@ -81,11 +94,18 @@ int main(int argc,char** argv)
// Choose the Random engine
//
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
G4Random::setTheEngine(new CLHEP::RanecuEngine);
// Construct the default run manager
//
#ifdef G4MULTITHREADED
G4MTRunManager * runManager = new G4MTRunManager;
if ( nThreads > 0 ) {
runManager->SetNumberOfThreads(nThreads);
}
#else
G4RunManager * runManager = new G4RunManager;
#endif
// Set mandatory initialization classes
//
@@ -95,19 +115,10 @@ int main(int argc,char** argv)
G4VModularPhysicsList* physicsList = new FTFP_BERT;
runManager->SetUserInitialization(physicsList);
// Set user action classes
//
runManager->SetUserAction(new B4PrimaryGeneratorAction);
//
runManager->SetUserAction(new B4RunAction());
//
B4aEventAction* eventAction = new B4aEventAction();
runManager->SetUserAction(eventAction);
//
B4aSteppingAction* steppingAction
= new B4aSteppingAction(detConstruction, eventAction);
runManager->SetUserAction(steppingAction);
B4aActionInitialization* actionInitialization
= new B4aActionInitialization(detConstruction);
runManager->SetUserInitialization(actionInitialization);
// Initialize G4 kernel
//
runManager->Initialize();