45 : theParticleTable(pTable)
47 if ( theParticleTable ==
nullptr )
51 currentParticle =
nullptr;
54 thisDirectory =
new G4UIdirectory(
"/particle/property/decay/");
55 thisDirectory->
SetGuidance(
"Decay Table control commands.");
59 selectCmd->
SetGuidance(
"Enter index of decay mode.");
63 currentChannel =
nullptr;
67 dumpCmd->
SetGuidance(
"Dump decay mode information.");
71 brCmd->
SetGuidance(
"Set branching ratio. [0< BR <1.0]");
73 brCmd->
SetRange(
"(br >=0.0) && (br <=1.0)");
78 if (dumpCmd !=
nullptr)
delete dumpCmd;
79 if (selectCmd !=
nullptr)
delete selectCmd;
80 if (brCmd !=
nullptr)
delete brCmd;
81 if (thisDirectory !=
nullptr)
delete thisDirectory;
86 if (SetCurrentParticle()==
nullptr)
88 G4cout <<
"Particle is not selected yet !! Command ignored." <<
G4endl;
91 if (currentDecayTable==
nullptr)
93 G4cout <<
"The particle has no decay table !! Command ignored." <<
G4endl;
97 if( command == dumpCmd )
103 else if ( command == selectCmd )
108 if ( currentChannel ==
nullptr )
114 idxCurrentChannel = index;
120 if ( currentChannel ==
nullptr )
122 G4cout <<
"Select a decay channel. Command ignored." <<
G4endl;
125 if (command == brCmd)
129 if( (br<0.0) || (br>1.0) )
131 G4cout <<
"Invalid brancing ratio. Command ignored." <<
G4endl;
135 currentChannel->
SetBR(br);
150 if (currentParticle !=
nullptr )
155 currentParticle = theParticleTable->
FindParticle(particleName);
156 idxCurrentChannel = -1;
157 currentDecayTable =
nullptr;
162 return currentParticle;
168 currentParticle = theParticleTable->
FindParticle(particleName);
169 idxCurrentChannel = -1;
170 currentDecayTable =
nullptr;
173 if (currentParticle !=
nullptr )
176 if ( (currentDecayTable !=
nullptr ) && (idxCurrentChannel >0) )
178 currentChannel = currentDecayTable->
GetDecayChannel(idxCurrentChannel);
182 idxCurrentChannel = -1;
183 currentChannel =
nullptr;
187 return currentParticle;
194 if (SetCurrentParticle() ==
nullptr)
200 if( command == selectCmd )
206 else if( command == brCmd )
208 if ( currentChannel !=
nullptr)
G4GLOB_DLL std::ostream G4cout
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
virtual ~G4DecayTableMessenger()
G4DecayTableMessenger(G4ParticleTable *pTable=nullptr)
virtual G4String GetCurrentValue(G4UIcommand *command)
G4VDecayChannel * GetDecayChannel(G4int index) const
G4DecayTable * GetDecayTable() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
static G4String ConvertToString(G4bool boolVal)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
static G4UImanager * GetUIpointer()
void SetBR(G4double value)