49 : thePhysicsList(pParticleList)
54 theDirectory->
SetGuidance(
"Commands for G4VUserPhysicsList.");
58 verboseCmd->
SetGuidance(
"Set the Verbose level of G4VUserPhysicsList.");
60 verboseCmd->
SetGuidance(
" 1 : Display warning messages");
64 verboseCmd->
SetRange(
"level >=0 && level <=3");
76 setCutForAGivenParticleCmd =
new G4UIcommand(
"/run/setCutForAGivenParticle",
this);
77 setCutForAGivenParticleCmd->
SetGuidance(
"Set a cut value to a specific particle ");
78 setCutForAGivenParticleCmd->
SetGuidance(
"Usage: /run/setCutForAGivenParticle gamma 1. mm");
92 getCutForAGivenParticleCmd =
new G4UIcmdWithAString(
"/run/getCutForAGivenParticle",
this);
93 getCutForAGivenParticleCmd->
SetGuidance(
"Get a cut value to a specific particle ");
94 getCutForAGivenParticleCmd->
SetGuidance(
"Usage: /run/getCutForAGivenParticle gamma ");
96 getCutForAGivenParticleCmd->
SetCandidates(
"e- e+ gamma proton");
101 setCutRCmd =
new G4UIcommand(
"/run/setCutForRegion",
this);
102 setCutRCmd->
SetGuidance(
"Set cut value for a region");
116 dumpListCmd->
SetGuidance(
"Dump List of particles in G4VUserPhysicsList. ");
121 addProcManCmd->
SetGuidance(
"add process manager to specified particle type");
129 buildPTCmd->
SetGuidance(
"build physics table of specified particle type");
144 retrieveCmd->
SetGuidance(
"Retrieve Physics Table");
145 retrieveCmd->
SetGuidance(
" Enter directory name or OFF to switch off");
152 asciiCmd->
SetGuidance(
"Switch on/off ascii mode in store/retrieve Physics Table");
153 asciiCmd->
SetGuidance(
" Enter 0(binary) or 1(ascii)");
157 asciiCmd->
SetRange(
"ascii ==0 || ascii ==1");
160 applyCutsCmd =
new G4UIcommand(
"/run/particle/applyCuts",
this);
161 applyCutsCmd->
SetGuidance(
"Set applyCuts flag for a particle.");
162 applyCutsCmd->
SetGuidance(
" Some EM processes which do not have infrared divergence");
163 applyCutsCmd->
SetGuidance(
"may generate gamma, e- and/or e+ with kinetic energies");
164 applyCutsCmd->
SetGuidance(
"below the production threshold. By setting this flag,");
165 applyCutsCmd->
SetGuidance(
"such secondaries below threshold are eliminated and");
166 applyCutsCmd->
SetGuidance(
"kinetic energies of such secondaries are accumulated");
167 applyCutsCmd->
SetGuidance(
"to the energy deposition of their mother.");
168 applyCutsCmd->
SetGuidance(
" Note that 'applyCuts' makes sense only for gamma,");
169 applyCutsCmd->
SetGuidance(
"e- and e+. If this command is issued for other particle,");
170 applyCutsCmd->
SetGuidance(
"a warning message is displayed and the command is");
172 applyCutsCmd->
SetGuidance(
" If particle name is 'all', this command affects on");
184 dumpCutValuesCmd->
SetGuidance(
"Dump a list of production threshold values in range and energy");
185 dumpCutValuesCmd->
SetGuidance(
"for all registered material-cuts-couples.");
186 dumpCutValuesCmd->
SetGuidance(
"Dumping a list takes place when you issue 'beamOn' and");
187 dumpCutValuesCmd->
SetGuidance(
"actual conversion tables from range to energy are available.");
189 "If you want a list 'immediately', use '/run/dumpRegion' for threshold");
190 dumpCutValuesCmd->
SetGuidance(
"list given in range only. Also, '/run/dumpCouples' gives you the");
192 "current list if you have already issued 'run/beamOn' at least once.");
199 dumpOrdParamCmd->
SetGuidance(
"Dump a list of ordering parameter ");
210 delete setCutForAGivenParticleCmd;
211 delete getCutForAGivenParticleCmd;
214 delete addProcManCmd;
220 delete dumpCutValuesCmd;
221 delete dumpOrdParamCmd;
229 if (command == setCutCmd) {
234 else if (command == setCutForAGivenParticleCmd) {
237 std::istringstream str(newValue);
238 str >> particleName >> cut >> unit;
241 else if (command == getCutForAGivenParticleCmd) {
244 else if (command == setCutRCmd) {
245 std::istringstream is(newValue);
249 is >> regName >> cVal >> uniName;
251 ed <<
"illegal arguments : " << newValue;
257 else if (command == verboseCmd) {
260 else if (command == dumpListCmd) {
263 else if (command == dumpOrdParamCmd) {
267 else if (command == addProcManCmd) {
269 if (particle ==
nullptr) {
270 ed <<
" Particle is not found : " << newValue;
275 ed <<
" Particle is not initialized : " << newValue;
281 else if (command == buildPTCmd) {
283 if (particle ==
nullptr) {
284 ed <<
" Particle is not found : " << newValue;
291 else if (command == storeCmd) {
294 else if (command == retrieveCmd) {
295 if ((newValue ==
"OFF") || (newValue ==
"off")) {
302 else if (command == asciiCmd) {
310 else if (command == applyCutsCmd) {
315 G4bool flag = (temp ==
"true" || temp ==
"TRUE");
322 else if (command == dumpCutValuesCmd) {
334 if (command == setCutCmd) {
337 else if (command == verboseCmd) {
340 else if (command == addProcManCmd) {
350 else if (command == buildPTCmd) {
360 else if (command == storeCmd) {
363 else if (command == retrieveCmd) {
371 else if (command == asciiCmd) {
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4PTblDicIterator * GetIterator() const
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)
G4String GetCurrentValue(G4UIcommand *command) override
G4UserPhysicsListMessenger(G4VUserPhysicsList *pParticleList)
void SetNewValue(G4UIcommand *command, G4String newValues) override
G4VUserPhysicsList * thePhysicsList
~G4UserPhysicsListMessenger() override
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)
void AddProcessManager(G4ParticleDefinition *newParticle, G4ProcessManager *newManager=nullptr)
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 ResetPhysicsTableRetrieved()
G4double GetDefaultCutValue() const