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

#include <F04PrimaryGeneratorMessenger.hh>

Inheritance diagram for F04PrimaryGeneratorMessenger:
Collaboration diagram for F04PrimaryGeneratorMessenger:

Public Member Functions

 F04PrimaryGeneratorMessenger (F04PrimaryGeneratorAction *)
 
virtual ~F04PrimaryGeneratorMessenger ()
 
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 43 of file F04PrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

F04PrimaryGeneratorMessenger::F04PrimaryGeneratorMessenger ( F04PrimaryGeneratorAction gun)

Definition at line 42 of file F04PrimaryGeneratorMessenger.cc.

43  : fAction(gun)
44 {
45  fRndmCmd = new G4UIcmdWithAString("/gun/random",this);
46  fRndmCmd->SetGuidance("Shoot randomly the incident particle.");
47  fRndmCmd->SetGuidance(" Choice : on, off(default)");
48  fRndmCmd->SetParameterName("choice",true);
49  fRndmCmd->SetDefaultValue("off");
50  fRndmCmd->SetCandidates("on off");
52 
53  fSetXvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
54  fSetXvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
55  fSetXvertexCmd->SetParameterName("xv",true);
56  fSetXvertexCmd->SetDefaultValue(0.0*mm);
57  fSetXvertexCmd->SetDefaultUnit("mm");
58 
59  fSetYvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
60  fSetYvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
61  fSetYvertexCmd->SetParameterName("yv",true);
62  fSetYvertexCmd->SetDefaultValue(0.0*mm);
63  fSetYvertexCmd->SetDefaultUnit("mm");
64 
65  fSetZvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
66  fSetZvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
67  fSetZvertexCmd->SetParameterName("zv",true);
68  fSetZvertexCmd->SetDefaultValue(0.0*mm);
69  fSetZvertexCmd->SetDefaultUnit("mm");
70 
71 }
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:

F04PrimaryGeneratorMessenger::~F04PrimaryGeneratorMessenger ( )
virtual

Definition at line 75 of file F04PrimaryGeneratorMessenger.cc.

76 {
77  delete fRndmCmd;
78  delete fSetXvertexCmd;
79  delete fSetYvertexCmd;
80  delete fSetZvertexCmd;
81 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 86 of file F04PrimaryGeneratorMessenger.cc.

87 {
88  if( command == fRndmCmd )
89  { fAction->SetRndmFlag(newValue);}
90  if( command == fSetXvertexCmd)
91  { fAction->SetXvertex(fSetXvertexCmd->GetNewDoubleValue(newValue));}
92  if( command == fSetYvertexCmd)
93  { fAction->SetYvertex(fSetYvertexCmd->GetNewDoubleValue(newValue));}
94  if( command == fSetZvertexCmd)
95  { fAction->SetZvertex(fSetZvertexCmd->GetNewDoubleValue(newValue));}
96 }
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: