Geant4  10.00.p02
GammaRayTelDetectorMessenger.cc
Go to the documentation of this file.
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 //
27 // $Id: GammaRayTelDetectorMessenger.cc 66508 2012-12-19 10:16:45Z gcosmo $
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class implementation file
31 // CERN Geneva Switzerland
32 //
33 //
34 // ------------ GammaRayTelDetectorMessenger ------
35 // by F.Longo, R.Giannitrapani & G.Santin (13 nov 2000)
36 //
37 // ************************************************************
38 
40 
42 #include "G4UIdirectory.hh"
43 #include "G4UIcmdWithAString.hh"
44 #include "G4UIcmdWithAnInteger.hh"
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 
51  :GammaRayTelDetector(GammaRayTelDet)
52 
53 {
54  GammaRayTeldetDir = new G4UIdirectory("/payload/");
55  GammaRayTeldetDir->SetGuidance("GammaRayTel payload control.");
56 
57  // converter material command
58 
59  ConverterMaterCmd = new G4UIcmdWithAString("/payload/setConvMat",this);
60  ConverterMaterCmd->SetGuidance("Select Material of the Converter.");
61  ConverterMaterCmd->SetParameterName("choice",false);
63 
64  // converter thickness command
65 
67  ("/payload/setConvThick",this);
68  ConverterThickCmd->SetGuidance("Set Thickness of the Converter");
69  ConverterThickCmd->SetParameterName("Size",false);
70  ConverterThickCmd->SetRange("Size>=0.");
73 
74  // tracker silicon thickness command
75 
77  ("/payload/setSiThick",this);
78  SiliconThickCmd->SetGuidance("Set Thickness of the Silicon");
79  SiliconThickCmd->SetParameterName("Size",false);
80  SiliconThickCmd->SetRange("Size>=0.");
83 
84  // tracker silicon pitch command
85 
87  ("/payload/setSiPitch",this);
88  SiliconPitchCmd->SetGuidance("Set Pitch of the Silicon Strips");
89  SiliconPitchCmd->SetParameterName("Size",false);
90  SiliconPitchCmd->SetRange("Size>=0.");
93 
94  // tracker silicon tile size command
95 
97  ("/payload/setSiTileXY",this);
98  SiliconTileXYCmd->SetGuidance("Set XY dimensions of Si Tile");
99  SiliconTileXYCmd->SetParameterName("Size",false);
100  SiliconTileXYCmd->SetRange("Size>=0.");
101  SiliconTileXYCmd->SetUnitCategory("Length");
103 
104  // tracker number of silicon tiles
105 
106  NbSiTilesCmd = new G4UIcmdWithAnInteger("/payload/setNbOfSiTiles",this);
107  NbSiTilesCmd->SetGuidance("Set number of Si Tiles.");
108  NbSiTilesCmd->SetParameterName("NbSiTiles",false);
109  NbSiTilesCmd->SetRange("NbSiTiles>0 && NbSiTiles<100");
111 
112  // tracker number of silicon layers
113 
114  NbTKRLayersCmd = new G4UIcmdWithAnInteger("/payload/setNbOfTKRLayers",this);
115  NbTKRLayersCmd->SetGuidance("Set number of TKR Layers.");
116  NbTKRLayersCmd->SetParameterName("NbTKRLayers",false);
117  NbTKRLayersCmd->SetRange("NbTKRLayers>0 && NbTKRLayers<30");
119 
120  // tracker layer distance
121 
123  ("/payload/setLayerDistance",this);
124  LayerDistanceCmd->SetGuidance("Set distance between two layers");
125  LayerDistanceCmd->SetParameterName("Size",false);
126  LayerDistanceCmd->SetRange("Size>=0.");
127  LayerDistanceCmd->SetUnitCategory("Length");
129 
130  // tracker views distance
131 
133  ("/payload/setViewsDistance",this);
134  ViewsDistanceCmd->SetGuidance("Set distance between X and Y views");
135  ViewsDistanceCmd->SetParameterName("Size",false);
136  ViewsDistanceCmd->SetRange("Size>=0.");
137  ViewsDistanceCmd->SetUnitCategory("Length");
139 
140  // calorimeter detector thickness
141 
143  ("/payload/setCALThick",this);
144  CALThickCmd->SetGuidance("Set thickness of CAL detectors");
145  CALThickCmd->SetParameterName("Size",false);
146  CALThickCmd->SetRange("Size>=0.");
147  CALThickCmd->SetUnitCategory("Length");
149 
150  // number calorimeter detectors
151 
152  NbCALBarsCmd = new G4UIcmdWithAnInteger("/payload/setNbOfCALBars",this);
153  NbCALBarsCmd->SetGuidance("Set number of CsI Bars.");
154  NbCALBarsCmd->SetParameterName("NbSiTiles",false);
155  NbCALBarsCmd->SetRange("NbSiTiles>0 && NbSiTiles<100");
157 
158  // number calorimeter layers
159 
160  NbCALLayersCmd = new G4UIcmdWithAnInteger("/payload/setNbOfCALLayers",this);
161  NbCALLayersCmd->SetGuidance("Set number of CAL Layers.");
162  NbCALLayersCmd->SetParameterName("NbCALLayers",false);
163  NbCALLayersCmd->SetRange("NbCALLayers>0 && NbCALLayers<16");
165 
166  // calorimeter detector thickness
167 
169  ("/payload/setACDThick",this);
170  ACDThickCmd->SetGuidance("Set thickness of ACD detectors");
171  ACDThickCmd->SetParameterName("Size",false);
172  ACDThickCmd->SetRange("Size>=0.");
173  ACDThickCmd->SetUnitCategory("Length");
175 
176  // update Payload
177 
178  UpdateCmd = new G4UIcmdWithoutParameter("/payload/update",this);
179  UpdateCmd->SetGuidance("Update payload geometry.");
180  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
181  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
183 
184  // magnetic field
185 
186  MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/payload/setField",this);
187  MagFieldCmd->SetGuidance("Define magnetic field.");
188  MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
189  MagFieldCmd->SetParameterName("Bz",false);
190  MagFieldCmd->SetUnitCategory("Magnetic flux density");
192 }
193 
194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
195 
197 {
198  delete ConverterMaterCmd; delete ConverterThickCmd;
199  delete NbSiTilesCmd; delete NbTKRLayersCmd;
200  delete SiliconTileXYCmd; delete SiliconPitchCmd;
201  delete SiliconThickCmd; delete LayerDistanceCmd;
202  delete ViewsDistanceCmd; delete ACDThickCmd;
203  delete NbCALLayersCmd; delete NbCALBarsCmd;
204  delete CALThickCmd; delete UpdateCmd;
205  delete MagFieldCmd; delete GammaRayTeldetDir;
206 }
207 
208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
209 
211 {
212 
213  // converter
214 
215  if( command == ConverterMaterCmd )
217 
218  if( command == ConverterThickCmd )
220 
221  // tracker
222 
223  if( command == SiliconTileXYCmd )
225 
226  if( command == SiliconPitchCmd )
228 
229  if( command == SiliconThickCmd )
231 
232  if( command == NbSiTilesCmd )
234 
235  if( command == NbTKRLayersCmd )
237 
238  if( command == LayerDistanceCmd )
240 
241  if( command == ViewsDistanceCmd )
243 
244  // calorimeter
245 
246  if( command == NbCALLayersCmd )
248 
249  if( command == NbCALBarsCmd )
251 
252  if( command == CALThickCmd )
254 
255  // anticoincidence
256 
257  if( command == ACDThickCmd )
259 
260  if( command == UpdateCmd )
262 
263  if( command == MagFieldCmd )
265 }
266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
267 
268 
269 
270 
271 
272 
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * CALThickCmd
G4UIcmdWithADoubleAndUnit * ConverterThickCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * LayerDistanceCmd
G4UIcmdWithADoubleAndUnit * SiliconPitchCmd
GammaRayTelDetectorConstruction * GammaRayTelDetector
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * SiliconThickCmd
G4UIcmdWithADoubleAndUnit * SiliconTileXYCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithADoubleAndUnit * ACDThickCmd
void SetNewValue(G4UIcommand *, G4String)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
GammaRayTelDetectorMessenger(GammaRayTelDetectorConstruction *)
G4UIcmdWithADoubleAndUnit * MagFieldCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * ViewsDistanceCmd