Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -27,39 +27,39 @@
|
||||
/// \file exampleB4d.cc
|
||||
/// \brief Main program of the B4d example
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
|
||||
#include "G4AnalysisManager.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4SteppingVerbose.hh"
|
||||
#include "G4TScoreNtupleWriter.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "FTFP_BERT.hh"
|
||||
#include "Randomize.hh"
|
||||
// #include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
namespace {
|
||||
void PrintUsage() {
|
||||
G4cerr << " Usage: " << G4endl;
|
||||
G4cerr << " exampleB4d [-m macro ] [-u UIsession] [-t nThreads] [-vDefault]"
|
||||
<< G4endl;
|
||||
G4cerr << " note: -t option is available only for multi-threaded mode."
|
||||
<< G4endl;
|
||||
}
|
||||
namespace
|
||||
{
|
||||
void PrintUsage()
|
||||
{
|
||||
G4cerr << " Usage: " << G4endl;
|
||||
G4cerr << " exampleB4d [-m macro ] [-u UIsession] [-t nThreads] [-vDefault]" << G4endl;
|
||||
G4cerr << " note: -t option is available only for multi-threaded mode." << G4endl;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Evaluate arguments
|
||||
//
|
||||
if ( argc > 7 ) {
|
||||
if (argc > 7) {
|
||||
PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
@@ -70,15 +70,17 @@ int main(int argc,char** argv)
|
||||
#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];
|
||||
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]);
|
||||
else if (G4String(argv[i]) == "-t") {
|
||||
nThreads = G4UIcommand::ConvertToInt(argv[i + 1]);
|
||||
}
|
||||
#endif
|
||||
else if ( G4String(argv[i]) == "-vDefault" ) {
|
||||
else if (G4String(argv[i]) == "-vDefault") {
|
||||
verboseBestUnits = false;
|
||||
--i; // this option is not followed with a parameter
|
||||
}
|
||||
@@ -91,7 +93,7 @@ int main(int argc,char** argv)
|
||||
// Detect interactive mode (if no macro provided) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( ! macro.size() ) {
|
||||
if (!macro.size()) {
|
||||
ui = new G4UIExecutive(argc, argv, session);
|
||||
}
|
||||
|
||||
@@ -99,17 +101,16 @@ int main(int argc,char** argv)
|
||||
// G4Random::setTheEngine(new CLHEP::MTwistEngine);
|
||||
|
||||
// Use G4SteppingVerboseWithUnits
|
||||
if ( verboseBestUnits ) {
|
||||
if (verboseBestUnits) {
|
||||
G4int precision = 4;
|
||||
G4SteppingVerbose::UseBestUnit(precision);
|
||||
}
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
auto runManager =
|
||||
G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
|
||||
auto runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
|
||||
#ifdef G4MULTITHREADED
|
||||
if ( nThreads > 0 ) {
|
||||
if (nThreads > 0) {
|
||||
runManager->SetNumberOfThreads(nThreads);
|
||||
}
|
||||
#endif
|
||||
@@ -142,17 +143,17 @@ int main(int argc,char** argv)
|
||||
G4TScoreNtupleWriter<G4AnalysisManager> scoreNtupleWriter;
|
||||
scoreNtupleWriter.SetVerboseLevel(1);
|
||||
scoreNtupleWriter.SetNtupleMerging(true);
|
||||
// Note: merging ntuples is available only with Root output
|
||||
// (the default in G4TScoreNtupleWriter)
|
||||
// Note: merging ntuples is available only with Root output
|
||||
// (the default in G4TScoreNtupleWriter)
|
||||
|
||||
// Process macro or start UI session
|
||||
//
|
||||
if ( macro.size() ) {
|
||||
if (macro.size()) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
UImanager->ApplyCommand(command+macro);
|
||||
UImanager->ApplyCommand(command + macro);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// interactive mode : define UI session
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
if (ui->IsGUI()) {
|
||||
|
||||
Reference in New Issue
Block a user