Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ProductionCutsTableMessenger Class Reference

#include <G4ProductionCutsTableMessenger.hh>

Inheritance diagram for G4ProductionCutsTableMessenger:
Collaboration diagram for G4ProductionCutsTableMessenger:

Public Member Functions

 G4ProductionCutsTableMessenger (G4ProductionCutsTable *pTable)
 
virtual ~G4ProductionCutsTableMessenger ()
 
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
 

Protected Attributes

G4ProductionCutsTabletheCutsTable
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

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)
 

Detailed Description

Definition at line 65 of file G4ProductionCutsTableMessenger.hh.

Constructor & Destructor Documentation

G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger ( G4ProductionCutsTable pTable)

Definition at line 51 of file G4ProductionCutsTableMessenger.cc.

52  :theCutsTable(pTable)
53 {
54  // /cuts/ directory
55  theDirectory = new G4UIdirectory("/cuts/");
56  theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
57 
58  // /cuts/verbose command
59  verboseCmd = new G4UIcmdWithAnInteger("/cuts/verbose",this);
60  verboseCmd->SetGuidance("Set the Verbose level of G4ProductionCutsTable.");
61  verboseCmd->SetGuidance(" 0 : Silent (default)");
62  verboseCmd->SetGuidance(" 1 : Display warning messages");
63  verboseCmd->SetGuidance(" 2 : Display more info");
64  verboseCmd->SetGuidance(" 2 : Display debug info");
65  verboseCmd->SetParameterName("level",true);
66  verboseCmd->SetDefaultValue(0);
67  verboseCmd->SetRange("level >=0 && level <=3");
68 
69  // /cuts/setLowEdge command
70  setLowEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setLowEdge",this);
71  setLowEdgeCmd->SetGuidance("Set low edge energy value ");
72  setLowEdgeCmd->SetParameterName("edge",false);
73  setLowEdgeCmd->SetDefaultValue(0.99);
74  setLowEdgeCmd->SetRange("edge >0.0");
75  setLowEdgeCmd->SetDefaultUnit("keV");
76  setLowEdgeCmd->AvailableForStates(G4State_PreInit);
77 
78  // /cuts/setHighEdge command
79  setHighEdgeCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setHighEdge",this);
80  setHighEdgeCmd->SetGuidance("Set high edge energy value ");
81  setHighEdgeCmd->SetParameterName("edge",false);
82  setHighEdgeCmd->SetDefaultValue(100.0);
83  setHighEdgeCmd->SetRange("edge >0.0");
84  setHighEdgeCmd->SetDefaultUnit("TeV");
85  setHighEdgeCmd->AvailableForStates(G4State_PreInit);
86 
87  // /cuts/setMaxCutEnergy command
88  setMaxEnergyCutCmd = new G4UIcmdWithADoubleAndUnit("/cuts/setMaxCutEnergy",this);
89  setMaxEnergyCutCmd->SetGuidance("Set maximum of cut energy value ");
90  setMaxEnergyCutCmd->SetParameterName("cut",false);
91  setMaxEnergyCutCmd->SetDefaultValue(10.0);
92  setMaxEnergyCutCmd->SetRange("cut >0.0");
93  setMaxEnergyCutCmd->SetDefaultUnit("GeV");
94  setMaxEnergyCutCmd->AvailableForStates(G4State_PreInit);
95 
96  // /cuts/dump command
97  dumpCmd = new G4UIcmdWithoutParameter("/cuts/dump",this);
98  dumpCmd->SetGuidance("Dump cuplues in ProductuinCutsTable. ");
99 
100 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

G4ProductionCutsTableMessenger::~G4ProductionCutsTableMessenger ( )
virtual

Definition at line 102 of file G4ProductionCutsTableMessenger.cc.

103 {
104  delete dumpCmd;
105  delete setMaxEnergyCutCmd;
106  delete setHighEdgeCmd;
107  delete setLowEdgeCmd;
108  delete verboseCmd;
109  delete theDirectory;
110 }

Member Function Documentation

G4String G4ProductionCutsTableMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 138 of file G4ProductionCutsTableMessenger.cc.

139 {
140  G4String cv;
141 
142  if( command==verboseCmd ){
143  cv = verboseCmd->ConvertToString(theCutsTable->GetVerboseLevel());
144 
145  } else if( command==setLowEdgeCmd ){
147  cv = setLowEdgeCmd->ConvertToString( lowEdge, "keV" );
148 
149  } else if( command==setHighEdgeCmd ){
151  cv = setHighEdgeCmd->ConvertToString( highEdge, "TeV" );
152 
153  } else if( command==setMaxEnergyCutCmd ){
155  cv = setMaxEnergyCutCmd->ConvertToString( cut, "GeV" );
156  }
157 
158 
159  return cv;
160 
161 }
G4double GetHighEdgeEnergy() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
G4double GetLowEdgeEnergy() const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 112 of file G4ProductionCutsTableMessenger.cc.

114 {
115  if( command==verboseCmd ) {
116  theCutsTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
117 
118  } else if( command==dumpCmd ){
119  theCutsTable-> DumpCouples();
120 
121  } else if( command==setLowEdgeCmd ){
122  G4double lowEdge = setLowEdgeCmd->GetNewDoubleValue(newValue);
124  theCutsTable->SetEnergyRange(lowEdge, highEdge);
125 
126  } else if( command==setHighEdgeCmd ){
127  G4double highEdge = setHighEdgeCmd->GetNewDoubleValue(newValue);
129  theCutsTable->SetEnergyRange(lowEdge, highEdge);
130 
131  } else if( command==setMaxEnergyCutCmd ){
132  G4double cut = setHighEdgeCmd->GetNewDoubleValue(newValue);
134 
135  }
136 }
G4double GetHighEdgeEnergy() const
void SetEnergyRange(G4double lowedge, G4double highedge)
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetVerboseLevel(G4int value)
G4double GetLowEdgeEnergy() const
double G4double
Definition: G4Types.hh:76
void SetMaxEnergyCut(G4double value)

Here is the call graph for this function:

Member Data Documentation

G4ProductionCutsTable* G4ProductionCutsTableMessenger::theCutsTable
protected

Definition at line 80 of file G4ProductionCutsTableMessenger.hh.


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