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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 10.7)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26                                                    26 
 27 // (adapted from B2aDetectorMessenger)             27 // (adapted from B2aDetectorMessenger)
 28 // Author: A.Knaian (ara@nklabs.com), N.MacFad     28 // Author: A.Knaian (ara@nklabs.com), N.MacFadden (natemacfadden@gmail.com)
 29                                                    29 
 30 #include "FADetectorConstructionMessenger.hh"      30 #include "FADetectorConstructionMessenger.hh"
 31 #include "FADetectorConstruction.hh"               31 #include "FADetectorConstruction.hh"
 32                                                    32 
 33 #include "G4UIcmdWithAnInteger.hh"                 33 #include "G4UIcmdWithAnInteger.hh"
 34 #include "G4UIcmdWithADoubleAndUnit.hh"            34 #include "G4UIcmdWithADoubleAndUnit.hh"
 35 #include "G4UIcmdWithADouble.hh"                   35 #include "G4UIcmdWithADouble.hh"
 36 #include "G4UIcmdWithABool.hh"                     36 #include "G4UIcmdWithABool.hh"
 37 #include "G4UIcmdWithAString.hh"                   37 #include "G4UIcmdWithAString.hh"
 38                                                    38 
 39 DetectorConstructionMessenger::DetectorConstru     39 DetectorConstructionMessenger::DetectorConstructionMessenger(DetectorConstruction* detectorIn)
 40  : G4UImessenger()                                 40  : G4UImessenger()
 41 {                                                  41 {
 42   fDetector = detectorIn;                          42   fDetector = detectorIn;
 43                                                    43 
 44   // Directory                                     44   // Directory
 45   //                                               45   //
 46   // /geometry                                     46   // /geometry
 47   fGeometryDirectory = new G4UIdirectory("/geo     47   fGeometryDirectory = new G4UIdirectory("/geometry/");
 48   fGeometryDirectory->SetGuidance("Geometry se     48   fGeometryDirectory->SetGuidance("Geometry setup.");
 49                                                    49 
 50   // Physics                                       50   // Physics
 51   //                                               51   //
 52   // /geometry/stepLim                             52   // /geometry/stepLim
 53   fStepLimCmd = new G4UIcmdWithADoubleAndUnit(     53   fStepLimCmd = new G4UIcmdWithADoubleAndUnit("/geometry/stepLim",this);
 54   fStepLimCmd->SetGuidance("Maximum step lengt     54   fStepLimCmd->SetGuidance("Maximum step length.");
 55   fStepLimCmd->SetParameterName("stepLim",fals     55   fStepLimCmd->SetParameterName("stepLim",false);
 56   fStepLimCmd->SetRange("stepLim>=0.");            56   fStepLimCmd->SetRange("stepLim>=0.");
 57   fStepLimCmd->SetDefaultValue(DBL_MAX);           57   fStepLimCmd->SetDefaultValue(DBL_MAX);
 58   fStepLimCmd->SetDefaultUnit("mm");               58   fStepLimCmd->SetDefaultUnit("mm");
 59   fStepLimCmd->AvailableForStates(G4State_PreI     59   fStepLimCmd->AvailableForStates(G4State_PreInit);
 60                                                    60 
 61   // Cloud droplet settings                        61   // Cloud droplet settings
 62   // /geometry/dropletR                            62   // /geometry/dropletR
 63   fDropletRCmd = new G4UIcmdWithADoubleAndUnit     63   fDropletRCmd = new G4UIcmdWithADoubleAndUnit("/geometry/dropletR",this);
 64   fDropletRCmd->SetGuidance("Minimal bounding      64   fDropletRCmd->SetGuidance("Minimal bounding radius of droplet.");
 65   fDropletRCmd->SetParameterName("dropletR",fa     65   fDropletRCmd->SetParameterName("dropletR",false);
 66   fDropletRCmd->SetRange("dropletR>0.");           66   fDropletRCmd->SetRange("dropletR>0.");
 67   fDropletRCmd->SetDefaultValue(1.0);              67   fDropletRCmd->SetDefaultValue(1.0);
 68   fDropletRCmd->SetDefaultUnit("mm");              68   fDropletRCmd->SetDefaultUnit("mm");
 69   fDropletRCmd->AvailableForStates(G4State_Pre     69   fDropletRCmd->AvailableForStates(G4State_PreInit);
 70                                                    70 
 71   // /geometry/dropletNumDens                      71   // /geometry/dropletNumDens     
 72   fDropletNumDensCmd = new G4UIcmdWithADouble(     72   fDropletNumDensCmd = new G4UIcmdWithADouble("/geometry/dropletNumDens", this);
 73   fDropletNumDensCmd->SetGuidance("Number of d     73   fDropletNumDensCmd->SetGuidance("Number of droplets per mm^3.");        // would be nice to have official number density units
 74   fDropletNumDensCmd->SetParameterName("drople     74   fDropletNumDensCmd->SetParameterName("dropletCOunt",false);
 75   fDropletNumDensCmd->SetDefaultValue(0);          75   fDropletNumDensCmd->SetDefaultValue(0);
 76   fDropletNumDensCmd->AvailableForStates(G4Sta     76   fDropletNumDensCmd->AvailableForStates(G4State_PreInit);
 77                                                    77 
 78   // Cloud build type                              78   // Cloud build type
 79   //                                               79   //
 80   // /geometry/fastAerosol                         80   // /geometry/fastAerosol
 81   fFastAerosolCloudCmd = new G4UIcmdWithABool(     81   fFastAerosolCloudCmd = new G4UIcmdWithABool("/geometry/fastAerosolCloud",this);
 82   fFastAerosolCloudCmd->SetGuidance("Whether o     82   fFastAerosolCloudCmd->SetGuidance("Whether or not to build the fastAerosol cloud.");
 83   fFastAerosolCloudCmd->SetParameterName("fast     83   fFastAerosolCloudCmd->SetParameterName("fastAerosol",false);
 84   fFastAerosolCloudCmd->SetDefaultValue(false)     84   fFastAerosolCloudCmd->SetDefaultValue(false);
 85   fFastAerosolCloudCmd->AvailableForStates(G4S     85   fFastAerosolCloudCmd->AvailableForStates(G4State_PreInit);
 86                                                    86 
 87   // /geometry/parameterisedCloud                  87   // /geometry/parameterisedCloud
 88   fParameterisedCloudCmd = new G4UIcmdWithABoo     88   fParameterisedCloudCmd = new G4UIcmdWithABool("/geometry/parameterisedCloud",this);
 89   fParameterisedCloudCmd->SetGuidance("Whether     89   fParameterisedCloudCmd->SetGuidance("Whether or not to build the parameterised cloud.");
 90   fParameterisedCloudCmd->SetParameterName("pa     90   fParameterisedCloudCmd->SetParameterName("parameterisedCloud",false);
 91   fParameterisedCloudCmd->SetDefaultValue(fals     91   fParameterisedCloudCmd->SetDefaultValue(false);
 92   fParameterisedCloudCmd->AvailableForStates(G     92   fParameterisedCloudCmd->AvailableForStates(G4State_PreInit);
 93                                                    93 
 94   // /geometry/smoothCloud                         94   // /geometry/smoothCloud
 95   fSmoothCloudCmd = new G4UIcmdWithABool("/geo     95   fSmoothCloudCmd = new G4UIcmdWithABool("/geometry/smoothCloud",this);
 96   fSmoothCloudCmd->SetGuidance("Whether or not     96   fSmoothCloudCmd->SetGuidance("Whether or not to build the smooth cloud.");
 97   fSmoothCloudCmd->SetParameterName("smoothClo     97   fSmoothCloudCmd->SetParameterName("smoothCloud",false);
 98   fSmoothCloudCmd->SetDefaultValue(false);         98   fSmoothCloudCmd->SetDefaultValue(false);
 99   fSmoothCloudCmd->AvailableForStates(G4State_     99   fSmoothCloudCmd->AvailableForStates(G4State_PreInit);
100                                                   100 
101   // fastAerosol cloud details                    101   // fastAerosol cloud details
102   //                                              102   //
103   // /geometry/cloudShape                         103   // /geometry/cloudShape
104   fCloudShapeCmd = new G4UIcmdWithAString("/ge    104   fCloudShapeCmd = new G4UIcmdWithAString("/geometry/cloudShape",this);
105   fCloudShapeCmd->SetGuidance("Cloud bulk shap    105   fCloudShapeCmd->SetGuidance("Cloud bulk shape");
106   fCloudShapeCmd->SetParameterName("cloudShape    106   fCloudShapeCmd->SetParameterName("cloudShapeStr",false);
107   fCloudShapeCmd->AvailableForStates(G4State_P    107   fCloudShapeCmd->AvailableForStates(G4State_PreInit);
108                                                   108 
109   // /geometry/dropletShape                       109   // /geometry/dropletShape
110   fDropletShapeCmd = new G4UIcmdWithAString("/    110   fDropletShapeCmd = new G4UIcmdWithAString("/geometry/dropletShape",this);
111   fDropletShapeCmd->SetGuidance("Cloud droplet    111   fDropletShapeCmd->SetGuidance("Cloud droplet shape");
112   fDropletShapeCmd->SetParameterName("dropletS    112   fDropletShapeCmd->SetParameterName("dropletShapeStr",false);
113   fDropletShapeCmd->AvailableForStates(G4State    113   fDropletShapeCmd->AvailableForStates(G4State_PreInit);
114                                                   114 
115   // /geometry/prePopulate                        115   // /geometry/prePopulate
116   fPrePopulateCmd = new G4UIcmdWithABool("/geo    116   fPrePopulateCmd = new G4UIcmdWithABool("/geometry/prePopulate",this);
117   fPrePopulateCmd->SetGuidance("Whether or not    117   fPrePopulateCmd->SetGuidance("Whether or not to populate the cloud at the beginning.");
118   fPrePopulateCmd->SetParameterName("prePopula    118   fPrePopulateCmd->SetParameterName("prePopulate",false);
119   fPrePopulateCmd->SetDefaultValue(false);        119   fPrePopulateCmd->SetDefaultValue(false);
120   fPrePopulateCmd->AvailableForStates(G4State_    120   fPrePopulateCmd->AvailableForStates(G4State_PreInit);
121                                                   121 
122   // /geometry/minSpacing                         122   // /geometry/minSpacing
123   fMinSpacingCmd = new G4UIcmdWithADoubleAndUn    123   fMinSpacingCmd = new G4UIcmdWithADoubleAndUnit("/geometry/minSpacing",this);
124   fMinSpacingCmd->SetGuidance("Minimum spacing    124   fMinSpacingCmd->SetGuidance("Minimum spacing between surfaces of spheres when generating random cloud of spheres.");
125   fMinSpacingCmd->SetParameterName("minSpacing    125   fMinSpacingCmd->SetParameterName("minSpacing",false);
126   fMinSpacingCmd->SetRange("minSpacing>0.");      126   fMinSpacingCmd->SetRange("minSpacing>0.");
127   fMinSpacingCmd->SetDefaultValue(10.);           127   fMinSpacingCmd->SetDefaultValue(10.);
128   fMinSpacingCmd->SetDefaultUnit("micrometer")    128   fMinSpacingCmd->SetDefaultUnit("micrometer");
129   fMinSpacingCmd->AvailableForStates(G4State_P    129   fMinSpacingCmd->AvailableForStates(G4State_PreInit);
130                                                   130 
131   // /geometry/setSmartless                       131   // /geometry/setSmartless
132   fSmartlessCmd = new G4UIcmdWithADouble("/geo    132   fSmartlessCmd = new G4UIcmdWithADouble("/geometry/smartless", this);
133   fSmartlessCmd->SetGuidance("Set the 'smartle    133   fSmartlessCmd->SetGuidance("Set the 'smartless' parameter for the parameterised cloud.");
134   fSmartlessCmd->SetParameterName("smartless",    134   fSmartlessCmd->SetParameterName("smartless",false);
135   fSmartlessCmd->SetRange("smartless>0.");        135   fSmartlessCmd->SetRange("smartless>0.");
136   fSmartlessCmd->SetDefaultValue(2.0);            136   fSmartlessCmd->SetDefaultValue(2.0);
137   fSmartlessCmd->AvailableForStates(G4State_Pr    137   fSmartlessCmd->AvailableForStates(G4State_PreInit);
138                                                   138 
139   // /geometry/cloudSeed                          139   // /geometry/cloudSeed
140   fCloudSeedCmd = new G4UIcmdWithAnInteger("/g    140   fCloudSeedCmd = new G4UIcmdWithAnInteger("/geometry/cloudSeed", this);
141   fCloudSeedCmd->SetGuidance("Base of the rand    141   fCloudSeedCmd->SetGuidance("Base of the random seed for the cloud sphere positions.");
142   fCloudSeedCmd->SetParameterName("cloudSeed",    142   fCloudSeedCmd->SetParameterName("cloudSeed",false);
143   fCloudSeedCmd->SetDefaultValue(0);              143   fCloudSeedCmd->SetDefaultValue(0);
144   fCloudSeedCmd->AvailableForStates(G4State_Pr    144   fCloudSeedCmd->AvailableForStates(G4State_PreInit);
145 }                                                 145 }
146                                                   146 
147 DetectorConstructionMessenger::~DetectorConstr    147 DetectorConstructionMessenger::~DetectorConstructionMessenger()
148 {                                                 148 {
149   delete fGeometryDirectory;                      149   delete fGeometryDirectory;
150                                                   150 
151   delete fStepLimCmd;                             151   delete fStepLimCmd;
152                                                   152 
153   delete fDropletRCmd;                            153   delete fDropletRCmd;
154   delete fDropletNumDensCmd;                      154   delete fDropletNumDensCmd;
155                                                   155 
156   delete fFastAerosolCloudCmd;                    156   delete fFastAerosolCloudCmd;
157   delete fParameterisedCloudCmd;                  157   delete fParameterisedCloudCmd;
158   delete fSmoothCloudCmd;                         158   delete fSmoothCloudCmd;
159                                                   159 
160   delete fCloudShapeCmd;                          160   delete fCloudShapeCmd;
161   delete fDropletShapeCmd;                        161   delete fDropletShapeCmd;
162   delete fPrePopulateCmd;                         162   delete fPrePopulateCmd;
163   delete fMinSpacingCmd;                          163   delete fMinSpacingCmd;
164   //delete fGridPitchCmd;                         164   //delete fGridPitchCmd;
165                                                   165 
166   delete fSmartlessCmd;                           166   delete fSmartlessCmd;
167                                                   167 
168   delete fCloudSeedCmd;                           168   delete fCloudSeedCmd;
169 }                                                 169 }
170                                                   170 
171 void DetectorConstructionMessenger::SetNewValu    171 void DetectorConstructionMessenger::SetNewValue( G4UIcommand* command, G4String newValue)
172 {                                                 172 {
173   // Geometry Commands                            173   // Geometry Commands
174                                                   174 
175   if( command == fFastAerosolCloudCmd ) {         175   if( command == fFastAerosolCloudCmd ) {
176     fDetector->fFastAerosolCloud = (fFastAeros    176     fDetector->fFastAerosolCloud = (fFastAerosolCloudCmd->GetNewBoolValue(newValue));
177   }                                               177   }
178                                                   178 
179   if( command == fStepLimCmd ) {                  179   if( command == fStepLimCmd ) {
180     fDetector->fStepLim = (fStepLimCmd->GetNew    180     fDetector->fStepLim = (fStepLimCmd->GetNewDoubleValue(newValue));
181   }                                               181   }
182                                                   182 
183   if( command == fDropletRCmd ) {                 183   if( command == fDropletRCmd ) {
184     fDetector->fDropletR = (fDropletRCmd->GetN    184     fDetector->fDropletR = (fDropletRCmd->GetNewDoubleValue(newValue));
185   }                                               185   }
186   if( command == fDropletNumDensCmd ) {           186   if( command == fDropletNumDensCmd ) {
187     fDetector->fDropletNumDens = (fDropletNumD    187     fDetector->fDropletNumDens = (fDropletNumDensCmd->GetNewDoubleValue(newValue));
188   }                                               188   }
189                                                   189 
190   if( command == fParameterisedCloudCmd ) {       190   if( command == fParameterisedCloudCmd ) {
191     fDetector->fParameterisedCloud = (fParamet    191     fDetector->fParameterisedCloud = (fParameterisedCloudCmd->GetNewBoolValue(newValue));
192   }                                               192   }
193   if( command == fSmoothCloudCmd ) {              193   if( command == fSmoothCloudCmd ) {
194     fDetector->fSmoothCloud = (fSmoothCloudCmd    194     fDetector->fSmoothCloud = (fSmoothCloudCmd->GetNewBoolValue(newValue));
195   }                                               195   }
196   if( command == fPrePopulateCmd ) {              196   if( command == fPrePopulateCmd ) {
197     fDetector->fPrePopulate = (fPrePopulateCmd    197     fDetector->fPrePopulate = (fPrePopulateCmd->GetNewBoolValue(newValue));
198   }                                               198   }
199                                                   199 
200   if( command == fCloudShapeCmd ) {               200   if( command == fCloudShapeCmd ) {
201     fDetector->fCloudShapeStr = newValue;         201     fDetector->fCloudShapeStr = newValue;
202   }                                               202   }
203   if( command == fDropletShapeCmd ) {             203   if( command == fDropletShapeCmd ) {
204     fDetector->fDropletShapeStr = newValue;       204     fDetector->fDropletShapeStr = newValue;
205   }                                               205   }
206   if( command == fMinSpacingCmd ) {               206   if( command == fMinSpacingCmd ) {
207     fDetector->fMinSpacing = (fMinSpacingCmd->    207     fDetector->fMinSpacing = (fMinSpacingCmd->GetNewDoubleValue(newValue));
208   }                                               208   }
209   if( command == fSmartlessCmd ) {                209   if( command == fSmartlessCmd ) {
210     fDetector->fSmartless = (fSmartlessCmd->Ge    210     fDetector->fSmartless = (fSmartlessCmd->GetNewDoubleValue(newValue));
211   }                                               211   }
212   if( command == fCloudSeedCmd ) {                212   if( command == fCloudSeedCmd ) {
213     fDetector->fCloudSeed = (fCloudSeedCmd->Ge    213     fDetector->fCloudSeed = (fCloudSeedCmd->GetNewIntValue(newValue));
214   }                                               214   }
215 }                                                 215 }
216                                                   216 
217                                                   217