Geant4 Cross Reference |
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 // G4UserPhysicsListMessenger implementation << 27 // 23 // 28 // Original author: H.Kurashige, 9 January 199 << 24 // $Id: G4UserPhysicsListMessenger.cc,v 1.10 2001/10/11 13:44:37 gcosmo Exp $ 29 // ------------------------------------------- << 25 // GEANT4 tag $Name: geant4-04-01 $ >> 26 // >> 27 // >> 28 //--------------------------------------------------------------- >> 29 // >> 30 // G4UserPhysicsListMessenger.cc >> 31 // ------------------------------------------------------------ >> 32 // History >> 33 // first version 09 Jan. 1998 by H.Kurashige >> 34 // add buildPhysicsTable command 13 Apr. 1999 by H.Kurashige >> 35 // add setStoredInAscii command 12 Mar. 2001 by H.Kurashige >> 36 // ------------------------------------------------------------ 30 37 31 #include "G4UserPhysicsListMessenger.hh" 38 #include "G4UserPhysicsListMessenger.hh" 32 << 39 #include "G4VUserPhysicsList.hh" 33 #include "G4ParticleTable.hh" << 40 #include "G4UIdirectory.hh" 34 #include "G4PhysicsListHelper.hh" << 41 #include "G4UIcmdWithoutParameter.hh" 35 #include "G4SystemOfUnits.hh" << 42 #include "G4UIcmdWithAnInteger.hh" 36 #include "G4Tokenizer.hh" << 37 #include "G4UIcmdWithADoubleAndUnit.hh" 43 #include "G4UIcmdWithADoubleAndUnit.hh" 38 #include "G4UIcmdWithAString.hh" 44 #include "G4UIcmdWithAString.hh" 39 #include "G4UIcmdWithAnInteger.hh" << 45 #include "G4ParticleTable.hh" 40 #include "G4UIcmdWithoutParameter.hh" << 41 #include "G4UIdirectory.hh" << 42 #include "G4UIparameter.hh" << 43 #include "G4VUserPhysicsList.hh" << 44 #include "G4ios.hh" 46 #include "G4ios.hh" >> 47 #include "G4Tokenizer.hh" 45 48 46 #include <sstream> << 47 49 48 G4UserPhysicsListMessenger::G4UserPhysicsListM << 50 G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList):thePhysicsList(pParticleList) 49 : thePhysicsList(pParticleList) << 50 { 51 { 51 G4UIparameter* param = nullptr; << 52 // /run/particle directory 52 // /run/particle directory 53 theDirectory = new G4UIdirectory("/run/parti 53 theDirectory = new G4UIdirectory("/run/particle/"); 54 theDirectory->SetGuidance("Commands for G4VU 54 theDirectory->SetGuidance("Commands for G4VUserPhysicsList."); 55 55 56 // /run/particle/Verbose command 56 // /run/particle/Verbose command 57 verboseCmd = new G4UIcmdWithAnInteger("/run/ << 57 verboseCmd = new G4UIcmdWithAnInteger("/run/particle/verbose",this); 58 verboseCmd->SetGuidance("Set the Verbose lev 58 verboseCmd->SetGuidance("Set the Verbose level of G4VUserPhysicsList."); 59 verboseCmd->SetGuidance(" 0 : Silent (defaul 59 verboseCmd->SetGuidance(" 0 : Silent (default)"); 60 verboseCmd->SetGuidance(" 1 : Display warnin 60 verboseCmd->SetGuidance(" 1 : Display warning messages"); 61 verboseCmd->SetGuidance(" 2 : Display more") 61 verboseCmd->SetGuidance(" 2 : Display more"); 62 verboseCmd->SetParameterName("level", true); << 62 verboseCmd->SetParameterName("level",true); 63 verboseCmd->SetDefaultValue(0); 63 verboseCmd->SetDefaultValue(0); 64 verboseCmd->SetRange("level >=0 && level <=3 64 verboseCmd->SetRange("level >=0 && level <=3"); 65 65 66 // /run/setCut command << 66 // /run/particle/setCut command 67 setCutCmd = new G4UIcmdWithADoubleAndUnit("/ << 67 setCutCmd = new G4UIcmdWithADoubleAndUnit("/run/particle/setCut",this); 68 setCutCmd->SetGuidance("Set default cut valu 68 setCutCmd->SetGuidance("Set default cut value "); 69 setCutCmd->SetParameterName("cut", false); << 69 setCutCmd->SetParameterName("cut",false); 70 setCutCmd->SetDefaultValue(1.0); 70 setCutCmd->SetDefaultValue(1.0); 71 setCutCmd->SetRange("cut >=0.0"); << 71 setCutCmd->SetRange("cut >0.0"); >> 72 setCutCmd->SetUnitCandidates("m cm mm microm"); 72 setCutCmd->SetDefaultUnit("mm"); 73 setCutCmd->SetDefaultUnit("mm"); 73 setCutCmd->AvailableForStates(G4State_PreIni << 74 setCutCmd->AvailableForStates(PreInit,Idle); 74 << 75 // /run/setCutForAGivenParticle command << 76 setCutForAGivenParticleCmd = new G4UIcommand << 77 setCutForAGivenParticleCmd->SetGuidance("Set << 78 setCutForAGivenParticleCmd->SetGuidance("Usa << 79 param = new G4UIparameter("particleName", 's << 80 param->SetParameterCandidates("e- e+ gamma p << 81 setCutForAGivenParticleCmd->SetParameter(par << 82 param = new G4UIparameter("cut", 'd', false) << 83 param->SetDefaultValue("1."); << 84 param->SetParameterRange("cut>=0.0"); << 85 setCutForAGivenParticleCmd->SetParameter(par << 86 param = new G4UIparameter("unit", 's', false << 87 param->SetDefaultUnit("mm"); << 88 setCutForAGivenParticleCmd->SetParameter(par << 89 setCutForAGivenParticleCmd->AvailableForStat << 90 << 91 // /run/getCutForAGivenParticle command << 92 getCutForAGivenParticleCmd = new G4UIcmdWith << 93 getCutForAGivenParticleCmd->SetGuidance("Get << 94 getCutForAGivenParticleCmd->SetGuidance("Usa << 95 getCutForAGivenParticleCmd->SetParameterName << 96 getCutForAGivenParticleCmd->SetCandidates("e << 97 getCutForAGivenParticleCmd->AvailableForStat << 98 << 99 << 100 // /run/setCutForRegion command << 101 setCutRCmd = new G4UIcommand("/run/setCutFor << 102 setCutRCmd->SetGuidance("Set cut value for a << 103 param = new G4UIparameter("Region", 's', fal << 104 setCutRCmd->SetParameter(param); << 105 param = new G4UIparameter("cut", 'd', false) << 106 param->SetParameterRange("cut >=0.0"); << 107 setCutRCmd->SetParameter(param); << 108 param = new G4UIparameter("Unit", 's', true) << 109 param->SetDefaultValue("mm"); << 110 param->SetParameterCandidates(setCutRCmd->Un << 111 setCutRCmd->SetParameter(param); << 112 setCutRCmd->AvailableForStates(G4State_Idle) << 113 75 114 // /run/particle/DumpList command 76 // /run/particle/DumpList command 115 dumpListCmd = new G4UIcmdWithoutParameter("/ << 77 dumpListCmd = new G4UIcmdWithoutParameter("/run/particle/dumpList",this); 116 dumpListCmd->SetGuidance("Dump List of parti 78 dumpListCmd->SetGuidance("Dump List of particles in G4VUserPhysicsList. "); 117 79 >> 80 >> 81 // /run/particle/DumpCutValues command >> 82 dumpCutValuesCmd = new G4UIcmdWithAString("/run/particle/dumpCutValues",this); >> 83 dumpCutValuesCmd->SetGuidance("Dump cut value information "); >> 84 dumpCutValuesCmd->SetGuidance("Enter particle name "); >> 85 dumpCutValuesCmd->SetGuidance(" enter all for all particles"); >> 86 dumpCutValuesCmd->SetParameterName("particle", true); >> 87 dumpCutValuesCmd->SetDefaultValue("table"); >> 88 dumpCutValuesCmd->AvailableForStates(Idle,GeomClosed,EventProc); >> 89 118 // /run/particle/addProcManager command 90 // /run/particle/addProcManager command 119 addProcManCmd = new G4UIcmdWithAString("/run 91 addProcManCmd = new G4UIcmdWithAString("/run/particle/addProcManager", this); 120 addProcManCmd->SetToBeBroadcasted(false); << 121 addProcManCmd->SetGuidance("add process mana 92 addProcManCmd->SetGuidance("add process manager to specified particle type"); 122 addProcManCmd->SetParameterName("particleTyp 93 addProcManCmd->SetParameterName("particleType", true); 123 addProcManCmd->SetDefaultValue(""); 94 addProcManCmd->SetDefaultValue(""); 124 addProcManCmd->AvailableForStates(G4State_Pr << 95 addProcManCmd->AvailableForStates(Init,Idle,GeomClosed,EventProc); 125 G4State_Ev << 126 96 127 // /run/particle/buildPhysicsTable command 97 // /run/particle/buildPhysicsTable command 128 buildPTCmd = new G4UIcmdWithAString("/run/pa 98 buildPTCmd = new G4UIcmdWithAString("/run/particle/buildPhysicsTable", this); 129 buildPTCmd->SetGuidance("build physics table 99 buildPTCmd->SetGuidance("build physics table of specified particle type"); 130 buildPTCmd->SetParameterName("particleType", 100 buildPTCmd->SetParameterName("particleType", true); 131 buildPTCmd->SetDefaultValue(""); 101 buildPTCmd->SetDefaultValue(""); 132 buildPTCmd->AvailableForStates(G4State_Init, << 102 buildPTCmd->AvailableForStates(Init,Idle,GeomClosed,EventProc); 133 103 134 // /run/particle/storePhysicsTable command 104 // /run/particle/storePhysicsTable command 135 storeCmd = new G4UIcmdWithAString("/run/part << 105 storeCmd = new G4UIcmdWithAString("/run/particle/storePhysicsTable",this); 136 storeCmd->SetGuidance("Store Physics Table") 106 storeCmd->SetGuidance("Store Physics Table"); 137 storeCmd->SetGuidance(" Enter directory nam 107 storeCmd->SetGuidance(" Enter directory name"); 138 storeCmd->SetParameterName("dirName", true); << 108 storeCmd->SetParameterName("dirName",true); 139 storeCmd->SetDefaultValue(""); 109 storeCmd->SetDefaultValue(""); 140 storeCmd->AvailableForStates(G4State_Idle); << 110 storeCmd->AvailableForStates(Idle); 141 111 142 // /run/particle/retrievePhysicsTable comma 112 // /run/particle/retrievePhysicsTable command 143 retrieveCmd = new G4UIcmdWithAString("/run/p << 113 retrieveCmd = new G4UIcmdWithAString("/run/particle/retrievePhysicsTable",this); 144 retrieveCmd->SetGuidance("Retrieve Physics T 114 retrieveCmd->SetGuidance("Retrieve Physics Table"); 145 retrieveCmd->SetGuidance(" Enter directory 115 retrieveCmd->SetGuidance(" Enter directory name or OFF to switch off"); 146 retrieveCmd->SetParameterName("dirName", tru << 116 retrieveCmd->SetParameterName("dirName",true); 147 retrieveCmd->SetDefaultValue(""); 117 retrieveCmd->SetDefaultValue(""); 148 retrieveCmd->AvailableForStates(G4State_PreI << 118 retrieveCmd->AvailableForStates(PreInit,Idle); 149 119 150 // /run/particle/setStoredInAscii command 120 // /run/particle/setStoredInAscii command 151 asciiCmd = new G4UIcmdWithAnInteger("/run/pa << 121 asciiCmd = new G4UIcmdWithAnInteger("/run/particle/setStoredInAscii",this); 152 asciiCmd->SetGuidance("Switch on/off ascii m << 122 asciiCmd->SetGuidance("Switch on/off ascii mode in store/retreive Physics Table"); 153 asciiCmd->SetGuidance(" Enter 0(binary) or 123 asciiCmd->SetGuidance(" Enter 0(binary) or 1(ascii)"); 154 asciiCmd->SetParameterName("ascii", true); << 124 asciiCmd->SetParameterName("ascii",true); 155 asciiCmd->SetDefaultValue(0); 125 asciiCmd->SetDefaultValue(0); 156 asciiCmd->AvailableForStates(G4State_PreInit << 126 asciiCmd->AvailableForStates(PreInit,Idle); 157 asciiCmd->SetRange("ascii ==0 || ascii ==1") 127 asciiCmd->SetRange("ascii ==0 || ascii ==1"); 158 128 159 // Commnad /run/particle/applyCuts comman << 129 //Commnad /run/particle/applyCuts command 160 applyCutsCmd = new G4UIcommand("/run/particl << 130 applyCutsCmd = new G4UIcommand("/run/particle/applyCuts",this); 161 applyCutsCmd->SetGuidance("Set applyCuts fla << 131 applyCutsCmd->SetGuidance("Set ApplyCuts flag "); 162 applyCutsCmd->SetGuidance(" Some EM processe << 132 applyCutsCmd->SetGuidance(" applyCuts [value] [particle]"); 163 applyCutsCmd->SetGuidance("may generate gamm << 133 applyCutsCmd->SetGuidance(" value : true(default) or false "); 164 applyCutsCmd->SetGuidance("below the product << 134 applyCutsCmd->SetGuidance(" particle : all(default) or particle name "); 165 applyCutsCmd->SetGuidance("such secondaries << 135 G4UIparameter* param = new G4UIparameter("Flag",'s',true); 166 applyCutsCmd->SetGuidance("kinetic energies << 167 applyCutsCmd->SetGuidance("to the energy dep << 168 applyCutsCmd->SetGuidance(" Note that 'apply << 169 applyCutsCmd->SetGuidance("e- and e+. If thi << 170 applyCutsCmd->SetGuidance("a warning message << 171 applyCutsCmd->SetGuidance("ignored."); << 172 applyCutsCmd->SetGuidance(" If particle name << 173 applyCutsCmd->SetGuidance("gamma, e- and e+. << 174 param = new G4UIparameter("Flag", 's', true) << 175 param->SetDefaultValue("true"); 136 param->SetDefaultValue("true"); 176 applyCutsCmd->SetParameter(param); 137 applyCutsCmd->SetParameter(param); 177 param = new G4UIparameter("Particle", 's', t << 138 param = new G4UIparameter("Particle",'s',true); 178 param->SetDefaultValue("all"); 139 param->SetDefaultValue("all"); 179 applyCutsCmd->SetParameter(param); 140 applyCutsCmd->SetParameter(param); 180 applyCutsCmd->AvailableForStates(G4State_Pre << 141 applyCutsCmd->AvailableForStates(PreInit,Init,Idle); 181 << 182 // /run/particle/dumpCutValues command << 183 dumpCutValuesCmd = new G4UIcmdWithAString("/ << 184 dumpCutValuesCmd->SetGuidance("Dump a list o << 185 dumpCutValuesCmd->SetGuidance("for all regis << 186 dumpCutValuesCmd->SetGuidance("Dumping a lis << 187 dumpCutValuesCmd->SetGuidance("actual conver << 188 dumpCutValuesCmd->SetGuidance( << 189 "If you want a list 'immediately', use '/r << 190 dumpCutValuesCmd->SetGuidance("list given in << 191 dumpCutValuesCmd->SetGuidance( << 192 "current list if you have already issued ' << 193 dumpCutValuesCmd->SetParameterName("particle << 194 dumpCutValuesCmd->SetDefaultValue("all"); << 195 dumpCutValuesCmd->AvailableForStates(G4State << 196 << 197 // /run/particle/dumpCutValues command << 198 dumpOrdParamCmd = new G4UIcmdWithAnInteger(" << 199 dumpOrdParamCmd->SetGuidance("Dump a list of << 200 dumpOrdParamCmd->SetParameterName("subtype", << 201 dumpOrdParamCmd->SetDefaultValue(-1); << 202 dumpOrdParamCmd->AvailableForStates(G4State_ << 203 } 142 } 204 143 205 // ------------------------------------------- << 206 G4UserPhysicsListMessenger::~G4UserPhysicsList 144 G4UserPhysicsListMessenger::~G4UserPhysicsListMessenger() 207 { 145 { 208 delete setCutCmd; << 146 delete setCutCmd; 209 delete setCutRCmd; << 210 delete setCutForAGivenParticleCmd; << 211 delete getCutForAGivenParticleCmd; << 212 delete verboseCmd; 147 delete verboseCmd; 213 delete dumpListCmd; 148 delete dumpListCmd; >> 149 delete dumpCutValuesCmd; 214 delete addProcManCmd; 150 delete addProcManCmd; 215 delete buildPTCmd; 151 delete buildPTCmd; 216 delete storeCmd; << 152 delete storeCmd; 217 delete retrieveCmd; 153 delete retrieveCmd; >> 154 delete theDirectory; 218 delete asciiCmd; 155 delete asciiCmd; 219 delete applyCutsCmd; 156 delete applyCutsCmd; 220 delete dumpCutValuesCmd; << 221 delete dumpOrdParamCmd; << 222 delete theDirectory; << 223 } 157 } 224 158 225 // ------------------------------------------- << 159 void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newValue) 226 void G4UserPhysicsListMessenger::SetNewValue(G << 227 { 160 { 228 G4ExceptionDescription ed; << 161 if( command==setCutCmd ){ 229 if (command == setCutCmd) { << 162 G4double newCut = setCutCmd->GetNewDoubleValue(newValue); 230 G4double newCut = setCutCmd->GetNewDoubleV << 231 thePhysicsList->SetDefaultCutValue(newCut) 163 thePhysicsList->SetDefaultCutValue(newCut); 232 thePhysicsList->SetCuts(); << 164 233 } << 165 } else if( command==verboseCmd ) { 234 else if (command == setCutForAGivenParticleC << 166 thePhysicsList->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue)); 235 G4String particleName, unit; << 167 236 G4double cut; << 168 } else if( command==dumpListCmd ){ 237 std::istringstream str(newValue); << 238 str >> particleName >> cut >> unit; << 239 thePhysicsList->SetCutValue(cut * G4UIcomm << 240 } << 241 else if (command == getCutForAGivenParticleC << 242 G4cout << thePhysicsList->GetCutValue(newV << 243 } << 244 else if (command == setCutRCmd) { << 245 std::istringstream is(newValue); << 246 G4String regName; << 247 G4String uniName; << 248 G4double cVal = -1.0; << 249 is >> regName >> cVal >> uniName; << 250 if (is.fail()) { << 251 ed << "illegal arguments : " << newValue << 252 command->CommandFailed(ed); << 253 return; << 254 } << 255 thePhysicsList->SetCutsForRegion(cVal * (s << 256 } << 257 else if (command == verboseCmd) { << 258 thePhysicsList->SetVerboseLevel(verboseCmd << 259 } << 260 else if (command == dumpListCmd) { << 261 thePhysicsList->DumpList(); 169 thePhysicsList->DumpList(); 262 } << 170 263 else if (command == dumpOrdParamCmd) { << 171 } else if( command==dumpCutValuesCmd ){ 264 G4int stype = dumpOrdParamCmd->GetNewIntVa << 172 if (newValue == "table") { 265 G4PhysicsListHelper::GetPhysicsListHelper( << 173 thePhysicsList->DumpCutValuesTable(); 266 } << 174 } else { 267 else if (command == addProcManCmd) { << 175 thePhysicsList->DumpCutValues(newValue); 268 G4ParticleDefinition* particle = (G4Partic << 269 if (particle == nullptr) { << 270 ed << " Particle is not found : " << new << 271 command->CommandFailed(ed); << 272 return; << 273 } << 274 if (particle->GetProcessManager() != nullp << 275 ed << " Particle is not initialized : " << 276 command->CommandFailed(ed); << 277 return; << 278 } 176 } >> 177 >> 178 } else if( command == addProcManCmd ){ >> 179 G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue); >> 180 if (particle == 0) return; >> 181 if (particle->GetProcessManager() != 0) return; 279 thePhysicsList->AddProcessManager(particle 182 thePhysicsList->AddProcessManager(particle); 280 } << 183 281 else if (command == buildPTCmd) { << 184 } else if( command == buildPTCmd ){ 282 G4ParticleDefinition* particle = (G4Partic 185 G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue); 283 if (particle == nullptr) { << 186 if (particle == 0) return; 284 ed << " Particle is not found : " << new << 285 command->CommandFailed(ed); << 286 return; << 287 } << 288 thePhysicsList->PreparePhysicsTable(partic << 289 thePhysicsList->BuildPhysicsTable(particle 187 thePhysicsList->BuildPhysicsTable(particle); 290 } << 188 291 else if (command == storeCmd) { << 189 } else if ( command == storeCmd ){ 292 thePhysicsList->StorePhysicsTable(newValue 190 thePhysicsList->StorePhysicsTable(newValue); 293 } << 191 294 else if (command == retrieveCmd) { << 192 } else if( command == retrieveCmd ) { 295 if ((newValue == "OFF") || (newValue == "o << 193 if ((newValue == "OFF") || (newValue == "off") ){ 296 thePhysicsList->ResetPhysicsTableRetriev 194 thePhysicsList->ResetPhysicsTableRetrieved(); 297 } << 195 } else { 298 else { << 299 thePhysicsList->SetPhysicsTableRetrieved 196 thePhysicsList->SetPhysicsTableRetrieved(newValue); 300 } 197 } 301 } << 198 302 else if (command == asciiCmd) { << 199 } else if( command == asciiCmd ) { 303 if (asciiCmd->GetNewIntValue(newValue) == 200 if (asciiCmd->GetNewIntValue(newValue) == 0) { 304 thePhysicsList->ResetStoredInAscii(); 201 thePhysicsList->ResetStoredInAscii(); 305 } << 202 } else { 306 else { << 307 thePhysicsList->SetStoredInAscii(); 203 thePhysicsList->SetStoredInAscii(); 308 } 204 } 309 } << 205 310 else if (command == applyCutsCmd) { << 206 } else if( command == applyCutsCmd ) { 311 G4Tokenizer next(newValue); << 207 G4Tokenizer next( newValue ); 312 208 313 // check 1st argument 209 // check 1st argument 314 G4String temp = G4String(next()); 210 G4String temp = G4String(next()); 315 G4bool flag = (temp == "true" || temp == " << 211 G4bool flag = (temp =="true" || temp=="TRUE"); 316 212 317 // check 2nd argument 213 // check 2nd argument 318 G4String name = G4String(next()); 214 G4String name = G4String(next()); 319 215 320 thePhysicsList->SetApplyCuts(flag, name); 216 thePhysicsList->SetApplyCuts(flag, name); >> 217 321 } 218 } 322 else if (command == dumpCutValuesCmd) { << 323 thePhysicsList->DumpCutValuesTable(1); << 324 } << 325 } << 326 219 327 // ------------------------------------------- << 220 } 328 G4String G4UserPhysicsListMessenger::GetCurren << 221 >> 222 G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command) 329 { 223 { 330 G4String cv; 224 G4String cv; 331 G4String candidates("none"); 225 G4String candidates("none"); 332 auto piter = G4ParticleTable::GetParticleTab << 226 G4ParticleTable::G4PTblDicIterator *piter = (G4ParticleTable::GetParticleTable())->GetIterator(); 333 << 227 334 if (command == setCutCmd) { << 228 if( command==setCutCmd ){ 335 cv = setCutCmd->ConvertToString(thePhysics << 229 cv = setCutCmd->ConvertToString( thePhysicsList->GetDefaultCutValue(), "mm" ); 336 } << 230 337 else if (command == verboseCmd) { << 231 } else if( command==verboseCmd ){ 338 cv = verboseCmd->ConvertToString(thePhysic 232 cv = verboseCmd->ConvertToString(thePhysicsList->GetVerboseLevel()); 339 } << 233 340 else if (command == addProcManCmd) { << 234 } else if( command== addProcManCmd ){ 341 // set candidate list 235 // set candidate list 342 piter->reset(); << 236 piter -> reset(); 343 while ((*piter)()) { << 237 while( (*piter)() ){ 344 G4ParticleDefinition* particle = piter-> << 238 G4ParticleDefinition *particle = piter->value(); 345 candidates += " " + particle->GetParticl 239 candidates += " " + particle->GetParticleName(); 346 } 240 } 347 addProcManCmd->SetCandidates(candidates); << 241 addProcManCmd->SetCandidates(candidates); 348 cv = ""; 242 cv = ""; 349 } << 243 350 else if (command == buildPTCmd) { << 244 } else if( command== buildPTCmd ){ 351 // set candidate list 245 // set candidate list 352 piter->reset(); << 246 piter -> reset(); 353 while ((*piter)()) { << 247 while( (*piter)() ){ 354 G4ParticleDefinition* particle = piter-> << 248 G4ParticleDefinition *particle = piter->value(); 355 candidates += " " + particle->GetParticl 249 candidates += " " + particle->GetParticleName(); 356 } 250 } 357 addProcManCmd->SetCandidates(candidates); << 251 addProcManCmd->SetCandidates(candidates); 358 cv = ""; 252 cv = ""; 359 } << 253 360 else if (command == storeCmd) { << 254 } else if ( command == storeCmd ){ 361 cv = thePhysicsList->GetPhysicsTableDirect 255 cv = thePhysicsList->GetPhysicsTableDirectory(); 362 } << 256 363 else if (command == retrieveCmd) { << 257 }else if( command == retrieveCmd ) { 364 if (thePhysicsList->IsPhysicsTableRetrieve 258 if (thePhysicsList->IsPhysicsTableRetrieved()) { 365 cv = thePhysicsList->GetPhysicsTableDire 259 cv = thePhysicsList->GetPhysicsTableDirectory(); 366 } << 260 } else { 367 else { << 368 cv = "OFF"; 261 cv = "OFF"; 369 } 262 } 370 } << 263 371 else if (command == asciiCmd) { << 264 } else if( command==asciiCmd ){ 372 if (thePhysicsList->IsStoredInAscii()) { << 265 if (thePhysicsList->IsStoredInAscii()){ 373 cv = "1"; 266 cv = "1"; 374 } << 267 } else { 375 else { << 376 cv = "0"; 268 cv = "0"; 377 } 269 } 378 } << 379 270 >> 271 } else if( command == applyCutsCmd ) { >> 272 if (thePhysicsList->GetApplyCuts("proton")){ >> 273 cv = "true"; >> 274 } else { >> 275 cv = "false"; >> 276 } >> 277 } >> 278 380 return cv; 279 return cv; 381 } 280 } >> 281 >> 282 >> 283 >> 284 >> 285 >> 286 >> 287 >> 288 382 289