Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Em10DetectorMessenger.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 //
28 //
29 //
30 // $Id$
31 //
32 //
33 
34 #include "Em10DetectorMessenger.hh"
35 
37 #include "G4UIdirectory.hh"
38 #include "G4UIcmdWithAString.hh"
39 #include "G4UIcmdWithAnInteger.hh"
42 
44 
46 :Em10Detector(Em10Det)
47 {
48  Em10detDir = new G4UIdirectory("/XTRdetector/");
49  Em10detDir->SetGuidance("Em10 detector control.");
50 
51  AbsMaterCmd = new G4UIcmdWithAString("/XTRdetector/setAbsMat",this);
52  AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
53  AbsMaterCmd->SetParameterName("choice",true);
54  AbsMaterCmd->SetDefaultValue("Xe");
55  AbsMaterCmd->AvailableForStates(G4State_Idle);
56 
57  RadiatorMaterCmd = new G4UIcmdWithAString("/XTRdetector/setRadMat",this);
58  RadiatorMaterCmd->SetGuidance("Select Material of the XTR radiator.");
59  RadiatorMaterCmd->SetParameterName("choice",true);
60  RadiatorMaterCmd->SetDefaultValue("CH2");
61  RadiatorMaterCmd->AvailableForStates(G4State_Idle);
62 
63  DetectorSetUpCmd = new G4UIcmdWithAString("/XTRdetector/setup",this);
64  DetectorSetUpCmd->SetGuidance("Select setup for comparison with experiment");
65  DetectorSetUpCmd->SetParameterName("choice",true);
66  DetectorSetUpCmd->SetDefaultValue("simpleALICE");
68 
69  ModelCmd = new G4UIcmdWithAnInteger("/XTRdetector/setModel",this);
70  ModelCmd->SetGuidance("Select Model for XTR");
71  ModelCmd->SetParameterName("choice",true);
72  ModelCmd->SetDefaultValue(0);
73  // ModelCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
75 
76  FoilNumCmd = new G4UIcmdWithAnInteger("/XTRdetector/setFoilNum",this);
77  FoilNumCmd->SetGuidance("Select foil number for XTR");
78  FoilNumCmd->SetParameterName("choice",true);
79  FoilNumCmd->SetDefaultValue(0);
81 
82  WorldMaterCmd = new G4UIcmdWithAString("/XTRdetector/setWorldMat",this);
83  WorldMaterCmd->SetGuidance("Select Material of the World.");
84  WorldMaterCmd->SetParameterName("wchoice",true);
85  WorldMaterCmd->SetDefaultValue("Air");
86  WorldMaterCmd->AvailableForStates(G4State_Idle);
87 
88  AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsThick",this);
89  AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
90  AbsThickCmd->SetParameterName("SizeZ",false,false);
91  AbsThickCmd->SetDefaultUnit("mm");
92  AbsThickCmd->SetRange("SizeZ>0.");
93  AbsThickCmd->AvailableForStates(G4State_Idle);
94 
95  RadiatorThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setRadThick",this);
96  RadiatorThickCmd->SetGuidance("Set Thickness of XTR radiator");
97  RadiatorThickCmd->SetParameterName("SizeZ",false,false);
98  RadiatorThickCmd->SetDefaultUnit("mm");
99  RadiatorThickCmd->SetRange("SizeZ>0.");
100  RadiatorThickCmd->AvailableForStates(G4State_Idle);
101 
102  GasGapThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setGasGapThick",this);
103  GasGapThickCmd->SetGuidance("Set Thickness of XTR gas gaps");
104  GasGapThickCmd->SetParameterName("SizeZ",false,false);
105  GasGapThickCmd->SetDefaultUnit("mm");
106  GasGapThickCmd->SetRange("SizeZ>0.");
107  GasGapThickCmd->AvailableForStates(G4State_Idle);
108 
109  AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsRad",this);
110  AbsRadCmd->SetGuidance("Set radius of the Absorber");
111  AbsRadCmd->SetParameterName("SizeR",false,false);
112  AbsRadCmd->SetDefaultUnit("mm");
113  AbsRadCmd->SetRange("SizeR>0.");
114  AbsRadCmd->AvailableForStates(G4State_Idle);
115 
116  AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsZpos",this);
117  AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
118  AbsZposCmd->SetParameterName("Zpos",false,false);
119  AbsZposCmd->SetDefaultUnit("mm");
120  AbsZposCmd->AvailableForStates(G4State_Idle);
121 
122  WorldZCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldZ",this);
123  WorldZCmd->SetGuidance("Set Z size of the World");
124  WorldZCmd->SetParameterName("WSizeZ",false,false);
125  WorldZCmd->SetDefaultUnit("mm");
126  WorldZCmd->SetRange("WSizeZ>0.");
127  WorldZCmd->AvailableForStates(G4State_Idle);
128 
129  WorldRCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldR",this);
130  WorldRCmd->SetGuidance("Set R size of the World");
131  WorldRCmd->SetParameterName("WSizeR",false,false);
132  WorldRCmd->SetDefaultUnit("mm");
133  WorldRCmd->SetRange("WSizeR>0.");
134  WorldRCmd->AvailableForStates(G4State_Idle);
135 
136  UpdateCmd = new G4UIcmdWithoutParameter("/XTRdetector/update",this);
137  UpdateCmd->SetGuidance("Update calorimeter geometry.");
138  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
139  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
140  UpdateCmd->AvailableForStates(G4State_Idle);
141 
142  MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setField",this);
143  MagFieldCmd->SetGuidance("Define magnetic field.");
144  MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
145  MagFieldCmd->SetParameterName("Bz",false,false);
146  MagFieldCmd->SetDefaultUnit("tesla");
147  MagFieldCmd->AvailableForStates(G4State_Idle);
148  /*
149  ElectronCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setElectronCut",this);
150  ElectronCutCmd->SetGuidance("Set electron cut in mm for vertex region");
151  ElectronCutCmd->SetParameterName("ElectronCut",false,false);
152  ElectronCutCmd->SetDefaultUnit("mm");
153  ElectronCutCmd->SetRange("ElectronCut>0.");
154  ElectronCutCmd->AvailableForStates(G4State_Idle);
155 
156 
157  PositronCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setPositronCut",this);
158  PositronCutCmd->SetGuidance("Set positron cut in mm for vertex region");
159  PositronCutCmd->SetParameterName("PositronCut",false,false);
160  PositronCutCmd->SetDefaultUnit("mm");
161  PositronCutCmd->SetRange("PositronCut>0.");
162  PositronCutCmd->AvailableForStates(G4State_Idle);
163 
164 
165  GammaCutCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setGammaCut",this);
166  GammaCutCmd->SetGuidance("Set gamma cut in mm for vertex region");
167  GammaCutCmd->SetParameterName("GammaCut",false,false);
168  GammaCutCmd->SetDefaultUnit("mm");
169  GammaCutCmd->SetRange("GammaCut>0.");
170  GammaCutCmd->AvailableForStates(G4State_Idle);
171  */
172 
173 }
174 
176 
178 {
179  delete AbsMaterCmd;
180  delete ModelCmd;
181  delete FoilNumCmd;
182  delete AbsThickCmd;
183  delete RadiatorThickCmd;
184  delete GasGapThickCmd;
185  delete AbsRadCmd;
186  delete AbsZposCmd;
187  delete WorldMaterCmd;
188  delete RadiatorMaterCmd;
189  delete WorldZCmd;
190  delete WorldRCmd;
191  delete UpdateCmd;
192  delete MagFieldCmd;
193  delete Em10detDir;
194 }
195 
197 
199 {
200  if( command == ModelCmd && newValue == 0 )
201  {
202  // Em10Detector->SetParametrisationModel(newValue);
203  Em10Detector->Construct();
204  }
205 }
207 //
208 //
209 
211 {
212  if( command == ModelCmd )
213  {
214  // Em10Detector->SetParametrisationModel(ModelCmd->GetNewIntValue(newValue));
215  // Em10Detector->ParametrisationModel();
216  }
217  if( command == FoilNumCmd )
218  {
219  Em10Detector->SetFoilNumber(FoilNumCmd->GetNewIntValue(newValue));
220  }
221  if( command == AbsMaterCmd )
222  { Em10Detector->SetAbsorberMaterial(newValue);}
223 
224  if( command == DetectorSetUpCmd )
225  { Em10Detector->SetDetectorSetUp(newValue);}
226 
227  if( command == RadiatorMaterCmd )
228  { Em10Detector->SetRadiatorMaterial(newValue);}
229 
230  if( command == WorldMaterCmd )
231  { Em10Detector->SetWorldMaterial(newValue);}
232 
233  if( command == AbsThickCmd )
234  { Em10Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
235 
236  if( command == RadiatorThickCmd )
237  { Em10Detector->SetRadiatorThickness(RadiatorThickCmd->
238  GetNewDoubleValue(newValue));}
239 
240  if( command == GasGapThickCmd )
241  { Em10Detector->SetGasGapThickness(GasGapThickCmd->
242  GetNewDoubleValue(newValue));}
243 
244  if( command == AbsRadCmd )
245  { Em10Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
246 
247  if( command == AbsZposCmd )
248  { Em10Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
249 
250  if( command == WorldZCmd )
251  { Em10Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
252 
253  if( command == WorldRCmd )
254  { Em10Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
255 
256  if( command == UpdateCmd )
257  { Em10Detector->UpdateGeometry(); }
258 
259  if( command == MagFieldCmd )
260  { Em10Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
261  /*
262  if( command == ElectronCutCmd )
263  {
264  Em10Detector->SetElectronCut(WorldRCmd->GetNewDoubleValue(newValue));
265  }
266  if( command == PositronCutCmd )
267  {
268  Em10Detector->SetPositronCut(WorldRCmd->GetNewDoubleValue(newValue));
269  }
270  if( command == GammaCutCmd )
271  {
272  Em10Detector->SetGammaCut(WorldRCmd->GetNewDoubleValue(newValue));
273  }
274  */
275 }
276 
277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....