Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
F01FieldMessenger.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id: F01FieldMessenger.cc 76248 2013-11-08 11:19:52Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "F01FieldMessenger.hh"
37 
38 #include "F01FieldSetup.hh"
39 #include "G4UIcmdWithAnInteger.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46  : G4UImessenger(),
47  fEMfieldSetup(fieldSetup),
48  fFieldDir(0),
49  fStepperCmd(0),
50  fMagFieldCmd(0),
51  fMinStepCmd(0),
52  fUpdateCmd(0)
53 {
54  fFieldDir = new G4UIdirectory("/field/");
55  fFieldDir->SetGuidance("F01 field tracking control.");
56 
57  fStepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
58  fStepperCmd->SetGuidance("Select stepper type for magnetic field");
59  fStepperCmd->SetParameterName("choice",true);
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).");
68 
69  fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
70  fMagFieldCmd->SetGuidance("Define magnetic field.");
71  fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
72  fMagFieldCmd->SetParameterName("Bz",false,false);
73  fMagFieldCmd->SetDefaultUnit("tesla");
75 
76  fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
77  fMinStepCmd->SetGuidance("Define minimal step");
78  fMinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
79  fMinStepCmd->SetParameterName("min step",false,false);
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
88  delete fStepperCmd;
89  delete fMagFieldCmd;
90  delete fMinStepCmd;
91  delete fFieldDir;
92  delete fUpdateCmd;
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  if( command == fStepperCmd )
101  if( command == fUpdateCmd )
103  if( command == fMagFieldCmd )
105  if( command == fMinStepCmd )
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
G4UIcmdWithADoubleAndUnit * fMinStepCmd
virtual ~F01FieldMessenger()
void SetStepperType(G4int i)
void SetMinStep(G4double s)
G4UIdirectory * fFieldDir
static G4double GetNewDoubleValue(const char *paramString)
void SetFieldValue(G4ThreeVector fieldVector)
G4UIcmdWithoutParameter * fUpdateCmd
void CreateStepperAndChordFinder()
F01FieldSetup * fEMfieldSetup
Definition of the F01FieldMessenger class.
F01FieldMessenger(F01FieldSetup *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Definition of the F01FieldSetup class.
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fMagFieldCmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
G4UIcmdWithAnInteger * fStepperCmd
virtual void SetNewValue(G4UIcommand *, G4String)
void SetDefaultUnit(const char *defUnit)