Geant4  10.02.p03
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
 

Private Attributes

F03PrimaryGeneratorActionfAction
 
G4UIcmdWithAStringfRndmCmd
 
G4UIcmdWithADoubleAndUnitfSetXVertexCmd
 
G4UIcmdWithADoubleAndUnitfSetYVertexCmd
 
G4UIcmdWithADoubleAndUnitfSetZVertexCmd
 

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::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),
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);
67 
68  fSetYVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
69  fSetYVertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
70  fSetYVertexCmd->SetParameterName("yv",true);
73 
74  fSetZVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
75  fSetZVertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
76  fSetZVertexCmd->SetParameterName("zv",true);
79 
80 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fSetYVertexCmd
G4UIcmdWithADoubleAndUnit * fSetZVertexCmd
G4UIcmdWithADoubleAndUnit * fSetXVertexCmd
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetCandidates(const char *candidateList)
static const double mm
Definition: G4SIunits.hh:114
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~F03PrimaryGeneratorMessenger()

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 }
G4UIcmdWithADoubleAndUnit * fSetYVertexCmd
G4UIcmdWithADoubleAndUnit * fSetZVertexCmd
G4UIcmdWithADoubleAndUnit * fSetXVertexCmd

Member Function Documentation

◆ SetNewValue()

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 )
101  if( command == fSetYVertexCmd )
103  if( command == fSetZVertexCmd )
105 }
G4UIcmdWithADoubleAndUnit * fSetYVertexCmd
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fSetZVertexCmd
G4UIcmdWithADoubleAndUnit * fSetXVertexCmd
Here is the call graph for this function:

Member Data Documentation

◆ fAction

F03PrimaryGeneratorAction* F03PrimaryGeneratorMessenger::fAction
private

Definition at line 56 of file F03PrimaryGeneratorMessenger.hh.

◆ fRndmCmd

G4UIcmdWithAString* F03PrimaryGeneratorMessenger::fRndmCmd
private

Definition at line 57 of file F03PrimaryGeneratorMessenger.hh.

◆ fSetXVertexCmd

G4UIcmdWithADoubleAndUnit* F03PrimaryGeneratorMessenger::fSetXVertexCmd
private

Definition at line 58 of file F03PrimaryGeneratorMessenger.hh.

◆ fSetYVertexCmd

G4UIcmdWithADoubleAndUnit* F03PrimaryGeneratorMessenger::fSetYVertexCmd
private

Definition at line 59 of file F03PrimaryGeneratorMessenger.hh.

◆ fSetZVertexCmd

G4UIcmdWithADoubleAndUnit* F03PrimaryGeneratorMessenger::fSetZVertexCmd
private

Definition at line 60 of file F03PrimaryGeneratorMessenger.hh.


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