48 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)");
86 if (SetCurrentParticle() ==
nullptr) {
87 G4cout <<
"Particle is not selected yet !! Command ignored." <<
G4endl;
90 if (currentDecayTable ==
nullptr) {
91 G4cout <<
"The particle has no decay table !! Command ignored." <<
G4endl;
95 if (command == dumpCmd) {
99 else if (command == selectCmd) {
103 if (currentChannel ==
nullptr) {
107 idxCurrentChannel = index;
111 if (currentChannel ==
nullptr) {
112 G4cout <<
"Select a decay channel. Command ignored." <<
G4endl;
115 if (command == brCmd) {
118 if ((br < 0.0) || (br > 1.0)) {
119 G4cout <<
"Invalid brancing ratio. Command ignored." <<
G4endl;
122 currentChannel->
SetBR(br);
135 if (currentParticle !=
nullptr) {
138 currentParticle = theParticleTable->
FindParticle(particleName);
139 idxCurrentChannel = -1;
140 currentDecayTable =
nullptr;
144 return currentParticle;
148 currentParticle = theParticleTable->
FindParticle(particleName);
149 idxCurrentChannel = -1;
150 currentDecayTable =
nullptr;
153 if (currentParticle !=
nullptr) {
155 if ((currentDecayTable !=
nullptr) && (idxCurrentChannel > 0)) {
156 currentChannel = currentDecayTable->
GetDecayChannel(idxCurrentChannel);
159 idxCurrentChannel = -1;
160 currentChannel =
nullptr;
164 return currentParticle;
171 if (SetCurrentParticle() ==
nullptr) {
176 if (command == selectCmd) {
180 else if (command == brCmd) {
181 if (currentChannel !=
nullptr) {
G4GLOB_DLL std::ostream G4cout
G4String GetCurrentValue(G4UIcommand *command) override
~G4DecayTableMessenger() override
G4DecayTableMessenger(G4ParticleTable *pTable=nullptr)
void SetNewValue(G4UIcommand *command, G4String newValues) override
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)