64 #ifdef G4MULTITHREADED 65 #include "G4MTRunManager.hh" 67 #include "G4RunManager.hh" 68 #endif // G4MULTITHREADED 70 #include "G4UImanager.hh" 71 #include "QGSP_BIC_HP.hh" 72 #include "Randomize.hh" 74 #include "FFDetectorConstruction.hh" 75 #include "FFActionInitialization.hh" 78 #include "G4VisExecutive.hh" 82 #include "G4UIExecutive.hh" 88 int main(
int argc,
char* argv[])
91 unsigned int numberOfThreads = 1;
94 G4String outputFileName =
"FF_Neutron_HP.out";
95 G4UImanager* UIManager = NULL;
97 char makeFissionFragments[] =
"G4NEUTRONHP_PRODUCE_FISSION_FRAGMENTS";
98 char useWendtFission[] =
"G4NEUTRON_HP_USE_WENDT_FISSION_MODEL";
100 char Force[] =
"G4FORCENUMBEROFTHREADS";
101 if(getenv(Force) != NULL) {
102 char doNotForce[]=
"G4FORCENUMBEROFTHREADS=1";
107 G4cout <<
"#### Starting: " << argv[0] <<
" ####" << G4endl;
111 if(getenv(makeFissionFragments) == NULL)
113 G4cerr << G4endl <<
"!!!!" << G4endl;
114 G4cerr <<
"!!!! Error in example" << argv[0] << G4endl;
115 G4cerr <<
"!!!! The \"" << makeFissionFragments <<
"\" " 116 "environment variable is not set!" << G4endl;
117 G4cerr <<
"!!!! Please set it in order to use this example." << G4endl;
118 G4cerr <<
"!!!!" << G4endl << G4endl;
125 if(getenv(useWendtFission) == NULL)
127 G4cout << G4endl <<
"!!!!" << G4endl;
128 G4cout <<
"!!!! Warning in example" << argv[0] << G4endl;
129 G4cout <<
"!!!! The \"" << useWendtFission <<
"\" " 130 "environment variable is not set!" << G4endl;
131 G4cout <<
"!!!! Please set it if you wish to use this fission model, " 132 "otherwise the default fission model will be used" << G4endl;
133 G4cout <<
"!!!!" << G4endl << G4endl;
142 if(argv[i][0] !=
'-')
144 G4cerr << G4endl <<
"!!!!" << G4endl;
145 G4cerr <<
"!!!! Error in argument " << i + 1 << G4endl;
146 G4cerr <<
"!!!! A command-line option was expected, but \"" 147 << argv[i] <<
"\" was found" << G4endl;
148 G4cerr <<
"!!!! " << argv[0] <<
" will now terminate" << G4endl;
149 G4cerr <<
"!!!!" << G4endl << G4endl;
157 G4cerr << G4endl <<
"!!!!" << G4endl;
158 G4cerr <<
"!!!! Error in argument " << i + 2 << G4endl;
159 G4cerr <<
"!!!! An argument was expected, but \"" << argv[i + 1]
160 <<
"\" was found" << G4endl;
161 G4cerr <<
"!!!! Ensure that a space is used to separate the " 162 "option and argument" << G4endl;
163 G4cerr <<
"!!!! " << argv[0] <<
" will now terminate" << G4endl;
164 G4cerr <<
"!!!!" << G4endl << G4endl;
172 scriptFileName =
"/control/execute ";
173 scriptFileName.append(argv[i + 1]);
177 outputFileName = argv[i + 1];
181 result = sscanf(argv[i + 1],
186 G4cerr << G4endl <<
"!!!!" << G4endl;
187 G4cerr <<
"!!!! Error in argument " << i + 2 << G4endl;
188 G4cerr <<
"!!!! An positive number was expected, but \"" 189 << argv[i + 1] <<
"\" was found" << G4endl;
190 G4cerr <<
"!!!! " << argv[0] <<
" will now terminate" 192 G4cerr <<
"!!!!" << G4endl << G4endl;
199 G4cout << G4endl <<
"!!!!" << G4endl;
200 G4cout <<
"!!!! Warning for command " << i + 1 << G4endl;
201 G4cout <<
"!!!! \"" << argv[i] <<
"\" is not a valid command" 203 G4cout <<
"!!!! " << argv[0] <<
" will ignore \"" << argv[i]
204 <<
"\" and \"" << argv[i + 1] <<
"\"" << G4endl;
205 G4cout <<
"!!!!" << G4endl << G4endl;
212 const G4long
seed = 62737819;
214 G4cout <<
"MT RNG Seed: " << seed << G4endl;
216 G4Random::setTheEngine(
new CLHEP::MTwistEngine(seed));
220 #ifdef G4MULTITHREADED 222 G4MTRunManager*
const runManager =
new G4MTRunManager();
223 runManager->SetNumberOfThreads(numberOfThreads);
225 G4cout <<
"Multithreading enabled" << G4endl;
226 G4cout <<
" Threads requested: " << numberOfThreads << G4endl;
227 G4cout <<
" Threads started: " << runManager->GetNumberOfThreads()
231 G4RunManager*
const runManager =
new G4RunManager();
232 #endif // G4MULTITHREADED 235 runManager->SetUserInitialization(
new FFDetectorConstruction());
236 runManager->SetUserInitialization(
new QGSP_BIC_HP());
237 runManager->SetUserInitialization(
new FFActionInitialization());
240 runManager->Initialize();
244 G4VisManager* visManager =
new G4VisExecutive();
245 visManager->Initialize();
249 UIManager = G4UImanager::GetUIpointer();
251 if(scriptFileName.length() != 0)
254 UIManager->ApplyCommand(scriptFileName);
259 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
int main(int argc, char *argv[])