Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeneralParticleSourceMessenger.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 ///////////////////////////////////////////////////////////////////////////////
27 //
28 // MODULE: G4GeneralParticleSourceMessenger.hh
29 //
30 // Version: 2.0
31 // Date: 5/02/04
32 // Author: Fan Lei
33 // Organisation: QinetiQ ltd.
34 // Customer: ESA/ESTEC
35 //
36 ///////////////////////////////////////////////////////////////////////////////
37 //
38 // CHANGE HISTORY
39 // --------------
40 //
41 // Version 2.0, 05/02/2004, Fan Lei, Created.
42 // After changes to version 1.1 as in Geant4 v6.0
43 // - Mutilple particle source definition
44 // - Re-structured commands
45 // - old commonds have been retained for backward compatibility, will be
46 // removed in the future.
47 //
48 ///////////////////////////////////////////////////////////////////////////////
49 //
50 //
51 // Class Description:
52 //
53 // The function of the G4GeneralParticleSourceMessenger is to allow the user to
54 // enter commands either in interactive command line mode or through macros to
55 // control the G4GeneralParticleSource.
56 //
57 ///////////////////////////////////////////////////////////////////////////////
58 //
59 // MEMBER FUNCTIONS
60 // ----------------
61 //
62 // G4GeneralParticleSourceMessenger(G4GeneralParticleSource *fPtclGun)
63 // Constructor: Sets up commands.
64 //
65 // ~G4GeneralParticleSourceMessenger()
66 // Destructor: Deletes commands.
67 //
68 // void SetParticleGun(G4SingleParticleSource *fpg) { fParticleGun = fpg; } ;
69 // To selecte the particle gun to be defined/modified.
70 // void SetNewValue(G4UIcommand *command, G4String newValues)
71 // Uses the appropriate methods in the G4GeneralParticleSource to carry out
72 // the user commands.
73 // G4String GetCurrentValue(G4UIcommand *command)
74 // Allows the user to retrieve the current values of parameters.
75 // Not implemented yet.
76 //
77 ///////////////////////////////////////////////////////////////////////////////
78 //
79 #ifndef G4GeneralParticleSourceMessenger_h
80 #define G4GeneralParticleSourceMessenger_h 1
81 
82 #include "G4UImessenger.hh"
83 #include "globals.hh"
84 
85 class G4ParticleTable;
86 class G4UIcommand;
87 class G4UIdirectory;
89 class G4UIcmdWithAString;
91 class G4UIcmdWith3Vector;
94 class G4UIcmdWithADouble;
95 class G4UIcmdWithABool;
97 
100 
102 {
103  public:
106 
107  void SetParticleGun(G4SingleParticleSource *fpg) { fParticleGun = fpg; } ;
108  // Select the particle gun to be defined/modified
109 
110  void SetNewValue(G4UIcommand *command, G4String newValues);
111  // Identifies the command which has been invoked by the user, extracts the
112  // parameters associated with that command (held in newValues), and uses
113  // these values with the appropriate member function of G4GeneralParticleSource.
114 
116 
117  private:
118  void IonCommand(G4String newValues);
119  void IonLvlCommand(G4String newValues);
120 
121  private:
123  G4SingleParticleSource* fParticleGun;
124  G4ParticleTable* particleTable;
125  G4String histtype;
126 
127  private: //commands
128  G4UIdirectory* gpsDirectory;
129 
130  // multiple source control commands
131  G4UIdirectory *sourceDirectory;
132  G4UIcmdWithADouble *addsourceCmd;
133  G4UIcmdWithoutParameter *listsourceCmd;
134  G4UIcmdWithoutParameter *clearsourceCmd;
135  G4UIcmdWithoutParameter *getsourceCmd;
136  G4UIcmdWithAnInteger *setsourceCmd;
137  G4UIcmdWithADouble *setintensityCmd;
138  G4UIcmdWithAnInteger *deletesourceCmd;
139  G4UIcmdWithABool *multiplevertexCmd;
140  G4UIcmdWithABool *flatsamplingCmd;
141 
142  // positional commands
143  G4UIdirectory *positionDirectory;
144  G4UIcmdWithAString *typeCmd1;
145  G4UIcmdWithAString *shapeCmd1;
146  G4UIcmdWith3VectorAndUnit *centreCmd1;
147  G4UIcmdWith3Vector *posrot1Cmd1;
148  G4UIcmdWith3Vector *posrot2Cmd1;
149  G4UIcmdWithADoubleAndUnit *halfxCmd1;
150  G4UIcmdWithADoubleAndUnit *halfyCmd1;
151  G4UIcmdWithADoubleAndUnit *halfzCmd1;
152  G4UIcmdWithADoubleAndUnit *radiusCmd1;
153  G4UIcmdWithADoubleAndUnit *radius0Cmd1;
154  G4UIcmdWithADoubleAndUnit *possigmarCmd1;
155  G4UIcmdWithADoubleAndUnit *possigmaxCmd1;
156  G4UIcmdWithADoubleAndUnit *possigmayCmd1;
157  G4UIcmdWithADoubleAndUnit *paralpCmd1;
158  G4UIcmdWithADoubleAndUnit *partheCmd1;
159  G4UIcmdWithADoubleAndUnit *parphiCmd1;
160  G4UIcmdWithAString *confineCmd1;
161 
162  //old ones, will be reomved soon
163  G4UIcmdWithAString *typeCmd;
164  G4UIcmdWithAString *shapeCmd;
165  G4UIcmdWith3VectorAndUnit *centreCmd;
166  G4UIcmdWith3Vector *posrot1Cmd;
167  G4UIcmdWith3Vector *posrot2Cmd;
168  G4UIcmdWithADoubleAndUnit *halfxCmd;
169  G4UIcmdWithADoubleAndUnit *halfyCmd;
170  G4UIcmdWithADoubleAndUnit *halfzCmd;
171  G4UIcmdWithADoubleAndUnit *radiusCmd;
172  G4UIcmdWithADoubleAndUnit *radius0Cmd;
173  G4UIcmdWithADoubleAndUnit *possigmarCmd;
174  G4UIcmdWithADoubleAndUnit *possigmaxCmd;
175  G4UIcmdWithADoubleAndUnit *possigmayCmd;
176  G4UIcmdWithADoubleAndUnit *paralpCmd;
177  G4UIcmdWithADoubleAndUnit *partheCmd;
178  G4UIcmdWithADoubleAndUnit *parphiCmd;
179  G4UIcmdWithAString *confineCmd;
180 
181  // angular commands
182  G4UIdirectory* angularDirectory;
183  G4UIcmdWithAString *angtypeCmd1;
184  G4UIcmdWith3Vector *angrot1Cmd1;
185  G4UIcmdWith3Vector *angrot2Cmd1;
186  G4UIcmdWithADoubleAndUnit *minthetaCmd1;
187  G4UIcmdWithADoubleAndUnit *maxthetaCmd1;
188  G4UIcmdWithADoubleAndUnit *minphiCmd1;
189  G4UIcmdWithADoubleAndUnit *maxphiCmd1;
190  G4UIcmdWithADoubleAndUnit *angsigmarCmd1;
191  G4UIcmdWithADoubleAndUnit *angsigmaxCmd1;
192  G4UIcmdWithADoubleAndUnit *angsigmayCmd1;
193  G4UIcmdWith3VectorAndUnit *angfocusCmd;
194  G4UIcmdWithABool *useuserangaxisCmd1;
195  G4UIcmdWithABool *surfnormCmd1;
196 
197  // old ones, will be removed soon
198  G4UIcmdWithAString *angtypeCmd;
199  G4UIcmdWith3Vector *angrot1Cmd;
200  G4UIcmdWith3Vector *angrot2Cmd;
201  G4UIcmdWithADoubleAndUnit *minthetaCmd;
202  G4UIcmdWithADoubleAndUnit *maxthetaCmd;
203  G4UIcmdWithADoubleAndUnit *minphiCmd;
204  G4UIcmdWithADoubleAndUnit *maxphiCmd;
205  G4UIcmdWithADoubleAndUnit *angsigmarCmd;
206  G4UIcmdWithADoubleAndUnit *angsigmaxCmd;
207  G4UIcmdWithADoubleAndUnit *angsigmayCmd;
208  G4UIcmdWithABool *useuserangaxisCmd;
209  G4UIcmdWithABool *surfnormCmd;
210 
211  // energy commands
212  G4UIdirectory* energyDirectory;
213  G4UIcmdWithAString *energytypeCmd1;
214  G4UIcmdWithADoubleAndUnit *eminCmd1;
215  G4UIcmdWithADoubleAndUnit *emaxCmd1;
216  G4UIcmdWithADoubleAndUnit *monoenergyCmd1;
217  G4UIcmdWithADoubleAndUnit *engsigmaCmd1;
218  G4UIcmdWithADouble *alphaCmd1;
219  G4UIcmdWithADouble *tempCmd1;
220  G4UIcmdWithADouble *ezeroCmd1;
221  G4UIcmdWithADouble *gradientCmd1;
222  G4UIcmdWithADouble *interceptCmd1;
223  G4UIcmdWithADouble *arbeintCmd1;
224  G4UIcmdWithoutParameter *calculateCmd1;
225  G4UIcmdWithABool *energyspecCmd1;
226  G4UIcmdWithABool *diffspecCmd1;
227 
228  // old ones, will be removed soon
229  G4UIcmdWithAString *energytypeCmd;
230  G4UIcmdWithADoubleAndUnit *eminCmd;
231  G4UIcmdWithADoubleAndUnit *emaxCmd;
232  G4UIcmdWithADoubleAndUnit *monoenergyCmd;
233  G4UIcmdWithADoubleAndUnit *engsigmaCmd;
234  G4UIcmdWithADouble *alphaCmd;
235  G4UIcmdWithADouble *tempCmd;
236  G4UIcmdWithADouble *ezeroCmd;
237  G4UIcmdWithADouble *gradientCmd;
238  G4UIcmdWithADouble *interceptCmd;
239  G4UIcmdWithoutParameter *calculateCmd;
240  G4UIcmdWithABool *energyspecCmd;
241  G4UIcmdWithABool *diffspecCmd;
242 
243  // histogram commands
244  G4UIdirectory *histDirectory;
245  G4UIcmdWith3Vector *histpointCmd;
246  G4UIcmdWithAString *histnameCmd;
247  G4UIcmdWithAString *arbintCmd;
248  G4UIcmdWithAString *resethistCmd;
249  // old ones, will be removed soon
250  G4UIcmdWith3Vector *histpointCmd1;
251  G4UIcmdWithAString *histfileCmd1;
252  G4UIcmdWithAString *histnameCmd1;
253  G4UIcmdWithAString *arbintCmd1;
254  G4UIcmdWithAString *resethistCmd1;
255 
256  G4UIcmdWithAnInteger* verbosityCmd;
257 
258  // Commands from G4ParticleGun
259  G4UIcommand* ionCmd;
260  G4UIcommand* ionLvlCmd;
261  G4UIcmdWithAString* particleCmd;
262  G4UIcmdWithADoubleAndUnit* timeCmd;
263  G4UIcmdWith3Vector* polCmd;
264  G4UIcmdWithAnInteger* numberCmd;
265  G4UIcmdWith3VectorAndUnit* positionCmd;
266  G4UIcmdWith3Vector* directionCmd;
267  G4UIcmdWithADoubleAndUnit* energyCmd;
268  G4UIcmdWithoutParameter* listCmd;
269 
270  private: // for ion shooting
271  G4bool fShootIon;
272  G4int fAtomicNumber;
273  G4int fAtomicMass;
274  G4int fIonCharge;
275  G4double fIonExciteEnergy;
276 
277  G4bool fShootIonL;
278  G4int fAtomicNumberL;
279  G4int fAtomicMassL;
280  G4int fIonChargeL;
281  G4int fIonEnergyLevel;
282 };
283 
284 #endif
285 
void SetNewValue(G4UIcommand *command, G4String newValues)
int G4int
Definition: G4Types.hh:78
G4GeneralParticleSourceMessenger(G4GeneralParticleSource *)
bool G4bool
Definition: G4Types.hh:79
void SetParticleGun(G4SingleParticleSource *fpg)
double G4double
Definition: G4Types.hh:76