Geant4  10.01
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 //
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 //
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 // Version 3.0, Aug-Oct 2014, Andrea Dotti
49 // Transformations for thread safety and use in MT application
50 // Messenger is now a singleton w/ explicit Destroy() method for deletion
51 // Note the following: the class should be instantiated only once
52 // by a worker thread. It relies on a new feature of basic messenger class
53 // that allows for UI commands to be created by worker threads but being
54 // executed by master thread. For this reason the messenger itself should
55 // be created once, form here the singleton pattern
57 //
58 //
59 // Class Description:
60 //
61 // The function of the G4GeneralParticleSourceMessenger is to allow the user to
62 // enter commands either in interactive command line mode or through macros to
63 // control the G4GeneralParticleSource.
64 //
66 //
67 // MEMBER FUNCTIONS
68 // ----------------
69 //
70 // G4GeneralParticleSourceMessenger(G4GeneralParticleSource *fPtclGun)
71 // Constructor: Sets up commands.
72 //
73 // ~G4GeneralParticleSourceMessenger()
74 // Destructor: Deletes commands.
75 //
76 // void SetParticleGun(G4SingleParticleSource *fpg) { fParticleGun = fpg; } ;
77 // To selecte the particle gun to be defined/modified.
78 // void SetNewValue(G4UIcommand *command, G4String newValues)
79 // Uses the appropriate methods in the G4GeneralParticleSource to carry out
80 // the user commands.
81 // G4String GetCurrentValue(G4UIcommand *command)
82 // Allows the user to retrieve the current values of parameters.
83 // Not implemented yet.
84 //
86 //
87 #ifndef G4GeneralParticleSourceMessenger_h
88 #define G4GeneralParticleSourceMessenger_h 1
89 
90 #include "G4UImessenger.hh"
91 #include "globals.hh"
92 
93 class G4ParticleTable;
94 class G4UIcommand;
95 class G4UIdirectory;
97 class G4UIcmdWithAString;
99 class G4UIcmdWith3Vector;
102 class G4UIcmdWithADouble;
103 class G4UIcmdWithABool;
105 
108 
110 {
111  public:
112 
114  // Select the particle gun to be defined/modified
115 
116  void SetNewValue(G4UIcommand *command, G4String newValues);
117  // Identifies the command which has been invoked by the user, extracts the
118  // parameters associated with that command (held in newValues), and uses
119  // these values with the appropriate member function of G4GeneralParticleSource.
120 
122 
124  static void Destroy();
125  private:
128 
129  void IonCommand(G4String newValues);
130  void IonLvlCommand(G4String newValues);
131 
132  private:
137 
138  private: //commands
140 
141  // multiple source control commands
152 
153  // positional commands
172 
173  //old ones, will be reomved soon
191 
192  // angular commands
207 
208  // old ones, will be removed soon
221 
222  // energy commands
238 
239  // old ones, will be removed soon
253 
254  // histogram commands
260  // old ones, will be removed soon
266 
268 
269  // Commands from G4ParticleGun
280 
281  private: // for ion shooting
287 
293 };
294 
295 #endif
296 
static G4GeneralParticleSourceMessenger * GetInstance(G4GeneralParticleSource *)
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