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

#include <F02FieldMessenger.hh>

Inheritance diagram for F02FieldMessenger:
Collaboration diagram for F02FieldMessenger:

Public Member Functions

 F02FieldMessenger (F02ElectricFieldSetup *)
 
virtual ~F02FieldMessenger ()
 
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 49 of file F02FieldMessenger.hh.

Constructor & Destructor Documentation

F02FieldMessenger::F02FieldMessenger ( F02ElectricFieldSetup fieldSetup)

Definition at line 45 of file F02FieldMessenger.cc.

46  : G4UImessenger(),
47  fElFieldSetup(fieldSetup),
48  fFieldDir(0),
49  fStepperCmd(0),
50  fElFieldCmd(0),
51  fMinStepCmd(0),
52  fUpdateCmd(0)
53 {
54  fFieldDir = new G4UIdirectory("/field/");
55  fFieldDir->SetGuidance("F02 field tracking control.");
56 
57  fStepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
58  fStepperCmd->SetGuidance("Select stepper type for electric field");
59  fStepperCmd->SetParameterName("choice",true);
60  fStepperCmd->SetDefaultValue(4);
62 
63  fUpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
64  fUpdateCmd->SetGuidance("Update calorimeter geometry.");
65  fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
66  fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
67  fUpdateCmd->AvailableForStates(G4State_Idle);
68 
69  fElFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
70  fElFieldCmd->SetGuidance("Define uniform Electric field.");
71  fElFieldCmd->SetGuidance("Electric field will be in Z direction.");
72  fElFieldCmd->SetGuidance("Value of Electric field has to be given in volt/m");
73  fElFieldCmd->SetParameterName("Ez",false,false);
74  fElFieldCmd->SetDefaultUnit("volt/m");
75  fElFieldCmd->AvailableForStates(G4State_Idle);
76 
77  fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
78  fMinStepCmd->SetGuidance("Define minimal step");
79  fMinStepCmd->SetParameterName("min step",false,false);
80  fMinStepCmd->SetDefaultUnit("mm");
81  fMinStepCmd->AvailableForStates(G4State_Idle);
82 }
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:240
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

F02FieldMessenger::~F02FieldMessenger ( )
virtual

Definition at line 86 of file F02FieldMessenger.cc.

87 {
88  delete fStepperCmd;
89  delete fElFieldCmd;
90  delete fMinStepCmd;
91  delete fFieldDir;
92  delete fUpdateCmd;
93 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 97 of file F02FieldMessenger.cc.

98 {
99  if( command == fStepperCmd )
100  fElFieldSetup->SetStepperType(fStepperCmd->GetNewIntValue(newValue));
101  if( command == fUpdateCmd )
102  fElFieldSetup->UpdateField();
103  if( command == fElFieldCmd )
104  fElFieldSetup->SetFieldValue(fElFieldCmd->GetNewDoubleValue(newValue));
105  if( command == fMinStepCmd )
106  fElFieldSetup->SetMinStep(fMinStepCmd->GetNewDoubleValue(newValue));
107 }
static G4int GetNewIntValue(const char *paramString)
void SetFieldValue(G4ThreeVector fieldVector)
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: