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

#include <F03FieldMessenger.hh>

Inheritance diagram for F03FieldMessenger:
Collaboration diagram for F03FieldMessenger:

Public Member Functions

 F03FieldMessenger (F03FieldSetup *)
 
virtual ~F03FieldMessenger ()
 
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 F03FieldMessenger.hh.

Constructor & Destructor Documentation

F03FieldMessenger::F03FieldMessenger ( F03FieldSetup fieldSetup)

Definition at line 47 of file F03FieldMessenger.cc.

48  : G4UImessenger(),
49  fEMfieldSetup(fieldSetup),
50  fFieldDir(0),
51  fStepperCmd(0),
52  fMagFieldCmd(0),
53  fMinStepCmd(0),
54  fUpdateCmd(0)
55 {
56  fFieldDir = new G4UIdirectory("/field/");
57  fFieldDir->SetGuidance("F03 field tracking control.");
58 
59  fStepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
60  fStepperCmd->SetGuidance("Select stepper type for magnetic field");
61  fStepperCmd->SetParameterName("choice",true);
62  fStepperCmd->SetDefaultValue(4);
64 
65  fUpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
66  fUpdateCmd->SetGuidance("Update calorimeter geometry.");
67  fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
68  fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
69  fUpdateCmd->AvailableForStates(G4State_Idle);
70 
71  fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
72  fMagFieldCmd->SetGuidance("Define magnetic field.");
73  fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
74  fMagFieldCmd->SetParameterName("Bz",false,false);
75  fMagFieldCmd->SetDefaultUnit("tesla");
76  fMagFieldCmd->AvailableForStates(G4State_Idle);
77 
78  fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
79  fMinStepCmd->SetGuidance("Define minimal step");
80  fMinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
81  fMinStepCmd->SetParameterName("min step",false,false);
82  fMinStepCmd->SetDefaultUnit("mm");
83  fMinStepCmd->AvailableForStates(G4State_Idle);
84 }
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:

F03FieldMessenger::~F03FieldMessenger ( )
virtual

Definition at line 88 of file F03FieldMessenger.cc.

89 {
90  delete fStepperCmd;
91  delete fMagFieldCmd;
92  delete fMinStepCmd;
93  delete fFieldDir;
94  delete fUpdateCmd;
95 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 99 of file F03FieldMessenger.cc.

100 {
101  if( command == fStepperCmd )
102  fEMfieldSetup->SetStepperType(fStepperCmd->GetNewIntValue(newValue));
103  if( command == fUpdateCmd )
104  fEMfieldSetup->UpdateField();
105  if( command == fMagFieldCmd )
106  {
107  fEMfieldSetup->SetFieldValue(fMagFieldCmd->GetNewDoubleValue(newValue));
108  // Check the value
109  G4cout << "Set field value to " <<
110  fEMfieldSetup->GetConstantFieldValue() / gauss << " Gauss " << G4endl;
111  }
112  if( command == fMinStepCmd )
113  fEMfieldSetup->SetMinStep(fMinStepCmd->GetNewDoubleValue(newValue));
114 }
void SetFieldValue(G4ThreeVector fieldVector)
G4ThreeVector GetConstantFieldValue()
static G4int GetNewIntValue(const char *paramString)
void SetStepperType(G4int i)
static G4double GetNewDoubleValue(const char *paramString)
G4GLOB_DLL std::ostream G4cout
static constexpr double gauss
Definition: G4SIunits.hh:270
void SetMinStep(G4double s)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:


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