Geant4-11
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// G4GeneralParticleSourceMessenger
27//
28// Class Description:
29//
30// The function of the G4GeneralParticleSourceMessenger is to allow the user to
31// enter commands either in interactive command line mode or through macros to
32// control the G4GeneralParticleSource.
33
34// Author: Fan Lei, QinetiQ ltd.
35// Customer: ESA/ESTEC
36// History:
37// - Version 2.0, 05/02/2004, Fan Lei - Created.
38// Multiple particle source definition
39// - Version 2.1, 20/03/2014, Andrew Green - Modifications for MT
40// Added a check to force only one thread to parse the macro file.
41// This information is fed into the GPS which now has a split mechanism
42// for the large data (hence need to only read in 1 thread)
43// - Version 3.0, Aug-Oct 2014, Andrea Dotti
44// Transformations for thread safety and use in MT application
45// Messenger is now a singleton w/ explicit Destroy() method for deletion
46// Note the following: the class should be instantiated only once
47// by a worker thread. It relies on a new feature of basic messenger class
48// that allows for UI commands to be created by worker threads but being
49// executed by master thread. For this reason the messenger itself should
50// be created once, form here the singleton pattern
51// --------------------------------------------------------------------
52#ifndef G4GeneralParticleSourceMessenger_hh
53#define G4GeneralParticleSourceMessenger_hh 1
54
55#include "G4UImessenger.hh"
56#include "globals.hh"
57
58class G4ParticleTable;
59class G4UIcommand;
60class G4UIdirectory;
70
73
75{
76 public:
77
79 // Select the particle gun to be defined/modified
80
81 void SetNewValue(G4UIcommand* command, G4String newValues);
82 // Identifies the command which has been invoked by the user, extracts the
83 // parameters associated with that command (held in newValues), and uses
84 // these values with the appropriate member function of
85 // G4GeneralParticleSource
86
88 // Allows the user to retrieve the current values of parameters.
89 // NOT yet implemented!
90
92 static void Destroy();
93
94 private:
95
97 // Constructor: sets up commands
99 // Destructor: deletes commands
100
101 void IonCommand(G4String newValues);
102 void IonLvlCommand(G4String newValues);
103
104 private:
105
110
112
113 // Multiple source control commands
114 //
125
126 // Positional commands
127 //
146
147 // Angular commands
148 //
163
164 // Energy commands
165 //
182
183 // Histogram commands
184 //
191
193
194 // Commands from G4ParticleGun
195 //
206
207 // For ion shooting
208 //
210
215
220
242};
243
244#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4GeneralParticleSourceMessenger * GetInstance(G4GeneralParticleSource *)
void SetParticleGun(G4SingleParticleSource *fpg)
void SetNewValue(G4UIcommand *command, G4String newValues)
G4GeneralParticleSourceMessenger(G4GeneralParticleSource *)