Main program of the exoticphysics/monopole example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "DetectorConstruction.hh"
#include "G4MonopolePhysics.hh"
#include "G4PhysListFactory.hh"
#include "G4VModularPhysicsList.hh"
#include "ActionInitialization.hh"
#include "globals.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the exoticphysics/monopole example.
Definition in file monopole.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 71 of file monopole.cc.
References PrintUsage().
82 #ifdef G4MULTITHREADED 85 for ( G4int i=1; i<argc; i=i+2 ) {
86 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
87 else if (
G4String(argv[i]) ==
"-s" ) setupMonopole = argv[i+1];
88 #ifdef G4MULTITHREADED 89 else if (
G4String(argv[i]) ==
"-t" ) {
90 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
100 G4UIExecutive* ui =
nullptr;
101 if ( ! macro.size() ) {
102 ui =
new G4UIExecutive(argc, argv);
106 CLHEP::HepRandom::setTheEngine(
new CLHEP::MixMaxRng);
109 #ifdef G4MULTITHREADED 110 G4MTRunManager* runManager =
new G4MTRunManager;
111 if ( nThreads > 0 ) {
112 runManager->SetNumberOfThreads(nThreads);
114 G4cout <<
"===== Monopole is started with " 115 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
117 G4RunManager* runManager =
new G4RunManager();
122 G4PhysListFactory factory;
123 G4VModularPhysicsList* phys = factory.GetReferencePhysList(
"FTFP_BERT");
126 G4MonopolePhysics * theMonopole =
new G4MonopolePhysics();
129 G4UImanager* UImanager = G4UImanager::GetUIpointer();
131 if ( setupMonopole.size() ) {
132 UImanager->ApplyCommand(
"/control/verbose 1");
133 UImanager->ApplyCommand(
"/monopole/setup " + setupMonopole);
137 phys->RegisterPhysics(theMonopole);
138 runManager->SetUserInitialization(phys);
141 G4VisManager* visManager =
new G4VisExecutive();
142 visManager->Initialize();
146 runManager->SetUserInitialization(det);
149 runManager->SetUserInitialization(
new ActionInitialization(det));
153 if ( macro.size() ) {
155 G4String command =
"/control/execute ";
156 UImanager->ApplyCommand(command+macro);
160 UImanager->ApplyCommand(
"/control/execute init_vis.mac");