Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
@@ -41,70 +41,57 @@
#include "PrimaryGeneratorAction.hh"
#include "SteppingVerbose.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
#include "G4VisExecutive.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
int main(int argc,char** argv) {
//detect interactive mode (if no arguments) and define UI session
G4UIExecutive* ui = 0;
if (argc == 1) ui = new G4UIExecutive(argc,argv);
//choose the Random engine
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new SteppingVerbose);
// Construct the default run manager
//construct the default run manager
G4RunManager* runManager = new G4RunManager;
// set mandatory initialization classes
//set mandatory initialization classes
//
runManager->SetUserInitialization(new DetectorConstruction);
runManager->SetUserInitialization(new PhysicsList);
runManager->SetUserAction(new PrimaryGeneratorAction);
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
//initialize visualization
G4VisManager* visManager = nullptr;
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
//get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc!=1) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
else // define visualization and UI terminal for interactive mode
{
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
#ifdef G4VIS_USE
UI->ApplyCommand("/control/execute vis.mac");
#endif
ui->SessionStart();
delete ui;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
}
if (ui) {
//interactive mode
visManager = new G4VisExecutive;
visManager->Initialize();
UImanager->ApplyCommand("/control/execute vis.mac");
ui->SessionStart();
delete ui;
}
else {
//batch mode
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
}
// job termination
//
//job termination
delete visManager;
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....