Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -28,18 +28,14 @@
//
//
//
//
//
// package includes
#include "G3toG4DetectorConstruction.hh"
#include "G3toG4ActionInitialization.hh"
// geant4 includes
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
#else
#include "G4RunManager.hh"
#endif
#include "G4RunManagerFactory.hh"
#include "FTFP_BERT.hh"
#include "G3VolTable.hh"
@@ -54,11 +50,11 @@
namespace {
void PrintUsage() {
G4cerr << " Usage: " << G4endl;
G4cerr
<< "clGeometry <call_list_file> [-m macro ] [-u UIsession] [-t nThreads]"
G4cerr
<< "clGeometry <call_list_file> [-m macro ] [-u UIsession] [-t nThreads]"
<< G4endl;
G4cerr
<< " note: -t option is available only for multi-threaded mode."
G4cerr
<< " note: -t option is relevant only for multi-threaded mode."
<< G4endl;
}
}
@@ -74,13 +70,11 @@ int main(int argc, char** argv)
PrintUsage();
return 1;
}
G4String inFile;
G4String macro = "";
G4String session;
#ifdef G4MULTITHREADED
G4int nofThreads = 4;
#endif
G4int nofThreads = 0;
// First argument is mandatory
inFile = argv[1];
@@ -96,17 +90,15 @@ int main(int argc, char** argv)
G4cout << "evaluating " << argv[i] << G4endl;
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" ) {
nofThreads = G4UIcommand::ConvertToInt(argv[i+1]);
}
#endif
else {
PrintUsage();
return 1;
}
}
}
// Detect interactive mode (if no macro provided) and define UI session
//
G4UIExecutive* ui = nullptr;
@@ -115,13 +107,9 @@ int main(int argc, char** argv)
}
// Construct the default run manager
#ifdef G4MULTITHREADED
G4MTRunManager* runManager = new G4MTRunManager;
runManager->SetNumberOfThreads(nofThreads);
#else
G4RunManager* runManager = new G4RunManager;
#endif
auto* runManager = G4RunManagerFactory::CreateRunManager();
if (nofThreads > 0) runManager->SetNumberOfThreads(nofThreads);
// Set mandatory initialization classes
//
// Detector construction
@@ -129,10 +117,10 @@ int main(int argc, char** argv)
// Physics list
runManager->SetUserInitialization(new FTFP_BERT);
// User action initialization
runManager->SetUserInitialization(new G3toG4ActionInitialization());
// Initialize visualization
//
auto visManager = new G4VisExecutive;
@@ -150,7 +138,7 @@ int main(int argc, char** argv)
G4String command = "/control/execute ";
UImanager->ApplyCommand(command+macro);
}
else {
else {
// interactive mode : define UI session
UImanager->ApplyCommand("/control/execute init_vis.mac");
ui->SessionStart();
@@ -159,7 +147,7 @@ int main(int argc, char** argv)
// Job termination
// Free the store: user actions, physics_list and detector_description are
// owned and deleted by the run manager, so they should not be deleted
// owned and deleted by the run manager, so they should not be deleted
// in the main() program !
delete visManager;