Geant4  10.02.p03
F02PrimaryGeneratorMessenger Class Reference

#include <F02PrimaryGeneratorMessenger.hh>

Inheritance diagram for F02PrimaryGeneratorMessenger:
Collaboration diagram for F02PrimaryGeneratorMessenger:

Public Member Functions

 F02PrimaryGeneratorMessenger (F02PrimaryGeneratorAction *)
 
virtual ~F02PrimaryGeneratorMessenger ()
 
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

F02PrimaryGeneratorActionfAction
 
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 F02PrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

◆ F02PrimaryGeneratorMessenger()

F02PrimaryGeneratorMessenger::F02PrimaryGeneratorMessenger ( F02PrimaryGeneratorAction action)

Definition at line 45 of file F02PrimaryGeneratorMessenger.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 * fSetZVertexCmd
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetDefaultValue(const char *defVal)
G4UIcmdWithADoubleAndUnit * fSetXVertexCmd
void SetDefaultUnit(const char *defUnit)
void SetCandidates(const char *candidateList)
G4UIcmdWithADoubleAndUnit * fSetYVertexCmd
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:

◆ ~F02PrimaryGeneratorMessenger()

F02PrimaryGeneratorMessenger::~F02PrimaryGeneratorMessenger ( )
virtual

Definition at line 84 of file F02PrimaryGeneratorMessenger.cc.

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

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 94 of file F02PrimaryGeneratorMessenger.cc.

96 {
97  if( command == fRndmCmd )
98  { fAction->SetRndmFlag(newValue);}
99  if( command == fSetXVertexCmd )
101  if( command == fSetYVertexCmd )
103  if( command == fSetZVertexCmd )
105 }
G4UIcmdWithADoubleAndUnit * fSetZVertexCmd
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fSetXVertexCmd
G4UIcmdWithADoubleAndUnit * fSetYVertexCmd
Here is the call graph for this function:

Member Data Documentation

◆ fAction

F02PrimaryGeneratorAction* F02PrimaryGeneratorMessenger::fAction
private

Definition at line 56 of file F02PrimaryGeneratorMessenger.hh.

◆ fRndmCmd

G4UIcmdWithAString* F02PrimaryGeneratorMessenger::fRndmCmd
private

Definition at line 57 of file F02PrimaryGeneratorMessenger.hh.

◆ fSetXVertexCmd

G4UIcmdWithADoubleAndUnit* F02PrimaryGeneratorMessenger::fSetXVertexCmd
private

Definition at line 58 of file F02PrimaryGeneratorMessenger.hh.

◆ fSetYVertexCmd

G4UIcmdWithADoubleAndUnit* F02PrimaryGeneratorMessenger::fSetYVertexCmd
private

Definition at line 59 of file F02PrimaryGeneratorMessenger.hh.

◆ fSetZVertexCmd

G4UIcmdWithADoubleAndUnit* F02PrimaryGeneratorMessenger::fSetZVertexCmd
private

Definition at line 60 of file F02PrimaryGeneratorMessenger.hh.


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