57G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(
59 : thePhysicsList(pParticleList)
64 theDirectory->
SetGuidance(
"Commands for G4VUserPhysicsList.");
68 verboseCmd->
SetGuidance(
"Set the Verbose level of G4VUserPhysicsList.");
70 verboseCmd->
SetGuidance(
" 1 : Display warning messages");
74 verboseCmd->
SetRange(
"level >=0 && level <=3");
86 setCutForAGivenParticleCmd =
87 new G4UIcommand(
"/run/setCutForAGivenParticle",
this);
89 "Set a cut value to a specific particle ");
91 "Usage: /run/setCutForAGivenParticle gamma 1. mm");
105 getCutForAGivenParticleCmd =
108 "Get a cut value to a specific particle ");
110 "Usage: /run/getCutForAGivenParticle gamma ");
112 getCutForAGivenParticleCmd->
SetCandidates(
"e- e+ gamma proton");
117 setCutRCmd =
new G4UIcommand(
"/run/setCutForRegion",
this);
118 setCutRCmd->
SetGuidance(
"Set cut value for a region");
133 dumpListCmd->
SetGuidance(
"Dump List of particles in G4VUserPhysicsList. ");
138 addProcManCmd->
SetGuidance(
"add process manager to specified particle type");
146 buildPTCmd->
SetGuidance(
"build physics table of specified particle type");
163 retrieveCmd->
SetGuidance(
"Retrieve Physics Table");
164 retrieveCmd->
SetGuidance(
" Enter directory name or OFF to switch off");
172 "Switch on/off ascii mode in store/retrieve Physics Table");
173 asciiCmd->
SetGuidance(
" Enter 0(binary) or 1(ascii)");
177 asciiCmd->
SetRange(
"ascii ==0 || ascii ==1");
180 applyCutsCmd =
new G4UIcommand(
"/run/particle/applyCuts",
this);
181 applyCutsCmd->
SetGuidance(
"Set applyCuts flag for a particle.");
183 " Some EM processes which do not have infrared divergence");
185 "may generate gamma, e- and/or e+ with kinetic energies");
187 "below the production threshold. By setting this flag,");
189 "such secondaries below threshold are eliminated and");
191 "kinetic energies of such secondaries are accumulated");
192 applyCutsCmd->
SetGuidance(
"to the energy deposition of their mother.");
194 " Note that 'applyCuts' makes sense only for gamma,");
196 "e- and e+. If this command is issued for other particle,");
198 "a warning message is displayed and the command is");
201 " If particle name is 'all', this command affects on");
215 "Dump a list of production threshold values in range and energy");
216 dumpCutValuesCmd->
SetGuidance(
"for all registered material-cuts-couples.");
218 "Dumping a list takes place when you issue 'beamOn' and");
220 "actual conversion tables from range to energy are available.");
222 "If you want a list 'immediately', use '/run/dumpRegion' for threshold");
224 "list given in range only. Also, '/run/dumpCouples' gives you the");
226 "current list if you have already issued 'run/beamOn' at least once.");
234 dumpOrdParamCmd->
SetGuidance(
"Dump a list of ordering parameter ");
245 delete setCutForAGivenParticleCmd;
246 delete getCutForAGivenParticleCmd;
249 delete addProcManCmd;
255 delete dumpCutValuesCmd;
256 delete dumpOrdParamCmd;
264 if(command == setCutCmd)
270 else if(command == setCutForAGivenParticleCmd)
274 std::istringstream str(newValue);
275 str >> particleName >> cut >> unit;
278 else if(command == getCutForAGivenParticleCmd)
282 else if(command == setCutRCmd)
284 std::istringstream is(newValue);
288 is >> regName >> cVal >> uniName;
291 ed <<
"illegal arguments : " << newValue;
298 else if(command == verboseCmd)
302 else if(command == dumpListCmd)
306 else if(command == dumpOrdParamCmd)
312 else if(command == addProcManCmd)
318 ed <<
" Particle is not found : " << newValue;
324 ed <<
" Particle is not initialized : " << newValue;
330 else if(command == buildPTCmd)
336 ed <<
" Particle is not found : " << newValue;
343 else if(command == storeCmd)
347 else if(command == retrieveCmd)
349 if((newValue ==
"OFF") || (newValue ==
"off"))
358 else if(command == asciiCmd)
369 else if(command == applyCutsCmd)
375 G4bool flag = (temp ==
"true" || temp ==
"TRUE");
382 else if(command == dumpCutValuesCmd)
395 if(command == setCutCmd)
399 else if(command == verboseCmd)
403 else if(command == addProcManCmd)
415 else if(command == buildPTCmd)
427 else if(command == storeCmd)
431 else if(command == retrieveCmd)
442 else if(command == asciiCmd)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
void reset(G4bool ifSkipIon=true)
static G4ParticleTable * GetParticleTable()
static G4PhysicsListHelper * GetPhysicsListHelper()
void DumpOrdingParameterTable(G4int subType=-1) const
void SetDefaultValue(G4double defVal)
void SetDefaultUnit(const char *defUnit)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetToBeBroadcasted(G4bool val)
static G4String CategoryOf(const char *unitName)
static G4double ValueOf(const char *unitName)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
static G4String UnitsList(const char *unitCategory)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
void SetDefaultUnit(const char *theDefaultUnit)
virtual G4String GetCurrentValue(G4UIcommand *command)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
G4VUserPhysicsList * thePhysicsList
virtual ~G4UserPhysicsListMessenger()
G4double GetCutValue(const G4String &pname) const
void SetDefaultCutValue(G4double newCutValue)
void SetPhysicsTableRetrieved(const G4String &directory="")
void PreparePhysicsTable(G4ParticleDefinition *)
void SetCutValue(G4double aCut, const G4String &pname)
G4bool IsStoredInAscii() const
void ResetStoredInAscii()
void SetCutsForRegion(G4double aCut, const G4String &rname)
G4bool StorePhysicsTable(const G4String &directory=".")
void SetVerboseLevel(G4int value)
G4int GetVerboseLevel() const
void SetApplyCuts(G4bool value, const G4String &name)
const G4String & GetPhysicsTableDirectory() const
G4bool IsPhysicsTableRetrieved() const
void DumpCutValuesTable(G4int flag=1)
void AddProcessManager(G4ParticleDefinition *newParticle, G4ProcessManager *newManager=0)
void ResetPhysicsTableRetrieved()
G4double GetDefaultCutValue() const