Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F03PrimaryGeneratorMessenger Class Reference

#include <F03PrimaryGeneratorMessenger.hh>

Inheritance diagram for F03PrimaryGeneratorMessenger:
Collaboration diagram for F03PrimaryGeneratorMessenger:

Public Member Functions

 F03PrimaryGeneratorMessenger (F03PrimaryGeneratorAction *)
 
virtual ~F03PrimaryGeneratorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 47 of file F03PrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

F03PrimaryGeneratorMessenger::F03PrimaryGeneratorMessenger ( F03PrimaryGeneratorAction action)

Definition at line 45 of file F03PrimaryGeneratorMessenger.cc.

47  : G4UImessenger(),
48  fAction(action),
49  fRndmCmd(0),
50  fSetXVertexCmd(0),
51  fSetYVertexCmd(0),
52  fSetZVertexCmd(0)
53 {
54  fRndmCmd = new G4UIcmdWithAString("/gun/random",this);
55  fRndmCmd->SetGuidance("Shoot randomly the incident particle.");
56  fRndmCmd->SetGuidance(" Choice : on, off(default)");
57  fRndmCmd->SetParameterName("choice",true);
58  fRndmCmd->SetDefaultValue("off");
59  fRndmCmd->SetCandidates("on off");
61 
62  fSetXVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
63  fSetXVertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
64  fSetXVertexCmd->SetParameterName("xv",true);
65  fSetXVertexCmd->SetDefaultValue(0.0*mm);
66  fSetXVertexCmd->SetDefaultUnit("mm");
67 
68  fSetYVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
69  fSetYVertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
70  fSetYVertexCmd->SetParameterName("yv",true);
71  fSetYVertexCmd->SetDefaultValue(0.0*mm);
72  fSetYVertexCmd->SetDefaultUnit("mm");
73 
74  fSetZVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
75  fSetZVertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
76  fSetZVertexCmd->SetParameterName("zv",true);
77  fSetZVertexCmd->SetDefaultValue(0.0*mm);
78  fSetZVertexCmd->SetDefaultUnit("mm");
79 
80 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static constexpr double mm
Definition: G4SIunits.hh:115
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

F03PrimaryGeneratorMessenger::~F03PrimaryGeneratorMessenger ( )
virtual

Definition at line 84 of file F03PrimaryGeneratorMessenger.cc.

85 {
86  delete fRndmCmd;
87  delete fSetXVertexCmd;
88  delete fSetYVertexCmd;
89  delete fSetZVertexCmd;
90 }

Member Function Documentation

void F03PrimaryGeneratorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 94 of file F03PrimaryGeneratorMessenger.cc.

96 {
97  if( command == fRndmCmd )
98  { fAction->SetRndmFlag(newValue);}
99  if( command == fSetXVertexCmd )
100  { fAction->SetXVertex(fSetXVertexCmd->GetNewDoubleValue(newValue));}
101  if( command == fSetYVertexCmd )
102  { fAction->SetYVertex(fSetYVertexCmd->GetNewDoubleValue(newValue));}
103  if( command == fSetZVertexCmd )
104  { fAction->SetZVertex(fSetZVertexCmd->GetNewDoubleValue(newValue));}
105 }
static G4double GetNewDoubleValue(const char *paramString)

Here is the call graph for this function:


The documentation for this class was generated from the following files: