Geant4  10.01.p03
G4EmParametersMessenger.cc
Go to the documentation of this file.
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 // $Id: G4EmParametersMessenger.cc 66241 2012-12-13 18:34:42Z gunter $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 // File name: G4EmParametersMessenger
33 //
34 // Author: Vladimir Ivanchenko created from G4EnergyLossMessenger
35 //
36 // Creation date: 22-05-2013
37 //
38 // Modifications:
39 //
40 // -------------------------------------------------------------------
41 //
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45 
47 
48 #include "G4UIdirectory.hh"
49 #include "G4UIcommand.hh"
50 #include "G4UIparameter.hh"
51 #include "G4UIcmdWithABool.hh"
52 #include "G4UIcmdWithAnInteger.hh"
53 #include "G4UIcmdWithADouble.hh"
55 #include "G4UIcmdWithAString.hh"
56 #include "G4UImanager.hh"
57 #include "G4MscStepLimitType.hh"
58 #include "G4EmParameters.hh"
59 
60 #include <sstream>
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63 
65  : theParameters(ptr)
66 {
67  eLossDirectory = new G4UIdirectory("/process/eLoss/");
68  eLossDirectory->SetGuidance("Commands for EM processes.");
69  mscDirectory = new G4UIdirectory("/process/msc/");
70  mscDirectory->SetGuidance("Commands for EM scattering processes.");
71  emDirectory = new G4UIdirectory("/process/em/");
72  emDirectory->SetGuidance("General commands for EM processes.");
73 
74  flucCmd = new G4UIcmdWithABool("/process/eLoss/fluct",this);
75  flucCmd->SetGuidance("Enable/disable energy loss fluctuations.");
76  flucCmd->SetParameterName("choice",true);
77  flucCmd->SetDefaultValue(true);
79 
80  rangeCmd = new G4UIcmdWithABool("/process/eLoss/CSDARange",this);
81  rangeCmd->SetGuidance("Enable/disable CSDA range calculation");
82  rangeCmd->SetParameterName("range",true);
83  rangeCmd->SetDefaultValue(false);
85 
86  lpmCmd = new G4UIcmdWithABool("/process/eLoss/LPM",this);
87  lpmCmd->SetGuidance("Enable/disable LPM effect calculation");
88  lpmCmd->SetParameterName("lpm",true);
89  lpmCmd->SetDefaultValue(true);
91 
92  splCmd = new G4UIcmdWithABool("/process/em/spline",this);
93  splCmd->SetGuidance("Enable/disable usage spline for Physics Vectors");
94  splCmd->SetParameterName("spl",true);
95  splCmd->SetDefaultValue(false);
97 
98  rsCmd = new G4UIcmdWithABool("/process/eLoss/useCutAsFinalRange",this);
99  rsCmd->SetGuidance("Enable?disable use of cut in range as a final range");
100  rsCmd->SetParameterName("choice",true);
101  rsCmd->SetDefaultValue(false);
103 
104  aplCmd = new G4UIcmdWithABool("/process/em/applyCuts",this);
105  aplCmd->SetGuidance("Enable/disable applying cuts for gamma processes");
106  aplCmd->SetParameterName("apl",true);
107  aplCmd->SetDefaultValue(false);
109 
110  deCmd = new G4UIcmdWithABool("/process/em/fluo",this);
111  deCmd->SetGuidance("Enable/disable atomic deexcitation");
112  deCmd->SetParameterName("fluoFlag",true);
113  deCmd->SetDefaultValue(false);
115 
116  auCmd = new G4UIcmdWithABool("/process/em/auger",this);
117  auCmd->SetGuidance("Enable/disable Auger electrons production");
118  auCmd->SetParameterName("augerFlag",true);
119  auCmd->SetDefaultValue(false);
121 
122  pixeCmd = new G4UIcmdWithABool("/process/em/pixe",this);
123  pixeCmd->SetGuidance("Enable/disable PIXE simulation");
124  pixeCmd->SetParameterName("pixeFlag",true);
125  pixeCmd->SetDefaultValue(false);
127 
128  dcutCmd = new G4UIcmdWithABool("/process/em/deexcitationIgnoreCut",this);
129  dcutCmd->SetGuidance("Enable/Disable usage of cuts in de-excitation module");
130  dcutCmd->SetParameterName("deexcut",true);
131  dcutCmd->SetDefaultValue(false);
133 
134  latCmd = new G4UIcmdWithABool("/process/msc/LateralDisplacement",this);
135  latCmd->SetGuidance("Enable/disable sampling of lateral displacement");
136  latCmd->SetParameterName("lat",true);
137  latCmd->SetDefaultValue(true);
139 
140  mulatCmd = new G4UIcmdWithABool("/process/msc/MuHadLateralDisplacement",this);
141  mulatCmd->SetGuidance("Enable/disable sampling of lateral displacement for muons and hadrons");
142  mulatCmd->SetParameterName("mulat",true);
143  mulatCmd->SetDefaultValue(true);
145 
146  catCmd = new G4UIcmdWithABool("/process/msc/DisplacementBeyondSafety",this);
147  catCmd->SetGuidance("Enable/disable displacement at geometry boundary");
148  catCmd->SetParameterName("cat",true);
149  catCmd->SetDefaultValue(true);
151 
152  delCmd = new G4UIcmdWithABool("/process/eLoss/UseAngularGenerator",this);
153  delCmd->SetGuidance("Enable usage of angular generator");
154  delCmd->SetParameterName("del",true);
155  delCmd->SetDefaultValue(false);
157 
158  minSubSecCmd = new G4UIcmdWithADouble("/process/eLoss/minsubsec",this);
159  minSubSecCmd->SetGuidance("Set the ratio subcut/cut ");
160  minSubSecCmd->SetParameterName("rcmin",true);
162 
163  minEnCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/minKinEnergy",this);
164  minEnCmd->SetGuidance("Set the min kinetic energy for EM tables");
165  minEnCmd->SetParameterName("emin",true);
166  minEnCmd->SetUnitCategory("Energy");
168 
169  maxEnCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/maxKinEnergy",this);
170  maxEnCmd->SetGuidance("Set the max kinetic energy for EM tables");
171  maxEnCmd->SetParameterName("emax",true);
172  maxEnCmd->SetUnitCategory("Energy");
174 
175  cenCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/maxKinEnergyCSDA",this);
176  cenCmd->SetGuidance("Set the max kinetic energy for CSDA table");
177  cenCmd->SetParameterName("emaxCSDA",true);
178  cenCmd->SetUnitCategory("Energy");
180 
181  lllCmd = new G4UIcmdWithADouble("/process/eLoss/linLossLimit",this);
182  lllCmd->SetGuidance("Set linearLossLimit parameter");
183  lllCmd->SetParameterName("linlim",true);
185 
186  brCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/bremThreshold",this);
187  brCmd->SetGuidance("Set bremsstrahlung energy threshold");
188  brCmd->SetParameterName("emaxBrem",true);
189  brCmd->SetUnitCategory("Energy");
191 
192  labCmd = new G4UIcmdWithADouble("/process/eLoss/LambdaFactor",this);
193  labCmd->SetGuidance("Set lambdaFactor parameter for integral option");
194  labCmd->SetParameterName("Fl",true);
196 
197  mscfCmd = new G4UIcmdWithADouble("/process/msc/FactorForAngleLimit",this);
198  mscfCmd->SetGuidance("Set factor for computation of a limit for -t (invariant trasfer)");
199  mscfCmd->SetParameterName("Fact",true);
200  mscfCmd->SetRange("Fact>0");
203 
204  angCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/ThetaLimit",this);
205  angCmd->SetGuidance("Set the limit on the polar angle for msc and single scattering");
206  angCmd->SetParameterName("theta",true);
207  angCmd->SetUnitCategory("Angle");
209 
210  frCmd = new G4UIcmdWithADouble("/process/msc/RangeFactor",this);
211  frCmd->SetGuidance("Set RangeFactor parameter for msc processes");
212  frCmd->SetParameterName("Fr",true);
213  frCmd->SetRange("Fr>0");
214  frCmd->SetDefaultValue(0.04);
216 
217  fgCmd = new G4UIcmdWithADouble("/process/msc/GeomFactor",this);
218  fgCmd->SetGuidance("Set GeomFactor parameter for msc processes");
219  fgCmd->SetParameterName("Fg",true);
220  fgCmd->SetRange("Fg>0");
221  fgCmd->SetDefaultValue(3.5);
223 
224  skinCmd = new G4UIcmdWithADouble("/process/msc/Skin",this);
225  skinCmd->SetGuidance("Set skin parameter for msc processes");
226  skinCmd->SetParameterName("skin",true);
228 
229  dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this);
230  dedxCmd->SetGuidance("Set number of bins for EM tables");
231  dedxCmd->SetParameterName("binsDEDX",true);
234 
235  lamCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsLambda",this);
236  lamCmd->SetGuidance("Set number of bins for EM tables");
237  lamCmd->SetParameterName("binsL",true);
238  lamCmd->SetDefaultValue(77);
240 
241  amCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsPerDecade",this);
242  amCmd->SetGuidance("Set number of bins per decade for EM tables");
243  amCmd->SetParameterName("bins",true);
246 
247  verCmd = new G4UIcmdWithAnInteger("/process/eLoss/verbose",this);
248  verCmd->SetGuidance("Set verbose level for EM physics");
249  verCmd->SetParameterName("verb",true);
252 
253  ver1Cmd = new G4UIcmdWithAnInteger("/process/em/verbose",this);
254  ver1Cmd->SetGuidance("Set verbose level for EM physics");
255  ver1Cmd->SetParameterName("verb1",true);
258 
259  ver2Cmd = new G4UIcmdWithAnInteger("/process/em/workerVerbose",this);
260  ver2Cmd->SetGuidance("Set worker verbose level for EM physics");
261  ver2Cmd->SetParameterName("verb2",true);
264 
265  mscCmd = new G4UIcmdWithAString("/process/msc/StepLimit",this);
266  mscCmd->SetGuidance("Set msc step limitation type");
267  mscCmd->SetParameterName("StepLim",true);
269 }
270 
271 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
272 
274 {
275  delete eLossDirectory;
276  delete mscDirectory;
277  delete emDirectory;
278 
279  delete flucCmd;
280  delete rangeCmd;
281  delete lpmCmd;
282  delete splCmd;
283  delete rsCmd;
284  delete aplCmd;
285  delete deCmd;
286  delete auCmd;
287  delete pixeCmd;
288  delete dcutCmd;
289  delete latCmd;
290  delete mulatCmd;
291  delete catCmd;
292  delete delCmd;
293 
294  delete minSubSecCmd;
295  delete minEnCmd;
296  delete maxEnCmd;
297  delete cenCmd;
298  delete lllCmd;
299  delete brCmd;
300  delete labCmd;
301  delete mscfCmd;
302  delete angCmd;
303  delete frCmd;
304  delete fgCmd;
305  delete skinCmd;
306 
307  delete dedxCmd;
308  delete lamCmd;
309  delete amCmd;
310  delete verCmd;
311  delete ver1Cmd;
312  delete ver2Cmd;
313 
314  delete mscCmd;
315 }
316 
317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
318 
320  G4String newValue)
321 {
322  G4bool physicsModified = false;
323  if (command == flucCmd) {
325  physicsModified = true;
326  } else if (command == rangeCmd) {
328  physicsModified = true;
329  } else if (command == lpmCmd) {
331  physicsModified = true;
332  } else if (command == splCmd) {
334  physicsModified = true;
335  } else if (command == rsCmd) {
337  } else if (command == aplCmd) {
339  } else if (command == deCmd) {
341  physicsModified = true;
342  } else if (command == auCmd) {
344  physicsModified = true;
345  } else if (command == pixeCmd) {
347  physicsModified = true;
348  } else if (command == dcutCmd) {
350  physicsModified = true;
351  } else if (command == latCmd) {
353  physicsModified = true;
354  } else if (command == mulatCmd) {
356  physicsModified = true;
357  } else if (command == catCmd) {
359  physicsModified = true;
360 
361  } else if (command == catCmd) {
363 
364  } else if (command == minSubSecCmd) {
366  } else if (command == minEnCmd) {
368  physicsModified = true;
369  } else if (command == maxEnCmd) {
371  physicsModified = true;
372  } else if (command == cenCmd) {
374  physicsModified = true;
375  } else if (command == lllCmd) {
377  } else if (command == brCmd) {
379  } else if (command == labCmd) {
381  } else if (command == mscfCmd) {
383  physicsModified = true;
384  } else if (command == angCmd) {
386  physicsModified = true;
387  } else if (command == frCmd) {
389  physicsModified = true;
390  } else if (command == fgCmd) {
392  physicsModified = true;
393  } else if (command == skinCmd) {
395  physicsModified = true;
396 
397  } else if (command == dedxCmd) {
399  physicsModified = true;
400  } else if (command == lamCmd) {
402  physicsModified = true;
403  } else if (command == amCmd) {
405  physicsModified = true;
406  } else if (command == verCmd) {
408  } else if (command == ver1Cmd) {
410  } else if (command == ver2Cmd) {
412 
413  } else if (command == mscCmd) {
414  G4MscStepLimitType msctype = fUseSafety;
415  if(newValue == "Minimal") {
416  msctype = fMinimal;
417  } else if(newValue == "UseDistanceToBoundary") {
418  msctype = fUseDistanceToBoundary;
419  } else if(newValue == "UseSafety") {
420  msctype = fUseSafety;
421  } else if(newValue == "UseSafetyPlus") {
422  msctype = fUseSafetyPlus;
423  } else {
424  G4cout << "### G4EmParametersMessenger WARNING: StepLimit type <"
425  << newValue << "> unknown!" << G4endl;
426  return;
427  }
429  physicsModified = true;
430  }
431  if(physicsModified) {
432  G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
433  }
434 }
435 
436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetLossFluctuations(G4bool val)
void SetApplyCuts(G4bool val)
void SetVerbose(G4int val)
void SetDeexcitationIgnoreCut(G4bool val)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetLatDisplacementBeyondSafety(G4bool val)
G4UIcmdWithAnInteger * ver2Cmd
static G4int GetNewIntValue(const char *paramString)
void SetMscStepLimitType(G4MscStepLimitType val)
G4EmParametersMessenger(G4EmParameters *)
G4UIcmdWithADoubleAndUnit * brCmd
G4UIcmdWithAnInteger * ver1Cmd
void SetLinearLossLimit(G4double val)
void SetAuger(G4bool val)
void SetNumberOfBins(G4int val)
void SetMinSubRange(G4double val)
void SetMaxEnergyForCSDARange(G4double val)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetMaxEnergy(G4double val)
void SetBremsstrahlungTh(G4double val)
static G4bool GetNewBoolValue(const char *paramString)
void SetDefaultValue(G4bool defVal)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetLateralDisplacement(G4bool val)
void SetWorkerVerbose(G4int val)
G4UIcmdWithADoubleAndUnit * angCmd
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetMscRangeFactor(G4double val)
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetNumberOfBinsPerDecade(G4int val)
void SetMscGeomFactor(G4double val)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithADouble * minSubSecCmd
G4UIcmdWithADoubleAndUnit * minEnCmd
G4UIcmdWithAnInteger * lamCmd
G4UIcmdWithADoubleAndUnit * maxEnCmd
void SetBuildCSDARange(G4bool val)
G4UIcmdWithAnInteger * verCmd
void SetPixe(G4bool val)
void SetSpline(G4bool val)
void SetMuHadLateralDisplacement(G4bool val)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetMinEnergy(G4double val)
void SetLPM(G4bool val)
G4MscStepLimitType
void SetDefaultValue(G4double defVal)
void SetUseCutAsFinalRange(G4bool val)
#define G4endl
Definition: G4ios.hh:61
void SetDefaultValue(G4int defVal)
void SetMscThetaLimit(G4double val)
void SetLambdaFactor(G4double val)
void SetFactorForAngleLimit(G4double val)
G4UIcmdWithADoubleAndUnit * cenCmd
virtual void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithAnInteger * dedxCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAnInteger * amCmd
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:432
void SetFluo(G4bool val)
void SetMscSkin(G4double val)