Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/run/src/G4RunMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /run/src/G4RunMessenger.cc (Version 11.3.0) and /run/src/G4RunMessenger.cc (Version 5.2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 // G4RunMessenger implementation               << 
 27 //                                                 23 //
 28 // Original author: M.Asai, 1997               <<  24 // $Id: G4RunMessenger.cc,v 1.18 2003/06/16 17:12:52 gunter Exp $
 29 // ------------------------------------------- <<  25 // GEANT4 tag $Name: geant4-05-02 $
                                                   >>  26 //
 30                                                    27 
 31 #include "G4RunMessenger.hh"                       28 #include "G4RunMessenger.hh"
 32                                                << 
 33 #include "G4MTRunManager.hh"                   << 
 34 #include "G4SubEvtRunManager.hh"               << 
 35 #include "G4ProductionCutsTable.hh"            << 
 36 #include "G4RunManager.hh"                         29 #include "G4RunManager.hh"
 37 #include "G4Tokenizer.hh"                      <<  30 #include "G4UIdirectory.hh"
 38 #include "G4UIcmdWithABool.hh"                 <<  31 #include "G4UIcmdWithoutParameter.hh"
 39 #include "G4UIcmdWithAString.hh"                   32 #include "G4UIcmdWithAString.hh"
 40 #include "G4UIcmdWithAnInteger.hh"                 33 #include "G4UIcmdWithAnInteger.hh"
 41 #include "G4UIcmdWithoutParameter.hh"          <<  34 #include "G4UIcmdWithABool.hh"
 42 #include "G4UIcommand.hh"                          35 #include "G4UIcommand.hh"
 43 #include "G4UIdirectory.hh"                    << 
 44 #include "G4UImanager.hh"                      << 
 45 #include "G4UIparameter.hh"                        36 #include "G4UIparameter.hh"
                                                   >>  37 #include "G4UImanager.hh"
                                                   >>  38 #include "G4ProductionCutsTable.hh"
 46 #include "G4ios.hh"                                39 #include "G4ios.hh"
 47 #include "Randomize.hh"                        <<  40 #include <strstream>
 48                                                << 
 49 #include <sstream>                             << 
 50                                                    41 
 51 G4RunMessenger::G4RunMessenger(G4RunManager* r <<  42 G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
                                                   >>  43 :runManager(runMgr)
 52 {                                                  44 {
 53   runDirectory = new G4UIdirectory("/run/");       45   runDirectory = new G4UIdirectory("/run/");
 54   runDirectory->SetGuidance("Run control comma     46   runDirectory->SetGuidance("Run control commands.");
 55                                                    47 
 56   initCmd = new G4UIcmdWithoutParameter("/run/ <<  48   initCmd = new G4UIcmdWithoutParameter("/run/initialize",this);
 57   initCmd->SetGuidance("Initialize G4 kernel."     49   initCmd->SetGuidance("Initialize G4 kernel.");
 58   initCmd->AvailableForStates(G4State_PreInit, <<  50   initCmd->AvailableForStates(G4State_PreInit,G4State_Idle),
 59                                                    51 
 60     beamOnCmd = new G4UIcommand("/run/beamOn", <<  52   beamOnCmd = new G4UIcommand("/run/beamOn",this);
 61   beamOnCmd->SetGuidance("Start a Run.");          53   beamOnCmd->SetGuidance("Start a Run.");
 62   beamOnCmd->SetGuidance("If G4 kernel is not      54   beamOnCmd->SetGuidance("If G4 kernel is not initialized, it will be initialized.");
 63   beamOnCmd->SetGuidance("Default number of ev     55   beamOnCmd->SetGuidance("Default number of events to be processed is 1.");
 64   beamOnCmd->SetGuidance("The second and third     56   beamOnCmd->SetGuidance("The second and third arguments can be used for");
 65   beamOnCmd->SetGuidance("executing a macro fi     57   beamOnCmd->SetGuidance("executing a macro file at the end of each event.");
 66   beamOnCmd->SetGuidance("If the second argume     58   beamOnCmd->SetGuidance("If the second argument, i.e. name of the macro");
 67   beamOnCmd->SetGuidance("file, is given but t     59   beamOnCmd->SetGuidance("file, is given but the third argument is not,");
 68   beamOnCmd->SetGuidance("the macro file will      60   beamOnCmd->SetGuidance("the macro file will be executed for all of the");
 69   beamOnCmd->SetGuidance("event.");                61   beamOnCmd->SetGuidance("event.");
 70   beamOnCmd->SetGuidance("If the third argumen     62   beamOnCmd->SetGuidance("If the third argument (nSelect) is given, the");
 71   beamOnCmd->SetGuidance("macro file will be e     63   beamOnCmd->SetGuidance("macro file will be executed only for the first");
 72   beamOnCmd->SetGuidance("nSelect events.");       64   beamOnCmd->SetGuidance("nSelect events.");
 73   beamOnCmd->AvailableForStates(G4State_PreIni <<  65   beamOnCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
 74   beamOnCmd->SetToBeBroadcasted(false);        <<  66   G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true);
 75   auto p1 = new G4UIparameter("numberOfEvent", << 
 76   p1->SetDefaultValue(1);                          67   p1->SetDefaultValue(1);
 77   p1->SetParameterRange("numberOfEvent >= 0");     68   p1->SetParameterRange("numberOfEvent >= 0");
 78   beamOnCmd->SetParameter(p1);                     69   beamOnCmd->SetParameter(p1);
 79   auto p2 = new G4UIparameter("macroFile", 's' <<  70   G4UIparameter* p2 = new G4UIparameter("macroFile",'s',true);
 80   p2->SetDefaultValue("***NULL***");               71   p2->SetDefaultValue("***NULL***");
 81   beamOnCmd->SetParameter(p2);                     72   beamOnCmd->SetParameter(p2);
 82   auto p3 = new G4UIparameter("nSelect", 'i',  <<  73   G4UIparameter* p3 = new G4UIparameter("nSelect",'i',true);
 83   p3->SetDefaultValue(-1);                         74   p3->SetDefaultValue(-1);
 84   p3->SetParameterRange("nSelect>=-1");            75   p3->SetParameterRange("nSelect>=-1");
 85   beamOnCmd->SetParameter(p3);                     76   beamOnCmd->SetParameter(p3);
 86   // beamOnCmd->SetToBeBroadcasted(false);     << 
 87                                                    77 
 88   verboseCmd = new G4UIcmdWithAnInteger("/run/ <<  78   verboseCmd = new G4UIcmdWithAnInteger("/run/verbose",this);
 89   verboseCmd->SetGuidance("Set the Verbose lev     79   verboseCmd->SetGuidance("Set the Verbose level of G4RunManager.");
 90   verboseCmd->SetGuidance(" 0 : Silent (defaul     80   verboseCmd->SetGuidance(" 0 : Silent (default)");
 91   verboseCmd->SetGuidance(" 1 : Display main t     81   verboseCmd->SetGuidance(" 1 : Display main topics");
 92   verboseCmd->SetGuidance(" 2 : Display main t     82   verboseCmd->SetGuidance(" 2 : Display main topics and run summary");
 93   verboseCmd->SetGuidance(" 3 : Display some a <<  83   verboseCmd->SetParameterName("level",true);
 94   verboseCmd->SetGuidance(" 4 : Display detail << 
 95   verboseCmd->SetGuidance(" N.B. 3 or 4 may ca << 
 96   verboseCmd->SetParameterName("level", true); << 
 97   verboseCmd->SetDefaultValue(0);                  84   verboseCmd->SetDefaultValue(0);
 98   verboseCmd->SetRange("level >=0 && level <=4 <<  85   verboseCmd->SetRange("level >=0 && level <=2");
 99                                                    86 
100   printProgCmd = new G4UIcmdWithAnInteger("/ru <<  87   dumpRegCmd = new G4UIcmdWithAString("/run/dumpRegion",this);
101   printProgCmd->SetGuidance("Display begin_of_ << 
102   printProgCmd->SetGuidance("If it is set to z << 
103   printProgCmd->SetGuidance("If it is set to - << 
104   printProgCmd->SetParameterName("mod", true); << 
105   printProgCmd->SetDefaultValue(-1);           << 
106   printProgCmd->SetRange("mod>=-1");           << 
107                                                << 
108   nThreadsCmd = new G4UIcmdWithAnInteger("/run << 
109   nThreadsCmd->SetGuidance("Set the number of  << 
110   nThreadsCmd->SetGuidance("This command works << 
111   nThreadsCmd->SetGuidance("This command is va << 
112   nThreadsCmd->SetGuidance("The command is ign << 
113   nThreadsCmd->SetParameterName("nThreads", tr << 
114   nThreadsCmd->SetDefaultValue(2);             << 
115   nThreadsCmd->SetRange("nThreads >0");        << 
116   nThreadsCmd->SetToBeBroadcasted(false);      << 
117   nThreadsCmd->AvailableForStates(G4State_PreI << 
118                                                << 
119   maxThreadsCmd = new G4UIcmdWithoutParameter( << 
120   maxThreadsCmd->SetGuidance(                  << 
121     "Set the number of threads to be the numbe << 
122   maxThreadsCmd->SetGuidance("This command wor << 
123   maxThreadsCmd->SetGuidance("This command is  << 
124   maxThreadsCmd->SetGuidance("The command is i << 
125   maxThreadsCmd->SetToBeBroadcasted(false);    << 
126   maxThreadsCmd->AvailableForStates(G4State_Pr << 
127                                                << 
128   pinAffinityCmd = new G4UIcmdWithAnInteger("/ << 
129   pinAffinityCmd->SetGuidance(                 << 
130     "Locks each thread to a specific logical c << 
131     "are locked in round robin to logical core << 
132   pinAffinityCmd->SetGuidance("This command is << 
133   pinAffinityCmd->SetGuidance("This command wo << 
134   pinAffinityCmd->SetGuidance("This command is << 
135   pinAffinityCmd->SetGuidance(                 << 
136     "If a value n>0 is provided it starts sett << 
137     "from the n-th CPU (note: counting from 1) << 
138   pinAffinityCmd->SetGuidance(                 << 
139     "E.g. /run/pinAffinity 3 locks first threa << 
140     "third logical CPU (number 2).");          << 
141   pinAffinityCmd->SetGuidance("If a value n<0  << 
142   pinAffinityCmd->SetParameterName("pinAffinit << 
143   pinAffinityCmd->SetDefaultValue(1);          << 
144   pinAffinityCmd->SetToBeBroadcasted(false);   << 
145   pinAffinityCmd->SetRange("pinAffinity > 0 || << 
146   pinAffinityCmd->AvailableForStates(G4State_P << 
147                                                << 
148   evModCmd = new G4UIcommand("/run/eventModulo << 
149   evModCmd->SetGuidance("Set the event modulo  << 
150   evModCmd->SetGuidance("i.e. each worker thre << 
151   evModCmd->SetGuidance("comes back to G4MTRun << 
152   evModCmd->SetGuidance("If it is set to zero  << 
153   evModCmd->SetGuidance("   N = int( sqrt( num << 
154   evModCmd->SetGuidance("The value N may affec << 
155   evModCmd->SetGuidance("if N is too small com << 
156   evModCmd->SetGuidance("The second parameter  << 
157   evModCmd->SetGuidance("thread is seeded by t << 
158   evModCmd->SetGuidance("by the master G4MTRun << 
159   evModCmd->SetGuidance(" - If seedOnce is set << 
160   evModCmd->SetGuidance("   by G4MTRunManager  << 
161   evModCmd->SetGuidance("   This option guaran << 
162   evModCmd->SetGuidance("   of threads.");     << 
163   evModCmd->SetGuidance(" - If seedOnce is set << 
164   evModCmd->SetGuidance("   event of each run  << 
165   evModCmd->SetGuidance("   guaranteed only if << 
166   evModCmd->SetGuidance("   On the other hand, << 
167   evModCmd->SetGuidance("   in particular for  << 
168   evModCmd->SetGuidance("   particle energy an << 
169   evModCmd->SetGuidance(" - If seedOnce is set << 
170   evModCmd->SetGuidance("   group of N events. << 
171   evModCmd->SetGuidance("   Geant4 allows numb << 
172   evModCmd->SetGuidance("   event loop.");     << 
173   evModCmd->SetGuidance("This command is valid << 
174   evModCmd->SetGuidance("This command is ignor << 
175   evModCmd->SetGuidance("sub-event parallel mo << 
176   auto emp1 = new G4UIparameter("N", 'i', true << 
177   emp1->SetDefaultValue(0);                    << 
178   emp1->SetParameterRange("N >= 0");           << 
179   evModCmd->SetParameter(emp1);                << 
180   auto emp2 = new G4UIparameter("seedOnce", 'i << 
181   emp2->SetDefaultValue(0);                    << 
182   emp2->SetParameterRange("seedOnce >= 0 && se << 
183   evModCmd->SetParameter(emp2);                << 
184   evModCmd->SetToBeBroadcasted(false);         << 
185   evModCmd->AvailableForStates(G4State_PreInit << 
186                                                << 
187   dumpRegCmd = new G4UIcmdWithAString("/run/du << 
188   dumpRegCmd->SetGuidance("Dump region informa     88   dumpRegCmd->SetGuidance("Dump region information.");
189   dumpRegCmd->SetGuidance("In case name of a r     89   dumpRegCmd->SetGuidance("In case name of a region is not given, all regions will be displayed.");
190   dumpRegCmd->SetParameterName("regionName", t     90   dumpRegCmd->SetParameterName("regionName", true);
191   dumpRegCmd->SetDefaultValue("**ALL**");          91   dumpRegCmd->SetDefaultValue("**ALL**");
192   dumpRegCmd->AvailableForStates(G4State_Idle)     92   dumpRegCmd->AvailableForStates(G4State_Idle);
193                                                    93 
194   dumpCoupleCmd = new G4UIcmdWithoutParameter( <<  94   dumpCoupleCmd = new G4UIcmdWithoutParameter("/run/dumpCouples",this);
195   dumpCoupleCmd->SetGuidance("Dump material-cu     95   dumpCoupleCmd->SetGuidance("Dump material-cuts-couple information.");
196   dumpCoupleCmd->SetGuidance("Note that materi     96   dumpCoupleCmd->SetGuidance("Note that material-cuts-couple information is updated");
197   dumpCoupleCmd->SetGuidance("after BeamOn has     97   dumpCoupleCmd->SetGuidance("after BeamOn has started.");
198   dumpCoupleCmd->AvailableForStates(G4State_Id     98   dumpCoupleCmd->AvailableForStates(G4State_Idle);
199                                                    99 
200   optCmd = new G4UIcmdWithABool("/run/optimize << 100   optCmd = new G4UIcmdWithABool("/run/optimizeGeometry",this);
201   optCmd->SetGuidance("Set the optimization fl    101   optCmd->SetGuidance("Set the optimization flag for geometry.");
202   optCmd->SetGuidance("If it is set to TRUE, G    102   optCmd->SetGuidance("If it is set to TRUE, G4GeometryManager will optimize");
203   optCmd->SetGuidance("the geometry definition    103   optCmd->SetGuidance("the geometry definitions.");
204   optCmd->SetGuidance("GEANT4 is initialized w    104   optCmd->SetGuidance("GEANT4 is initialized with this flag as TRUE.");
205   optCmd->SetParameterName("optimizeFlag", tru << 105   optCmd->SetParameterName("optimizeFlag",true);
206   optCmd->SetDefaultValue(true);                  106   optCmd->SetDefaultValue(true);
207   optCmd->AvailableForStates(G4State_PreInit,  << 107   optCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
208                                                   108 
209   brkBoECmd = new G4UIcmdWithABool("/run/break << 109   brkBoECmd = new G4UIcmdWithABool("/run/breakAtBeginOfEvent",this);
210   brkBoECmd->SetGuidance("Set a break point at << 110   brkBoECmd->SetGuidance("Set a break point at the begining of every event.");
211   brkBoECmd->SetParameterName("flag", true);   << 111   brkBoECmd->SetParameterName("flag",true);
212   brkBoECmd->SetDefaultValue(true);               112   brkBoECmd->SetDefaultValue(true);
213                                                << 113   
214   brkEoECmd = new G4UIcmdWithABool("/run/break << 114   brkEoECmd = new G4UIcmdWithABool("/run/breakAtEndOfEvent",this);
215   brkEoECmd->SetGuidance("Set a break point at    115   brkEoECmd->SetGuidance("Set a break point at the end of every event.");
216   brkEoECmd->SetParameterName("flag", true);   << 116   brkEoECmd->SetParameterName("flag",true);
217   brkEoECmd->SetDefaultValue(true);               117   brkEoECmd->SetDefaultValue(true);
218                                                << 118   
219   abortCmd = new G4UIcmdWithABool("/run/abort" << 119   abortCmd = new G4UIcmdWithABool("/run/abort",this);
220   abortCmd->SetGuidance("Abort current run pro    120   abortCmd->SetGuidance("Abort current run processing.");
221   abortCmd->SetGuidance(                       << 121   abortCmd->SetGuidance("If softAbort is false (default), currently processing event will be immediately aborted,");
222     "If softAbort is false (default), currentl << 122   abortCmd->SetGuidance("while softAbort is true, abortion occurs after processing the current event.");
223     "will be immediately aborted,");           << 123   abortCmd->AvailableForStates(G4State_GeomClosed,G4State_EventProc);
224   abortCmd->SetGuidance(                       << 124   abortCmd->SetParameterName("softAbort",true);
225     "while softAbort is true, abortion occurs  << 
226     "processing the current event.");          << 
227   abortCmd->AvailableForStates(G4State_GeomClo << 
228   abortCmd->SetParameterName("softAbort", true << 
229   abortCmd->SetDefaultValue(false);               125   abortCmd->SetDefaultValue(false);
230                                                   126 
231   abortEventCmd = new G4UIcmdWithoutParameter( << 127   abortEventCmd = new G4UIcmdWithoutParameter("/run/abortCurrentEvent",this);
232   abortEventCmd->SetGuidance("Abort currently     128   abortEventCmd->SetGuidance("Abort currently processing event.");
233   abortEventCmd->AvailableForStates(G4State_Ev    129   abortEventCmd->AvailableForStates(G4State_EventProc);
234                                                   130 
235   geomCmd = new G4UIcmdWithoutParameter("/run/ << 131   geomCmd = new G4UIcmdWithoutParameter("/run/geometryModified",this);
236   geomCmd->SetGuidance("Force geometry to be c << 132   geomCmd->SetGuidance("Force geometry to be closed again.");
237   geomCmd->SetGuidance("This command must be a << 133   geomCmd->SetGuidance("This command must be applied");
238   geomCmd->SetGuidance(" after the first initi << 134   geomCmd->SetGuidance(" if geometry has been modified after the");
239   geomCmd->AvailableForStates(G4State_PreInit, << 135   geomCmd->SetGuidance(" first initialization (or BeamOn).");
240                                                << 136   geomCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
241   geomRebCmd = new G4UIcmdWithABool("/run/rein << 137 
242   geomRebCmd->SetGuidance("Force geometry to b << 138   cutCmd = new G4UIcmdWithoutParameter("/run/cutoffModified",this);
243   geomRebCmd->SetGuidance("This command must b << 139   cutCmd->SetGuidance("Force closssection tables to be calculated again.");
244   geomRebCmd->SetGuidance(" detector construct << 140   cutCmd->SetGuidance("This command must be applied");
245   geomRebCmd->SetGuidance("/run/geometryModifi << 141   cutCmd->SetGuidance(" if cutoff value(s) have been modified after the");
246   geomRebCmd->SetParameterName("destroyFirst", << 142   cutCmd->SetGuidance(" first initialization (or BeamOn).");
247   geomRebCmd->SetDefaultValue(false);          << 143   cutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
248   geomRebCmd->AvailableForStates(G4State_PreIn << 144   
249                                                << 
250   physCmd = new G4UIcmdWithoutParameter("/run/ << 
251   physCmd->SetGuidance("Force all physics tabl << 
252   physCmd->SetGuidance("This command must be a << 
253   physCmd->SetGuidance(" if physics process ha << 
254   physCmd->SetGuidance(" first initialization  << 
255   physCmd->AvailableForStates(G4State_PreInit, << 
256                                                << 
257   constScoreCmd = new G4UIcmdWithoutParameter( << 
258   constScoreCmd->SetGuidance("Construct scorin << 
259   constScoreCmd->SetGuidance(                  << 
260     "This command is not mandatory, but automa << 
261     "called when a run starts.");              << 
262   constScoreCmd->SetGuidance(                  << 
263     "But the user may use this to visualize th << 
264     "world(s) before a run to start.");        << 
265   constScoreCmd->AvailableForStates(G4State_Id << 
266                                                << 
267   randomDirectory = new G4UIdirectory("/random    145   randomDirectory = new G4UIdirectory("/random/");
268   randomDirectory->SetGuidance("Random number     146   randomDirectory->SetGuidance("Random number status control commands.");
269                                                << 147   
270   seedCmd = new G4UIcmdWithAString("/random/se << 148   randDirCmd = new G4UIcmdWithAString("/random/setDirectoryName",this);
271   seedCmd->SetGuidance("Initialize the random  << 
272   seedCmd->SetGuidance("Number of integers sho << 
273   seedCmd->SetGuidance(                        << 
274     "Actual number of integers to be used depe << 
275     "random number engine.");                  << 
276 #ifdef G4MULTITHREADED                         << 
277   seedCmd->SetGuidance("This command sets the  << 
278 #endif                                         << 
279   seedCmd->SetParameterName("IntArray", false) << 
280   seedCmd->AvailableForStates(G4State_PreInit, << 
281   seedCmd->SetToBeBroadcasted(false);          << 
282                                                << 
283   randDirCmd = new G4UIcmdWithAString("/random << 
284   randDirCmd->SetGuidance("Define the director    149   randDirCmd->SetGuidance("Define the directory name of the rndm status files.");
285   randDirCmd->SetGuidance("Directory will be c << 150   randDirCmd->SetGuidance("Directory must be creates before storing the files.");
286   randDirCmd->SetParameterName("fileName", tru << 151   randDirCmd->SetParameterName("fileName",true);
287   randDirCmd->SetDefaultValue("./");              152   randDirCmd->SetDefaultValue("./");
288   randDirCmd->AvailableForStates(G4State_PreIn << 153   randDirCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
289                                                << 154   
290   savingFlagCmd = new G4UIcmdWithABool("/rando << 155   savingFlagCmd = new G4UIcmdWithABool("/random/setSavingFlag",this);
291   savingFlagCmd->SetGuidance("The randomNumber    156   savingFlagCmd->SetGuidance("The randomNumberStatus will be saved at :");
292   savingFlagCmd->SetGuidance(                  << 157   savingFlagCmd->SetGuidance("begining of run (currentRun.rndm) and "
293     "beginning of run (currentRun.rndm) and "  << 158                              "begining of event (currentEvent.rndm) ");  
294     "beginning of event (currentEvent.rndm) ") << 159   savingFlagCmd->SetParameterName("flag",true);
295   savingFlagCmd->SetParameterName("flag", true << 
296   savingFlagCmd->SetDefaultValue(true);           160   savingFlagCmd->SetDefaultValue(true);
297                                                << 161   
298   saveThisRunCmd = new G4UIcmdWithoutParameter << 162   saveThisRunCmd = new G4UIcmdWithoutParameter("/random/saveThisRun",this);
299   saveThisRunCmd->SetGuidance("copy currentRun    163   saveThisRunCmd->SetGuidance("copy currentRun.rndm to runXXX.rndm");
300   saveThisRunCmd->AvailableForStates(G4State_I << 164   saveThisRunCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
301                                                << 165   
302   saveThisEventCmd = new G4UIcmdWithoutParamet << 166   saveThisEventCmd = new G4UIcmdWithoutParameter("/random/saveThisEvent",this);
303   saveThisEventCmd->SetGuidance("copy currentE    167   saveThisEventCmd->SetGuidance("copy currentEvent.rndm to runXXXevtYYY.rndm");
304   saveThisEventCmd->AvailableForStates(G4State    168   saveThisEventCmd->AvailableForStates(G4State_EventProc);
305                                                << 169           
306   restoreRandCmd = new G4UIcmdWithAString("/ra << 170   restoreRandCmd = new G4UIcmdWithAString("/random/resetEngineFrom",this);
307   restoreRandCmd->SetGuidance("Reset the statu    171   restoreRandCmd->SetGuidance("Reset the status of the rndm engine from a file.");
308   restoreRandCmd->SetGuidance("See CLHEP manua    172   restoreRandCmd->SetGuidance("See CLHEP manual for detail.");
309   restoreRandCmd->SetGuidance("The engine stat    173   restoreRandCmd->SetGuidance("The engine status must be stored beforehand.");
310   restoreRandCmd->SetGuidance(                 << 174   restoreRandCmd->SetGuidance("Directory of the status file should be set by"
311     "Directory of the status file should be se << 175                               " /random/setDirectoryName.");
312     " /random/setDirectoryName.");             << 176   restoreRandCmd->SetParameterName("fileName",true);
313   restoreRandCmd->SetParameterName("fileName", << 
314   restoreRandCmd->SetDefaultValue("currentRun.    177   restoreRandCmd->SetDefaultValue("currentRun.rndm");
315   restoreRandCmd->AvailableForStates(G4State_P << 178   restoreRandCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
316   restoreRandCmd->SetToBeBroadcasted(false);   << 179   
                                                   >> 180   //old commands for the rndm engine status handling
                                                   >> 181   //
                                                   >> 182   randDirOld = new G4UIcmdWithAString("/run/randomNumberStatusDirectory",this);
                                                   >> 183   randDirOld->SetGuidance("Define the directory name of the rndm status files.");
                                                   >> 184   randDirOld->SetGuidance("Directory must be creates before storing the files.");
                                                   >> 185   randDirOld->SetParameterName("fileName",true);
                                                   >> 186   randDirOld->SetDefaultValue("./");
                                                   >> 187   randDirOld->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
                                                   >> 188   
                                                   >> 189   storeRandOld = new G4UIcmdWithAnInteger("/run/storeRandomNumberStatus",this);
                                                   >> 190   storeRandOld->SetGuidance("The randomNumberStatus will be saved at :");
                                                   >> 191   storeRandOld->SetGuidance("begining of run (currentRun.rndm) and "
                                                   >> 192                             "begining of event (currentEvent.rndm) ");  
                                                   >> 193   storeRandOld->SetParameterName("flag",true);
                                                   >> 194   storeRandOld->SetDefaultValue(1);
                                                   >> 195           
                                                   >> 196   restoreRandOld = new G4UIcmdWithAString("/run/restoreRandomNumberStatus",this);
                                                   >> 197   restoreRandOld->SetGuidance("Reset the status of the rndm engine from a file.");
                                                   >> 198   restoreRandOld->SetGuidance("See CLHEP manual for detail.");
                                                   >> 199   restoreRandOld->SetGuidance("The engine status must be stored beforehand.");
                                                   >> 200   restoreRandOld->SetGuidance("Directory of the status file should be set by"
                                                   >> 201                               " /random/setDirectoryName.");
                                                   >> 202   restoreRandOld->SetParameterName("fileName",true);
                                                   >> 203   restoreRandOld->SetDefaultValue("currentRun.rndm");
                                                   >> 204   restoreRandOld->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);  
317                                                   205 
318   restoreRandCmdMT = new G4UIcmdWithABool("/ra << 
319   restoreRandCmdMT->SetGuidance("Reset the sta << 
320   restoreRandCmdMT->SetGuidance("Note that the << 
321   restoreRandCmdMT->SetGuidance(               << 
322     "run{#1}evt{#2}.rndm ; where #1 is the run << 
323     "number and #2 is the event number.");     << 
324   restoreRandCmdMT->SetGuidance(               << 
325     "For example to re-seed the first event of << 
326     "run the file should be called run0evt0.rn << 
327   restoreRandCmdMT->SetGuidance(               << 
328     "If for a specific run/event the file is n << 
329     "the standard re-seeding strategy is used. << 
330   restoreRandCmdMT->SetGuidance(               << 
331     "This command has meaning only in MT mode  << 
332     "strong reproducibility studies.");        << 
333   restoreRandCmdMT->SetGuidance(               << 
334     "Directory of the status file should be se << 
335     " /random/setDirectoryName.");             << 
336   restoreRandCmdMT->SetDefaultValue(false);    << 
337   restoreRandCmdMT->AvailableForStates(G4State << 
338                                                << 
339   saveEachEventCmd = new G4UIcmdWithABool("/ra << 
340   saveEachEventCmd->SetGuidance("Save random n << 
341   saveEachEventCmd->SetGuidance("File name con << 
342   saveEachEventCmd->SetParameterName("flag", t << 
343   saveEachEventCmd->SetDefaultValue(true);     << 
344                                                << 
345   randEvtCmd = new G4UIcmdWithAnInteger("/run/ << 
346   randEvtCmd->SetGuidance("Flag to store rndm  << 
347   randEvtCmd->SetGuidance(" flag = 0 : not sto << 
348   randEvtCmd->SetGuidance(" flag = 1 : status  << 
349   randEvtCmd->SetGuidance(                     << 
350     " flag = 2 : status before event processin << 
351     "particle generation) is stored");         << 
352   randEvtCmd->SetGuidance(" flag = 3 : both ar << 
353   randEvtCmd->SetGuidance(                     << 
354     "Note: Some performance overhead may be se << 
355     "status, in particular");                  << 
356   randEvtCmd->SetGuidance(                     << 
357     "for the case of simplest geometry and sma << 
358   randEvtCmd->SetParameterName("flag", true);  << 
359   randEvtCmd->SetDefaultValue(0);              << 
360   randEvtCmd->SetRange("flag>=0 && flag<=3");  << 
361   randEvtCmd->AvailableForStates(G4State_PreIn << 
362                                                << 
363   procUICmds = new G4UIcmdWithoutParameter("/r << 
364   procUICmds->SetToBeBroadcasted(false);       << 
365   procUICmds->SetGuidance("Force workers to pr << 
366   procUICmds->SetGuidance("This commands is me << 
367   procUICmds->AvailableForStates(G4State_PreIn << 
368                                                << 
369   trajMergeCmd = new G4UIcmdWithABool("/run/tr << 
370   trajMergeCmd->SetGuidance("Merge trajectorie << 
371   trajMergeCmd->SetGuidance("In sub-event para << 
372   trajMergeCmd->SetGuidance("threads are not m << 
373   trajMergeCmd->SetGuidance("due to the perfor << 
374   trajMergeCmd->SetGuidance("This command enab << 
375   trajMergeCmd->SetGuidance("/tracking/storeTr << 
376   trajMergeCmd->SetGuidance("This command is v << 
377   trajMergeCmd->AvailableForStates(G4State_Pre << 
378   trajMergeCmd->SetParameterName("flag", true) << 
379   trajMergeCmd->SetDefaultValue(true);         << 
380   trajMergeCmd->SetToBeBroadcasted(false);     << 
381 }                                                 206 }
382                                                   207 
383 // ------------------------------------------- << 
384 G4RunMessenger::~G4RunMessenger()                 208 G4RunMessenger::~G4RunMessenger()
385 {                                                 209 {
386   delete beamOnCmd;                               210   delete beamOnCmd;
387   delete verboseCmd;                              211   delete verboseCmd;
388   delete printProgCmd;                         << 
389   delete nThreadsCmd;                          << 
390   delete maxThreadsCmd;                        << 
391   delete pinAffinityCmd;                       << 
392   delete evModCmd;                             << 
393   delete optCmd;                                  212   delete optCmd;
394   delete dumpRegCmd;                              213   delete dumpRegCmd;
395   delete dumpCoupleCmd;                           214   delete dumpCoupleCmd;
396   delete brkBoECmd;                               215   delete brkBoECmd;
397   delete brkEoECmd;                               216   delete brkEoECmd;
398   delete abortCmd;                                217   delete abortCmd;
399   delete abortEventCmd;                           218   delete abortEventCmd;
400   delete initCmd;                                 219   delete initCmd;
401   delete geomCmd;                                 220   delete geomCmd;
402   delete geomRebCmd;                           << 221   delete cutCmd;
403   delete physCmd;                              << 222   delete randDirOld; delete storeRandOld; delete restoreRandOld; 
404   delete randEvtCmd;                           << 223   delete runDirectory;
405   delete constScoreCmd;                        << 224   
406   delete procUICmds;                           << 225   delete randDirCmd;
407   delete trajMergeCmd;                         << 
408                                                << 
409   delete seedCmd;                              << 
410   delete savingFlagCmd;                           226   delete savingFlagCmd;
411   delete saveThisRunCmd;                          227   delete saveThisRunCmd;
412   delete saveThisEventCmd;                        228   delete saveThisEventCmd;
413   delete restoreRandCmd;                          229   delete restoreRandCmd;
414   delete randomDirectory;                         230   delete randomDirectory;
415   delete saveEachEventCmd;                     << 
416                                                << 
417   delete randDirCmd;                           << 
418   delete runDirectory;                         << 
419                                                << 
420   delete restoreRandCmdMT;                     << 
421 }                                                 231 }
422                                                   232 
423 // ------------------------------------------- << 233 void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
424 void G4RunMessenger::SetNewValue(G4UIcommand*  << 
425 {                                                 234 {
426   if (command == beamOnCmd) {                  << 235   if( command==beamOnCmd )
                                                   >> 236   {
427     G4int nev;                                    237     G4int nev;
428     G4int nst;                                 << 238     G4int ns;
429     const auto nv = (const char*)newValue;     << 239     const char* nv = (const char*)newValue;
430     std::istringstream is(nv);                 << 240     std::istrstream is((char*)nv);
431     is >> nev >> macroFileName >> nst;         << 241     is >> nev >> macroFileName >> ns;
432     if (macroFileName == "***NULL***") {       << 242     if(macroFileName=="***NULL***")
433       runManager->BeamOn(nev);                 << 243     { runManager->BeamOn(nev); }
434     }                                          << 244     else
435     else {                                     << 245     { runManager->BeamOn(nev,macroFileName,ns); }
436       runManager->BeamOn(nev, macroFileName, n << 246   }
437     }                                          << 247   else if( command==verboseCmd )
438   }                                            << 248   { runManager->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue)); }
439   else if (command == verboseCmd) {            << 249   else if( command==dumpRegCmd )
440     runManager->SetVerboseLevel(verboseCmd->Ge << 250   { 
441   }                                            << 251     runManager->UpdateRegion();
442   else if (command == printProgCmd) {          << 252     if(newValue=="**ALL**")
443     runManager->SetPrintProgress(printProgCmd- << 253     { runManager->DumpRegion(); }
444   }                                            << 254     else
445   else if (command == nThreadsCmd) {           << 255     { runManager->DumpRegion(newValue); }
446     G4RunManager::RMType rmType = runManager-> << 
447     if (rmType == G4RunManager::masterRM) {    << 
448       static_cast<G4MTRunManager*>(runManager) << 
449         ->SetNumberOfThreads(nThreadsCmd->GetN << 
450     }                                          << 
451     else if (rmType == G4RunManager::sequentia << 
452       G4cout << "*** /run/numberOfThreads comm << 
453              << "\nCommand is ignored." << G4e << 
454     }                                          << 
455     else {                                     << 
456       G4Exception("G4RunMessenger::ApplyNewCom << 
457                   "/run/numberOfThreads comman << 
458     }                                          << 
459   }                                            << 
460   else if (command == maxThreadsCmd) {         << 
461     G4RunManager::RMType rmType = runManager-> << 
462     if (rmType == G4RunManager::masterRM) {    << 
463       static_cast<G4MTRunManager*>(runManager) << 
464         ->SetNumberOfThreads(G4Threading::G4Ge << 
465     }                                          << 
466     else if (rmType == G4RunManager::sequentia << 
467       G4cout << "*** /run/useMaximumLogicalCor << 
468                 "sequential mode."             << 
469              << "\nCommand is ignored." << G4e << 
470     }                                          << 
471     else {                                     << 
472       G4Exception("G4RunMessenger::ApplyNewCom << 
473                   "/run/useMaximumLogicalCores << 
474     }                                          << 
475   }                                               256   }
476   else if (command == pinAffinityCmd) {        << 257   else if( command==dumpCoupleCmd)
477     G4RunManager::RMType rmType = runManager-> << 258   {
478     if (rmType == G4RunManager::masterRM) {    << 
479       static_cast<G4MTRunManager*>(runManager) << 
480         ->SetPinAffinity(pinAffinityCmd->GetNe << 
481     }                                          << 
482     else if (rmType == G4RunManager::sequentia << 
483       G4cout << "*** /run/pinAffinity command  << 
484              << "\nCommand is ignored." << G4e << 
485     }                                          << 
486     else {                                     << 
487       G4Exception("G4RunMessenger::ApplyNewCom << 
488                   "/run/pinAffinity command is << 
489     }                                          << 
490   }                                            << 
491   else if (command == evModCmd) {              << 
492     G4RunManager::RMType rmType = runManager-> << 
493     if (rmType == G4RunManager::masterRM) {    << 
494       G4int nevMod = 0;                        << 
495       G4int sOnce = 0;                         << 
496       const auto nv = (const char*)newValue;   << 
497       std::istringstream is(nv);               << 
498       is >> nevMod >> sOnce;                   << 
499       static_cast<G4MTRunManager*>(runManager) << 
500       G4MTRunManager::SetSeedOncePerCommunicat << 
501     }                                          << 
502     else if (rmType == G4RunManager::sequentia << 
503       G4cout << "*** /run/eventModulo command  << 
504              << "\nCommand is ignored." << G4e << 
505     }                                          << 
506     else if (rmType == G4RunManager::subEventM << 
507       G4cout << "*** /run/eventModulo command  << 
508              << "\nCommand is ignored." << G4e << 
509     }                                          << 
510     else {                                     << 
511       G4Exception("G4RunMessenger::ApplyNewCom << 
512                   "/run/eventModulo command is << 
513     }                                          << 
514   }                                            << 
515   else if (command == dumpRegCmd) {            << 
516     if (newValue == "**ALL**") {               << 
517       runManager->DumpRegion();                << 
518     }                                          << 
519     else {                                     << 
520       runManager->DumpRegion(newValue);        << 
521     }                                          << 
522   }                                            << 
523   else if (command == dumpCoupleCmd) {         << 
524     G4ProductionCutsTable::GetProductionCutsTa    259     G4ProductionCutsTable::GetProductionCutsTable()->DumpCouples();
525   }                                               260   }
526   else if (command == optCmd) {                << 261   else if( command==optCmd )
527     runManager->SetGeometryToBeOptimized(optCm << 262   { runManager->SetGeometryToBeOptimized(optCmd->GetNewBoolValue(newValue)); }
528   }                                            << 263   else if( command==brkBoECmd )
529   else if (command == brkBoECmd) {             << 264   { G4UImanager::GetUIpointer()->SetPauseAtBeginOfEvent(brkBoECmd->GetNewBoolValue(newValue)); }
530     G4UImanager::GetUIpointer()->SetPauseAtBeg << 265   else if( command==brkEoECmd )
531   }                                            << 266   { G4UImanager::GetUIpointer()->SetPauseAtEndOfEvent(brkEoECmd->GetNewBoolValue(newValue)); }
532   else if (command == brkEoECmd) {             << 267   else if( command==abortCmd )
533     G4UImanager::GetUIpointer()->SetPauseAtEnd << 268   { runManager->AbortRun(abortCmd->GetNewBoolValue(newValue)); }
534   }                                            << 269   else if( command==abortEventCmd )
535   else if (command == abortCmd) {              << 270   { runManager->AbortEvent(); }
536     runManager->AbortRun(abortCmd->GetNewBoolV << 271   else if( command==initCmd )
537   }                                            << 272   { runManager->Initialize(); }
538   else if (command == abortEventCmd) {         << 273   else if( command==geomCmd )
539     runManager->AbortEvent();                  << 274   { runManager->GeometryHasBeenModified(); }
540   }                                            << 275   else if( command==cutCmd )
541   else if (command == initCmd) {               << 276   { runManager->CutOffHasBeenModified(); }
542     runManager->Initialize();                  << 277   
543   }                                            << 278   else if( command==randDirCmd )
544   else if (command == geomCmd) {               << 279   { runManager->SetRandomNumberStoreDir(newValue); }
545     runManager->GeometryHasBeenModified(false) << 280   else if( command==savingFlagCmd )
546   }                                            << 281   { runManager->SetRandomNumberStore(savingFlagCmd->GetNewBoolValue(newValue)); }    
547   else if (command == geomRebCmd) {            << 282   else if( command==saveThisRunCmd )
548     runManager->ReinitializeGeometry(geomRebCm << 283   { runManager->rndmSaveThisRun(); }
549   }                                            << 284   else if( command==saveThisEventCmd )
550   else if (command == physCmd) {               << 285   { runManager->rndmSaveThisEvent(); }  
551     runManager->PhysicsHasBeenModified();      << 286   else if( command==restoreRandCmd )
552   }                                            << 287   { runManager->RestoreRandomNumberStatus(newValue); }
553   else if (command == seedCmd) {               << 288   
554     G4Tokenizer next(newValue);                << 289   else if( command==randDirOld )
555     G4int idx = 0;                             << 290   {G4cout << "warning: deprecated command. Use /random/setDirectoryName"
556     G4long seeds[100];                         << 291           << G4endl; 
557     G4String vl;                               << 292    runManager->SetRandomNumberStoreDir(newValue); }
558     while (!(vl = next()).empty()) {           << 293   else if( command==storeRandOld )
559       seeds[idx] = StoL(vl);                   << 294   {G4cout << "warning: deprecated command. Use /random/setSavingFlag"
560       ++idx;                                   << 295           << G4endl;
561     }                                          << 296    G4int frequency = storeRandOld->GetNewIntValue(newValue);
562     if (idx < 2) {                             << 297    G4bool flag = false;
563       G4cerr << "/random/setSeeds should have  << 298    if(frequency != 0) flag = true;       
564                 "Command ignored."             << 299    runManager->SetRandomNumberStore(flag); }    
565              << G4endl;                        << 300   else if( command==restoreRandOld )
566     }                                          << 301   {G4cout << "warning: deprecated command. Use /random/resetEngineFrom"
567     else {                                     << 302            << G4endl;  
568       seeds[idx] = 0;                          << 303    runManager->RestoreRandomNumberStatus(newValue); }  
569       G4Random::setTheSeeds(seeds);            << 
570     }                                          << 
571   }                                            << 
572   else if (command == randDirCmd) {            << 
573     runManager->SetRandomNumberStoreDir(newVal << 
574   }                                            << 
575   else if (command == savingFlagCmd) {         << 
576     runManager->SetRandomNumberStore(savingFla << 
577   }                                            << 
578   else if (command == saveThisRunCmd) {        << 
579     runManager->rndmSaveThisRun();             << 
580   }                                            << 
581   else if (command == saveThisEventCmd) {      << 
582     runManager->rndmSaveThisEvent();           << 
583   }                                            << 
584   else if (command == restoreRandCmd) {        << 
585     runManager->RestoreRandomNumberStatus(newV << 
586   }                                            << 
587   else if (command == randEvtCmd) {            << 
588     runManager->StoreRandomNumberStatusToG4Eve << 
589   }                                            << 
590   else if (command == saveEachEventCmd) {      << 
591     runManager->SetRandomNumberStorePerEvent(s << 
592   }                                            << 
593   else if (command == constScoreCmd) {         << 
594     runManager->ConstructScoringWorlds();      << 
595   }                                            << 
596   else if (command == restoreRandCmdMT) {      << 
597     runManager->RestoreRndmEachEvent(restoreRa << 
598   }                                            << 
599   else if (command == procUICmds) {            << 
600     G4RunManager::RMType rmType = runManager-> << 
601     if (rmType == G4RunManager::masterRM) {    << 
602       auto rm = dynamic_cast<G4MTRunManager*>( << 
603       if (rm != nullptr) {                     << 
604         rm->RequestWorkersProcessCommandsStack << 
605       }                                        << 
606       else {                                   << 
607         G4Exception("G4RunManager::ApplyNewCom << 
608                     "/run/workersProcessCmds c << 
609                     "non-G4MTRunManager class  << 
610       }                                        << 
611     }                                          << 
612     else if (rmType == G4RunManager::sequentia << 
613       G4cout << "*** /run/workersProcessCmds c << 
614              << "\nCommand is ignored." << G4e << 
615     }                                          << 
616     else {                                     << 
617       G4Exception("G4RunMessenger::ApplyNewCom << 
618                   "/run/workersProcessCmds com << 
619     }                                          << 
620   }                                            << 
621   else if (command == trajMergeCmd) {          << 
622     G4RunManager::RMType rmType = runManager-> << 
623     if (rmType == G4RunManager::subEventMaster << 
624       auto rm = dynamic_cast<G4SubEvtRunManage << 
625       if (rm != nullptr) {                     << 
626         rm->TrajectoriesToBeMerged(trajMergeCm << 
627       }                                        << 
628       else {                                   << 
629         G4ExceptionDescription ed;             << 
630         ed << "/run/trajectoriesToBeMerged com << 
631            << "instance that is not G4SubEvtRu << 
632         G4Exception("G4RunManager::ApplyNewCom << 
633       }                                        << 
634     }                                          << 
635     else {                                     << 
636       G4cout << "*** /run/trajectoriesToBeMerg << 
637              << "class instance that is not G4 << 
638              << "\nCommand is ignored." << G4e << 
639     }                                          << 
640   }                                            << 
641 }                                                 304 }
642                                                   305 
643 // ------------------------------------------- << 306 G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
644 G4String G4RunMessenger::GetCurrentValue(G4UIc << 
645 {                                                 307 {
646   G4String cv;                                    308   G4String cv;
647                                                << 309   
648   if (command == verboseCmd) {                 << 310   if( command==verboseCmd )
649     cv = verboseCmd->ConvertToString(runManage << 311   { cv = verboseCmd->ConvertToString(runManager->GetVerboseLevel()); }
650   }                                            << 312   else if( command==randDirCmd )
651   else if (command == printProgCmd) {          << 313   { cv = runManager->GetRandomNumberStoreDir(); }
652     cv = printProgCmd->ConvertToString(runMana << 314   
653   }                                            << 
654   else if (command == randDirCmd) {            << 
655     cv = runManager->GetRandomNumberStoreDir() << 
656   }                                            << 
657   else if (command == randEvtCmd) {            << 
658     cv = randEvtCmd->ConvertToString(runManage << 
659   }                                            << 
660   else if (command == nThreadsCmd) {           << 
661     G4RunManager::RMType rmType = runManager-> << 
662     if (rmType == G4RunManager::masterRM) {    << 
663       cv = nThreadsCmd->ConvertToString(       << 
664         static_cast<G4MTRunManager*>(runManage << 
665     }                                          << 
666     else if (rmType == G4RunManager::sequentia << 
667       cv = "0";                                << 
668     }                                          << 
669   }                                            << 
670   else if (command == evModCmd) {              << 
671     G4RunManager::RMType rmType = runManager-> << 
672     if (rmType == G4RunManager::masterRM) {    << 
673       cv = evModCmd->ConvertToString(static_ca << 
674            + " " + evModCmd->ConvertToString(G << 
675     }                                          << 
676     else if (rmType == G4RunManager::sequentia << 
677       G4cout << "*** /run/eventModulo command  << 
678     }                                          << 
679   }                                            << 
680                                                << 
681   return cv;                                      315   return cv;
682 }                                                 316 }
                                                   >> 317 
683                                                   318