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

Diff markup

Differences between /examples/advanced/gammaray_telescope/src/GammaRayTelDetectorMessenger.cc (Version 11.3.0) and /examples/advanced/gammaray_telescope/src/GammaRayTelDetectorMessenger.cc (Version 7.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 // -------------------------------------------    
 28 //      GEANT 4 class implementation file         
 29 //      CERN Geneva Switzerland                   
 30 //                                                
 31 //                                                
 32 //      ------------ GammaRayTelDetectorMessen    
 33 //           by F.Longo, R.Giannitrapani & G.S    
 34 //                                                
 35 // *******************************************    
 36                                                   
 37 #include "GammaRayTelDetectorConstruction.hh"     
 38 #include "GammaRayTelDetectorMessenger.hh"        
 39                                                   
 40 #include "G4UIcmdWithADoubleAndUnit.hh"           
 41 #include "G4UIcmdWithAnInteger.hh"                
 42 #include "G4UIcmdWithAString.hh"                  
 43 #include "G4UIcmdWithoutParameter.hh"             
 44 #include "G4UIdirectory.hh"                       
 45                                                   
 46 //....oooOO0OOooo........oooOO0OOooo........oo    
 47                                                   
 48 GammaRayTelDetectorMessenger::GammaRayTelDetec    
 49   directory = new G4UIdirectory("/payload/");     
 50   directory->SetGuidance("GammaRayTel payload     
 51                                                   
 52   // converter material command                   
 53                                                   
 54   converterMaterialCmd = new G4UIcmdWithAStrin    
 55   converterMaterialCmd->SetGuidance("Select th    
 56   converterMaterialCmd->SetParameterName("choi    
 57   converterMaterialCmd->AvailableForStates(G4S    
 58                                                   
 59   // converter thickness command                  
 60                                                   
 61   converterThicknessCmd = new G4UIcmdWithADoub    
 62   converterThicknessCmd->SetGuidance("Set the     
 63   converterThicknessCmd->SetParameterName("Siz    
 64   converterThicknessCmd->SetRange("Size>=0.");    
 65   converterThicknessCmd->SetUnitCategory("Leng    
 66   converterThicknessCmd->AvailableForStates(G4    
 67                                                   
 68   // tracker silicon thickness command            
 69                                                   
 70   siliconThicknessCmd = new G4UIcmdWithADouble    
 71   siliconThicknessCmd->SetGuidance("Set the th    
 72   siliconThicknessCmd->SetParameterName("Size"    
 73   siliconThicknessCmd->SetRange("Size>=0.");      
 74   siliconThicknessCmd->SetUnitCategory("Length    
 75   siliconThicknessCmd->AvailableForStates(G4St    
 76                                                   
 77   // tracker silicon pitch command                
 78                                                   
 79   siliconPitchCmd = new G4UIcmdWithADoubleAndU    
 80   siliconPitchCmd->SetGuidance("Set the pitch     
 81   siliconPitchCmd->SetParameterName("Size", fa    
 82   siliconPitchCmd->SetRange("Size>=0.");          
 83   siliconPitchCmd->SetUnitCategory("Length");     
 84   siliconPitchCmd->AvailableForStates(G4State_    
 85                                                   
 86   // tracker silicon tile size command            
 87                                                   
 88   siliconTileXYCmd = new G4UIcmdWithADoubleAnd    
 89   siliconTileXYCmd->SetGuidance("Set XY dimens    
 90   siliconTileXYCmd->SetParameterName("Size", f    
 91   siliconTileXYCmd->SetRange("Size>=0.");         
 92   siliconTileXYCmd->SetUnitCategory("Length");    
 93   siliconTileXYCmd->AvailableForStates(G4State    
 94                                                   
 95   // tracker number of silicon tiles              
 96                                                   
 97   numberOfSiTilesCmd = new G4UIcmdWithAnIntege    
 98   numberOfSiTilesCmd->SetGuidance("Set the num    
 99   numberOfSiTilesCmd->SetParameterName("NbSiTi    
100   numberOfSiTilesCmd->SetRange("NbSiTiles>0 &&    
101   numberOfSiTilesCmd->AvailableForStates(G4Sta    
102                                                   
103   // tracker number of silicon layers             
104                                                   
105   numberOfTKRLayersCmd = new G4UIcmdWithAnInte    
106   numberOfTKRLayersCmd->SetGuidance("Set the n    
107   numberOfTKRLayersCmd->SetParameterName("NbTK    
108   numberOfTKRLayersCmd->SetRange("NbTKRLayers>    
109   numberOfTKRLayersCmd->AvailableForStates(G4S    
110                                                   
111   // tracker layer distance                       
112                                                   
113   layerDistanceCmd = new G4UIcmdWithADoubleAnd    
114   layerDistanceCmd->SetGuidance("Set the dista    
115   layerDistanceCmd->SetParameterName("Size", f    
116   layerDistanceCmd->SetRange("Size>=0.");         
117   layerDistanceCmd->SetUnitCategory("Length");    
118   layerDistanceCmd->AvailableForStates(G4State    
119                                                   
120   // tracker views distance                       
121                                                   
122   viewsDistanceCmd = new G4UIcmdWithADoubleAnd    
123   viewsDistanceCmd->SetGuidance("Set the dista    
124   viewsDistanceCmd->SetParameterName("Size", f    
125   viewsDistanceCmd->SetRange("Size>=0.");         
126   viewsDistanceCmd->SetUnitCategory("Length");    
127   viewsDistanceCmd->AvailableForStates(G4State    
128                                                   
129   // calorimeter detector thickness               
130                                                   
131   calThicknessCmd = new G4UIcmdWithADoubleAndU    
132   calThicknessCmd->SetGuidance("Set the thickn    
133   calThicknessCmd->SetParameterName("Size", fa    
134   calThicknessCmd->SetRange("Size>=0.");          
135   calThicknessCmd->SetUnitCategory("Length");     
136   calThicknessCmd->AvailableForStates(G4State_    
137                                                   
138   // calorimeter, number of detectors             
139                                                   
140   numberOfCALBarsCmd = new G4UIcmdWithAnIntege    
141   numberOfCALBarsCmd->SetGuidance("Set the num    
142   numberOfCALBarsCmd->SetParameterName("NbSiTi    
143   numberOfCALBarsCmd->SetRange("NbSiTiles>0 &&    
144   numberOfCALBarsCmd->AvailableForStates(G4Sta    
145                                                   
146   // calorimeter, number of layers                
147                                                   
148   numberOfCALLayersCmd = new G4UIcmdWithAnInte    
149   numberOfCALLayersCmd->SetGuidance("Set the n    
150   numberOfCALLayersCmd->SetParameterName("NbCA    
151   numberOfCALLayersCmd->SetRange("NbCALLayers>    
152   numberOfCALLayersCmd->AvailableForStates(G4S    
153                                                   
154   // anticoincidence detector thickness           
155                                                   
156   acdThicknessCmd = new G4UIcmdWithADoubleAndU    
157   acdThicknessCmd->SetGuidance("Set the thickn    
158   acdThicknessCmd->SetParameterName("Size", fa    
159   acdThicknessCmd->SetRange("Size>=0.");          
160   acdThicknessCmd->SetUnitCategory("Length");     
161   acdThicknessCmd->AvailableForStates(G4State_    
162                                                   
163   // update payload geometry                      
164                                                   
165   updateCmd = new G4UIcmdWithoutParameter("/pa    
166   updateCmd->SetGuidance("Update the geometry     
167   updateCmd->SetGuidance("This command MUST be    
168   updateCmd->SetGuidance("if you changed geome    
169   updateCmd->AvailableForStates(G4State_Idle);    
170                                                   
171   // magnetic field                               
172                                                   
173   magneticFieldCmd = new G4UIcmdWithADoubleAnd    
174   magneticFieldCmd->SetGuidance("Define the ma    
175   magneticFieldCmd->SetGuidance("Magnetic fiel    
176   magneticFieldCmd->SetParameterName("Bz", fal    
177   magneticFieldCmd->SetUnitCategory("Magnetic     
178   magneticFieldCmd->AvailableForStates(G4State    
179 }                                                 
180                                                   
181 //....oooOO0OOooo........oooOO0OOooo........oo    
182                                                   
183 GammaRayTelDetectorMessenger::~GammaRayTelDete    
184   delete converterMaterialCmd;                    
185   delete converterThicknessCmd;                   
186   delete numberOfSiTilesCmd;                      
187   delete numberOfTKRLayersCmd;                    
188   delete siliconTileXYCmd;                        
189   delete siliconPitchCmd;                         
190   delete siliconThicknessCmd;                     
191   delete layerDistanceCmd;                        
192   delete viewsDistanceCmd;                        
193   delete acdThicknessCmd;                         
194   delete numberOfCALLayersCmd;                    
195   delete numberOfCALBarsCmd;                      
196   delete calThicknessCmd;                         
197   delete updateCmd;                               
198   delete magneticFieldCmd;                        
199   delete directory;                               
200 }                                                 
201                                                   
202 //....oooOO0OOooo........oooOO0OOooo........oo    
203                                                   
204 void GammaRayTelDetectorMessenger::SetNewValue    
205   // converter                                    
206                                                   
207   if (command == converterMaterialCmd) {          
208     detector->SetConverterMaterial(newValue);     
209   } else if (command == converterThicknessCmd)    
210     detector->SetConverterThickness(converterT    
211     } else                                        
212                                                   
213     // tracker (TKR)                              
214                                                   
215     if (command == siliconTileXYCmd) {            
216     detector->SetTKRTileSizeXY(siliconTileXYCm    
217   } else if (command == siliconPitchCmd) {        
218     detector->SetTKRSiliconPitch(siliconPitchC    
219   } else if (command == siliconThicknessCmd) {    
220     detector->SetTKRSiliconThickness(siliconTh    
221   } else if (command == numberOfSiTilesCmd) {     
222     detector->SetNbOfTKRTiles(numberOfSiTilesC    
223   } else if (command == numberOfTKRLayersCmd)     
224     detector->SetNbOfTKRLayers(numberOfTKRLaye    
225   } else if (command == layerDistanceCmd) {       
226     detector->SetTKRLayerDistance(layerDistanc    
227   } else if (command == viewsDistanceCmd) {       
228     detector->SetTKRViewsDistance(viewsDistanc    
229   } else                                          
230                                                   
231   // calorimeter (CAL)                            
232                                                   
233   if (command == numberOfCALLayersCmd) {          
234     detector->SetNbOfCALLayers(numberOfCALLaye    
235   } else if (command == numberOfCALBarsCmd) {     
236     detector->SetNbOfCALBars(numberOfCALBarsCm    
237   } else if (command == calThicknessCmd) {        
238     detector->SetCALBarThickness(calThicknessC    
239   } else                                          
240                                                   
241   // anticoincidence (ACD)                        
242                                                   
243   if (command == acdThicknessCmd) {               
244     detector->SetACDThickness(acdThicknessCmd-    
245   } else if (command == updateCmd) {              
246     detector->UpdateGeometry();                   
247   } else if (command == magneticFieldCmd) {       
248     detector->SetMagField(magneticFieldCmd->Ge    
249   }                                               
250 }                                                 
251