Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
IORTPrimaryGeneratorMessenger Class Reference

#include <IORTPrimaryGeneratorMessenger.hh>

Inheritance diagram for IORTPrimaryGeneratorMessenger:
G4UImessenger

Public Member Functions

 IORTPrimaryGeneratorMessenger (IORTPrimaryGeneratorAction *)
 
 ~IORTPrimaryGeneratorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 

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
 

Detailed Description

Definition at line 51 of file IORTPrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

IORTPrimaryGeneratorMessenger::IORTPrimaryGeneratorMessenger ( IORTPrimaryGeneratorAction IORTGun)

Definition at line 47 of file IORTPrimaryGeneratorMessenger.cc.

References G4State_Idle, and G4State_PreInit.

49 :IORTAction(IORTGun)
50 {
51  //
52  // Definition of the interactive commands to modify the parameters of the
53  // generation of primary particles
54  //
55  beamParametersDir = new G4UIdirectory("/beam/");
56  beamParametersDir -> SetGuidance("set parameters of beam");
57 
58  EnergyDir = new G4UIdirectory("/beam/energy/");
59  EnergyDir -> SetGuidance ("set energy of beam");
60 
61  particlePositionDir = new G4UIdirectory("/beam/position/");
62  particlePositionDir -> SetGuidance ("set position of particle");
63 
64 
65 
66 
67  MomentumDir = new G4UIdirectory("/beam/momentum/");
68  MomentumDir -> SetGuidance ("set momentum of particle ");
69 
70 
71  ThetaCmd = new G4UIcmdWithADoubleAndUnit("/beam/momentum/Theta",this);
72  ThetaCmd -> SetGuidance("set Theta");
73  ThetaCmd -> SetParameterName("Theta",false);
74  ThetaCmd -> SetDefaultUnit("deg");
75  ThetaCmd -> SetUnitCandidates("deg rad");
76  ThetaCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
77 
78 
79 /*
80  sigmaMomentumYCmd = new G4UIcmdWithADouble("/beam/momentum/sigmaY",this);
81  sigmaMomentumYCmd -> SetGuidance("set sigma momentum y");
82  sigmaMomentumYCmd -> SetParameterName("momentum",false);
83  sigmaMomentumYCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
84 
85  sigmaMomentumZCmd = new G4UIcmdWithADouble("/beam/momentum/sigmaZ",this);
86  sigmaMomentumZCmd -> SetGuidance("set sigma momentum z");
87  sigmaMomentumZCmd -> SetParameterName("momentum",false);
88  sigmaMomentumZCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
89  */
90  meanKineticEnergyCmd = new G4UIcmdWithADoubleAndUnit("/beam/energy/meanEnergy",this);
91  meanKineticEnergyCmd -> SetGuidance("set mean Kinetic energy");
92  meanKineticEnergyCmd -> SetParameterName("Energy",false);
93  meanKineticEnergyCmd -> SetDefaultUnit("MeV");
94  meanKineticEnergyCmd -> SetUnitCandidates("eV keV MeV GeV TeV");
95  meanKineticEnergyCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
96 
97  sigmaEnergyCmd = new G4UIcmdWithADoubleAndUnit("/beam/energy/sigmaEnergy",this);
98  sigmaEnergyCmd -> SetGuidance("set sigma energy");
99  sigmaEnergyCmd -> SetParameterName("Energy",false);
100  sigmaEnergyCmd -> SetDefaultUnit("keV");
101  sigmaEnergyCmd -> SetUnitCandidates("eV keV MeV GeV TeV");
102  sigmaEnergyCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
103 
104  XpositionCmd = new G4UIcmdWithADoubleAndUnit("/beam/position/Xposition",this);
105  XpositionCmd -> SetGuidance("set x coordinate of particle");
106  XpositionCmd -> SetParameterName("position",false);
107  XpositionCmd -> SetDefaultUnit("mm");
108  XpositionCmd -> SetUnitCandidates("mm cm m");
109  XpositionCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
110 
111  YpositionCmd = new G4UIcmdWithADoubleAndUnit("/beam/position/Yposition",this);
112  YpositionCmd -> SetGuidance("set y coordinate of particle");
113  YpositionCmd -> SetParameterName("position",false);
114  YpositionCmd -> SetDefaultUnit("mm");
115  YpositionCmd -> SetUnitCandidates("mm cm m");
116  YpositionCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
117 
118  sigmaYCmd = new G4UIcmdWithADoubleAndUnit("/beam/position/Yposition/sigmaY",this);
119  sigmaYCmd -> SetGuidance("set sigma y");
120  sigmaYCmd -> SetParameterName("position",false);
121  sigmaYCmd -> SetDefaultUnit("mm");
122  sigmaYCmd -> SetUnitCandidates("mm cm m");
123  sigmaYCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
124 
125  ZpositionCmd = new G4UIcmdWithADoubleAndUnit("/beam/position/Zposition",this);
126  ZpositionCmd -> SetGuidance("set z coordinate of particle");
127  ZpositionCmd -> SetParameterName("position",false);
128  ZpositionCmd -> SetDefaultUnit("mm");
129  ZpositionCmd -> SetUnitCandidates("mm cm m");
130  ZpositionCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
131 
132  sigmaZCmd = new G4UIcmdWithADoubleAndUnit("/beam/position/Zposition/sigmaZ",this);
133  sigmaZCmd -> SetGuidance("set sigma z");
134  sigmaZCmd -> SetParameterName("position",false);
135  sigmaZCmd -> SetDefaultUnit("mm");
136  sigmaZCmd -> SetUnitCandidates("mm cm m");
137  sigmaZCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
138 }
IORTPrimaryGeneratorMessenger::~IORTPrimaryGeneratorMessenger ( )

Definition at line 140 of file IORTPrimaryGeneratorMessenger.cc.

141 {
142  delete beamParametersDir;
143  delete EnergyDir;
144  delete meanKineticEnergyCmd;
145  delete sigmaEnergyCmd;
146  delete particlePositionDir;
147  delete MomentumDir;
148  delete XpositionCmd;
149  delete YpositionCmd;
150  delete ZpositionCmd;
151  delete sigmaYCmd;
152  delete sigmaZCmd;
153  delete ThetaCmd;
154 // delete sigmaMomentumYCmd;
155 // delete sigmaMomentumZCmd;
156 }

Member Function Documentation

void IORTPrimaryGeneratorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 158 of file IORTPrimaryGeneratorMessenger.cc.

159 {
160  if ( command == meanKineticEnergyCmd )
161  { IORTAction -> SetmeanKineticEnergy(meanKineticEnergyCmd
162  -> GetNewDoubleValue(newValue));}
163  if ( command == sigmaEnergyCmd )
164  { IORTAction -> SetsigmaEnergy(sigmaEnergyCmd
165  -> GetNewDoubleValue(newValue));}
166  if ( command == XpositionCmd )
167  { IORTAction -> SetXposition(XpositionCmd
168  -> GetNewDoubleValue(newValue));}
169 
170  if ( command == YpositionCmd )
171  { IORTAction -> SetYposition(YpositionCmd
172  -> GetNewDoubleValue(newValue));}
173 
174  if ( command == ZpositionCmd )
175  { IORTAction -> SetZposition(ZpositionCmd
176  -> GetNewDoubleValue(newValue));}
177 
178  if ( command == sigmaYCmd )
179  { IORTAction -> SetsigmaY(sigmaYCmd
180  -> GetNewDoubleValue(newValue));}
181 
182  if ( command == sigmaZCmd )
183  { IORTAction -> SetsigmaZ(sigmaZCmd
184  -> GetNewDoubleValue(newValue));}
185 
186 if ( command == ThetaCmd )
187  { IORTAction -> SetTheta(ThetaCmd
188  -> GetNewDoubleValue(newValue));}
189 
190 
191 /*
192  if ( command == sigmaMomentumYCmd )
193  { IORTAction -> SetsigmaMomentumY(sigmaMomentumYCmd
194  -> GetNewDoubleValue(newValue));}
195 
196  if ( command == sigmaMomentumZCmd )
197  { IORTAction -> SetsigmaMomentumZ(sigmaMomentumZCmd
198  -> GetNewDoubleValue(newValue));}
199 */
200 }

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