Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/medical/GammaTherapy/src/DetectorMessenger.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: DetectorMessenger.cc 103469 2017-04-11 07:29:36Z gcosmo $
27 //
30 //
31 // -------------------------------------------------------------
32 // GEANT4 test IBREM
33 //
34 // Authors: V.Grichine, V.Ivanchenko
35 //
36 // Modified:
37 //
38 // 18-02-03 V.Ivanchenko create
39 //
40 // -------------------------------------------------------------
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 #include "DetectorMessenger.hh"
46 #include "DetectorConstruction.hh"
47 #include "G4UIdirectory.hh"
48 #include "G4UIcmdWithABool.hh"
49 #include "G4UIcmdWithAString.hh"
50 #include "G4UIcmdWithAnInteger.hh"
53 
54 //#include "g4root.hh"
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59  fDetector(h)
60 {
61  fDetDir = new G4UIdirectory("/testem/");
62  fDetDir->SetGuidance("General commands");
63  fDetDir1= new G4UIdirectory("/testem/physics/");
64  fDetDir1->SetGuidance(" commands to define physics");
65  fDetDir2= new G4UIdirectory("/testem/gun/");
66  fDetDir2->SetGuidance(" commands to define gun");
67 
68  fAbsMaterCmd = new G4UIcmdWithAString("/testem/target1Material",this);
69  fAbsMaterCmd->SetGuidance("Select Material of the target1.");
70  fAbsMaterCmd->SetParameterName("Material1",false);
72 
73  fWorldMaterCmd = new G4UIcmdWithAString("/testem/target2Material",this);
74  fWorldMaterCmd->SetGuidance("Select Material of the target2.");
75  fWorldMaterCmd->SetParameterName("Material2",false);
77 
78  fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/testem/mylarZ",this);
79  fAbsThickCmd->SetGuidance("Set mylarZ");
80  fAbsThickCmd->SetParameterName("mylarZ",false);
81  fAbsThickCmd->SetUnitCategory("Length");
83 
84  fAbsGapCmd = new G4UIcmdWithADoubleAndUnit("/testem/delta",this);
85  fAbsGapCmd->SetGuidance("Set gap between absorbers");
86  fAbsGapCmd->SetParameterName("delta",false);
87  fAbsGapCmd->SetUnitCategory("Length");
89 
90  fAbsSizYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/target1Z",this);
91  fAbsSizYZCmd->SetGuidance("Set targeet1Z");
92  fAbsSizYZCmd->SetParameterName("target1Z",false);
93  fAbsSizYZCmd->SetUnitCategory("Length");
95 
96  fWorldXCmd = new G4UIcmdWithADoubleAndUnit("/testem/target2Z",this);
97  fWorldXCmd->SetGuidance("Set target2Z");
98  fWorldXCmd->SetParameterName("target2Z",false);
99  fWorldXCmd->SetUnitCategory("Length");
101 
102  fXMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/checkShiftZ",this);
103  fXMagFieldCmd->SetGuidance("Define checkShftZ");
104  fXMagFieldCmd->SetParameterName("CheckSZ",false);
105  fXMagFieldCmd->SetUnitCategory("Length");
107 
108  fYMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/sdZ",this);
109  fYMagFieldCmd->SetGuidance("Define sensitive detector Z");
110  fYMagFieldCmd->SetParameterName("sdZ",false);
111  fYMagFieldCmd->SetUnitCategory("Length");
113 
114  fZMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/sdShiftZ",this);
115  fZMagFieldCmd->SetGuidance("Define shift of sensitive detector");
116  fZMagFieldCmd->SetParameterName("sdShiftZ",false);
117  fZMagFieldCmd->SetUnitCategory("Length");
119 
120  fNumOfAbsCmd = new G4UIcmdWithAnInteger("/testem/numberDivR",this);
121  fNumOfAbsCmd->SetGuidance("Set number divisions R");
122  fNumOfAbsCmd->SetParameterName("NR",false);
124 
125  fNumOfEvt = new G4UIcmdWithAnInteger("/testem/numberDivZ",this);
126  fNumOfEvt->SetGuidance("Set number of divisions Z");
127  fNumOfEvt->SetParameterName("NZ",false);
129 
130  fVerbCmd = new G4UIcmdWithAnInteger("/testem/verbose",this);
131  fVerbCmd->SetGuidance("Set verbose for ");
132  fVerbCmd->SetParameterName("verb",false);
134 
135  fIntCmd = new G4UIcmdWithAnInteger("/testem/numberDivE",this);
136  fIntCmd->SetGuidance("Set number of divisions E");
137  fIntCmd->SetParameterName("NZ",false);
139 
140  fDeltaECmd = new G4UIcmdWithADoubleAndUnit("/testem/maxEnergy",this);
141  fDeltaECmd->SetGuidance("Define scale of secondary energy histogram");
142  fDeltaECmd->SetParameterName("DeltaE",false);
143  fDeltaECmd->SetUnitCategory("Energy");
145 
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151 {
152  delete fDetDir;
153  delete fDetDir1;
154  delete fDetDir2;
155 
156  delete fAbsMaterCmd;
157  delete fAbsThickCmd;
158  delete fAbsGapCmd;
159  delete fAbsSizYZCmd;
160  delete fWorldMaterCmd;
161  delete fWorldXCmd;
162  delete fXMagFieldCmd;
163  delete fYMagFieldCmd;
164  delete fZMagFieldCmd;
165  delete fNumOfAbsCmd;
166  delete fNumOfEvt;
167  delete fVerbCmd;
168  delete fIntCmd;
169  delete fDeltaECmd;
170 
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
174 
176 {
177 
178  if( command == fAbsMaterCmd )
179  { fDetector->SetTarget1Material(newValue);}
180 
181  if( command == fWorldMaterCmd )
182  { fDetector->SetTarget2Material(newValue);}
183 
184  if( command == fAbsThickCmd )
186 
187  if( command == fAbsGapCmd )
189 
190  if( command == fAbsSizYZCmd )
192 
193  if( command == fWorldXCmd )
195 
196  if( command == fXMagFieldCmd )
198 
199  if( command == fYMagFieldCmd )
200  { G4double x = fYMagFieldCmd->GetNewDoubleValue(newValue);
202  }
203 
204  if( command == fZMagFieldCmd )
206 
207  if( command == fNumOfAbsCmd )
208  {
210  }
211 
212  if( command == fNumOfEvt )
214 
215  if( command == fIntCmd )
217  if( command == fDeltaECmd )
219 
220  if( command == fVerbCmd ){
221  G4int ver = fVerbCmd->GetNewIntValue(newValue);
222  fDetector->SetVerbose(ver);
223  }
224 
225 }
226 
227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Float_t x
Definition: compare.C:6
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
double G4double
Definition: G4Types.hh:76
void SetUnitCategory(const char *unitCategory)
int G4int
Definition: G4Types.hh:78
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
Simple detector construction with a box volume placed in a world.