57 G4UserPhysicsListMessenger::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. ");
128 addProcManCmd->
SetGuidance(
"add process manager to specified particle type");
135 buildPTCmd->
SetGuidance(
"build physics table of specified particle type");
150 retrieveCmd->
SetGuidance(
"Retrieve Physics Table");
151 retrieveCmd->
SetGuidance(
" Enter directory name or OFF to switch off");
158 asciiCmd->
SetGuidance(
"Switch on/off ascii mode in store/retreive Physics Table");
159 asciiCmd->
SetGuidance(
" Enter 0(binary) or 1(ascii)");
163 asciiCmd->
SetRange(
"ascii ==0 || ascii ==1");
166 applyCutsCmd =
new G4UIcommand(
"/run/particle/applyCuts",
this);
167 applyCutsCmd->
SetGuidance(
"Set applyCuts flag for a particle.");
168 applyCutsCmd->
SetGuidance(
" Some EM processes which do not have infrared divergence");
169 applyCutsCmd->
SetGuidance(
"may generate gamma, e- and/or e+ with kinetic energies");
170 applyCutsCmd->
SetGuidance(
"below the production threshold. By setting this flag,");
171 applyCutsCmd->
SetGuidance(
"such secondaries below threshold are eliminated and");
172 applyCutsCmd->
SetGuidance(
"kinetic energies of such secondaries are accumulated");
173 applyCutsCmd->
SetGuidance(
"to the energy deposition of their mother.");
174 applyCutsCmd->
SetGuidance(
" Note that 'applyCuts' makes sense only for gamma,");
175 applyCutsCmd->
SetGuidance(
"e- and e+. If this command is issued for other particle,");
176 applyCutsCmd->
SetGuidance(
"a warning message is displayed and the command is");
178 applyCutsCmd->
SetGuidance(
" If particle name is 'all', this command affects on");
190 dumpCutValuesCmd->
SetGuidance(
"Dump a list of production threshold values in range and energy");
191 dumpCutValuesCmd->
SetGuidance(
"for all registered material-cuts-couples.");
192 dumpCutValuesCmd->
SetGuidance(
"Dumping a list takes place when you issue 'beamOn' and");
193 dumpCutValuesCmd->
SetGuidance(
"actual conversion tables from range to energy are available.");
194 dumpCutValuesCmd->
SetGuidance(
"If you want a list 'immediately', use '/run/dumpRegion' for threshold");
195 dumpCutValuesCmd->
SetGuidance(
"list given in gange only. Also, '/run/dumpCouples' gives you the");
196 dumpCutValuesCmd->
SetGuidance(
"current list if you have already issued 'run/beamOn' at least once.");
203 dumpOrdParamCmd->
SetGuidance(
"Dump a list of ordering parameter ");
213 delete setCutForAGivenParticleCmd;
214 delete getCutForAGivenParticleCmd;
217 delete addProcManCmd;
223 delete dumpCutValuesCmd;
224 delete dumpOrdParamCmd;
230 if( command==setCutCmd ){
235 }
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;
256 }
else if( command==verboseCmd ) {
259 }
else if( command==dumpListCmd ){
262 }
else if( command==dumpOrdParamCmd ){
266 }
else if( command == addProcManCmd ){
268 if (particle == 0)
return;
272 }
else if( command == buildPTCmd ){
274 if (particle == 0)
return;
278 }
else if ( command == storeCmd ){
281 }
else if( command == retrieveCmd ) {
282 if ((newValue ==
"OFF") || (newValue ==
"off") ){
288 }
else if( command == asciiCmd ) {
295 }
else if( command == applyCutsCmd ) {
300 G4bool flag = (temp ==
"true" || temp==
"TRUE");
307 }
else if( command == dumpCutValuesCmd ) {
319 if( command==setCutCmd ) {
322 }
else if( command==verboseCmd ){
325 }
else if( command== addProcManCmd ){
335 }
else if( command== buildPTCmd ){
345 }
else if ( command == storeCmd ){
348 }
else if( command == retrieveCmd ) {
355 }
else if( command==asciiCmd ){
G4double GetCutValue(const G4String &pname) const
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultCutValue(G4double newCutValue)
void SetParameter(G4UIparameter *const newParameter)
void SetApplyCuts(G4bool value, const G4String &name)
void SetDefaultValue(G4double defVal)
void SetCutValue(G4double aCut, const G4String &pname)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void PreparePhysicsTable(G4ParticleDefinition *)
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
const G4String & GetPhysicsTableDirectory() const
void SetToBeBroadcasted(G4bool val)
void SetDefaultValue(const char *theDefaultValue)
static G4String ConvertToString(G4bool boolVal)
void ResetPhysicsTableRetrieved()
void SetCutsForRegion(G4double aCut, const G4String &rname)
static G4double GetNewDoubleValue(const char *paramString)
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4int GetVerboseLevel() const
void DumpOrdingParameterTable(G4int subType=-1) const
void SetPhysicsTableRetrieved(const G4String &directory="")
void DumpCutValuesTable(G4int flag=1)
void AddProcessManager(G4ParticleDefinition *newParticle, G4ProcessManager *newManager=0)
G4double GetDefaultCutValue() const
G4GLOB_DLL std::ostream G4cout
static G4String UnitsList(const char *unitCategory)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
void SetRange(const char *rs)
void SetGuidance(const char *aGuidance)
void SetVerboseLevel(G4int value)
G4bool IsPhysicsTableRetrieved() const
void AvailableForStates(G4ApplicationState s1)
G4bool StorePhysicsTable(const G4String &directory=".")
static G4ParticleTable * GetParticleTable()
void SetDefaultValue(const char *defVal)
static G4double ValueOf(const char *unitName)
void SetDefaultUnit(const char *defUnit)
static G4PhysicsListHelper * GetPhysicsListHelper()
G4bool IsStoredInAscii() const
void SetCandidates(const char *candidateList)
virtual G4String GetCurrentValue(G4UIcommand *command)
void SetDefaultValue(G4int defVal)
void ResetStoredInAscii()
virtual ~G4UserPhysicsListMessenger()
static G4String CategoryOf(const char *unitName)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4VUserPhysicsList * thePhysicsList