Implementation of the microdosimetry example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "G4VisExecutive.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "CommandLineParser.hh"
Go to the source code of this file.
Implementation of the microdosimetry example.
Definition in file wholeNuclearDNA.cc.
void GetNameAndPathOfExecutable |
( |
char ** |
argv, |
|
|
G4String & |
executable, |
|
|
G4String & |
path |
|
) |
| |
Definition at line 187 of file wholeNuclearDNA.cc.
Referenced by Parse().
192 std::string aux(argv[0]);
195 #if defined(_WIN32) || defined(WIN32) 196 int pos = aux.rfind(
'\\');
198 int pos = aux.rfind(
'/');
202 path = aux.substr(0, pos + 1);
203 executable = aux.substr(pos + 1);
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 65 of file wholeNuclearDNA.cc.
References Parse(), and parser().
75 Command* commandLine(0);
77 #ifdef G4MULTITHREADED 78 G4MTRunManager* runManager=
new G4MTRunManager;
79 if ((commandLine =
parser->GetCommandIfActive(
"-mt")))
82 if(commandLine->GetOption() ==
"NMAX")
84 nThreads = G4Threading::G4GetNumberOfCores();
88 nThreads = G4UIcommand::ConvertToInt(commandLine->GetOption());
90 G4cout <<
"===== WholeNuclearDNA is started with " 91 << runManager->GetNumberOfThreads()
92 <<
" threads =====" << G4endl;
94 runManager->SetNumberOfThreads(nThreads);
97 G4RunManager* runManager =
new G4RunManager();
102 runManager->SetUserInitialization(detector);
103 runManager->SetUserInitialization(
new PhysicsList);
104 runManager->SetUserInitialization(
new ActionInitialization());
107 runManager->Initialize();
110 G4VisManager* visManager =
new G4VisExecutive;
113 visManager->Initialize();
116 G4UImanager* UImanager = G4UImanager::GetUIpointer();
117 G4UIExecutive* ui(0);
120 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
122 ui =
new G4UIExecutive(argc, argv,
123 commandLine->GetOption());
126 UImanager->ApplyCommand(
"/control/execute gui.mac");
128 if(
parser->GetCommandIfActive(
"-novis") == 0)
131 if((commandLine =
parser->GetCommandIfActive(
"-vis")))
134 UImanager->ApplyCommand(
G4String(
"/vis/open ")+
135 commandLine->GetOption());
140 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
142 UImanager->ApplyCommand(
"/control/execute vis.mac");
150 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
152 UImanager->ApplyCommand(
G4String(
"/vis/open ")+commandLine->GetOption());
153 UImanager->ApplyCommand(
"/control/execute vis.mac");
157 if ((commandLine =
parser->GetCommandIfActive(
"-mac")))
159 G4String command =
"/control/execute ";
160 UImanager->ApplyCommand(command + commandLine->GetOption());
164 UImanager->ApplyCommand(
"/control/execute wholeNuclearDNA.in");
167 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
170 G4UIQt* UIQt =
static_cast<G4UIQt*
> (UImanager->GetG4UIWindow());
172 UIQt->AddViewerTabFromFile(
"README",
"README from "+
G4String(argv[0]));
CommandLineParser * parser(0)
void Parse(int &argc, char **argv)
void Parse |
( |
int & |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 208 of file wholeNuclearDNA.cc.
References GetNameAndPathOfExecutable(), and parser().
Referenced by main().
213 parser = CommandLineParser::GetParser();
215 parser->AddCommand(
"-gui",
216 Command::OptionNotCompulsory,
217 "Select geant4 UI or just launch a geant4 terminal session",
220 parser->AddCommand(
"-mac",
222 "Give a mac file to execute",
231 #ifdef G4MULTITHREADED 234 "Launch in MT mode (events computed in parallel)",
238 parser->AddCommand(
"-vis",
240 "Select a visualization driver",
243 parser->AddCommand(
"-novis",
244 Command::WithoutOption,
245 "Deactivate visualization when using GUI");
251 parser->AddCommand(
"-out",
252 Command::OptionNotCompulsory,
253 "Output files (ROOT is used by default)",
259 if (
parser->Parse(argc, argv) != 0)
263 CommandLineParser::DeleteInstance();
270 if (
parser->CheckIfNotHandledOptionsExists(argc, argv))
void GetNameAndPathOfExecutable(char **argv, G4String &executable, G4String &path)
CommandLineParser * parser(0)
CommandLineParser* parser |
( |
0 |
| ) |
|