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

#include <ExG4EventAction01Messenger.hh>

Inheritance diagram for ExG4EventAction01Messenger:
G4UImessenger

Public Member Functions

 ExG4EventAction01Messenger (ExG4EventAction01 *eventAction)
 
 ~ExG4EventAction01Messenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
- 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

Messenger class that defines commands for ExG4EventAction01

It implements commands:

Definition at line 49 of file ExG4EventAction01Messenger.hh.

Constructor & Destructor Documentation

ExG4EventAction01Messenger::ExG4EventAction01Messenger ( ExG4EventAction01 eventAction)

Definition at line 40 of file ExG4EventAction01Messenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_Init, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithABool::SetParameterName(), and G4UIcommand::SetRange().

41  : G4UImessenger(),
42  fEventAction(eventAction),
43  fTopDirectory(0),
44  fDirectory(0),
45  fSetVerboseLevelCmd(0),
46  fSetPrintModuloCmd(0),
47  fSetSaveRndmCmd(0)
48 {
49  fTopDirectory = new G4UIdirectory("/ExG4/");
50  fTopDirectory->SetGuidance("UI commands of common example classes");
51 
52  fDirectory = new G4UIdirectory("/ExG4/event/");
53  fDirectory->SetGuidance("Event control");
54 
55  fSetVerboseLevelCmd = new G4UIcmdWithAnInteger("/ExG4/event/verboseLevel",this);
56  fSetVerboseLevelCmd->SetGuidance("Set event verbose level ." );
57  fSetVerboseLevelCmd->SetParameterName("VerboseLevel",false);
58  fSetVerboseLevelCmd->AvailableForStates(G4State_PreInit, G4State_Init);
59 
60  fSetPrintModuloCmd = new G4UIcmdWithAnInteger("/ExG4/event/printModulo",this);
61  fSetPrintModuloCmd->SetGuidance("Print events modulo n");
62  fSetPrintModuloCmd->SetParameterName("PrintModulo",false);
63  fSetPrintModuloCmd->SetRange("PrintModulo>0");
64  fSetPrintModuloCmd->AvailableForStates(G4State_Idle, G4State_Init);
65 
66  fSetSaveRndmCmd = new G4UIcmdWithABool("/ExG4/event/saveRndm",this);
67  fSetSaveRndmCmd->SetGuidance("Activate saving random number at endOfEvent.");
68  fSetSaveRndmCmd->SetParameterName("SaveRndm",false);
69  fSetSaveRndmCmd->AvailableForStates(G4State_Idle, G4State_Init);
70 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
ExG4EventAction01Messenger::~ExG4EventAction01Messenger ( )

Definition at line 73 of file ExG4EventAction01Messenger.cc.

74 {
75  delete fTopDirectory;
76  delete fDirectory;
77  delete fSetVerboseLevelCmd;
78  delete fSetPrintModuloCmd;
79  delete fSetSaveRndmCmd;
80 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 83 of file ExG4EventAction01Messenger.cc.

References G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithAnInteger::GetNewIntValue(), ExG4EventAction01::SetPrintModulo(), ExG4EventAction01::SetSaveRndm(), and ExG4EventAction01::SetVerboseLevel().

84 {
85  if(command == fSetVerboseLevelCmd) {
86  fEventAction->SetVerboseLevel(fSetVerboseLevelCmd->GetNewIntValue(newValue));
87  }
88  else if ( command == fSetPrintModuloCmd ) {
89  fEventAction->SetPrintModulo(fSetPrintModuloCmd->GetNewIntValue(newValue));
90  }
91  else if ( command == fSetSaveRndmCmd ) {
92  fEventAction->SetSaveRndm(fSetSaveRndmCmd->GetNewBoolValue(newValue));
93  }
94 }
static G4int GetNewIntValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
void SetPrintModulo(G4int value)
void SetSaveRndm(G4bool value)
void SetVerboseLevel(G4int level)

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