Geant4  10.02.p03
G4DecayTableMessenger Class Reference

#include <G4DecayTableMessenger.hh>

Inheritance diagram for G4DecayTableMessenger:
Collaboration diagram for G4DecayTableMessenger:

Public Member Functions

 G4DecayTableMessenger (G4ParticleTable *pTable=0)
 
virtual ~G4DecayTableMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Member Functions

 G4DecayTableMessenger (const G4DecayTableMessenger &)
 
G4DecayTableMessengeroperator= (const G4DecayTableMessenger &)
 
G4ParticleDefinitionSetCurrentParticle ()
 

Private Attributes

G4ParticleTabletheParticleTable
 
G4ParticleDefinitioncurrentParticle
 
G4DecayTablecurrentDecayTable
 
G4int idxCurrentChannel
 
G4VDecayChannelcurrentChannel
 
G4UIdirectorythisDirectory
 
G4UIcmdWithoutParameterdumpCmd
 
G4UIcmdWithAnIntegerselectCmd
 
G4UIcmdWithADoublebrCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 67 of file G4DecayTableMessenger.hh.

Constructor & Destructor Documentation

◆ G4DecayTableMessenger() [1/2]

G4DecayTableMessenger::G4DecayTableMessenger ( G4ParticleTable pTable = 0)

Definition at line 58 of file G4DecayTableMessenger.cc.

59  :theParticleTable(pTable),
63 {
65 
66  currentParticle = 0;
67 
68  //Commnad /particle/property/decay/
69  thisDirectory = new G4UIdirectory("/particle/property/decay/");
70  thisDirectory->SetGuidance("Decay Table control commands.");
71 
72  //Commnad /particle/property/decay/select
73  selectCmd = new G4UIcmdWithAnInteger("/particle/property/decay/select",this);
74  selectCmd->SetGuidance("Enter index of decay mode.");
75  selectCmd->SetParameterName("mode", true);
77  selectCmd->SetRange("mode >=0");
78  currentChannel = 0;
79 
80  //Commnad /particle/property/decay/dump
81  dumpCmd = new G4UIcmdWithoutParameter("/particle/property/decay/dump",this);
82  dumpCmd->SetGuidance("Dump decay mode information.");
83 
84  //Command /particle/property/decay/br
85  brCmd = new G4UIcmdWithADouble("/particle/property/decay/br",this);
86  brCmd->SetGuidance("Set branching ratio. [0< BR <1.0]");
87  brCmd->SetParameterName("br",false);
88  brCmd->SetRange("(br >=0.0) && (br <=1.0)");
89 
90 }
G4ParticleDefinition * currentParticle
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithADouble * brCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
static G4ParticleTable * GetParticleTable()
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAnInteger * selectCmd
G4VDecayChannel * currentChannel
void SetDefaultValue(G4int defVal)
G4ParticleTable * theParticleTable
Here is the call graph for this function:

◆ ~G4DecayTableMessenger()

G4DecayTableMessenger::~G4DecayTableMessenger ( )
virtual

Definition at line 92 of file G4DecayTableMessenger.cc.

93 {
94  delete dumpCmd;
95  delete selectCmd;
96  delete brCmd;
97  delete thisDirectory;
98 }
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithADouble * brCmd
G4UIcmdWithAnInteger * selectCmd

◆ G4DecayTableMessenger() [2/2]

G4DecayTableMessenger::G4DecayTableMessenger ( const G4DecayTableMessenger )
inlineprivate

Definition at line 77 of file G4DecayTableMessenger.hh.

Member Function Documentation

◆ GetCurrentValue()

G4String G4DecayTableMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 179 of file G4DecayTableMessenger.cc.

180 {
181  G4String returnValue('\0');
182 
183  if (SetCurrentParticle()==0) {
184  // no particle is selected. return null
185  return returnValue;
186  }
187 
188  if( command == selectCmd ){
189  //Commnad /particle/property/decay/select
191 
192  } else if( command == brCmd ){
193  if ( currentChannel != 0) {
194  returnValue = brCmd->ConvertToString(currentChannel->GetBR());
195  }
196  }
197  return returnValue;
198 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4ParticleDefinition * SetCurrentParticle()
G4UIcmdWithADouble * brCmd
G4UIcmdWithAnInteger * selectCmd
G4VDecayChannel * currentChannel
G4double GetBR() const
Here is the call graph for this function:

◆ operator=()

G4DecayTableMessenger& G4DecayTableMessenger::operator= ( const G4DecayTableMessenger )
inlineprivate

Definition at line 78 of file G4DecayTableMessenger.hh.

78 { return *this;}
Here is the call graph for this function:

◆ SetCurrentParticle()

G4ParticleDefinition * G4DecayTableMessenger::SetCurrentParticle ( )
private

Definition at line 143 of file G4DecayTableMessenger.cc.

144 {
145  // set currentParticle pointer
146 
147  // get particle name by asking G4ParticleMessenger via UImanager
148 
149  G4String particleName = G4UImanager::GetUIpointer()->GetCurrentStringValue("/particle/select");
150 
151  if (currentParticle != 0 ){
152  // check whether selection is changed
153  if (currentParticle->GetParticleName() != particleName) {
155  idxCurrentChannel = -1;
156  currentDecayTable = 0;
157  } else {
158  // no change
159  return currentParticle;
160  }
161  } else {
163  idxCurrentChannel = -1;
164  currentDecayTable = 0;
165  }
166 
167  if (currentParticle != 0 ){
169  if ((currentDecayTable != 0 ) && (idxCurrentChannel >0) ) {
171  } else {
172  idxCurrentChannel = -1;
173  currentChannel = 0;
174  }
175  }
176  return currentParticle;
177 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleDefinition * currentParticle
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
const G4String & GetParticleName() const
G4DecayTable * GetDecayTable() const
G4VDecayChannel * GetDecayChannel(G4int index) const
G4VDecayChannel * currentChannel
G4ParticleTable * theParticleTable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNewValue()

void G4DecayTableMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 100 of file G4DecayTableMessenger.cc.

101 {
102  if (SetCurrentParticle()==0) {
103  G4cout << "Particle is not selected yet !! Command ignored." << G4endl;
104  return;
105  }
106  if (currentDecayTable==0) {
107  G4cout << "The particle has no decay table !! Command ignored." << G4endl;
108  return;
109  }
110 
111  if( command == dumpCmd ){
112  //Commnad /particle/property/decay/dump
114 
115  } else if ( command == selectCmd ){
116  //Commnad /particle/property/decay/select
117  G4int index = selectCmd->GetNewIntValue(newValue) ;
119  if ( currentChannel == 0 ) {
120  G4cout << "Invalid index. Command ignored." << G4endl;
121  } else {
123  }
124 
125  } else {
126  if ( currentChannel == 0 ) {
127  G4cout << "Select a decay channel. Command ignored." << G4endl;
128  return;
129  }
130  if (command == brCmd) {
131  //Commnad /particle/property/decay/br
132  G4double br = brCmd->GetNewDoubleValue(newValue);
133  if( (br<0.0) || (br>1.0) ) {
134  G4cout << "Invalid brancing ratio. Command ignored." << G4endl;
135  } else {
136  currentChannel->SetBR(br);
137  }
138  }
139  }
140 }
void SetBR(G4double value)
Int_t index
static G4int GetNewIntValue(const char *paramString)
G4ParticleDefinition * SetCurrentParticle()
int G4int
Definition: G4Types.hh:78
G4UIcmdWithoutParameter * dumpCmd
G4GLOB_DLL std::ostream G4cout
G4UIcmdWithADouble * brCmd
static G4double GetNewDoubleValue(const char *paramString)
void DumpInfo() const
G4VDecayChannel * GetDecayChannel(G4int index) const
G4UIcmdWithAnInteger * selectCmd
#define G4endl
Definition: G4ios.hh:61
G4VDecayChannel * currentChannel
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ brCmd

G4UIcmdWithADouble* G4DecayTableMessenger::brCmd
private

Definition at line 91 of file G4DecayTableMessenger.hh.

◆ currentChannel

G4VDecayChannel* G4DecayTableMessenger::currentChannel
private

Definition at line 86 of file G4DecayTableMessenger.hh.

◆ currentDecayTable

G4DecayTable* G4DecayTableMessenger::currentDecayTable
private

Definition at line 84 of file G4DecayTableMessenger.hh.

◆ currentParticle

G4ParticleDefinition* G4DecayTableMessenger::currentParticle
private

Definition at line 83 of file G4DecayTableMessenger.hh.

◆ dumpCmd

G4UIcmdWithoutParameter* G4DecayTableMessenger::dumpCmd
private

Definition at line 89 of file G4DecayTableMessenger.hh.

◆ idxCurrentChannel

G4int G4DecayTableMessenger::idxCurrentChannel
private

Definition at line 85 of file G4DecayTableMessenger.hh.

◆ selectCmd

G4UIcmdWithAnInteger* G4DecayTableMessenger::selectCmd
private

Definition at line 90 of file G4DecayTableMessenger.hh.

◆ theParticleTable

G4ParticleTable* G4DecayTableMessenger::theParticleTable
private

Definition at line 82 of file G4DecayTableMessenger.hh.

◆ thisDirectory

G4UIdirectory* G4DecayTableMessenger::thisDirectory
private

Definition at line 88 of file G4DecayTableMessenger.hh.


The documentation for this class was generated from the following files: