Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
Em10PrimaryGeneratorMessenger Class Reference

#include <Em10PrimaryGeneratorMessenger.hh>

Inheritance diagram for Em10PrimaryGeneratorMessenger:
G4UImessenger

Public Member Functions

 Em10PrimaryGeneratorMessenger (Em10PrimaryGeneratorAction *)
 
 ~Em10PrimaryGeneratorMessenger ()
 
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
 

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
 

Detailed Description

Definition at line 49 of file Em10PrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

Em10PrimaryGeneratorMessenger::Em10PrimaryGeneratorMessenger ( Em10PrimaryGeneratorAction Em10Gun)

Definition at line 46 of file Em10PrimaryGeneratorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, python.hepunit::mm, G4UIcmdWithAString::SetCandidates(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithADoubleAndUnit::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetParameterName().

47 :G4UImessenger(),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");
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 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Em10PrimaryGeneratorMessenger::~Em10PrimaryGeneratorMessenger ( )

Definition at line 76 of file Em10PrimaryGeneratorMessenger.cc.

77 {
78  delete RndmCmd;
79  delete setxvertexCmd;
80  delete setyvertexCmd;
81  delete setzvertexCmd;
82 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 86 of file Em10PrimaryGeneratorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), Em10PrimaryGeneratorAction::SetRndmFlag(), Em10PrimaryGeneratorAction::Setxvertex(), Em10PrimaryGeneratorAction::Setyvertex(), and Em10PrimaryGeneratorAction::Setzvertex().

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 }
static G4double GetNewDoubleValue(const char *paramString)

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