Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/exoticphysics/saxs/src/SAXSDetectorConstructionMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 /// \file SAXSDetectorConstructionMessenger.cc
 27 /// \brief Implementation of the SAXSDetectorConstructionMessenger class
 28 //
 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 30 
 31 #include "SAXSDetectorConstructionMessenger.hh"
 32 
 33 #include "SAXSDetectorConstruction.hh"
 34 
 35 #include "G4RunManager.hh"
 36 #include "G4UIcmdWith3VectorAndUnit.hh"
 37 #include "G4UIcmdWithABool.hh"
 38 #include "G4UIcmdWithADouble.hh"
 39 #include "G4UIcmdWithADoubleAndUnit.hh"
 40 #include "G4UIcmdWithAString.hh"
 41 #include "G4UIcmdWithAnInteger.hh"
 42 #include "G4UIdirectory.hh"
 43 #include "G4ios.hh"
 44 
 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 46 
 47 SAXSDetectorConstructionMessenger::SAXSDetectorConstructionMessenger(
 48   SAXSDetectorConstruction* detconstr)
 49   : G4UImessenger(), fDetector(detconstr)
 50 {
 51   fCmdDir = new G4UIdirectory("/det/");
 52   fCmdDir->SetGuidance("Detector Control");
 53 
 54   fSetCustomMatFFfilename = new G4UIcmdWithAString("/det/SetCustomMatFF", this);
 55   fSetCustomMatFFfilename->SetGuidance("Set CustomMat FF filename");
 56   fSetCustomMatFFfilename->SetParameterName("mmff", false);
 57   fSetCustomMatFFfilename->AvailableForStates(G4State_PreInit);
 58 
 59   fSetCustomMatDensityCmd = new G4UIcmdWithADouble("/det/setCustomMatDensity", this);
 60   fSetCustomMatDensityCmd->SetGuidance("Set density for custom material");
 61   fSetCustomMatDensityCmd->SetParameterName("cmden", false);
 62   fSetCustomMatDensityCmd->SetRange("cmden>0.");
 63   fSetCustomMatDensityCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 64 
 65   fSetCustomMatHmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatHmassfract", this);
 66   fSetCustomMatHmassfractCmd->SetGuidance("Set H mass fraction for custom material");
 67   fSetCustomMatHmassfractCmd->SetParameterName("cmHmf", false);
 68   fSetCustomMatHmassfractCmd->SetRange("cmHmf>=0.");
 69   fSetCustomMatHmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 70 
 71   fSetCustomMatCmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatCmassfract", this);
 72   fSetCustomMatCmassfractCmd->SetGuidance("Set C mass fraction for custom material");
 73   fSetCustomMatCmassfractCmd->SetParameterName("cmCmf", false);
 74   fSetCustomMatCmassfractCmd->SetRange("cmCmf>=0.");
 75   fSetCustomMatCmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 76 
 77   fSetCustomMatNmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatNmassfract", this);
 78   fSetCustomMatNmassfractCmd->SetGuidance("Set N mass fraction for custom material");
 79   fSetCustomMatNmassfractCmd->SetParameterName("cmNmf", false);
 80   fSetCustomMatNmassfractCmd->SetRange("cmNmf>=0.");
 81   fSetCustomMatNmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 82 
 83   fSetCustomMatOmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatOmassfract", this);
 84   fSetCustomMatOmassfractCmd->SetGuidance("Set O mass fraction for custom material");
 85   fSetCustomMatOmassfractCmd->SetParameterName("cmOmf", false);
 86   fSetCustomMatOmassfractCmd->SetRange("cmOmf>=0.");
 87   fSetCustomMatOmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 88 
 89   fSetCustomMatNamassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatNamassfract", this);
 90   fSetCustomMatNamassfractCmd->SetGuidance("Set Na mass fraction for custom material");
 91   fSetCustomMatNamassfractCmd->SetParameterName("cmNamf", false);
 92   fSetCustomMatNamassfractCmd->SetRange("cmNamf>=0.");
 93   fSetCustomMatNamassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
 94 
 95   fSetCustomMatPmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatPmassfract", this);
 96   fSetCustomMatPmassfractCmd->SetGuidance("Set P mass fraction for custom material");
 97   fSetCustomMatPmassfractCmd->SetParameterName("cmPmf", false);
 98   fSetCustomMatPmassfractCmd->SetRange("cmPmf>=0.");
 99   fSetCustomMatPmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
100 
101   fSetCustomMatSmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatSmassfract", this);
102   fSetCustomMatSmassfractCmd->SetGuidance("Set S mass fraction for custom material");
103   fSetCustomMatSmassfractCmd->SetParameterName("cmSmf", false);
104   fSetCustomMatSmassfractCmd->SetRange("cmSmf>=0.");
105   fSetCustomMatSmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
106 
107   fSetCustomMatClmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatClmassfract", this);
108   fSetCustomMatClmassfractCmd->SetGuidance("Set Cl mass fraction for custom material");
109   fSetCustomMatClmassfractCmd->SetParameterName("cmClmf", false);
110   fSetCustomMatClmassfractCmd->SetRange("cmClmf>=0.");
111   fSetCustomMatClmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
112 
113   fSetCustomMatKmassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatKmassfract", this);
114   fSetCustomMatKmassfractCmd->SetGuidance("Set K mass fraction for custom material");
115   fSetCustomMatKmassfractCmd->SetParameterName("cmKmf", false);
116   fSetCustomMatKmassfractCmd->SetRange("cmKmf>=0.");
117   fSetCustomMatKmassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
118 
119   fSetCustomMatCamassfractCmd = new G4UIcmdWithADouble("/det/setCustomMatCamassfract", this);
120   fSetCustomMatCamassfractCmd->SetGuidance("Set Ca mass fraction for custom material");
121   fSetCustomMatCamassfractCmd->SetParameterName("cmCamf", false);
122   fSetCustomMatCamassfractCmd->SetRange("cmCamf>=0.");
123   fSetCustomMatCamassfractCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
124 
125   fPhantomMaterialCmd = new G4UIcmdWithAnInteger("/det/setPhantomMaterial", this);
126   fPhantomMaterialCmd->SetGuidance("Set Phantom material");
127   fPhantomMaterialCmd->SetParameterName("PhantomMat", false);
128   fPhantomMaterialCmd->SetRange("PhantomMat>=1 && PhantomMat<=30");
129   fPhantomMaterialCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
130 
131   fPhantomDiameterCmd = new G4UIcmdWithADoubleAndUnit("/det/setPhantomDiameter", this);
132   fPhantomDiameterCmd->SetGuidance("Set Phantom Diameter");
133   fPhantomDiameterCmd->SetParameterName("PhantomDiameter", false);
134   fPhantomDiameterCmd->SetUnitCategory("Length");
135   fPhantomDiameterCmd->SetRange("PhantomDiameter>0.");
136   fPhantomDiameterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
137 
138   fPhantomHeightCmd = new G4UIcmdWithADoubleAndUnit("/det/setPhantomHeight", this);
139   fPhantomHeightCmd->SetGuidance("Set Phantom Thickness");
140   fPhantomHeightCmd->SetParameterName("PhantomHeight", false);
141   fPhantomHeightCmd->SetUnitCategory("Length");
142   fPhantomHeightCmd->SetRange("PhantomHeight>0.");
143   fPhantomHeightCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
144 
145   fPhantomZCmd = new G4UIcmdWithADoubleAndUnit("/det/setPhantomZ", this);
146   fPhantomZCmd->SetGuidance("Set Phantom Z");
147   fPhantomZCmd->SetParameterName("PhantomZ", false);
148   fPhantomZCmd->SetUnitCategory("Length");
149   fPhantomZCmd->SetRange("PhantomZ>=0.");
150   fPhantomZCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
151 
152   fSetComp0Cmd = new G4UIcmdWithADouble("/det/setComp0", this);
153   fSetComp0Cmd->SetGuidance("Set Comp0 for medical material");
154   fSetComp0Cmd->SetParameterName("c0", false);
155   fSetComp0Cmd->SetRange("c0>=0.");
156   fSetComp0Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
157 
158   fSetComp1Cmd = new G4UIcmdWithADouble("/det/setComp1", this);
159   fSetComp1Cmd->SetGuidance("Set Comp1 for medical material");
160   fSetComp1Cmd->SetParameterName("c1", false);
161   fSetComp1Cmd->SetRange("c1>=0.");
162   fSetComp1Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
163 
164   fSetComp2Cmd = new G4UIcmdWithADouble("/det/setComp2", this);
165   fSetComp2Cmd->SetGuidance("Set Comp2 for medical material");
166   fSetComp2Cmd->SetParameterName("c2", false);
167   fSetComp2Cmd->SetRange("c2>=0.");
168   fSetComp2Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
169 
170   fSetComp3Cmd = new G4UIcmdWithADouble("/det/setComp3", this);
171   fSetComp3Cmd->SetGuidance("Set Comp3 for medical material");
172   fSetComp3Cmd->SetParameterName("c3", false);
173   fSetComp3Cmd->SetRange("c3>=0.");
174   fSetComp3Cmd->AvailableForStates(G4State_PreInit, G4State_Idle);
175 
176   fThetaSetupCmd = new G4UIcmdWithADouble("/det/setThetaSetup", this);
177   fThetaSetupCmd->SetGuidance("Set theta setup (rad)");
178   fThetaSetupCmd->SetParameterName("theta", false);
179   fThetaSetupCmd->SetRange("theta>=0.");
180   fThetaSetupCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
181 
182   fSetSlitsCmd = new G4UIcmdWithABool("/det/setSlits", this);
183   fSetSlitsCmd->SetGuidance("set Slits");
184   fSetSlitsCmd->SetParameterName("fIWantSlits", true);
185   fSetSlitsCmd->SetDefaultValue(false);
186 
187   fSlit1ThicknessCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit1Thickness", this);
188   fSlit1ThicknessCmd->SetGuidance("Set Slit1 Thickness");
189   fSlit1ThicknessCmd->SetParameterName("Slit1Thickness", false);
190   fSlit1ThicknessCmd->SetUnitCategory("Length");
191   fSlit1ThicknessCmd->SetRange("Slit1Thickness>0.");
192   fSlit1ThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
193 
194   fSlit2ThicknessCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit2Thickness", this);
195   fSlit2ThicknessCmd->SetGuidance("Set Slit2 Thickness");
196   fSlit2ThicknessCmd->SetParameterName("Slit2Thickness", false);
197   fSlit2ThicknessCmd->SetUnitCategory("Length");
198   fSlit2ThicknessCmd->SetRange("Slit2Thickness>0.");
199   fSlit2ThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
200 
201   fSlit3ThicknessCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit3Thickness", this);
202   fSlit3ThicknessCmd->SetGuidance("Set Slit3 Thickness");
203   fSlit3ThicknessCmd->SetParameterName("Slit3Thickness", false);
204   fSlit3ThicknessCmd->SetUnitCategory("Length");
205   fSlit3ThicknessCmd->SetRange("Slit3Thickness>0.");
206   fSlit3ThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
207 
208   fSlit4ThicknessCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit4Thickness", this);
209   fSlit4ThicknessCmd->SetGuidance("Set Slit4 Thickness");
210   fSlit4ThicknessCmd->SetParameterName("Slit4Thickness", false);
211   fSlit4ThicknessCmd->SetUnitCategory("Length");
212   fSlit4ThicknessCmd->SetRange("Slit4Thickness>0.");
213   fSlit4ThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
214 
215   fSlit1DistanceCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit1SampleDistance", this);
216   fSlit1DistanceCmd->SetGuidance("Set Slit1-to-Sample Distance");
217   fSlit1DistanceCmd->SetParameterName("Slit1dist", false);
218   fSlit1DistanceCmd->SetUnitCategory("Length");
219   fSlit1DistanceCmd->SetRange("Slit1dist>0.");
220   fSlit1DistanceCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
221 
222   fSlit2DistanceCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit2SampleDistance", this);
223   fSlit2DistanceCmd->SetGuidance("Set Slit2-to-Sample Distance");
224   fSlit2DistanceCmd->SetParameterName("Slit2dist", false);
225   fSlit2DistanceCmd->SetUnitCategory("Length");
226   fSlit2DistanceCmd->SetRange("Slit2dist>0.");
227   fSlit2DistanceCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
228 
229   fSlit3DistanceCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit3SampleDistance", this);
230   fSlit3DistanceCmd->SetGuidance("Set Slit3-to-Sample Distance");
231   fSlit3DistanceCmd->SetParameterName("Slit3dist", false);
232   fSlit3DistanceCmd->SetUnitCategory("Length");
233   fSlit3DistanceCmd->SetRange("Slit3dist>0.");
234   fSlit3DistanceCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
235 
236   fSlit4DistanceCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit4SampleDistance", this);
237   fSlit4DistanceCmd->SetGuidance("Set Slit4-to-Sample Distance");
238   fSlit4DistanceCmd->SetParameterName("Slit4dist", false);
239   fSlit4DistanceCmd->SetUnitCategory("Length");
240   fSlit4DistanceCmd->SetRange("Slit4dist>0.");
241   fSlit4DistanceCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
242 
243   fSlit1xApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit1xAperture", this);
244   fSlit1xApertureCmd->SetGuidance("Set Slit1 x Aperture");
245   fSlit1xApertureCmd->SetParameterName("Slit1xAp", false);
246   fSlit1xApertureCmd->SetUnitCategory("Length");
247   fSlit1xApertureCmd->SetRange("Slit1xAp>0.");
248   fSlit1xApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
249 
250   fSlit2xApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit2xAperture", this);
251   fSlit2xApertureCmd->SetGuidance("Set Slit2 x Aperture");
252   fSlit2xApertureCmd->SetParameterName("Slit2xAp", false);
253   fSlit2xApertureCmd->SetUnitCategory("Length");
254   fSlit2xApertureCmd->SetRange("Slit2xAp>0.");
255   fSlit2xApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
256 
257   fSlit3xApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit3xAperture", this);
258   fSlit3xApertureCmd->SetGuidance("Set Slit3 x Aperture");
259   fSlit3xApertureCmd->SetParameterName("Slit3xAp", false);
260   fSlit3xApertureCmd->SetUnitCategory("Length");
261   fSlit3xApertureCmd->SetRange("Slit3xAp>0.");
262   fSlit3xApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
263 
264   fSlit4xApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit4xAperture", this);
265   fSlit4xApertureCmd->SetGuidance("Set Slit4 x Aperture");
266   fSlit4xApertureCmd->SetParameterName("Slit4xAp", false);
267   fSlit4xApertureCmd->SetUnitCategory("Length");
268   fSlit4xApertureCmd->SetRange("Slit4xAp>0.");
269   fSlit4xApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
270 
271   fSlit1yApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit1yAperture", this);
272   fSlit1yApertureCmd->SetGuidance("Set Slit1 y Aperture");
273   fSlit1yApertureCmd->SetParameterName("Slit1yAp", false);
274   fSlit1yApertureCmd->SetUnitCategory("Length");
275   fSlit1yApertureCmd->SetRange("Slit1yAp>0.");
276   fSlit1yApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
277 
278   fSlit2yApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit2yAperture", this);
279   fSlit2yApertureCmd->SetGuidance("Set Slit2 y Aperture");
280   fSlit2yApertureCmd->SetParameterName("Slit2yAp", false);
281   fSlit2yApertureCmd->SetUnitCategory("Length");
282   fSlit2yApertureCmd->SetRange("Slit2yAp>0.");
283   fSlit2yApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
284 
285   fSlit3yApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit3yAperture", this);
286   fSlit3yApertureCmd->SetGuidance("Set Slit3 y Aperture");
287   fSlit3yApertureCmd->SetParameterName("Slit3yAp", false);
288   fSlit3yApertureCmd->SetUnitCategory("Length");
289   fSlit3yApertureCmd->SetRange("Slit3yAp>0.");
290   fSlit3yApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
291 
292   fSlit4yApertureCmd = new G4UIcmdWithADoubleAndUnit("/det/setSlit4yAperture", this);
293   fSlit4yApertureCmd->SetGuidance("Set Slit4 y Aperture");
294   fSlit4yApertureCmd->SetParameterName("Slit4yAp", false);
295   fSlit4yApertureCmd->SetUnitCategory("Length");
296   fSlit4yApertureCmd->SetRange("Slit4yAp>0.");
297   fSlit4yApertureCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
298 
299   fDetectorThicknessCmd = new G4UIcmdWithADoubleAndUnit("/det/setDetectorThickness", this);
300   fDetectorThicknessCmd->SetGuidance("Set Detector Thickness");
301   fDetectorThicknessCmd->SetParameterName("DetectorThickness", false);
302   fDetectorThicknessCmd->SetUnitCategory("Length");
303   fDetectorThicknessCmd->SetRange("DetectorThickness>0.");
304   fDetectorThicknessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
305 
306   fDetectorSizeCmd = new G4UIcmdWithADoubleAndUnit("/det/setDetectorSize", this);
307   fDetectorSizeCmd->SetGuidance("Set DetectorSize");
308   fDetectorSizeCmd->SetParameterName("scrnsize", false);
309   fDetectorSizeCmd->SetUnitCategory("Length");
310   fDetectorSizeCmd->SetRange("scrnsize>0.");
311   fDetectorSizeCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
312 
313   fDetectorDistanceCmd = new G4UIcmdWithADoubleAndUnit("/det/setDetectorSampleDistance", this);
314   fDetectorDistanceCmd->SetGuidance("Set Detector Distance");
315   fDetectorDistanceCmd->SetParameterName("detDist", false);
316   fDetectorDistanceCmd->SetUnitCategory("Length");
317   fDetectorDistanceCmd->SetRange("detDist>0.");
318   fDetectorDistanceCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
319 }
320 
321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
322 
323 SAXSDetectorConstructionMessenger::~SAXSDetectorConstructionMessenger()
324 {
325   delete fCmdDir;
326 
327   delete fSetCustomMatFFfilename;
328   delete fSetCustomMatDensityCmd;
329   delete fSetCustomMatHmassfractCmd;
330   delete fSetCustomMatCmassfractCmd;
331   delete fSetCustomMatNmassfractCmd;
332   delete fSetCustomMatOmassfractCmd;
333   delete fSetCustomMatNamassfractCmd;
334   delete fSetCustomMatPmassfractCmd;
335   delete fSetCustomMatSmassfractCmd;
336   delete fSetCustomMatClmassfractCmd;
337   delete fSetCustomMatKmassfractCmd;
338   delete fSetCustomMatCamassfractCmd;
339 
340   delete fPhantomMaterialCmd;
341   delete fPhantomDiameterCmd;
342   delete fPhantomHeightCmd;
343   delete fPhantomZCmd;
344 
345   delete fSetComp0Cmd;
346   delete fSetComp1Cmd;
347   delete fSetComp2Cmd;
348   delete fSetComp3Cmd;
349 
350   delete fThetaSetupCmd;
351 
352   delete fSetSlitsCmd;
353   delete fSlit1ThicknessCmd;
354   delete fSlit2ThicknessCmd;
355   delete fSlit3ThicknessCmd;
356   delete fSlit4ThicknessCmd;
357   delete fSlit1DistanceCmd;
358   delete fSlit2DistanceCmd;
359   delete fSlit3DistanceCmd;
360   delete fSlit4DistanceCmd;
361   delete fSlit1xApertureCmd;
362   delete fSlit2xApertureCmd;
363   delete fSlit3xApertureCmd;
364   delete fSlit4xApertureCmd;
365   delete fSlit1yApertureCmd;
366   delete fSlit2yApertureCmd;
367   delete fSlit3yApertureCmd;
368   delete fSlit4yApertureCmd;
369 
370   delete fDetectorThicknessCmd;
371   delete fDetectorSizeCmd;
372   delete fDetectorDistanceCmd;
373 }
374 
375 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
376 
377 void SAXSDetectorConstructionMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
378 {
379   if (command == fSetCustomMatFFfilename) fDetector->SetCustomMatFF(newValue);
380 
381   if (command == fSetCustomMatDensityCmd)
382     fDetector->SetCustomMatDensity(fSetCustomMatDensityCmd->GetNewDoubleValue(newValue));
383 
384   if (command == fSetCustomMatHmassfractCmd)
385     fDetector->SetCustomMatHmassfract(fSetCustomMatHmassfractCmd->GetNewDoubleValue(newValue));
386 
387   if (command == fSetCustomMatCmassfractCmd)
388     fDetector->SetCustomMatCmassfract(fSetCustomMatCmassfractCmd->GetNewDoubleValue(newValue));
389   if (command == fSetCustomMatNmassfractCmd)
390     fDetector->SetCustomMatNmassfract(fSetCustomMatNmassfractCmd->GetNewDoubleValue(newValue));
391   if (command == fSetCustomMatOmassfractCmd)
392     fDetector->SetCustomMatOmassfract(fSetCustomMatOmassfractCmd->GetNewDoubleValue(newValue));
393   if (command == fSetCustomMatNamassfractCmd)
394     fDetector->SetCustomMatNamassfract(fSetCustomMatNamassfractCmd->GetNewDoubleValue(newValue));
395   if (command == fSetCustomMatPmassfractCmd)
396     fDetector->SetCustomMatPmassfract(fSetCustomMatPmassfractCmd->GetNewDoubleValue(newValue));
397   if (command == fSetCustomMatSmassfractCmd)
398     fDetector->SetCustomMatSmassfract(fSetCustomMatSmassfractCmd->GetNewDoubleValue(newValue));
399   if (command == fSetCustomMatClmassfractCmd)
400     fDetector->SetCustomMatClmassfract(fSetCustomMatClmassfractCmd->GetNewDoubleValue(newValue));
401   if (command == fSetCustomMatKmassfractCmd)
402     fDetector->SetCustomMatKmassfract(fSetCustomMatKmassfractCmd->GetNewDoubleValue(newValue));
403   if (command == fSetCustomMatCamassfractCmd)
404     fDetector->SetCustomMatCamassfract(fSetCustomMatCamassfractCmd->GetNewDoubleValue(newValue));
405 
406   if (command == fPhantomMaterialCmd) {
407     fDetector->SetPhantomMaterial(fPhantomMaterialCmd->GetNewIntValue(newValue));
408   }
409   if (command == fPhantomDiameterCmd) {
410     fDetector->SetPhantomDiameter(fPhantomDiameterCmd->GetNewDoubleValue(newValue));
411   }
412   if (command == fPhantomHeightCmd) {
413     fDetector->SetPhantomHeight(fPhantomHeightCmd->GetNewDoubleValue(newValue));
414   }
415   if (command == fPhantomZCmd) {
416     fDetector->SetPhantomZ(fPhantomZCmd->GetNewDoubleValue(newValue));
417   }
418 
419   if (command == fSetComp0Cmd) fDetector->SetComp0(fSetComp0Cmd->GetNewDoubleValue(newValue));
420   if (command == fSetComp1Cmd) fDetector->SetComp1(fSetComp1Cmd->GetNewDoubleValue(newValue));
421   if (command == fSetComp2Cmd) fDetector->SetComp2(fSetComp2Cmd->GetNewDoubleValue(newValue));
422   if (command == fSetComp3Cmd) fDetector->SetComp3(fSetComp3Cmd->GetNewDoubleValue(newValue));
423 
424   if (command == fThetaSetupCmd)
425     fDetector->SetThetaSetup(fThetaSetupCmd->GetNewDoubleValue(newValue));
426   if (command == fSetSlitsCmd) fDetector->SetSlits(fSetSlitsCmd->GetNewBoolValue(newValue));
427   if (command == fSlit1ThicknessCmd)
428     fDetector->SetSlit1Thickness(fSlit1ThicknessCmd->GetNewDoubleValue(newValue));
429   if (command == fSlit2ThicknessCmd)
430     fDetector->SetSlit2Thickness(fSlit2ThicknessCmd->GetNewDoubleValue(newValue));
431   if (command == fSlit3ThicknessCmd)
432     fDetector->SetSlit3Thickness(fSlit3ThicknessCmd->GetNewDoubleValue(newValue));
433   if (command == fSlit4ThicknessCmd)
434     fDetector->SetSlit4Thickness(fSlit4ThicknessCmd->GetNewDoubleValue(newValue));
435   if (command == fSlit1DistanceCmd)
436     fDetector->SetSlit1SampleDistance(fSlit1DistanceCmd->GetNewDoubleValue(newValue));
437   if (command == fSlit2DistanceCmd)
438     fDetector->SetSlit2SampleDistance(fSlit2DistanceCmd->GetNewDoubleValue(newValue));
439   if (command == fSlit3DistanceCmd)
440     fDetector->SetSlit3SampleDistance(fSlit3DistanceCmd->GetNewDoubleValue(newValue));
441   if (command == fSlit4DistanceCmd)
442     fDetector->SetSlit4SampleDistance(fSlit4DistanceCmd->GetNewDoubleValue(newValue));
443   if (command == fSlit1xApertureCmd)
444     fDetector->SetSlit1xAperture(fSlit1xApertureCmd->GetNewDoubleValue(newValue));
445   if (command == fSlit2xApertureCmd)
446     fDetector->SetSlit2xAperture(fSlit2xApertureCmd->GetNewDoubleValue(newValue));
447   if (command == fSlit3xApertureCmd)
448     fDetector->SetSlit3xAperture(fSlit3xApertureCmd->GetNewDoubleValue(newValue));
449   if (command == fSlit4xApertureCmd)
450     fDetector->SetSlit4xAperture(fSlit4xApertureCmd->GetNewDoubleValue(newValue));
451   if (command == fSlit1yApertureCmd)
452     fDetector->SetSlit1yAperture(fSlit1yApertureCmd->GetNewDoubleValue(newValue));
453   if (command == fSlit2yApertureCmd)
454     fDetector->SetSlit2yAperture(fSlit2yApertureCmd->GetNewDoubleValue(newValue));
455   if (command == fSlit3yApertureCmd)
456     fDetector->SetSlit3yAperture(fSlit3yApertureCmd->GetNewDoubleValue(newValue));
457   if (command == fSlit4yApertureCmd)
458     fDetector->SetSlit4yAperture(fSlit4yApertureCmd->GetNewDoubleValue(newValue));
459   if (command == fDetectorThicknessCmd)
460     fDetector->SetDetectorThickness(fDetectorThicknessCmd->GetNewDoubleValue(newValue));
461   if (command == fDetectorSizeCmd)
462     fDetector->SetDetectorSize(fDetectorSizeCmd->GetNewDoubleValue(newValue));
463   if (command == fDetectorDistanceCmd)
464     fDetector->SetDetectorSampleDistance(fDetectorDistanceCmd->GetNewDoubleValue(newValue));
465 }
466 
467 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
468