Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -29,16 +29,17 @@
|
||||
//
|
||||
// $Id: $
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT4 - RE01 exsample code
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
#include "G4MTRunManager.hh"
|
||||
@@ -54,17 +55,17 @@
|
||||
#include "G4ParallelWorldPhysics.hh"
|
||||
#include "RE01ActionInitialization.hh"
|
||||
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4VisExecutive.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4UI_USE
|
||||
#include "G4UIExecutive.hh"
|
||||
#endif
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// Instantiate G4UIExecutive if there are no arguments (interactive mode)
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager * runManager = new G4MTRunManager;
|
||||
//runManager->SetNumberOfThreads(4);
|
||||
@@ -72,11 +73,9 @@ int main(int argc,char** argv)
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization manager construction
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
G4String parallelWorldName = "ReadoutWorld";
|
||||
G4VUserDetectorConstruction* detector
|
||||
@@ -90,31 +89,26 @@ int main(int argc,char** argv)
|
||||
physicsList->RegisterPhysics(
|
||||
new G4ParallelWorldPhysics(parallelWorldName));
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
|
||||
runManager->SetUserInitialization(
|
||||
new RE01ActionInitialization);
|
||||
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
if(argc==1)
|
||||
|
||||
if(ui)
|
||||
{
|
||||
#ifdef G4UI_USE
|
||||
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
|
||||
delete runManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user