Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/management/src/G4ProcessTableMessenger.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 /processes/management/src/G4ProcessTableMessenger.cc (Version 11.3.0) and /processes/management/src/G4ProcessTableMessenger.cc (Version 5.2.p1)


  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 // G4ProcessTableMessenger class implementatio << 
 27 //                                                 23 //
 28 // Author: H.Kurashige, 15 August 1998         <<  24 // $Id: G4ProcessTableMessenger.cc,v 1.13 2003/06/16 17:12:34 gunter Exp $
 29 // ------------------------------------------- <<  25 // GEANT4 tag $Name: geant4-05-02-patch-01 $
                                                   >>  26 //
                                                   >>  27 //
                                                   >>  28 //---------------------------------------------------------------
                                                   >>  29 //
                                                   >>  30 //  G4ProcessTableMessenger.cc
                                                   >>  31 //
                                                   >>  32 //  Description:
                                                   >>  33 //    This is a messenger class to interface to exchange information
                                                   >>  34 //    between ProcessTable and UI.
                                                   >>  35 //
                                                   >>  36 //
                                                   >>  37 //  History:
                                                   >>  38 //    15 Aug. 1998, H. Kurashige  
                                                   >>  39 //   Use STL vector instead of RW vector    1. Mar 00 H.Kurashige
                                                   >>  40 //
                                                   >>  41 //---------------------------------------------------------------
 30                                                    42 
 31 #include "G4ProcessTableMessenger.hh"              43 #include "G4ProcessTableMessenger.hh"
 32                                                    44 
 33 #include "G4UImanager.hh"                          45 #include "G4UImanager.hh"
 34 #include "G4UIdirectory.hh"                        46 #include "G4UIdirectory.hh"
 35 #include "G4UIcmdWithoutParameter.hh"              47 #include "G4UIcmdWithoutParameter.hh"
 36 #include "G4UIcmdWithAnInteger.hh"                 48 #include "G4UIcmdWithAnInteger.hh"
 37 #include "G4UIcmdWithAString.hh"                   49 #include "G4UIcmdWithAString.hh"
 38                                                    50 
 39 #include "G4VProcess.hh"                           51 #include "G4VProcess.hh"
 40 #include "G4ProcessManager.hh"                     52 #include "G4ProcessManager.hh"
 41 #include "G4ProcessTable.hh"                       53 #include "G4ProcessTable.hh"
 42 #include "G4ParticleTable.hh"                      54 #include "G4ParticleTable.hh"
 43                                                    55 
 44 #include "G4ios.hh"                                56 #include "G4ios.hh"                 
 45 #include "G4Tokenizer.hh"                          57 #include "G4Tokenizer.hh"
 46 #include <iomanip>                                 58 #include <iomanip>               
 47 #include <sstream>                             <<  59 #include <strstream>
 48                                                    60 
 49 G4ThreadLocal G4int G4ProcessTableMessenger::N <<  61 /////////////////////////////////////////
                                                   >>  62 G4int G4ProcessTableMessenger::NumberOfProcessType = 10;
 50                                                    63 
 51 // ------------------------------------------- <<  64 //////////////////////////
 52 G4ProcessTableMessenger::G4ProcessTableMesseng     65 G4ProcessTableMessenger::G4ProcessTableMessenger(G4ProcessTable* pTable)
 53   : theProcessTable(pTable)                    <<  66                         :theProcessTable(pTable), 
                                                   >>  67        currentProcessTypeName("all"),
                                                   >>  68        currentProcessName("all"),
                                                   >>  69        currentParticleName("all")
 54 {                                                  70 { 
 55   // Command   /particle/process               <<  71   //Commnad   /particle/process
 56   thisDirectory = new G4UIdirectory("/process/     72   thisDirectory = new G4UIdirectory("/process/");
 57   thisDirectory->SetGuidance("Process Table co     73   thisDirectory->SetGuidance("Process Table control commands.");
 58                                                    74 
 59   // Command   /particle/process/list          <<  75 
                                                   >>  76   //Commnad   /particle/process/list
 60   listCmd = new G4UIcmdWithAString("/process/l     77   listCmd = new G4UIcmdWithAString("/process/list",this);
 61   listCmd->SetGuidance("List up process names"     78   listCmd->SetGuidance("List up process names");
 62   listCmd->SetGuidance("  list [type] ");          79   listCmd->SetGuidance("  list [type] ");
 63   listCmd->SetGuidance("    type: process type <<  80   listCmd->SetGuidance("    type: process type [all:for all proceeses]");
 64   listCmd->SetParameterName("type", true);         81   listCmd->SetParameterName("type", true);
 65   listCmd->SetDefaultValue("all");                 82   listCmd->SetDefaultValue("all");
 66   SetNumberOfProcessType();                        83   SetNumberOfProcessType();
 67                                                    84  
 68   G4String candidates("all");                      85   G4String candidates("all");
 69   for (G4int idx = 0; idx < NumberOfProcessTyp <<  86   for (G4int idx = 0; idx < NumberOfProcessType ; idx ++ ) {
 70   {                                            <<  87     candidates += " " + 
 71     candidates += " " + G4VProcess::GetProcess <<  88       G4VProcess::GetProcessTypeName(G4ProcessType(idx));
 72   }                                                89   }
 73   listCmd->SetCandidates((const char*)(candida     90   listCmd->SetCandidates((const char*)(candidates));
 74                                                    91 
 75   // Command   /particle/process/verbose       <<  92   //Commnad   /particle/process/Verbose
 76   verboseCmd = new G4UIcmdWithAnInteger("/proc     93   verboseCmd = new G4UIcmdWithAnInteger("/process/verbose",this);
 77   verboseCmd->SetGuidance("Set Verbose Level f     94   verboseCmd->SetGuidance("Set Verbose Level for Process Table");
 78   verboseCmd->SetGuidance("  verbose [level]")     95   verboseCmd->SetGuidance("  verbose [level]");
 79   verboseCmd->SetGuidance("   level: verbose l     96   verboseCmd->SetGuidance("   level: verbose level");
 80   verboseCmd->SetParameterName("verbose", true     97   verboseCmd->SetParameterName("verbose", true);
 81   verboseCmd->SetDefaultValue(1);                  98   verboseCmd->SetDefaultValue(1);
 82   verboseCmd->SetRange("verbose >=0");             99   verboseCmd->SetRange("verbose >=0");
 83   verboseCmd->AvailableForStates(G4State_PreIn    100   verboseCmd->AvailableForStates(G4State_PreInit,G4State_Init,G4State_Idle,G4State_GeomClosed,G4State_EventProc);
 84                                                   101 
 85   // Command   /particle/process/setVerbose    << 102   //Commnad   /particle/process/setVerbose
 86   procVerboseCmd = new G4UIcommand("/process/s    103   procVerboseCmd = new G4UIcommand("/process/setVerbose",this);
 87   procVerboseCmd->SetGuidance("Set verbose lev    104   procVerboseCmd->SetGuidance("Set verbose level for processes");
 88   procVerboseCmd->SetGuidance("  setVerbose le    105   procVerboseCmd->SetGuidance("  setVerbose level [type or name] ");
 89   procVerboseCmd->SetGuidance("    level: verb    106   procVerboseCmd->SetGuidance("    level: verbose level ");
 90   procVerboseCmd->SetGuidance("    name : proc    107   procVerboseCmd->SetGuidance("    name : process name ");
 91   procVerboseCmd->SetGuidance("    type : proc    108   procVerboseCmd->SetGuidance("    type : process type ");
 92   procVerboseCmd->SetGuidance("       [all] fo << 109   procVerboseCmd->SetGuidance("       [all] for all proceeses ");
 93   G4UIparameter* param = new G4UIparameter("ve    110   G4UIparameter* param = new G4UIparameter("verbose",'i',false);
 94   procVerboseCmd->SetParameter(param);            111   procVerboseCmd->SetParameter(param);
 95   param = new G4UIparameter("type",'s',true);     112   param = new G4UIparameter("type",'s',true);
 96   param->SetDefaultValue("all");                  113   param->SetDefaultValue("all");
 97   procVerboseCmd->SetParameter(param);            114   procVerboseCmd->SetParameter(param);
 98   procVerboseCmd->AvailableForStates(G4State_I    115   procVerboseCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
 99                                                   116  
100   // Command   /particle/process/dump          << 117   //Commnad   /particle/process/dump
101   dumpCmd = new G4UIcommand("/process/dump",th    118   dumpCmd = new G4UIcommand("/process/dump",this);
102   dumpCmd->SetGuidance("Dump process informati    119   dumpCmd->SetGuidance("Dump process information");
103   dumpCmd->SetGuidance(" dump name [particle]"    120   dumpCmd->SetGuidance(" dump name [particle]");
104   dumpCmd->SetGuidance("   name:     process n    121   dumpCmd->SetGuidance("   name:     process name or type name");
105   dumpCmd->SetGuidance("   particle: particle     122   dumpCmd->SetGuidance("   particle: particle name [all: for all particles]");
106   param = new G4UIparameter("procName",'s',fal    123   param = new G4UIparameter("procName",'s',false);
107   dumpCmd->SetParameter(param);                   124   dumpCmd->SetParameter(param);
108   param = new G4UIparameter("particle",'s',tru    125   param = new G4UIparameter("particle",'s',true);
109   param->SetDefaultValue("all");                  126   param->SetDefaultValue("all");
110   dumpCmd->SetParameter(param);                   127   dumpCmd->SetParameter(param);
111   dumpCmd->AvailableForStates(G4State_Init,G4S    128   dumpCmd->AvailableForStates(G4State_Init,G4State_Idle,G4State_GeomClosed,G4State_EventProc);
112                                                   129 
113   // Command   /process/activate               << 130   //Commnad   /particle/process/activate
114   activateCmd = new G4UIcommand("/process/acti    131   activateCmd = new G4UIcommand("/process/activate",this);
115   activateCmd->SetGuidance("Activate processes    132   activateCmd->SetGuidance("Activate processes  ");
116   activateCmd->SetGuidance(" Activate  name [p    133   activateCmd->SetGuidance(" Activate  name [particle]");
117   activateCmd->SetGuidance("   name:     proce    134   activateCmd->SetGuidance("   name:     process name or type name");
118   activateCmd->SetGuidance("   particle: parti    135   activateCmd->SetGuidance("   particle: particle name [all: for all particles]");
119   param = new G4UIparameter("procName",'s',fal    136   param = new G4UIparameter("procName",'s',false);
120   activateCmd->SetParameter(param);               137   activateCmd->SetParameter(param);
121   param = new G4UIparameter("particle",'s',tru    138   param = new G4UIparameter("particle",'s',true);
122   param->SetDefaultValue("all");                  139   param->SetDefaultValue("all");
123   activateCmd->SetParameter(param);               140   activateCmd->SetParameter(param);
124   activateCmd->AvailableForStates(G4State_Idle << 141   activateCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
125                                                   142   
126   // Command   /process/inactivate             << 143   //Commnad   /particle/process/inactivate
127   inactivateCmd = new G4UIcommand("/process/in    144   inactivateCmd = new G4UIcommand("/process/inactivate",this);
128   inactivateCmd->SetGuidance("Inactivate proce    145   inactivateCmd->SetGuidance("Inactivate process  ");
129   inactivateCmd->SetGuidance("Inactivate proce    146   inactivateCmd->SetGuidance("Inactivate processes  ");
130   inactivateCmd->SetGuidance(" Inactivate  nam    147   inactivateCmd->SetGuidance(" Inactivate  name [particle]");
131   inactivateCmd->SetGuidance("   name:     pro    148   inactivateCmd->SetGuidance("   name:     process name or type name");
132   inactivateCmd->SetGuidance("   particle: par    149   inactivateCmd->SetGuidance("   particle: particle name [all: for all particles]");
133   param = new G4UIparameter("procName",'s',fal    150   param = new G4UIparameter("procName",'s',false);
134   inactivateCmd->SetParameter(param);             151   inactivateCmd->SetParameter(param);
135   param = new G4UIparameter("particle",'s',tru    152   param = new G4UIparameter("particle",'s',true);
136   param->SetDefaultValue("all");                  153   param->SetDefaultValue("all");
137   inactivateCmd->SetParameter(param);             154   inactivateCmd->SetParameter(param);
138   inactivateCmd->AvailableForStates(G4State_Id << 155   inactivateCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
139 }                                                 156 }
140                                                   157 
141 // ------------------------------------------- << 158 //////////////////
142 G4ProcessTableMessenger::~G4ProcessTableMessen    159 G4ProcessTableMessenger::~G4ProcessTableMessenger()
143 {                                                 160 {
144   delete activateCmd;                             161   delete activateCmd; 
145   delete inactivateCmd;                           162   delete inactivateCmd; 
146   delete verboseCmd;                              163   delete verboseCmd;
147   delete dumpCmd;                                 164   delete dumpCmd;
148   delete listCmd;                                 165   delete listCmd;
149   delete procVerboseCmd;                          166   delete procVerboseCmd;
150   delete thisDirectory;                           167   delete thisDirectory;
151 }                                                 168 }
152                                                   169 
153 // ------------------------------------------- << 170 ///////////////
154 void                                           << 171 void G4ProcessTableMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
155 G4ProcessTableMessenger::SetNewValue(G4UIcomma << 
156 {                                                 172 {
157   G4ProcessTable::G4ProcNameVector* procNameVe    173   G4ProcessTable::G4ProcNameVector* procNameVector 
158                          = theProcessTable->Ge    174                          = theProcessTable->GetNameList(); 
                                                   >> 175   G4int idx;
                                                   >> 176 
                                                   >> 177   G4ProcessVector* tmpVector=0;
159   G4int type = -1;                                178   G4int type = -1;
160   G4ExceptionDescription ed;                   << 
161                                                   179 
162   if( command == listCmd )                     << 180   if( command == listCmd ){
163   {                                            << 181     //Commnad  /process/list
164     // Command  /process/list                  << 
165     type = -1;                                    182     type = -1;
166     if (newValue == "all")                     << 183     if (newValue == "all") {  
167     {                                          << 184       currentProcessTypeName = newValue;
168       currentProcessTypeName = std::move(newVa << 185     } else {
169     }                                          << 
170     else                                       << 
171     {                                          << 
172       type  = GetProcessType(newValue);           186       type  = GetProcessType(newValue);
173       if (type <0)                             << 187       if (type <0) {
174       {                                        << 188   G4cout << " illegal type !!! " << G4endl;
175         G4cout << " illegal type !!! " << G4en << 189       } else {
176       }                                        << 190   currentProcessTypeName = newValue;
177       else                                     << 
178       {                                        << 
179         currentProcessTypeName = std::move(new << 
180       }                                           191       }
181     }                                             192     }    
182     G4int counter = 0;                            193     G4int counter = 0;
183     for (auto itr=procNameVector->cbegin(); it << 194     idx =0;
184     {                                          << 195     G4ProcessTable::G4ProcNameVector::iterator itr; 
185       G4ProcessVector* tmpVector = theProcessT << 196     for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
186       if ( (type <0) || ( ((*tmpVector)(0)->Ge << 197       idx +=1;
187       {                                        << 198       tmpVector = theProcessTable->FindProcesses(*itr);
                                                   >> 199       if ( (type <0) || ( ((*tmpVector)(0)->GetProcessType()) == type) ) {
188         if ( counter%4 != 0) G4cout << ",";       200         if ( counter%4 != 0) G4cout << ",";
189         G4cout << std::setw(19) << *itr;       << 201   G4cout << std::setw(19) <<*itr;
190         if ((counter++)%4 == 3)                << 202   if ((counter++)%4 == 3) {
191         {                                      << 
192           G4cout << G4endl;                       203           G4cout << G4endl;
193         }                                         204         }
194       }                                           205       }
195       delete tmpVector;                        << 
196     }                                             206     }
197     G4cout << G4endl;                             207     G4cout << G4endl;
198   }                                            << 208     delete tmpVector;
199   else if( command==procVerboseCmd )           << 209     //Commnad  /process/list
200   {                                            << 210 
201     // Command  /process/setVerbose            << 211   } else if( command==procVerboseCmd ) {
                                                   >> 212     //Commnad  /process/setVerbose
202     G4Tokenizer next( newValue );                 213     G4Tokenizer next( newValue );
203                                                   214 
204     // check 1st argument                         215     // check 1st argument
205     G4String tmpS = G4String(next());             216     G4String tmpS = G4String(next());
206     //  inputstream for newValues                 217     //  inputstream for newValues
207     const char* temp = (const char*)(tmpS);       218     const char* temp = (const char*)(tmpS);
208     std::istringstream is((char*)temp);        << 219     std::istrstream is((char*)temp);
209     G4int level;                                  220     G4int level;
210     is  >>level;                                  221     is  >>level;
211                                                   222 
212     // check 2nd argument                         223     // check 2nd argument
213     currentProcessTypeName = G4String(next());    224     currentProcessTypeName = G4String(next());
214     if (currentProcessTypeName.empty()) curren << 225     if (currentProcessTypeName.isNull()) currentProcessTypeName = "all";
215     G4bool isProcName = false;                    226     G4bool isProcName = false;
216     G4bool isAll = false;                         227     G4bool isAll = false;
217     type = -1;                                    228     type = -1;
218                                                   229 
219     if (currentProcessTypeName == "all")       << 230     if (currentProcessTypeName == "all") {  
220     {                                          << 
221       isAll = true;                               231       isAll = true; 
222     }                                          << 232     } else {
223     else                                       << 
224     {                                          << 
225       type  = GetProcessType(currentProcessTyp    233       type  = GetProcessType(currentProcessTypeName);
226       if (type<0)                              << 234       if (type<0) {
227       {                                        << 235   isProcName = true;
228         isProcName = true;                     << 236   currentProcessName = currentProcessTypeName;
229         currentProcessName = currentProcessTyp << 237   currentProcessTypeName = "";
230         currentProcessTypeName = "";           << 
231       }                                           238       }
232     }                                             239     }  
233     for (auto itr=procNameVector->cbegin(); it << 240     idx =0;
234     {                                          << 241     G4ProcessTable::G4ProcNameVector::iterator itr; 
235       G4ProcessVector* tmpVector = theProcessT << 242     for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
                                                   >> 243       idx +=1;
                                                   >> 244       tmpVector = theProcessTable->FindProcesses(*itr);
236       G4VProcess* p = (*tmpVector)(0);            245       G4VProcess* p = (*tmpVector)(0);
237       if ( isAll ||                               246       if ( isAll || 
238            (!isProcName && ( p->GetProcessType << 247      (!isProcName && ( p->GetProcessType() == type) ) ||
239            ( isProcName && ( p->GetProcessName << 248      ( isProcName && ( p->GetProcessName()== currentProcessName) ) ){
240       {                                        << 249   p->SetVerboseLevel(level);
241         p->SetVerboseLevel(level);             << 
242       }                                           250       }
243       delete tmpVector;                        << 
244     }                                             251     }
245   }                                            << 252     delete tmpVector;
246   else if( command==verboseCmd )               << 253     //Commnad  /process/setVerbose
247   {                                            << 254 
248     // Command   /process/verbose              << 255   } else if( command==verboseCmd ) {
249     theProcessTable->SetVerboseLevel(verboseCm << 256     //Commnad   /process/verbose
250   }                                            << 257      theProcessTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
251   else                                         << 258     //Commnad   /process/verbose
252   {                                            << 259 
                                                   >> 260   } else {
253     G4Tokenizer next( newValue );                 261     G4Tokenizer next( newValue );
254                                                   262 
255     // check 1st argument                         263     // check 1st argument
256     currentProcessName = G4String(next());        264     currentProcessName = G4String(next());
                                                   >> 265     G4bool isNameFound = false;
257     G4bool isProcName = false;                    266     G4bool isProcName = false; 
258     for (auto itr=procNameVector->cbegin(); it << 267     G4ProcessTable::G4ProcNameVector::iterator itr; 
259     {                                          << 268     for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
260       if ( (*itr) == currentProcessName )      << 269       if ( (*itr) == currentProcessName ) {
261       {                                        << 270   isNameFound = true;
262         isProcName = true;                     << 271   isProcName  = true; 
263         break;                                 << 272   break;
264       }                                           273       }
265     }                                             274     }
266     if (!isProcName)                           << 275     if (!isProcName) {
267     {                                          << 
268       type  = GetProcessType(currentProcessNam    276       type  = GetProcessType(currentProcessName);
269       if (type <0 )                            << 277       if (type >=0) {
270       {                                        << 278   isNameFound = true;
271         // no processes with specified name    << 279       } else {
272         ed << " illegal process (or type) name << 280   // no processes with specifed name
273            << currentProcessName << "]";       << 281   G4cout << " illegal process (or type) name " << G4endl;
274         command->CommandFailed(ed);            << 282   currentProcessName = "";
275         currentProcessName = "";               << 283   return;
276         return;                                << 
277       }                                           284       }
278     }                                             285     }
279                                                   286   
280     // check 2nd argument                         287     // check 2nd argument
281     currentParticleName = G4String(next());       288     currentParticleName = G4String(next());
282     G4bool isParticleFound = false;               289     G4bool isParticleFound = false;
283     G4ParticleDefinition* currentParticle = nu << 290     G4ParticleDefinition* currentParticle = 0;
284     if ( currentParticleName == "all" )        << 291     if ( currentParticleName == "all" ) {
285     {                                          << 
286       isParticleFound = true;                     292       isParticleFound = true;
287     }                                          << 293 
288     else                                       << 294     } else {
289     {                                          << 295       isParticleFound = G4ParticleTable::GetParticleTable()->contains(currentParticleName);
290       isParticleFound = G4ParticleTable::GetPa << 296       if (isParticleFound) {
291                       ->contains(currentPartic << 297   currentParticle = G4ParticleTable::GetParticleTable()->FindParticle(currentParticleName);
292       if (isParticleFound)                     << 
293       {                                        << 
294         currentParticle = G4ParticleTable::Get << 
295                         ->FindParticle(current << 
296       }                                           298       }
                                                   >> 299 
297     }                                             300     }
298                                                   301 
299     if ( !isParticleFound )                    << 302     if ( !isParticleFound ) {
300     {                                          << 303       // no particle with specifed name
301       // no particle with specified name       << 304       G4cout << " illegal particle name " << G4endl;
302       ed << " illegal particle name [" << curr << 
303       command->CommandFailed(ed);              << 
304       currentParticleName = "";                   305       currentParticleName = "";
305       return;                                     306       return;
306     }                                             307     }
307                                                   308         
308     if( command==dumpCmd )                     << 309     if( command==dumpCmd ) {
309     {                                          << 
310       // process/dump                             310       // process/dump
311       G4ProcessVector* tmpVector;              << 311       if (isProcName) {
312       if (isProcName)                          << 312   tmpVector = theProcessTable->FindProcesses(currentProcessName);
313       {                                        << 313       } else {
314         tmpVector = theProcessTable->FindProce << 314   tmpVector = theProcessTable->FindProcesses(G4ProcessType(type));
315       }                                        << 
316       else                                     << 
317       {                                        << 
318         tmpVector = theProcessTable->FindProce << 
319       }                                           315       }
320       for (G4int i=0; i<(G4int)tmpVector->leng << 316       for (G4int i=0; i<tmpVector->length(); i++) {
321       {                                        << 317   theProcessTable->DumpInfo( (*tmpVector)(i), currentParticle );
322         theProcessTable->DumpInfo( (*tmpVector << 
323       }                                           318       }
324       delete tmpVector;                           319       delete tmpVector;
325     }                                          << 320       // process/dump
326     else if ( (command==activateCmd) || (comma << 321 
327     {                                          << 322     } else if ( (command==activateCmd) || (command==inactivateCmd)) {
328       // process/activate , inactivate            323       // process/activate , inactivate
329       G4bool fActive = (command==activateCmd);    324       G4bool fActive = (command==activateCmd);
330       if (isProcName)                          << 325       if (isProcName) {
331       {                                        << 326   if ( currentParticle == 0 ) {
332         if ( currentParticle == nullptr )      << 327     theProcessTable->SetProcessActivation(currentProcessName, 
333         {                                      << 328             fActive);
334           theProcessTable->SetProcessActivatio << 329   } else {
335                                                << 330     theProcessTable->SetProcessActivation(currentProcessName,
336         }                                      << 331             currentParticle,
337         else                                   << 332             fActive);
338         {                                      << 333   }
339           theProcessTable->SetProcessActivatio << 334       } else {
340                                                << 335   if ( currentParticle == 0 ) {
341                                                << 336     theProcessTable->SetProcessActivation(G4ProcessType(type),
342         }                                      << 337             fActive);
343       }                                        << 338   } else {
344       else                                     << 339     theProcessTable->SetProcessActivation(G4ProcessType(type),
345       {                                        << 340             currentParticle,
346         if ( currentParticle == nullptr )      << 341             fActive);
347         {                                      << 342   }
348           theProcessTable->SetProcessActivatio << 
349                                                << 
350         }                                      << 
351         else                                   << 
352         {                                      << 
353           theProcessTable->SetProcessActivatio << 
354                                                << 
355                                                << 
356         }                                      << 
357       }                                           343       }
358       G4UImanager::GetUIpointer()->ApplyComman << 344       //  process/activate , inactivate
359     }                                             345     } 
360   }                                               346   }
361 }                                                 347 }
362                                                   348 
363 // ------------------------------------------- << 349 
364 G4String G4ProcessTableMessenger::GetCurrentVa << 350 //////////////////
                                                   >> 351 G4String G4ProcessTableMessenger::GetCurrentValue(G4UIcommand * command)
365 {                                                 352 {
366   if( command==verboseCmd )                    << 353   G4ProcessTable::G4ProcNameVector* procNameVector 
367   {                                            << 354                          = theProcessTable->GetNameList(); 
368     // Command   /process/verbose              << 355 
369     return verboseCmd->ConvertToString(theProc << 356   G4String candidates;
370   }                                            << 357   G4String returnValue('\0');
371   else if ( command==listCmd )                 << 358 
372   {                                            << 359   char line[255];
373     // Command   /process/list                 << 360   std::ostrstream os(line,255);
374     return currentProcessTypeName;             << 361   G4UIparameter * param; 
375   }                                            << 362 
376   else                                         << 363   G4int idx; 
377   {                                            << 364 
378     // Command   /process/dump, activate, inac << 365   if( command==verboseCmd ){
379     return   (currentProcessName + " " + curre << 366     //Commnad   /process/verbose
                                                   >> 367     os << theProcessTable->GetVerboseLevel() << '\0';
                                                   >> 368     returnValue = G4String(line);
                                                   >> 369 
                                                   >> 370   } else if ( command==listCmd ){
                                                   >> 371     //Commnad   /process/list
                                                   >> 372     candidates = "all";
                                                   >> 373     for (idx = 0; idx < NumberOfProcessType ; idx ++ ) {
                                                   >> 374       candidates += " " + 
                                                   >> 375          G4VProcess::GetProcessTypeName(G4ProcessType(idx));
                                                   >> 376     }
                                                   >> 377     listCmd->SetCandidates((const char*)(candidates));
                                                   >> 378     returnValue =  currentProcessTypeName;
                                                   >> 379 
                                                   >> 380   } else {
                                                   >> 381     //Commnad   /process/dump, activate, inactivate
                                                   >> 382     // process name 
                                                   >> 383     param = command->GetParameter(0);
                                                   >> 384     candidates = "";
                                                   >> 385     G4ProcessTable::G4ProcNameVector::iterator itr; 
                                                   >> 386     for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
                                                   >> 387       candidates += " " + (*itr);
                                                   >> 388     }
                                                   >> 389     param->SetParameterCandidates((const char*)(candidates));
                                                   >> 390     // particle name
                                                   >> 391     param = command->GetParameter(1);
                                                   >> 392     candidates = "all";
                                                   >> 393     G4ParticleTable::G4PTblDicIterator *piter 
                                                   >> 394                         = G4ParticleTable::GetParticleTable()->GetIterator();
                                                   >> 395     piter -> reset();
                                                   >> 396     while( (*piter)() ){
                                                   >> 397       G4ParticleDefinition *particle = piter->value();
                                                   >> 398       candidates += " " + particle->GetParticleName();
                                                   >> 399     }
                                                   >> 400     param->SetParameterCandidates((const char*)(candidates));
                                                   >> 401 
                                                   >> 402     returnValue =  currentProcessName + " " + currentParticleName;
                                                   >> 403 
380   }                                               404   }
381                                                   405 
382   return "";                                   << 406   return returnValue;
383 }                                                 407 }
384                                                   408 
385 // ------------------------------------------- << 409 /////////////////
386 G4String G4ProcessTableMessenger::GetProcessTy    410 G4String G4ProcessTableMessenger::GetProcessTypeName(G4ProcessType aType) const
387 {                                                 411 {
388   return G4VProcess::GetProcessTypeName(aType)    412   return G4VProcess::GetProcessTypeName(aType);
389 }                                                 413 }
390                                                   414 
391 // ------------------------------------------- << 415 /////////////////
392 G4int G4ProcessTableMessenger::GetProcessType(    416 G4int G4ProcessTableMessenger::GetProcessType(const G4String& aTypeName) const
393 {                                                 417 {
394   G4int type = -1;                                418   G4int type = -1;
395   for (G4int idx = 0; idx < NumberOfProcessTyp << 419   for (G4int idx = 0; idx < NumberOfProcessType ; idx ++ ) {
396   {                                            << 420     if (aTypeName == G4VProcess::GetProcessTypeName(G4ProcessType(idx)) ) {
397     if (aTypeName == G4VProcess::GetProcessTyp << 
398     {                                          << 
399       type = idx;                                 421       type = idx;
400       break;                                      422       break;
401     }                                             423     }
402   }                                               424   }
403   return type;                                    425   return type;
404 }                                                 426 }
405                                                   427 
406 // ------------------------------------------- << 428 
                                                   >> 429 /////////////////
407 void G4ProcessTableMessenger::SetNumberOfProce    430 void G4ProcessTableMessenger::SetNumberOfProcessType()
408 {                                                 431 {
409   G4bool isFoundEndMark = false;                  432   G4bool isFoundEndMark = false;
410   G4int idx;                                      433   G4int idx;
411   for (idx = 0; idx < 1000 ; ++idx )           << 434   for (idx = 0; idx < 1000 ; idx ++ ) {
412   {                                            << 
413     G4String typeName = G4VProcess::GetProcess    435     G4String typeName = G4VProcess::GetProcessTypeName(G4ProcessType(idx));
414     isFoundEndMark = G4StrUtil::contains(typeN << 436     if ( isFoundEndMark = typeName.contains("---")) break;
415     if ( isFoundEndMark ) break;               << 
416   }                                               437   }
417   if ( isFoundEndMark )                        << 438   if ( isFoundEndMark ) {
418   {                                            << 
419     NumberOfProcessType = idx;                    439     NumberOfProcessType = idx;
420   }                                            << 440   } else {
421   else                                         << 441     G4Exception("G4ProcessTableMessenger::SetNumberOfProcessType(): No End Mark for  G4VProcess::GetProcessTypeName() ");
422   {                                            << 
423     G4Exception("G4ProcessTableMessenger::SetN << 
424                 "ProcMan014", FatalException,  << 
425   }                                               442   } 
426 }                                                 443 }
                                                   >> 444 
                                                   >> 445 
                                                   >> 446 
                                                   >> 447 
427                                                   448