Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GammaRayTelPrimaryGeneratorMessenger.cc
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 // $Id: GammaRayTelPrimaryGeneratorMessenger.cc 66508 2012-12-19 10:16:45Z gcosmo $
28 // ------------------------------------------------------------
29 // GEANT 4 class implementation file
30 // CERN Geneva Switzerland
31 //
32 //
33 // ------------ GammaRayTelPrimaryGeneratorMessenger ------
34 // by G.Santin, F.Longo & R.Giannitrapani (13 nov 2000)
35 //
36 // ************************************************************
37 
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
40 
42 
44 #include "G4SystemOfUnits.hh"
45 #include "G4UIcmdWithAnInteger.hh"
46 #include "G4UIcmdWithAString.hh"
48 #include "G4UIcmdWithABool.hh"
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
54  :GammaRayTelAction(GammaRayTelGun)
55 {
56  RndmCmd = new G4UIcmdWithAString("/gun/random",this);
57  RndmCmd->SetGuidance("Shoot randomly the incident particle.");
58  RndmCmd->SetGuidance(" Choice : on(default), off");
59  RndmCmd->SetParameterName("choice",true);
60  RndmCmd->SetDefaultValue("on");
61  RndmCmd->SetCandidates("on off");
62  RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
63 
64  SourceTypeCmd = new G4UIcmdWithAnInteger("/gun/sourceType",this);
65  SourceTypeCmd->SetGuidance("Select the type of incident flux.");
66  SourceTypeCmd->SetGuidance(" Choice : 0(default), 1(isotropic), 2(wide parallel beam)");
67  SourceTypeCmd->SetParameterName("choice",true);
68  SourceTypeCmd->SetDefaultValue((G4int)0);
69  SourceTypeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
70 
71  VertexRadiusCmd = new G4UIcmdWithADoubleAndUnit("/gun/vertexRadius",this);
72  VertexRadiusCmd->SetGuidance("Radius (and unit) of sphere for vertices of incident flux.");
73  VertexRadiusCmd->SetParameterName("choice",true);
74  VertexRadiusCmd->SetDefaultValue((G4double)1.*cm);
75  VertexRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
76 
77  SpectrumTypeCmd = new G4UIcmdWithAnInteger("/gun/spectrumType",this);
78  SpectrumTypeCmd->SetGuidance("Select the type of incident spectrum.");
79  SpectrumTypeCmd->SetGuidance(" Choice : 0(default), 1(), 2(E^{-gamma}), 3()");
80  SpectrumTypeCmd->SetParameterName("choice",true);
81  SpectrumTypeCmd->SetDefaultValue((G4int)0);
82  SpectrumTypeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
83 
84 
85  SourceGenCmd = new G4UIcmdWithABool("/gun/sourceGen",this);
86  SourceGenCmd->SetGuidance("Select the native Generation");
87  SourceGenCmd->SetGuidance(" Choice : true(native), false(GPS)");
88  SourceGenCmd->SetParameterName("choice",true);
89  SourceGenCmd->SetDefaultValue((G4bool)true);
90  SourceGenCmd->AvailableForStates(G4State_PreInit);
91 
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
95 
97 {
98  delete RndmCmd;
99  delete SourceTypeCmd;
100  delete VertexRadiusCmd;
101  delete SpectrumTypeCmd;
102  delete SourceGenCmd;
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
106 
108 {
109  if( command == RndmCmd )
110  { GammaRayTelAction->SetRndmFlag(newValue);}
111 
112  if( command == SourceTypeCmd )
113  { GammaRayTelAction->SetSourceType(SourceTypeCmd->GetNewIntValue(newValue));}
114 
115  if( command == VertexRadiusCmd )
116  { GammaRayTelAction->SetVertexRadius(VertexRadiusCmd->GetNewDoubleValue(newValue));}
117 
118  if( command == SpectrumTypeCmd )
119  { GammaRayTelAction->SetSpectrumType(SpectrumTypeCmd->GetNewIntValue(newValue));}
120 
121  if( command == SourceGenCmd )
122  { GammaRayTelAction->SetSourceGen(SourceGenCmd->GetNewBoolValue(newValue));}
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
int G4int
Definition: G4Types.hh:78
static G4bool GetNewBoolValue(const char *paramString)
GammaRayTelPrimaryGeneratorMessenger(GammaRayTelPrimaryGeneratorAction *)
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76