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

#include <F04FieldMessenger.hh>

Inheritance diagram for F04FieldMessenger:
G4UImessenger

Public Member Functions

 F04FieldMessenger (F04GlobalField *, F04DetectorConstruction *)
 
virtual ~F04FieldMessenger ()
 
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
 

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 47 of file F04FieldMessenger.hh.

Constructor & Destructor Documentation

F04FieldMessenger::F04FieldMessenger ( F04GlobalField pEMfield,
F04DetectorConstruction detector 
)

Definition at line 45 of file F04FieldMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcommand::SetRange().

47  : fGlobalField(pEMfield)
48 {
49  fDetector = detector;
50 
51  fDetDir = new G4UIdirectory("/field/");
52  fDetDir->SetGuidance(" Field tracking control ");
53 
54  fCaptureB1Cmd = new G4UIcmdWithADoubleAndUnit("/field/SetCaptureB1",this);
55  fCaptureB1Cmd->SetGuidance("Set B1 of the Capture Magnet");
56  fCaptureB1Cmd->SetParameterName("CSizeB1",false,false);
57  fCaptureB1Cmd->SetDefaultUnit("tesla");
58  fCaptureB1Cmd->SetRange("CSizeB1>0.");
60 
61  fCaptureB2Cmd = new G4UIcmdWithADoubleAndUnit("/field/SetCaptureB2",this);
62  fCaptureB2Cmd->SetGuidance("Set B2 of the Capture Magnet");
63  fCaptureB2Cmd->SetParameterName("CSizeB2",false,false);
64  fCaptureB2Cmd->SetDefaultUnit("tesla");
65  fCaptureB2Cmd->SetRange("CSizeB2>0.");
67 
68  fTransferBCmd = new G4UIcmdWithADoubleAndUnit("/field/SetTransferB",this);
69  fTransferBCmd->SetGuidance("Set B of the Transfer Magnet");
70  fTransferBCmd->SetParameterName("TSizeB",false,false);
71  fTransferBCmd->SetDefaultUnit("tesla");
72  fTransferBCmd->SetRange("TSizeB>0.");
74 
75  fStepperCMD = new G4UIcmdWithAnInteger("/field/setStepperType",this);
76  fStepperCMD->SetGuidance("Select stepper type for field");
77  fStepperCMD->SetParameterName("choice",true);
78  fStepperCMD->SetDefaultValue(4);
80 
81  fMinStepCMD = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
82  fMinStepCMD->SetGuidance("Define minimal step");
83  fMinStepCMD->SetParameterName("min step",false,false);
84  fMinStepCMD->SetDefaultUnit("mm");
86 
87  fDeltaChordCMD = new G4UIcmdWithADoubleAndUnit("/field/setDeltaChord",this);
88  fDeltaChordCMD->SetGuidance("Define delta chord");
89  fDeltaChordCMD->SetParameterName("delta chord",false,false);
90  fDeltaChordCMD->SetDefaultUnit("mm");
92 
93  fDeltaOneStepCMD =
94  new G4UIcmdWithADoubleAndUnit("/field/setDeltaOneStep",this);
95  fDeltaOneStepCMD->SetGuidance("Define delta one step");
96  fDeltaOneStepCMD->SetParameterName("delta one step",false,false);
97  fDeltaOneStepCMD->SetDefaultUnit("mm");
99 
100  fDeltaIntersectionCMD =
101  new G4UIcmdWithADoubleAndUnit("/field/setDeltaIntersection",this);
102  fDeltaIntersectionCMD->SetGuidance("Define delta intersection");
103  fDeltaIntersectionCMD->SetParameterName("delta intersection",false,false);
104  fDeltaIntersectionCMD->SetDefaultUnit("mm");
105  fDeltaIntersectionCMD->AvailableForStates(G4State_PreInit,G4State_Idle);
106 
107  fEpsMinCMD = new G4UIcmdWithADoubleAndUnit("/field/setEpsMin",this);
108  fEpsMinCMD->SetGuidance("Define eps min");
109  fEpsMinCMD->SetParameterName("eps min",false,false);
110  fEpsMinCMD->SetDefaultUnit("mm");
112 
113  fEpsMaxCMD = new G4UIcmdWithADoubleAndUnit("/field/setEpsMax",this);
114  fEpsMaxCMD->SetGuidance("Define eps max");
115  fEpsMaxCMD->SetParameterName("eps max",false,false);
116  fEpsMaxCMD->SetDefaultUnit("mm");
118 }
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
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
F04FieldMessenger::~F04FieldMessenger ( )
virtual

Definition at line 122 of file F04FieldMessenger.cc.

123 {
124  delete fDetDir;
125 
126  delete fCaptureB1Cmd;
127  delete fCaptureB2Cmd;
128  delete fTransferBCmd;
129 
130  delete fStepperCMD;
131  delete fMinStepCMD;
132  delete fDeltaChordCMD;
133  delete fDeltaOneStepCMD;
134  delete fDeltaIntersectionCMD;
135  delete fEpsMinCMD;
136  delete fEpsMaxCMD;
137 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 141 of file F04FieldMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), F04DetectorConstruction::SetCaptureMgntB1(), F04DetectorConstruction::SetCaptureMgntB2(), F04GlobalField::SetDeltaChord(), F04GlobalField::SetEpsMax(), F04GlobalField::SetEpsMin(), F04GlobalField::SetMinStep(), F04GlobalField::SetStepperType(), and F04DetectorConstruction::SetTransferMgntB().

142 {
143 
144  if( command == fCaptureB1Cmd )
145  fDetector->SetCaptureMgntB1(fCaptureB1Cmd->GetNewDoubleValue(newValue));
146 
147  if( command == fCaptureB2Cmd )
148  fDetector->SetCaptureMgntB2(fCaptureB2Cmd->GetNewDoubleValue(newValue));
149 
150  if( command == fTransferBCmd )
151  fDetector->SetTransferMgntB(fTransferBCmd->GetNewDoubleValue(newValue));
152 
153  if( command == fStepperCMD )
154  {
155  fGlobalField->SetStepperType(fStepperCMD->GetNewIntValue(newValue));
156  }
157  if( command == fMinStepCMD )
158  {
159  fGlobalField->SetMinStep(fMinStepCMD->GetNewDoubleValue(newValue));
160  }
161  if( command == fDeltaChordCMD )
162  {
163  fGlobalField->SetDeltaChord(fDeltaChordCMD->GetNewDoubleValue(newValue));
164  }
165  if( command == fDeltaOneStepCMD )
166  {
167  fGlobalField->
168  SetDeltaOneStep(fDeltaOneStepCMD->GetNewDoubleValue(newValue));
169  }
170  if( command == fDeltaIntersectionCMD )
171  {
172  fGlobalField->
173  SetDeltaIntersection(fDeltaIntersectionCMD->GetNewDoubleValue(newValue));
174  }
175  if( command == fEpsMinCMD )
176  {
177  fGlobalField->SetEpsMin(fEpsMinCMD->GetNewDoubleValue(newValue));
178  }
179  if( command == fEpsMaxCMD )
180  {
181  fGlobalField->SetEpsMax(fEpsMaxCMD->GetNewDoubleValue(newValue));
182  }
183 }
void SetEpsMax(G4double eps)
Set the maximum eps length.
static G4int GetNewIntValue(const char *paramString)
void SetEpsMin(G4double eps)
Set the minimum eps length.
static G4double GetNewDoubleValue(const char *paramString)
void SetDeltaChord(G4double dcr)
Set the delta chord length.
void SetMinStep(G4double stp)
Set the minimum step length.
void SetStepperType(G4int i)
Set the Stepper types.

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