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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/advanced/fastAerosol/src/FADetectorConstructionMessenger.cc (Version 11.3.0) and /examples/advanced/fastAerosol/src/FADetectorConstructionMessenger.cc (Version 6.2)


  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 // (adapted from B2aDetectorMessenger)            
 28 // Author: A.Knaian (ara@nklabs.com), N.MacFad    
 29                                                   
 30 #include "FADetectorConstructionMessenger.hh"     
 31 #include "FADetectorConstruction.hh"              
 32                                                   
 33 #include "G4UIcmdWithAnInteger.hh"                
 34 #include "G4UIcmdWithADoubleAndUnit.hh"           
 35 #include "G4UIcmdWithADouble.hh"                  
 36 #include "G4UIcmdWithABool.hh"                    
 37 #include "G4UIcmdWithAString.hh"                  
 38                                                   
 39 DetectorConstructionMessenger::DetectorConstru    
 40  : G4UImessenger()                                
 41 {                                                 
 42   fDetector = detectorIn;                         
 43                                                   
 44   // Directory                                    
 45   //                                              
 46   // /geometry                                    
 47   fGeometryDirectory = new G4UIdirectory("/geo    
 48   fGeometryDirectory->SetGuidance("Geometry se    
 49                                                   
 50   // Physics                                      
 51   //                                              
 52   // /geometry/stepLim                            
 53   fStepLimCmd = new G4UIcmdWithADoubleAndUnit(    
 54   fStepLimCmd->SetGuidance("Maximum step lengt    
 55   fStepLimCmd->SetParameterName("stepLim",fals    
 56   fStepLimCmd->SetRange("stepLim>=0.");           
 57   fStepLimCmd->SetDefaultValue(DBL_MAX);          
 58   fStepLimCmd->SetDefaultUnit("mm");              
 59   fStepLimCmd->AvailableForStates(G4State_PreI    
 60                                                   
 61   // Cloud droplet settings                       
 62   // /geometry/dropletR                           
 63   fDropletRCmd = new G4UIcmdWithADoubleAndUnit    
 64   fDropletRCmd->SetGuidance("Minimal bounding     
 65   fDropletRCmd->SetParameterName("dropletR",fa    
 66   fDropletRCmd->SetRange("dropletR>0.");          
 67   fDropletRCmd->SetDefaultValue(1.0);             
 68   fDropletRCmd->SetDefaultUnit("mm");             
 69   fDropletRCmd->AvailableForStates(G4State_Pre    
 70                                                   
 71   // /geometry/dropletNumDens                     
 72   fDropletNumDensCmd = new G4UIcmdWithADouble(    
 73   fDropletNumDensCmd->SetGuidance("Number of d    
 74   fDropletNumDensCmd->SetParameterName("drople    
 75   fDropletNumDensCmd->SetDefaultValue(0);         
 76   fDropletNumDensCmd->AvailableForStates(G4Sta    
 77                                                   
 78   // Cloud build type                             
 79   //                                              
 80   // /geometry/fastAerosol                        
 81   fFastAerosolCloudCmd = new G4UIcmdWithABool(    
 82   fFastAerosolCloudCmd->SetGuidance("Whether o    
 83   fFastAerosolCloudCmd->SetParameterName("fast    
 84   fFastAerosolCloudCmd->SetDefaultValue(false)    
 85   fFastAerosolCloudCmd->AvailableForStates(G4S    
 86                                                   
 87   // /geometry/parameterisedCloud                 
 88   fParameterisedCloudCmd = new G4UIcmdWithABoo    
 89   fParameterisedCloudCmd->SetGuidance("Whether    
 90   fParameterisedCloudCmd->SetParameterName("pa    
 91   fParameterisedCloudCmd->SetDefaultValue(fals    
 92   fParameterisedCloudCmd->AvailableForStates(G    
 93                                                   
 94   // /geometry/smoothCloud                        
 95   fSmoothCloudCmd = new G4UIcmdWithABool("/geo    
 96   fSmoothCloudCmd->SetGuidance("Whether or not    
 97   fSmoothCloudCmd->SetParameterName("smoothClo    
 98   fSmoothCloudCmd->SetDefaultValue(false);        
 99   fSmoothCloudCmd->AvailableForStates(G4State_    
100                                                   
101   // fastAerosol cloud details                    
102   //                                              
103   // /geometry/cloudShape                         
104   fCloudShapeCmd = new G4UIcmdWithAString("/ge    
105   fCloudShapeCmd->SetGuidance("Cloud bulk shap    
106   fCloudShapeCmd->SetParameterName("cloudShape    
107   fCloudShapeCmd->AvailableForStates(G4State_P    
108                                                   
109   // /geometry/dropletShape                       
110   fDropletShapeCmd = new G4UIcmdWithAString("/    
111   fDropletShapeCmd->SetGuidance("Cloud droplet    
112   fDropletShapeCmd->SetParameterName("dropletS    
113   fDropletShapeCmd->AvailableForStates(G4State    
114                                                   
115   // /geometry/prePopulate                        
116   fPrePopulateCmd = new G4UIcmdWithABool("/geo    
117   fPrePopulateCmd->SetGuidance("Whether or not    
118   fPrePopulateCmd->SetParameterName("prePopula    
119   fPrePopulateCmd->SetDefaultValue(false);        
120   fPrePopulateCmd->AvailableForStates(G4State_    
121                                                   
122   // /geometry/minSpacing                         
123   fMinSpacingCmd = new G4UIcmdWithADoubleAndUn    
124   fMinSpacingCmd->SetGuidance("Minimum spacing    
125   fMinSpacingCmd->SetParameterName("minSpacing    
126   fMinSpacingCmd->SetRange("minSpacing>0.");      
127   fMinSpacingCmd->SetDefaultValue(10.);           
128   fMinSpacingCmd->SetDefaultUnit("micrometer")    
129   fMinSpacingCmd->AvailableForStates(G4State_P    
130                                                   
131   // /geometry/setSmartless                       
132   fSmartlessCmd = new G4UIcmdWithADouble("/geo    
133   fSmartlessCmd->SetGuidance("Set the 'smartle    
134   fSmartlessCmd->SetParameterName("smartless",    
135   fSmartlessCmd->SetRange("smartless>0.");        
136   fSmartlessCmd->SetDefaultValue(2.0);            
137   fSmartlessCmd->AvailableForStates(G4State_Pr    
138                                                   
139   // /geometry/cloudSeed                          
140   fCloudSeedCmd = new G4UIcmdWithAnInteger("/g    
141   fCloudSeedCmd->SetGuidance("Base of the rand    
142   fCloudSeedCmd->SetParameterName("cloudSeed",    
143   fCloudSeedCmd->SetDefaultValue(0);              
144   fCloudSeedCmd->AvailableForStates(G4State_Pr    
145 }                                                 
146                                                   
147 DetectorConstructionMessenger::~DetectorConstr    
148 {                                                 
149   delete fGeometryDirectory;                      
150                                                   
151   delete fStepLimCmd;                             
152                                                   
153   delete fDropletRCmd;                            
154   delete fDropletNumDensCmd;                      
155                                                   
156   delete fFastAerosolCloudCmd;                    
157   delete fParameterisedCloudCmd;                  
158   delete fSmoothCloudCmd;                         
159                                                   
160   delete fCloudShapeCmd;                          
161   delete fDropletShapeCmd;                        
162   delete fPrePopulateCmd;                         
163   delete fMinSpacingCmd;                          
164   //delete fGridPitchCmd;                         
165                                                   
166   delete fSmartlessCmd;                           
167                                                   
168   delete fCloudSeedCmd;                           
169 }                                                 
170                                                   
171 void DetectorConstructionMessenger::SetNewValu    
172 {                                                 
173   // Geometry Commands                            
174                                                   
175   if( command == fFastAerosolCloudCmd ) {         
176     fDetector->fFastAerosolCloud = (fFastAeros    
177   }                                               
178                                                   
179   if( command == fStepLimCmd ) {                  
180     fDetector->fStepLim = (fStepLimCmd->GetNew    
181   }                                               
182                                                   
183   if( command == fDropletRCmd ) {                 
184     fDetector->fDropletR = (fDropletRCmd->GetN    
185   }                                               
186   if( command == fDropletNumDensCmd ) {           
187     fDetector->fDropletNumDens = (fDropletNumD    
188   }                                               
189                                                   
190   if( command == fParameterisedCloudCmd ) {       
191     fDetector->fParameterisedCloud = (fParamet    
192   }                                               
193   if( command == fSmoothCloudCmd ) {              
194     fDetector->fSmoothCloud = (fSmoothCloudCmd    
195   }                                               
196   if( command == fPrePopulateCmd ) {              
197     fDetector->fPrePopulate = (fPrePopulateCmd    
198   }                                               
199                                                   
200   if( command == fCloudShapeCmd ) {               
201     fDetector->fCloudShapeStr = newValue;         
202   }                                               
203   if( command == fDropletShapeCmd ) {             
204     fDetector->fDropletShapeStr = newValue;       
205   }                                               
206   if( command == fMinSpacingCmd ) {               
207     fDetector->fMinSpacing = (fMinSpacingCmd->    
208   }                                               
209   if( command == fSmartlessCmd ) {                
210     fDetector->fSmartless = (fSmartlessCmd->Ge    
211   }                                               
212   if( command == fCloudSeedCmd ) {                
213     fDetector->fCloudSeed = (fCloudSeedCmd->Ge    
214   }                                               
215 }                                                 
216                                                   
217