Geant4  10.02.p01
G4RunMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4RunMessenger.cc 94337 2015-11-12 10:02:04Z gcosmo $
28 //
29 
30 #include "G4RunMessenger.hh"
31 #include "G4RunManager.hh"
32 #include "G4MTRunManager.hh"
33 #include "G4UIdirectory.hh"
35 #include "G4UIcmdWithAString.hh"
36 #include "G4UIcmdWithAnInteger.hh"
37 #include "G4UIcmdWithABool.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UIparameter.hh"
40 #include "G4UImanager.hh"
41 #include "G4ProductionCutsTable.hh"
42 #include "G4ios.hh"
43 #include "G4MaterialScanner.hh"
44 #include "G4Tokenizer.hh"
45 #include "Randomize.hh"
46 #include <sstream>
47 
49 :runManager(runMgr)
50 {
51  runDirectory = new G4UIdirectory("/run/");
52  runDirectory->SetGuidance("Run control commands.");
53 
54  initCmd = new G4UIcmdWithoutParameter("/run/initialize",this);
55  initCmd->SetGuidance("Initialize G4 kernel.");
57 
58  beamOnCmd = new G4UIcommand("/run/beamOn",this);
59  beamOnCmd->SetGuidance("Start a Run.");
60  beamOnCmd->SetGuidance("If G4 kernel is not initialized, it will be initialized.");
61  beamOnCmd->SetGuidance("Default number of events to be processed is 1.");
62  beamOnCmd->SetGuidance("The second and third arguments can be used for");
63  beamOnCmd->SetGuidance("executing a macro file at the end of each event.");
64  beamOnCmd->SetGuidance("If the second argument, i.e. name of the macro");
65  beamOnCmd->SetGuidance("file, is given but the third argument is not,");
66  beamOnCmd->SetGuidance("the macro file will be executed for all of the");
67  beamOnCmd->SetGuidance("event.");
68  beamOnCmd->SetGuidance("If the third argument (nSelect) is given, the");
69  beamOnCmd->SetGuidance("macro file will be executed only for the first");
70  beamOnCmd->SetGuidance("nSelect events.");
73  G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true);
74  p1->SetDefaultValue(1);
75  p1->SetParameterRange("numberOfEvent >= 0");
77  G4UIparameter* p2 = new G4UIparameter("macroFile",'s',true);
78  p2->SetDefaultValue("***NULL***");
80  G4UIparameter* p3 = new G4UIparameter("nSelect",'i',true);
81  p3->SetDefaultValue(-1);
82  p3->SetParameterRange("nSelect>=-1");
84  //beamOnCmd->SetToBeBroadcasted(false);
85 
86  verboseCmd = new G4UIcmdWithAnInteger("/run/verbose",this);
87  verboseCmd->SetGuidance("Set the Verbose level of G4RunManager.");
88  verboseCmd->SetGuidance(" 0 : Silent (default)");
89  verboseCmd->SetGuidance(" 1 : Display main topics");
90  verboseCmd->SetGuidance(" 2 : Display main topics and run summary");
91  verboseCmd->SetParameterName("level",true);
93  verboseCmd->SetRange("level >=0 && level <=2");
94 
95  printProgCmd = new G4UIcmdWithAnInteger("/run/printProgress",this);
96  printProgCmd->SetGuidance("Display begin_of_event information at given frequency.");
97  printProgCmd->SetGuidance("If it is set to zero, only the begin_of_run is shown.");
98  printProgCmd->SetGuidance("If it is set to -1, no print-out is shown.");
99  printProgCmd->SetParameterName("mod",true);
101  printProgCmd->SetRange("mod>=-1");
102 
103  nThreadsCmd = new G4UIcmdWithAnInteger("/run/numberOfThreads",this);
104  nThreadsCmd->SetGuidance("Set the number of threads to be used.");
105  nThreadsCmd->SetGuidance("This command works only in PreInit state.");
106  nThreadsCmd->SetGuidance("This command is valid only for multi-threaded mode.");
107  nThreadsCmd->SetGuidance("The command is ignored if it is issued in sequential mode.");
108  nThreadsCmd->SetParameterName("nThreads",true);
110  nThreadsCmd->SetRange("nThreads >0");
113 
114  maxThreadsCmd = new G4UIcmdWithoutParameter("/run/useMaximumLogicalCores",this);
115  maxThreadsCmd->SetGuidance("Set the number of threads to be the number of available logical cores.");
116  maxThreadsCmd->SetGuidance("This command works only in PreInit state.");
117  maxThreadsCmd->SetGuidance("This command is valid only for multi-threaded mode.");
118  maxThreadsCmd->SetGuidance("The command is ignored if it is issued in sequential mode.");
121 
122  pinAffinityCmd = new G4UIcmdWithAnInteger("/run/pinAffinity",this);
123  pinAffinityCmd->SetGuidance("Locks each thread to a specific logical core. Workers are locked in round robin to logical cores.");
124  pinAffinityCmd->SetGuidance("This command is valid only for multi-threaded mode.");
125  pinAffinityCmd->SetGuidance("This command works only in PreInit state.");
126  pinAffinityCmd->SetGuidance("This command is ignored if it is issued in sequential mode.");
127  pinAffinityCmd->SetGuidance("If a value n>0 is provided it starts setting affinity from the n-th CPU (note: counting from 1).");
128  pinAffinityCmd->SetGuidance("E.g. /run/pinAffinity 3 locks first thread on third logical CPU (number 2).");
129  pinAffinityCmd->SetGuidance("If a value n<0 is provided never locks on n-th CPU.");
130  pinAffinityCmd->SetParameterName("pinAffinity",true);
133  pinAffinityCmd->SetRange("pinAffinity > 0 || pinAffinity < 0");
135 
136  evModCmd = new G4UIcommand("/run/eventModulo",this);
137  evModCmd->SetGuidance("Set the event modulo for dispatching events to worker threads");
138  evModCmd->SetGuidance("i.e. each worker thread is ordered to simulate N events and then");
139  evModCmd->SetGuidance("comes back to G4MTRunManager for next set.");
140  evModCmd->SetGuidance("If it is set to zero (default value), N is roughly given by this.");
141  evModCmd->SetGuidance(" N = int( sqrt( number_of_events / number_of_threads ) )");
142  evModCmd->SetGuidance("The value N may affect on the computing performance in particular");
143  evModCmd->SetGuidance("if N is too small compared to the total number of events.");
144  evModCmd->SetGuidance("The second parameter seedOnce specifies how frequently each worker");
145  evModCmd->SetGuidance("thread is seeded by the random number sequence contrally managed");
146  evModCmd->SetGuidance("by the master G4MTRunManager.");
147  evModCmd->SetGuidance(" - If seedOnce is set to 0 (default), seeds that are centrally managed");
148  evModCmd->SetGuidance(" by G4MTRunManager are set for every event of every worker thread.");
149  evModCmd->SetGuidance(" This option guarantees event reproducability regardless of number");
150  evModCmd->SetGuidance(" of threads.");
151  evModCmd->SetGuidance(" - If seedOnce is set to 1, seeds are set only once for the first");
152  evModCmd->SetGuidance(" event of each run of each worker thread. Event reproducability is");
153  evModCmd->SetGuidance(" guaranteed only if the same number of worker threads are used.");
154  evModCmd->SetGuidance(" On the other hand, this option offers better computing performance");
155  evModCmd->SetGuidance(" in particular for applications with relatively small primary");
156  evModCmd->SetGuidance(" particle energy and large number of events.");
157  evModCmd->SetGuidance(" - If seedOnce is set to 2, seeds are set only for the first event of");
158  evModCmd->SetGuidance(" group of N events. This option is reserved for the future use when");
159  evModCmd->SetGuidance(" Geant4 allows number of threads to be dynatically changed during an");
160  evModCmd->SetGuidance(" event loop.");
161  evModCmd->SetGuidance("This command is valid only for multi-threaded mode.");
162  evModCmd->SetGuidance("This command is ignored if it is issued in sequential mode.");
163  G4UIparameter* emp1 = new G4UIparameter("N",'i',true);
164  emp1->SetDefaultValue(0);
165  emp1->SetParameterRange("N >= 0");
166  evModCmd->SetParameter(emp1);
167  G4UIparameter* emp2 = new G4UIparameter("seedOnce",'i',true);
168  emp2->SetDefaultValue(0);
169  emp2->SetParameterRange("seedOnce >= 0 && seedOnce <=2");
170  evModCmd->SetParameter(emp2);
173 
174  dumpRegCmd = new G4UIcmdWithAString("/run/dumpRegion",this);
175  dumpRegCmd->SetGuidance("Dump region information.");
176  dumpRegCmd->SetGuidance("In case name of a region is not given, all regions will be displayed.");
177  dumpRegCmd->SetParameterName("regionName", true);
178  dumpRegCmd->SetDefaultValue("**ALL**");
180 
181  dumpCoupleCmd = new G4UIcmdWithoutParameter("/run/dumpCouples",this);
182  dumpCoupleCmd->SetGuidance("Dump material-cuts-couple information.");
183  dumpCoupleCmd->SetGuidance("Note that material-cuts-couple information is updated");
184  dumpCoupleCmd->SetGuidance("after BeamOn has started.");
186 
187  optCmd = new G4UIcmdWithABool("/run/optimizeGeometry",this);
188  optCmd->SetGuidance("Set the optimization flag for geometry.");
189  optCmd->SetGuidance("If it is set to TRUE, G4GeometryManager will optimize");
190  optCmd->SetGuidance("the geometry definitions.");
191  optCmd->SetGuidance("GEANT4 is initialized with this flag as TRUE.");
192  optCmd->SetParameterName("optimizeFlag",true);
193  optCmd->SetDefaultValue(true);
195 
196  brkBoECmd = new G4UIcmdWithABool("/run/breakAtBeginOfEvent",this);
197  brkBoECmd->SetGuidance("Set a break point at the begining of every event.");
198  brkBoECmd->SetParameterName("flag",true);
199  brkBoECmd->SetDefaultValue(true);
200 
201  brkEoECmd = new G4UIcmdWithABool("/run/breakAtEndOfEvent",this);
202  brkEoECmd->SetGuidance("Set a break point at the end of every event.");
203  brkEoECmd->SetParameterName("flag",true);
204  brkEoECmd->SetDefaultValue(true);
205 
206  abortCmd = new G4UIcmdWithABool("/run/abort",this);
207  abortCmd->SetGuidance("Abort current run processing.");
208  abortCmd->SetGuidance("If softAbort is false (default), currently processing event will be immediately aborted,");
209  abortCmd->SetGuidance("while softAbort is true, abortion occurs after processing the current event.");
211  abortCmd->SetParameterName("softAbort",true);
212  abortCmd->SetDefaultValue(false);
213 
214  abortEventCmd = new G4UIcmdWithoutParameter("/run/abortCurrentEvent",this);
215  abortEventCmd->SetGuidance("Abort currently processing event.");
217 
218  geomCmd = new G4UIcmdWithoutParameter("/run/geometryModified",this);
219  geomCmd->SetGuidance("Force geometry to be closed (re-voxellized) again.");
220  geomCmd->SetGuidance("This command must be applied if geometry has been modified");
221  geomCmd->SetGuidance(" after the first initialization (or BeamOn).");
223 
224  geomRebCmd = new G4UIcmdWithABool("/run/reinitializeGeometry",this);
225  geomRebCmd->SetGuidance("Force geometry to be rebuilt once again.");
226  geomRebCmd->SetGuidance("This command must be applied if the user needs his/her");
227  geomRebCmd->SetGuidance(" detector construction to be reinvoked.");
228  geomRebCmd->SetGuidance("/run/geometryModified is automatically issued with this command.");
229  geomRebCmd->SetParameterName("destroyFirst",true);
230  geomRebCmd->SetDefaultValue(false);
232 
233  physCmd = new G4UIcmdWithoutParameter("/run/physicsModified",this);
234  physCmd->SetGuidance("Force all physics tables recalculated again.");
235  physCmd->SetGuidance("This command must be applied");
236  physCmd->SetGuidance(" if physics process has been modified after the");
237  physCmd->SetGuidance(" first initialization (or BeamOn).");
239 
240  constScoreCmd = new G4UIcmdWithoutParameter("/run/constructScoringWorlds",this);
241  constScoreCmd->SetGuidance("Constrct scoring parallel world(s) if defined.");
242  constScoreCmd->SetGuidance("This command is not mandatory, but automatically called when a run starts.");
243  constScoreCmd->SetGuidance("But the user may use this to visualize the scoring world(s) before a run to start.");
245 
247 
248  randomDirectory = new G4UIdirectory("/random/");
249  randomDirectory->SetGuidance("Random number status control commands.");
250 
251  seedCmd = new G4UIcmdWithAString("/random/setSeeds",this);
252  seedCmd->SetGuidance("Initialize the random number generator with integer seed stream.");
253  seedCmd->SetGuidance("Number of integers should be more than 1.");
254  seedCmd->SetGuidance("Actual number of integers to be used depends on the individual random number engine.");
255 #ifdef G4MULTITHREADED
256  seedCmd->SetGuidance("This command sets the seeds for the master thread.");
257 #endif
258  seedCmd->SetParameterName("IntArray",false);
260  seedCmd->SetToBeBroadcasted(false);
261 
262  randDirCmd = new G4UIcmdWithAString("/random/setDirectoryName",this);
263  randDirCmd->SetGuidance("Define the directory name of the rndm status files.");
264  randDirCmd->SetGuidance("Directory will be created if it does not exist.");
265  randDirCmd->SetParameterName("fileName",true);
268 
269  savingFlagCmd = new G4UIcmdWithABool("/random/setSavingFlag",this);
270  savingFlagCmd->SetGuidance("The randomNumberStatus will be saved at :");
271  savingFlagCmd->SetGuidance("begining of run (currentRun.rndm) and "
272  "begining of event (currentEvent.rndm) ");
273  savingFlagCmd->SetParameterName("flag",true);
275 
276  saveThisRunCmd = new G4UIcmdWithoutParameter("/random/saveThisRun",this);
277  saveThisRunCmd->SetGuidance("copy currentRun.rndm to runXXX.rndm");
279 
280  saveThisEventCmd = new G4UIcmdWithoutParameter("/random/saveThisEvent",this);
281  saveThisEventCmd->SetGuidance("copy currentEvent.rndm to runXXXevtYYY.rndm");
283 
284  restoreRandCmd = new G4UIcmdWithAString("/random/resetEngineFrom",this);
285  restoreRandCmd->SetGuidance("Reset the status of the rndm engine from a file.");
286  restoreRandCmd->SetGuidance("See CLHEP manual for detail.");
287  restoreRandCmd->SetGuidance("The engine status must be stored beforehand.");
288  restoreRandCmd->SetGuidance("Directory of the status file should be set by"
289  " /random/setDirectoryName.");
290  restoreRandCmd->SetParameterName("fileName",true);
291  restoreRandCmd->SetDefaultValue("currentRun.rndm");
294 
295  restoreRandCmdMT = new G4UIcmdWithABool("/random/resetEngineFromEachEvent",this);
296  restoreRandCmdMT->SetGuidance("Reset the status of the rndm engine from a file at each event.");
297  restoreRandCmdMT->SetGuidance("Note that the file must follow the following naming convention:");
298  restoreRandCmdMT->SetGuidance("run{#1}evt{#2}.rndm ; where #1 is the run number and #2 is the event number.");
299  restoreRandCmdMT->SetGuidance("For example to re-seed the first event of the first run the file should be called run0evt0.rndm.");
300  restoreRandCmdMT->SetGuidance("If for a specific run/event the file is not found, the standard re-seeding strategy is used.");
301  restoreRandCmdMT->SetGuidance("This command has meaning only in MT mode for strong reproducibility studies.");
302  restoreRandCmdMT->SetGuidance("Directory of the status file should be set by"
303  " /random/setDirectoryName.");
306 
307 
308  saveEachEventCmd = new G4UIcmdWithABool("/random/saveEachEventFlag",this);
309  saveEachEventCmd->SetGuidance("Save random number status at beginning of each event.");
310  saveEachEventCmd->SetGuidance("File name contains run and event numbers: runXXXevtYYY.rndm");
311  saveEachEventCmd->SetParameterName("flag",true);
313 
314  randEvtCmd = new G4UIcmdWithAnInteger("/run/storeRndmStatToEvent",this);
315  randEvtCmd->SetGuidance("Flag to store rndm status to G4Event object.");
316  randEvtCmd->SetGuidance(" flag = 0 : not store (default)");
317  randEvtCmd->SetGuidance(" flag = 1 : status before primary particle generation is stored");
318  randEvtCmd->SetGuidance(" flag = 2 : status before event processing (after primary particle generation) is stored");
319  randEvtCmd->SetGuidance(" flag = 3 : both are stored");
320  randEvtCmd->SetGuidance("Note: Some performance overhead may be seen by storing rndm status, in particular");
321  randEvtCmd->SetGuidance("for the case of simplest geometry and small number of tracks per event.");
322  randEvtCmd->SetParameterName("flag",true);
324  randEvtCmd->SetRange("flag>=0 && flag<3");
326 
327 }
328 
330 {
331  delete materialScanner;
332  delete beamOnCmd;
333  delete verboseCmd;
334  delete printProgCmd;
335  delete nThreadsCmd;
336  delete maxThreadsCmd;
337  delete evModCmd;
338  delete optCmd;
339  delete dumpRegCmd;
340  delete dumpCoupleCmd;
341  delete brkBoECmd;
342  delete brkEoECmd;
343  delete abortCmd;
344  delete abortEventCmd;
345  delete initCmd;
346  delete geomCmd;
347  delete geomRebCmd;
348  delete physCmd;
349  delete randEvtCmd;
350  delete constScoreCmd;
351 
352  delete seedCmd;
353  delete savingFlagCmd;
354  delete saveThisRunCmd;
355  delete saveThisEventCmd;
356  delete restoreRandCmd;
357  delete randomDirectory;
358  delete saveEachEventCmd;
359 
360  delete randDirCmd;
361  delete runDirectory;
362 
363  delete restoreRandCmdMT;
364 }
365 
367 {
368  if( command==beamOnCmd )
369  {
370  G4int nev;
371  G4int nst;
372  const char* nv = (const char*)newValue;
373  std::istringstream is(nv);
374  is >> nev >> macroFileName >> nst;
375  if(macroFileName=="***NULL***")
376  { runManager->BeamOn(nev); }
377  else
378  { runManager->BeamOn(nev,macroFileName,nst); }
379  }
380  else if( command==verboseCmd )
382  else if( command == printProgCmd )
384  else if( command==nThreadsCmd )
385  {
387  if( rmType==G4RunManager::masterRM )
388  {
389  static_cast<G4MTRunManager*>(runManager)->SetNumberOfThreads(
390  nThreadsCmd->GetNewIntValue(newValue));
391  }
392  else if ( rmType==G4RunManager::sequentialRM )
393  {
394  G4cout<<"*** /run/numberOfThreads command is issued in sequential mode."
395  <<"\nCommand is ignored."<<G4endl;
396  }
397  else
398  {
399  G4Exception("G4RunMessenger::ApplyNewCommand","Run0901",FatalException,
400  "/run/numberOfThreads command is issued to local thread.");
401  }
402  }
403  else if( command==maxThreadsCmd)
404  {
406  if( rmType==G4RunManager::masterRM )
407  {
408  static_cast<G4MTRunManager*>(runManager)->SetNumberOfThreads(
410  }
411  else if ( rmType==G4RunManager::sequentialRM )
412  {
413  G4cout<<"*** /run/useMaximumLogicalCores command is issued in sequential mode."
414  <<"\nCommand is ignored."<<G4endl;
415  }
416  else
417  {
418  G4Exception("G4RunMessenger::ApplyNewCommand","Run0901",FatalException,
419  "/run/useMaximumLogicalCores command is issued to local thread.");
420  }
421  }
422  else if ( command == pinAffinityCmd )
423  {
425  if( rmType==G4RunManager::masterRM )
426  {
427  static_cast<G4MTRunManager*>(runManager)->SetPinAffinity(
428  pinAffinityCmd->GetNewIntValue(newValue) );
429  }
430  else if ( rmType==G4RunManager::sequentialRM )
431  {
432  G4cout<<"*** /run/pinAffinity command is issued in sequential mode."
433  <<"\nCommand is ignored."<<G4endl;
434  }
435  else
436  {
437  G4Exception("G4RunMessenger::ApplyNewCommand","Run0901",FatalException,
438  "/run/pinAffinity command is issued to local thread.");
439  }
440 
441  }
442  else if( command==evModCmd)
443  {
445  if( rmType==G4RunManager::masterRM )
446  {
447  G4int nevMod = 0;
448  G4int sOnce = 0;
449  const char* nv = (const char*)newValue;
450  std::istringstream is(nv);
451  is >> nevMod >> sOnce;
452  static_cast<G4MTRunManager*>(runManager)->SetEventModulo(nevMod);
454  }
455  else if ( rmType==G4RunManager::sequentialRM )
456  {
457  G4cout<<"*** /run/eventModulo command is issued in sequential mode."
458  <<"\nCommand is ignored."<<G4endl;
459  }
460  else
461  {
462  G4Exception("G4RunMessenger::ApplyNewCommand","Run0902",FatalException,
463  "/run/eventModulo command is issued to local thread.");
464  }
465  }
466  else if( command==dumpRegCmd )
467  {
468  if(newValue=="**ALL**")
469  { runManager->DumpRegion(); }
470  else
471  { runManager->DumpRegion(newValue); }
472  }
473  else if( command==dumpCoupleCmd)
474  {
476  }
477  else if( command==optCmd )
479  else if( command==brkBoECmd )
481  else if( command==brkEoECmd )
483  else if( command==abortCmd )
484  { runManager->AbortRun(abortCmd->GetNewBoolValue(newValue)); }
485  else if( command==abortEventCmd )
486  { runManager->AbortEvent(); }
487  else if( command==initCmd )
488  { runManager->Initialize(); }
489  else if( command==geomCmd )
491  else if( command==geomRebCmd )
493  else if( command==physCmd )
495  else if( command==seedCmd )
496  {
497  G4Tokenizer next(newValue);
498  G4int idx=0;
499  long seeds[100];
500  G4String vl;
501  while(!(vl=next()).isNull())
502  { seeds[idx] = (long)(StoI(vl)); idx++; }
503  if(idx<2)
504  { G4cerr << "/random/setSeeds should have at least two integers. Command ignored." << G4endl; }
505  else
506  {
507  seeds[idx] = 0;
508  G4Random::setTheSeeds(seeds);
509  }
510  }
511  else if( command==randDirCmd )
512  { runManager->SetRandomNumberStoreDir(newValue); }
513  else if( command==savingFlagCmd )
515  else if( command==saveThisRunCmd )
517  else if( command==saveThisEventCmd )
519  else if( command==restoreRandCmd )
520  { runManager->RestoreRandomNumberStatus(newValue); }
521  else if( command==randEvtCmd )
523  else if( command==saveEachEventCmd)
525  else if( command==constScoreCmd )
527  else if( command==restoreRandCmdMT)
529 }
530 
532 {
533  G4String cv;
534 
535  if( command==verboseCmd )
537  else if( command == printProgCmd )
539  else if( command==randDirCmd )
541  else if( command==randEvtCmd )
543  else if( command==nThreadsCmd )
544  {
546  if( rmType==G4RunManager::masterRM )
547  {
549  static_cast<G4MTRunManager*>(runManager)->GetNumberOfThreads());
550  }
551  else if ( rmType==G4RunManager::sequentialRM )
552  {
553  cv = "0";
554  }
555  }
556  else if( command==evModCmd)
557  {
559  if( rmType==G4RunManager::masterRM )
560  {
562  static_cast<G4MTRunManager*>(runManager)->GetEventModulo() )
564  }
565  else if ( rmType==G4RunManager::sequentialRM )
566  { G4cout<<"*** /run/eventModulo command is valid only in MT mode."<<G4endl; }
567  }
568 
569  return cv;
570 }
571 
G4UIcmdWithoutParameter * saveThisRunCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void GeometryHasBeenModified(G4bool prop=true)
G4UIcmdWithABool * optCmd
G4int GetVerboseLevel() const
virtual void AbortRun(G4bool softAbort=false)
G4UIcmdWithAString * randDirCmd
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
G4int GetPrintProgress()
G4RunMessenger(G4RunManager *runMgr)
G4UIcmdWithoutParameter * initCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIdirectory * runDirectory
const G4String & GetRandomNumberStoreDir() const
void SetVerboseLevel(G4int vl)
G4UIcmdWithAString * restoreRandCmd
static G4int GetNewIntValue(const char *paramString)
void SetParameterRange(const char *theRange)
G4UIcmdWithAnInteger * nThreadsCmd
G4UIdirectory * randomDirectory
void SetPrintProgress(G4int i)
G4UIcmdWithAnInteger * printProgCmd
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetGeometryToBeOptimized(G4bool vl)
void SetDefaultValue(const char *theDefaultValue)
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
void SetRandomNumberStorePerEvent(G4bool flag)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
G4UIcmdWithoutParameter * constScoreCmd
G4UIcmdWithABool * savingFlagCmd
void SetRandomNumberStore(G4bool flag)
G4int GetFlagRandomNumberStatusToG4Event() const
G4String GetCurrentValue(G4UIcommand *command)
G4UIcmdWithoutParameter * maxThreadsCmd
int G4int
Definition: G4Types.hh:78
G4UIcmdWithoutParameter * geomCmd
static G4bool GetNewBoolValue(const char *paramString)
void SetDefaultValue(G4bool defVal)
G4MaterialScanner * materialScanner
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
virtual void RestoreRandomNumberStatus(const G4String &fileN)
G4UIcmdWithoutParameter * dumpCoupleCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
virtual void rndmSaveThisRun()
G4GLOB_DLL std::ostream G4cout
void StoreRandomNumberStatusToG4Event(G4int vl)
void PhysicsHasBeenModified()
RMType GetRunManagerType() const
G4UIcmdWithABool * geomRebCmd
virtual void ConstructScoringWorlds()
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4int G4GetNumberOfCores()
Definition: G4Threading.cc:127
virtual void rndmSaveThisEvent()
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4String macroFileName
G4UIcmdWithAString * seedCmd
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
G4int StoI(G4String s)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4UIcmdWithoutParameter * physCmd
void SetNewValue(G4UIcommand *command, G4String newValues)
static G4ProductionCutsTable * GetProductionCutsTable()
G4UIcmdWithABool * brkEoECmd
G4RunManager * runManager
G4UIcmdWithoutParameter * abortEventCmd
void SetDefaultValue(const char *defVal)
G4UIcmdWithABool * saveEachEventCmd
void SetPauseAtEndOfEvent(G4bool vl)
Definition: G4UImanager.hh:196
G4UIcmdWithAString * dumpRegCmd
virtual void RestoreRndmEachEvent(G4bool)
G4UIcommand * beamOnCmd
G4UIcmdWithABool * brkBoECmd
G4UIcmdWithAnInteger * randEvtCmd
static G4int SeedOncePerCommunication()
void SetPauseAtBeginOfEvent(G4bool vl)
Definition: G4UImanager.hh:192
virtual void Initialize()
#define G4endl
Definition: G4ios.hh:61
G4UIcmdWithAnInteger * pinAffinityCmd
G4UIcmdWithoutParameter * saveThisEventCmd
virtual void AbortEvent()
void SetDefaultValue(G4int defVal)
G4UIcmdWithABool * restoreRandCmdMT
void SetRandomNumberStoreDir(const G4String &dir)
G4UIcmdWithABool * abortCmd
static void SetSeedOncePerCommunication(G4int val)
void DumpRegion(const G4String &rname) const
G4UIcommand * evModCmd
G4UIcmdWithAnInteger * verboseCmd
G4GLOB_DLL std::ostream G4cerr