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 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 ]

Diff markup

Differences between /examples/extended/optical/wls/src/WLSDetectorMessenger.cc (Version 11.3.0) and /examples/extended/optical/wls/src/WLSDetectorMessenger.cc (Version 4.0)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 /// \file optical/wls/src/WLSDetectorMessenger    
 28 /// \brief Implementation of the WLSDetectorMe    
 29 //                                                
 30 //                                                
 31 #include "WLSDetectorMessenger.hh"                
 32                                                   
 33 #include "G4UIcmdWithABool.hh"                    
 34 #include "G4UIcmdWithADouble.hh"                  
 35 #include "G4UIcmdWithADoubleAndUnit.hh"           
 36 #include "G4UIcmdWithAString.hh"                  
 37 #include "G4UIcmdWithAnInteger.hh"                
 38 #include "G4UIcmdWithoutParameter.hh"             
 39 #include "G4UIdirectory.hh"                       
 40                                                   
 41 //....oooOO0OOooo........oooOO0OOooo........oo    
 42                                                   
 43 WLSDetectorMessenger::WLSDetectorMessenger(WLS    
 44 {                                                 
 45   fDetDir = new G4UIdirectory("/WLS/");           
 46   fDetDir->SetGuidance(" Geometry Setup ");       
 47                                                   
 48   fSetPhotonDetGeometryCmd = new G4UIcmdWithAS    
 49   fSetPhotonDetGeometryCmd->SetGuidance("Selec    
 50   fSetPhotonDetGeometryCmd->SetGuidance("Only     
 51   fSetPhotonDetGeometryCmd->SetCandidates("Cir    
 52   fSetPhotonDetGeometryCmd->AvailableForStates    
 53   fSetPhotonDetGeometryCmd->SetToBeBroadcasted    
 54                                                   
 55   fSetNumOfCladLayersCmd = new G4UIcmdWithAnIn    
 56   fSetNumOfCladLayersCmd->SetGuidance("Select     
 57   fSetNumOfCladLayersCmd->SetGuidance("Maximum    
 58   fSetNumOfCladLayersCmd->SetParameterName("nu    
 59   fSetNumOfCladLayersCmd->SetRange("numberOfLa    
 60   fSetNumOfCladLayersCmd->AvailableForStates(G    
 61   fSetNumOfCladLayersCmd->SetToBeBroadcasted(f    
 62                                                   
 63   fSetSurfaceRoughnessCmd = new G4UIcmdWithADo    
 64   fSetSurfaceRoughnessCmd->SetGuidance("Set th    
 65   fSetSurfaceRoughnessCmd->SetParameterName("r    
 66   fSetSurfaceRoughnessCmd->SetRange("roughness    
 67   fSetSurfaceRoughnessCmd->AvailableForStates(    
 68   fSetSurfaceRoughnessCmd->SetToBeBroadcasted(    
 69                                                   
 70   fSetXYRatioCmd = new G4UIcmdWithADouble("/WL    
 71   fSetXYRatioCmd->SetGuidance("Set the ratio b    
 72   fSetXYRatioCmd->SetParameterName("ratio", fa    
 73   fSetXYRatioCmd->SetRange("ratio>0 && ratio<=    
 74   fSetXYRatioCmd->AvailableForStates(G4State_P    
 75   fSetXYRatioCmd->SetToBeBroadcasted(false);      
 76                                                   
 77   fSetMirrorPolishCmd = new G4UIcmdWithADouble    
 78   fSetMirrorPolishCmd->SetGuidance("Set the po    
 79   fSetMirrorPolishCmd->SetParameterName("polis    
 80   fSetMirrorPolishCmd->SetRange("polish>0 && p    
 81   fSetMirrorPolishCmd->AvailableForStates(G4St    
 82   fSetMirrorPolishCmd->SetToBeBroadcasted(fals    
 83                                                   
 84   fSetMirrorReflectivityCmd = new G4UIcmdWithA    
 85   fSetMirrorReflectivityCmd->SetGuidance("Set     
 86   fSetMirrorReflectivityCmd->SetParameterName(    
 87   fSetMirrorReflectivityCmd->SetRange("reflect    
 88   fSetMirrorReflectivityCmd->AvailableForState    
 89   fSetMirrorReflectivityCmd->SetToBeBroadcaste    
 90                                                   
 91   fSetPhotonDetPolishCmd = new G4UIcmdWithADou    
 92   fSetPhotonDetPolishCmd->SetGuidance("Set the    
 93   fSetPhotonDetPolishCmd->SetParameterName("po    
 94   fSetPhotonDetPolishCmd->SetRange("polish>0 &    
 95   fSetPhotonDetPolishCmd->AvailableForStates(G    
 96   fSetPhotonDetPolishCmd->SetToBeBroadcasted(f    
 97                                                   
 98   fSetPhotonDetReflectivityCmd = new G4UIcmdWi    
 99   fSetPhotonDetReflectivityCmd->SetGuidance("S    
100   fSetPhotonDetReflectivityCmd->SetParameterNa    
101   fSetPhotonDetReflectivityCmd->SetRange("refl    
102   fSetPhotonDetReflectivityCmd->AvailableForSt    
103   fSetPhotonDetReflectivityCmd->SetToBeBroadca    
104                                                   
105   fSetWLSLengthCmd = new G4UIcmdWithADoubleAnd    
106   fSetWLSLengthCmd->SetGuidance("Set the half     
107   fSetWLSLengthCmd->SetParameterName("length",    
108   fSetWLSLengthCmd->SetRange("length>0.");        
109   fSetWLSLengthCmd->SetUnitCategory("Length");    
110   fSetWLSLengthCmd->SetDefaultUnit("mm");         
111   fSetWLSLengthCmd->AvailableForStates(G4State    
112   fSetWLSLengthCmd->SetToBeBroadcasted(false);    
113                                                   
114   fSetWLSRadiusCmd = new G4UIcmdWithADoubleAnd    
115   fSetWLSRadiusCmd->SetGuidance("Set the radiu    
116   fSetWLSRadiusCmd->SetParameterName("radius",    
117   fSetWLSRadiusCmd->SetRange("radius>0.");        
118   fSetWLSRadiusCmd->SetUnitCategory("Length");    
119   fSetWLSRadiusCmd->SetDefaultUnit("mm");         
120   fSetWLSRadiusCmd->AvailableForStates(G4State    
121   fSetWLSRadiusCmd->SetToBeBroadcasted(false);    
122                                                   
123   fSetClad1RadiusCmd = new G4UIcmdWithADoubleA    
124   fSetClad1RadiusCmd->SetGuidance("Set the rad    
125   fSetClad1RadiusCmd->SetParameterName("radius    
126   fSetClad1RadiusCmd->SetRange("radius>0.");      
127   fSetClad1RadiusCmd->SetUnitCategory("Length"    
128   fSetClad1RadiusCmd->SetDefaultUnit("mm");       
129   fSetClad1RadiusCmd->AvailableForStates(G4Sta    
130   fSetClad1RadiusCmd->SetToBeBroadcasted(false    
131                                                   
132   fSetClad2RadiusCmd = new G4UIcmdWithADoubleA    
133   fSetClad2RadiusCmd->SetGuidance("Set the rad    
134   fSetClad2RadiusCmd->SetParameterName("radius    
135   fSetClad2RadiusCmd->SetRange("radius>0.");      
136   fSetClad2RadiusCmd->SetUnitCategory("Length"    
137   fSetClad2RadiusCmd->SetDefaultUnit("mm");       
138   fSetClad2RadiusCmd->AvailableForStates(G4Sta    
139   fSetClad2RadiusCmd->SetToBeBroadcasted(false    
140                                                   
141   fSetPhotonDetHalfLengthCmd = new G4UIcmdWith    
142   fSetPhotonDetHalfLengthCmd->SetGuidance("Set    
143   fSetPhotonDetHalfLengthCmd->SetParameterName    
144   fSetPhotonDetHalfLengthCmd->SetRange("halfL>    
145   fSetPhotonDetHalfLengthCmd->SetUnitCategory(    
146   fSetPhotonDetHalfLengthCmd->SetDefaultUnit("    
147   fSetPhotonDetHalfLengthCmd->AvailableForStat    
148   fSetPhotonDetHalfLengthCmd->SetToBeBroadcast    
149                                                   
150   fSetGapCmd = new G4UIcmdWithADoubleAndUnit("    
151   fSetGapCmd->SetGuidance("Set the distance be    
152   fSetGapCmd->SetParameterName("theta", false)    
153   fSetGapCmd->SetUnitCategory("Length");          
154   fSetGapCmd->SetDefaultUnit("mm");               
155   fSetGapCmd->SetRange("theta>=0.");              
156   fSetGapCmd->AvailableForStates(G4State_PreIn    
157   fSetGapCmd->SetToBeBroadcasted(false);          
158                                                   
159   fSetPhotonDetAlignmentCmd = new G4UIcmdWithA    
160   fSetPhotonDetAlignmentCmd->SetGuidance("Set     
161   fSetPhotonDetAlignmentCmd->SetParameterName(    
162   fSetPhotonDetAlignmentCmd->SetUnitCategory("    
163   fSetPhotonDetAlignmentCmd->SetDefaultUnit("d    
164   fSetPhotonDetAlignmentCmd->SetRange("theta>-    
165   fSetPhotonDetAlignmentCmd->AvailableForState    
166   fSetPhotonDetAlignmentCmd->SetToBeBroadcaste    
167                                                   
168   fSetMirrorCmd = new G4UIcmdWithABool("/WLS/s    
169   fSetMirrorCmd->SetGuidance("Place a mirror a    
170   fSetMirrorCmd->AvailableForStates(G4State_Pr    
171   fSetMirrorCmd->SetToBeBroadcasted(false);       
172                                                   
173   fSetBarLengthCmd = new G4UIcmdWithADoubleAnd    
174   fSetBarLengthCmd->SetGuidance("Set the lengt    
175   fSetBarLengthCmd->SetParameterName("length",    
176   fSetBarLengthCmd->SetRange("length>0.");        
177   fSetBarLengthCmd->SetUnitCategory("Length");    
178   fSetBarLengthCmd->SetDefaultUnit("mm");         
179   fSetBarLengthCmd->AvailableForStates(G4State    
180   fSetBarLengthCmd->SetToBeBroadcasted(false);    
181                                                   
182   fSetBarBaseCmd = new G4UIcmdWithADoubleAndUn    
183   fSetBarBaseCmd->SetGuidance("Set the side le    
184   fSetBarBaseCmd->SetParameterName("length", f    
185   fSetBarBaseCmd->SetRange("length>0.");          
186   fSetBarBaseCmd->SetUnitCategory("Length");      
187   fSetBarBaseCmd->SetDefaultUnit("mm");           
188   fSetBarBaseCmd->AvailableForStates(G4State_P    
189   fSetBarBaseCmd->SetToBeBroadcasted(false);      
190                                                   
191   fSetHoleRadiusCmd = new G4UIcmdWithADoubleAn    
192   fSetHoleRadiusCmd->SetGuidance("Set the radi    
193   fSetHoleRadiusCmd->SetParameterName("radius"    
194   fSetHoleRadiusCmd->SetRange("radius>0.");       
195   fSetHoleRadiusCmd->SetUnitCategory("Length")    
196   fSetHoleRadiusCmd->SetDefaultUnit("mm");        
197   fSetHoleRadiusCmd->AvailableForStates(G4Stat    
198   fSetHoleRadiusCmd->SetToBeBroadcasted(false)    
199                                                   
200   fSetCoatingThicknessCmd = new G4UIcmdWithADo    
201   fSetCoatingThicknessCmd->SetGuidance("Set th    
202   fSetCoatingThicknessCmd->SetParameterName("t    
203   fSetCoatingThicknessCmd->SetUnitCategory("Le    
204   fSetCoatingThicknessCmd->SetDefaultUnit("mm"    
205   fSetCoatingThicknessCmd->SetRange("thick>=0.    
206   fSetCoatingThicknessCmd->AvailableForStates(    
207   fSetCoatingThicknessCmd->SetToBeBroadcasted(    
208                                                   
209   fSetCoatingRadiusCmd = new G4UIcmdWithADoubl    
210   fSetCoatingRadiusCmd->SetGuidance("Set inner    
211   fSetCoatingRadiusCmd->SetParameterName("crad    
212   fSetCoatingRadiusCmd->SetUnitCategory("Lengt    
213   fSetCoatingRadiusCmd->SetDefaultUnit("mm");     
214   fSetCoatingRadiusCmd->SetRange("cradius>=0."    
215   fSetCoatingRadiusCmd->AvailableForStates(G4S    
216   fSetCoatingRadiusCmd->SetToBeBroadcasted(fal    
217 }                                                 
218                                                   
219 //....oooOO0OOooo........oooOO0OOooo........oo    
220                                                   
221 WLSDetectorMessenger::~WLSDetectorMessenger()     
222 {                                                 
223   delete fDetDir;                                 
224                                                   
225   delete fSetBarLengthCmd;                        
226   delete fSetBarBaseCmd;                          
227   delete fSetClad1RadiusCmd;                      
228   delete fSetClad2RadiusCmd;                      
229   delete fSetCoatingThicknessCmd;                 
230   delete fSetCoatingRadiusCmd;                    
231   delete fSetGapCmd;                              
232   delete fSetHoleRadiusCmd;                       
233   delete fSetMirrorCmd;                           
234   delete fSetMirrorPolishCmd;                     
235   delete fSetMirrorReflectivityCmd;               
236   delete fSetNumOfCladLayersCmd;                  
237   delete fSetPhotonDetAlignmentCmd;               
238   delete fSetPhotonDetGeometryCmd;                
239   delete fSetPhotonDetHalfLengthCmd;              
240   delete fSetPhotonDetPolishCmd;                  
241   delete fSetPhotonDetReflectivityCmd;            
242   delete fSetSurfaceRoughnessCmd;                 
243   delete fSetWLSLengthCmd;                        
244   delete fSetWLSRadiusCmd;                        
245   delete fSetXYRatioCmd;                          
246 }                                                 
247                                                   
248 //....oooOO0OOooo........oooOO0OOooo........oo    
249                                                   
250 void WLSDetectorMessenger::SetNewValue(G4UIcom    
251 {                                                 
252   if (command == fSetPhotonDetGeometryCmd) {      
253     fDetector->SetPhotonDetGeometry(val);         
254   }                                               
255   else if (command == fSetNumOfCladLayersCmd)     
256     fDetector->SetNumberOfCladding(G4UIcmdWith    
257   }                                               
258   else if (command == fSetSurfaceRoughnessCmd)    
259     fDetector->SetSurfaceRoughness(G4UIcmdWith    
260   }                                               
261   else if (command == fSetXYRatioCmd) {           
262     fDetector->SetXYRatio(G4UIcmdWithADouble::    
263   }                                               
264   else if (command == fSetMirrorPolishCmd) {      
265     fDetector->SetMirrorPolish(G4UIcmdWithADou    
266   }                                               
267   else if (command == fSetMirrorReflectivityCm    
268     fDetector->SetMirrorReflectivity(G4UIcmdWi    
269   }                                               
270   else if (command == fSetPhotonDetPolishCmd)     
271     fDetector->SetPhotonDetPolish(G4UIcmdWithA    
272   }                                               
273   else if (command == fSetPhotonDetReflectivit    
274     fDetector->SetPhotonDetReflectivity(G4UIcm    
275   }                                               
276   else if (command == fSetWLSLengthCmd) {         
277     fDetector->SetWLSLength(G4UIcmdWithADouble    
278   }                                               
279   else if (command == fSetWLSRadiusCmd) {         
280     fDetector->SetWLSRadius(G4UIcmdWithADouble    
281   }                                               
282   else if (command == fSetClad1RadiusCmd) {       
283     fDetector->SetClad1Radius(G4UIcmdWithADoub    
284   }                                               
285   else if (command == fSetClad2RadiusCmd) {       
286     fDetector->SetClad2Radius(G4UIcmdWithADoub    
287   }                                               
288   else if (command == fSetPhotonDetHalfLengthC    
289     fDetector->SetPhotonDetHalfLength(G4UIcmdW    
290   }                                               
291   else if (command == fSetGapCmd) {               
292     fDetector->SetGap(G4UIcmdWithADoubleAndUni    
293   }                                               
294   else if (command == fSetPhotonDetAlignmentCm    
295     fDetector->SetPhotonDetAlignment(G4UIcmdWi    
296   }                                               
297   else if (command == fSetMirrorCmd) {            
298     fDetector->SetMirror(G4UIcmdWithABool::Get    
299   }                                               
300   else if (command == fSetBarLengthCmd) {         
301     fDetector->SetBarLength(G4UIcmdWithADouble    
302   }                                               
303   else if (command == fSetBarBaseCmd) {           
304     fDetector->SetBarBase(G4UIcmdWithADoubleAn    
305   }                                               
306   else if (command == fSetHoleRadiusCmd) {        
307     fDetector->SetHoleRadius(G4UIcmdWithADoubl    
308   }                                               
309   else if (command == fSetCoatingThicknessCmd)    
310     fDetector->SetCoatingThickness(G4UIcmdWith    
311   }                                               
312   else if (command == fSetCoatingRadiusCmd) {     
313     fDetector->SetCoatingRadius(G4UIcmdWithADo    
314   }                                               
315 }                                                 
316