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