Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
extended
electromagnetic
TestEm10
src
Em10PrimaryGeneratorMessenger.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
//
28
//
29
//
30
// $Id$
31
//
32
//
33
34
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
35
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
36
37
#include "
Em10PrimaryGeneratorMessenger.hh
"
38
39
#include "
Em10PrimaryGeneratorAction.hh
"
40
#include "
G4UIcmdWithAString.hh
"
41
#include "
G4UIcmdWithADoubleAndUnit.hh
"
42
#include "
G4SystemOfUnits.hh
"
43
44
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45
46
Em10PrimaryGeneratorMessenger::Em10PrimaryGeneratorMessenger
(
Em10PrimaryGeneratorAction
* Em10Gun)
47
:Em10Action(Em10Gun)
48
{
49
RndmCmd =
new
G4UIcmdWithAString
(
"/gun/random"
,
this
);
50
RndmCmd->
SetGuidance
(
"Shoot randomly the incident particle."
);
51
RndmCmd->
SetGuidance
(
" Choice : on, off(default)"
);
52
RndmCmd->
SetParameterName
(
"choice"
,
true
);
53
RndmCmd->
SetDefaultValue
(
"off"
);
54
RndmCmd->
SetCandidates
(
"on off"
);
55
RndmCmd->
AvailableForStates
(
G4State_PreInit
,
G4State_Idle
);
56
57
setxvertexCmd =
new
G4UIcmdWithADoubleAndUnit
(
"/gun/xvertex"
,
this
);
58
setxvertexCmd->
SetGuidance
(
" Set x coord. of the primary vertex."
);
59
setxvertexCmd->
SetParameterName
(
"xv"
,
true
);
60
setxvertexCmd->
SetDefaultValue
(0.0*
mm
) ;
61
62
setyvertexCmd =
new
G4UIcmdWithADoubleAndUnit
(
"/gun/yvertex"
,
this
);
63
setyvertexCmd->
SetGuidance
(
" Set y coord. of the primary vertex."
);
64
setyvertexCmd->
SetParameterName
(
"yv"
,
true
);
65
setyvertexCmd->
SetDefaultValue
(0.0*
mm
) ;
66
67
setzvertexCmd =
new
G4UIcmdWithADoubleAndUnit
(
"/gun/zvertex"
,
this
);
68
setzvertexCmd->
SetGuidance
(
" Set z coord. of the primary vertex."
);
69
setzvertexCmd->
SetParameterName
(
"zv"
,
true
);
70
setzvertexCmd->
SetDefaultValue
(0.0*
mm
) ;
71
72
}
73
74
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
75
76
Em10PrimaryGeneratorMessenger::~Em10PrimaryGeneratorMessenger
()
77
{
78
delete
RndmCmd;
79
delete
setxvertexCmd;
80
delete
setyvertexCmd;
81
delete
setzvertexCmd;
82
}
83
84
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85
86
void
Em10PrimaryGeneratorMessenger::SetNewValue
(
G4UIcommand
* command,
G4String
newValue)
87
{
88
if
( command == RndmCmd )
89
{ Em10Action->
SetRndmFlag
(newValue);}
90
if
( command == setxvertexCmd)
91
{ Em10Action->
Setxvertex
(setxvertexCmd->
GetNewDoubleValue
(newValue));}
92
if
( command == setyvertexCmd)
93
{ Em10Action->
Setyvertex
(setyvertexCmd->
GetNewDoubleValue
(newValue));}
94
if
( command == setzvertexCmd)
95
{ Em10Action->
Setzvertex
(setzvertexCmd->
GetNewDoubleValue
(newValue));}
96
}
97
98
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
99
Generated on Sat May 25 2013 14:32:20 for Geant4 by
1.8.4