Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "B1ActionInitialization.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
@@ -46,14 +46,16 @@ 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);
|
||||
}
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if ( argc == 1 ) { ui = new G4UIExecutive(argc, argv); }
|
||||
|
||||
// Optionally: choose a different Random engine...
|
||||
// G4Random::setTheEngine(new CLHEP::MTwistEngine);
|
||||
|
||||
|
||||
//use G4SteppingVerboseWithUnits
|
||||
G4int precision = 4;
|
||||
G4SteppingVerbose::UseBestUnit(precision);
|
||||
|
||||
// Construct the default run manager
|
||||
//
|
||||
auto* runManager =
|
||||
@@ -68,10 +70,10 @@ int main(int argc,char** argv)
|
||||
G4VModularPhysicsList* physicsList = new QBBC;
|
||||
physicsList->SetVerboseLevel(1);
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
|
||||
// User action initialization
|
||||
runManager->SetUserInitialization(new B1ActionInitialization());
|
||||
|
||||
|
||||
// Initialize visualization
|
||||
//
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
@@ -84,13 +86,13 @@ int main(int argc,char** argv)
|
||||
|
||||
// Process macro or start UI session
|
||||
//
|
||||
if ( ! ui ) {
|
||||
if ( ! ui ) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// interactive mode
|
||||
UImanager->ApplyCommand("/control/execute init_vis.mac");
|
||||
ui->SessionStart();
|
||||
@@ -99,9 +101,9 @@ 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;
|
||||
delete runManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user