Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
F04FieldMessenger.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 //
26 // $Id: F04FieldMessenger.cc 78551 2014-01-07 09:45:08Z gcosmo $
27 //
30 //
31 
32 #include "F04FieldMessenger.hh"
33 
34 #include "F04GlobalField.hh"
35 #include "G4UIdirectory.hh"
36 #include "G4UIcmdWithAString.hh"
37 #include "G4UIcmdWithAnInteger.hh"
40 
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46  F04DetectorConstruction* detector)
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);
80 
81  fMinStepCMD = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
82  fMinStepCMD->SetGuidance("Define minimal step");
83  fMinStepCMD->SetParameterName("min step",false,false);
86 
87  fDeltaChordCMD = new G4UIcmdWithADoubleAndUnit("/field/setDeltaChord",this);
88  fDeltaChordCMD->SetGuidance("Define delta chord");
89  fDeltaChordCMD->SetParameterName("delta chord",false,false);
92 
94  new G4UIcmdWithADoubleAndUnit("/field/setDeltaOneStep",this);
95  fDeltaOneStepCMD->SetGuidance("Define delta one step");
96  fDeltaOneStepCMD->SetParameterName("delta one step",false,false);
99 
101  new G4UIcmdWithADoubleAndUnit("/field/setDeltaIntersection",this);
102  fDeltaIntersectionCMD->SetGuidance("Define delta intersection");
103  fDeltaIntersectionCMD->SetParameterName("delta intersection",false,false);
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 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
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 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
142 {
143 
144  if( command == fCaptureB1Cmd )
146 
147  if( command == fCaptureB2Cmd )
149 
150  if( command == fTransferBCmd )
152 
153  if( command == fStepperCMD )
154  {
156  }
157  if( command == fMinStepCMD )
158  {
160  }
161  if( command == fDeltaChordCMD )
162  {
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  {
178  }
179  if( command == fEpsMaxCMD )
180  {
182  }
183 }
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
F04GlobalField * fGlobalField
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fDeltaChordCMD
G4UIcmdWithAnInteger * fStepperCMD
void SetDefaultValue(G4int defVal)
F04FieldMessenger(F04GlobalField *, F04DetectorConstruction *)
void SetEpsMin(G4double eps)
Set the minimum eps length.
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
virtual void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithADoubleAndUnit * fCaptureB1Cmd
Definition of the F04DetectorConstruction class.
G4UIcmdWithADoubleAndUnit * fDeltaOneStepCMD
G4UIcmdWithADoubleAndUnit * fEpsMinCMD
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fDeltaIntersectionCMD
G4UIdirectory * fDetDir
void SetMinStep(G4double stp)
Set the minimum step length.
Definition of the F04FieldMessenger class.
void SetEpsMax(G4double eps)
Set the maximum eps length.
G4UIcmdWithADoubleAndUnit * fTransferBCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
F04DetectorConstruction * fDetector
void SetStepperType(G4int i)
Set the Stepper types.
Definition of the F04GlobalField class.
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fMinStepCMD
G4UIcmdWithADoubleAndUnit * fEpsMaxCMD
void SetDeltaChord(G4double dcr)
Set the delta chord length.
G4UIcmdWithADoubleAndUnit * fCaptureB2Cmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
void SetDefaultUnit(const char *defUnit)