59 :theParticleTable(pTable),
60 currentParticle(0), currentDecayTable(0),
61 idxCurrentChannel(-1), currentChannel(0),
62 thisDirectory(0),dumpCmd(0),selectCmd(0),brCmd(0)
69 thisDirectory =
new G4UIdirectory(
"/particle/property/decay/");
70 thisDirectory->
SetGuidance(
"Decay Table control commands.");
74 selectCmd->
SetGuidance(
"Enter index of decay mode.");
82 dumpCmd->
SetGuidance(
"Dump decay mode information.");
86 brCmd->
SetGuidance(
"Set branching ratio. [0< BR <1.0]");
88 brCmd->
SetRange(
"(br >=0.0) && (br <=1.0)");
102 if (SetCurrentParticle()==0) {
103 G4cout <<
"Particle is not selected yet !! Command ignored." <<
G4endl;
106 if (currentDecayTable==0) {
107 G4cout <<
"The particle has no decay table !! Command ignored." <<
G4endl;
111 if( command == dumpCmd ){
115 }
else if ( command == selectCmd ){
119 if ( currentChannel == 0 ) {
122 idxCurrentChannel = index;
126 if ( currentChannel == 0 ) {
127 G4cout <<
"Select a decay channel. Command ignored." <<
G4endl;
130 if (command == brCmd) {
133 if( (br<0.0) || (br>1.0) ) {
134 G4cout <<
"Invalid brancing ratio. Command ignored." <<
G4endl;
136 currentChannel->
SetBR(br);
151 if (currentParticle != 0 ){
154 currentParticle = theParticleTable->
FindParticle(particleName);
155 idxCurrentChannel = -1;
156 currentDecayTable = 0;
159 return currentParticle;
162 currentParticle = theParticleTable->
FindParticle(particleName);
163 idxCurrentChannel = -1;
164 currentDecayTable = 0;
167 if (currentParticle != 0 ){
169 if ((currentDecayTable != 0 ) && (idxCurrentChannel >0) ) {
170 currentChannel = currentDecayTable->
GetDecayChannel(idxCurrentChannel);
172 idxCurrentChannel = -1;
176 return currentParticle;
183 if (SetCurrentParticle()==0) {
188 if( command == selectCmd ){
192 }
else if( command == brCmd ){
193 if ( currentChannel != 0) {
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetBR(G4double value)
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
virtual G4String GetCurrentValue(G4UIcommand *command)
static G4String ConvertToString(G4bool boolVal)
G4VDecayChannel * GetDecayChannel(G4int index) const
const G4String & GetParticleName() const
static G4UImanager * GetUIpointer()
G4DecayTable * GetDecayTable() const
G4GLOB_DLL std::ostream G4cout
virtual ~G4DecayTableMessenger()
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
void SetGuidance(const char *aGuidance)
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
static G4ParticleTable * GetParticleTable()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
G4DecayTableMessenger(G4ParticleTable *pTable=0)