57G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(
G4VUserPhysicsList* pParticleList):thePhysicsList(pParticleList)
62 theDirectory->
SetGuidance(
"Commands for G4VUserPhysicsList.");
66 verboseCmd->
SetGuidance(
"Set the Verbose level of G4VUserPhysicsList.");
68 verboseCmd->
SetGuidance(
" 1 : Display warning messages");
72 verboseCmd->
SetRange(
"level >=0 && level <=3");
84 setCutForAGivenParticleCmd =
new G4UIcommand(
"/run/setCutForAGivenParticle",
this) ;
85 setCutForAGivenParticleCmd->
SetGuidance(
"Set a cut value to a specific particle ") ;
86 setCutForAGivenParticleCmd->
SetGuidance(
"Usage: /run/setCutForAGivenParticle gamma 1. mm") ;
100 getCutForAGivenParticleCmd =
new G4UIcmdWithAString(
"/run/getCutForAGivenParticle",
this) ;
101 getCutForAGivenParticleCmd->
SetGuidance(
"Get a cut value to a specific particle ") ;
102 getCutForAGivenParticleCmd->
SetGuidance(
"Usage: /run/getCutForAGivenParticle gamma ") ;
104 getCutForAGivenParticleCmd->
SetCandidates(
"e- e+ gamma proton");
108 setCutRCmd =
new G4UIcommand(
"/run/setCutForRegion",
this);
109 setCutRCmd->
SetGuidance(
"Set cut value for a region");
123 dumpListCmd->
SetGuidance(
"Dump List of particles in G4VUserPhysicsList. ");
127 addProcManCmd->
SetGuidance(
"add process manager to specified particle type");
134 buildPTCmd->
SetGuidance(
"build physics table of specified particle type");
149 retrieveCmd->
SetGuidance(
"Retrieve Physics Table");
150 retrieveCmd->
SetGuidance(
" Enter directory name or OFF to switch off");
157 asciiCmd->
SetGuidance(
"Switch on/off ascii mode in store/retreive Physics Table");
158 asciiCmd->
SetGuidance(
" Enter 0(binary) or 1(ascii)");
162 asciiCmd->
SetRange(
"ascii ==0 || ascii ==1");
165 applyCutsCmd =
new G4UIcommand(
"/run/particle/applyCuts",
this);
166 applyCutsCmd->
SetGuidance(
"Set applyCuts flag for a particle.");
167 applyCutsCmd->
SetGuidance(
" Some EM processes which do not have infrared divergence");
168 applyCutsCmd->
SetGuidance(
"may generate gamma, e- and/or e+ with kinetic energies");
169 applyCutsCmd->
SetGuidance(
"below the production threshold. By setting this flag,");
170 applyCutsCmd->
SetGuidance(
"such secondaries below threshold are eliminated and");
171 applyCutsCmd->
SetGuidance(
"kinetic energies of such secondaries are accumulated");
172 applyCutsCmd->
SetGuidance(
"to the energy deposition of their mother.");
173 applyCutsCmd->
SetGuidance(
" Note that 'applyCuts' makes sense only for gamma,");
174 applyCutsCmd->
SetGuidance(
"e- and e+. If this command is issued for other particle,");
175 applyCutsCmd->
SetGuidance(
"a warning message is displayed and the command is");
177 applyCutsCmd->
SetGuidance(
" If particle name is 'all', this command affects on");
189 dumpCutValuesCmd->
SetGuidance(
"Dump a list of production threshold values in range and energy");
190 dumpCutValuesCmd->
SetGuidance(
"for all registered material-cuts-couples.");
191 dumpCutValuesCmd->
SetGuidance(
"Dumping a list takes place when you issue 'beamOn' and");
192 dumpCutValuesCmd->
SetGuidance(
"actual conversion tables from range to energy are available.");
193 dumpCutValuesCmd->
SetGuidance(
"If you want a list 'immediately', use '/run/dumpRegion' for threshold");
194 dumpCutValuesCmd->
SetGuidance(
"list given in gange only. Also, '/run/dumpCouples' gives you the");
195 dumpCutValuesCmd->
SetGuidance(
"current list if you have already issued 'run/beamOn' at least once.");
202 dumpOrdParamCmd->
SetGuidance(
"Dump a list of ordering parameter ");
212 delete setCutForAGivenParticleCmd;
213 delete getCutForAGivenParticleCmd;
216 delete addProcManCmd;
222 delete dumpCutValuesCmd;
223 delete dumpOrdParamCmd;
229 if( command==setCutCmd ){
234 }
else if( command==setCutForAGivenParticleCmd ){
236 std::istringstream str (newValue) ;
237 str >> particleName >> cut >> unit ;
240 }
else if( command==getCutForAGivenParticleCmd ){
243 }
else if( command==setCutRCmd ){
244 std::istringstream is(newValue);
248 is >> regName >> cVal >> uniName;
255 }
else if( command==verboseCmd ) {
258 }
else if( command==dumpListCmd ){
261 }
else if( command==dumpOrdParamCmd ){
265 }
else if( command == addProcManCmd ){
267 if (particle == 0)
return;
271 }
else if( command == buildPTCmd ){
273 if (particle == 0)
return;
277 }
else if ( command == storeCmd ){
280 }
else if( command == retrieveCmd ) {
281 if ((newValue ==
"OFF") || (newValue ==
"off") ){
287 }
else if( command == asciiCmd ) {
294 }
else if( command == applyCutsCmd ) {
299 G4bool flag = (temp ==
"true" || temp==
"TRUE");
306 }
else if( command == dumpCutValuesCmd ) {
318 if( command==setCutCmd ) {
321 }
else if( command==verboseCmd ){
324 }
else if( command== addProcManCmd ){
334 }
else if( command== buildPTCmd ){
344 }
else if ( command == storeCmd ){
347 }
else if( command == retrieveCmd ) {
354 }
else if( command==asciiCmd ){
G4DLLIMPORT std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() 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)
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)
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)
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