ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4EmParametersMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4EmParametersMessenger.cc
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 // -------------------------------------------------------------------
27 //
28 // GEANT4 Class file
29 //
30 // File name: G4EmParametersMessenger
31 //
32 // Author: Vladimir Ivanchenko created from G4EnergyLossMessenger
33 //
34 // Creation date: 22-05-2013
35 //
36 // -------------------------------------------------------------------
37 //
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
41 
43 #include "G4UIdirectory.hh"
44 #include "G4UIcommand.hh"
45 #include "G4UIparameter.hh"
46 #include "G4UIcmdWithABool.hh"
47 #include "G4UIcmdWithAnInteger.hh"
48 #include "G4UIcmdWithADouble.hh"
50 #include "G4UIcmdWithAString.hh"
52 #include "G4UImanager.hh"
53 #include "G4MscStepLimitType.hh"
55 #include "G4EmParameters.hh"
56 
57 #include <sstream>
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
60 
62  : theParameters(ptr)
63 {
64  gconvDirectory = new G4UIdirectory("/process/gconv/");
65  gconvDirectory->SetGuidance("Commands for EM gamma conversion BH5D model.");
66  eLossDirectory = new G4UIdirectory("/process/eLoss/");
67  eLossDirectory->SetGuidance("Commands for EM processes.");
68  mscDirectory = new G4UIdirectory("/process/msc/");
69  mscDirectory->SetGuidance("Commands for EM scattering processes.");
70  emDirectory = new G4UIdirectory("/process/em/");
71  emDirectory->SetGuidance("General commands for EM processes.");
72  dnaDirectory = new G4UIdirectory("/process/dna/");
73  dnaDirectory->SetGuidance("Commands for DNA processes.");
74 
75  flucCmd = new G4UIcmdWithABool("/process/eLoss/fluct",this);
76  flucCmd->SetGuidance("Enable/disable energy loss fluctuations.");
77  flucCmd->SetParameterName("choice",true);
78  flucCmd->SetDefaultValue(true);
80 
81  rangeCmd = new G4UIcmdWithABool("/process/eLoss/CSDARange",this);
82  rangeCmd->SetGuidance("Enable/disable CSDA range calculation");
83  rangeCmd->SetParameterName("range",true);
84  rangeCmd->SetDefaultValue(false);
86 
87  lpmCmd = new G4UIcmdWithABool("/process/eLoss/LPM",this);
88  lpmCmd->SetGuidance("Enable/disable LPM effect calculation");
89  lpmCmd->SetParameterName("lpm",true);
90  lpmCmd->SetDefaultValue(true);
92 
93  splCmd = new G4UIcmdWithABool("/process/em/spline",this);
94  splCmd->SetGuidance("Enable/disable usage spline for Physics Vectors");
95  splCmd->SetParameterName("spl",true);
96  splCmd->SetDefaultValue(false);
98 
99  rsCmd = new G4UIcmdWithABool("/process/eLoss/useCutAsFinalRange",this);
100  rsCmd->SetGuidance("Enable/disable use of cut in range as a final range");
101  rsCmd->SetParameterName("choice",true);
102  rsCmd->SetDefaultValue(false);
104 
105  aplCmd = new G4UIcmdWithABool("/process/em/applyCuts",this);
106  aplCmd->SetGuidance("Enable/disable applying cuts for gamma processes");
107  aplCmd->SetParameterName("apl",true);
108  aplCmd->SetDefaultValue(false);
110 
111  latCmd = new G4UIcmdWithABool("/process/msc/LateralDisplacement",this);
112  latCmd->SetGuidance("Enable/disable sampling of lateral displacement");
113  latCmd->SetParameterName("lat",true);
114  latCmd->SetDefaultValue(true);
116 
117  lat96Cmd = new G4UIcmdWithABool("/process/msc/LateralDisplacementAlg96",this);
118  lat96Cmd->SetGuidance("Enable/disable sampling of lateral displacement");
119  lat96Cmd->SetParameterName("lat96",true);
120  lat96Cmd->SetDefaultValue(false);
122 
123  mulatCmd = new G4UIcmdWithABool("/process/msc/MuHadLateralDisplacement",this);
124  mulatCmd->SetGuidance("Enable/disable sampling of lateral displacement for muons and hadrons");
125  mulatCmd->SetParameterName("mulat",true);
126  mulatCmd->SetDefaultValue(true);
128 
129  catCmd = new G4UIcmdWithABool("/process/msc/DisplacementBeyondSafety",this);
130  catCmd->SetGuidance("Enable/disable displacement at geometry boundary");
131  catCmd->SetParameterName("cat",true);
132  catCmd->SetDefaultValue(false);
134 
135  delCmd = new G4UIcmdWithABool("/process/eLoss/UseAngularGenerator",this);
136  delCmd->SetGuidance("Enable usage of angular generator for ionisation");
137  delCmd->SetParameterName("del",true);
138  delCmd->SetDefaultValue(false);
140 
141  IntegCmd = new G4UIcmdWithABool("/process/eLoss/integral",this);
142  IntegCmd->SetGuidance("Switch true/false the integral option");
143  IntegCmd->SetParameterName("integ",true);
144  IntegCmd->SetDefaultValue(true);
146 
147  mottCmd = new G4UIcmdWithABool("/process/msc/UseMottCorrection",this);
148  mottCmd->SetGuidance("Enable usage of Mott corrections for e- elastic scattering");
149  mottCmd->SetParameterName("mott",true);
150  mottCmd->SetDefaultValue(false);
152 
153  birksCmd = new G4UIcmdWithABool("/process/msc/UseG4EmSaturation",this);
154  birksCmd->SetGuidance("Enable usage of built-in Birks saturation");
155  birksCmd->SetParameterName("birks",true);
156  birksCmd->SetDefaultValue(false);
158 
159  sharkCmd = new G4UIcmdWithABool("/process/em/UseGeneralProcess",this);
160  sharkCmd->SetGuidance("Enable gamma, e+- general process");
161  sharkCmd->SetParameterName("gen",true);
162  sharkCmd->SetDefaultValue(false);
164 
165  sampleTCmd = new G4UIcmdWithABool("/process/em/enableSamplingTable",this);
166  sampleTCmd->SetGuidance("Enable usage of sampling table for secondary generation");
167  sampleTCmd->SetParameterName("sampleT",true);
168  sampleTCmd->SetDefaultValue(false);
170 
171  icru90Cmd = new G4UIcmdWithABool("/process/eLoss/UseICRU90",this);
172  icru90Cmd->SetGuidance("Enable usage of ICRU90 stopping powers");
173  icru90Cmd->SetParameterName("icru90",true);
174  icru90Cmd->SetDefaultValue(false);
176 
177  mudatCmd = new G4UIcmdWithABool("/process/em/MuDataFromFile",this);
178  mudatCmd->SetGuidance("Enable usage of muon data from file");
179  mudatCmd->SetParameterName("mudat",true);
180  mudatCmd->SetDefaultValue(false);
182 
183  minSubSecCmd = new G4UIcmdWithADouble("/process/eLoss/minsubsec",this);
184  minSubSecCmd->SetGuidance("Set the ratio subcut/cut ");
185  minSubSecCmd->SetParameterName("rcmin",true);
187 
188  minEnCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/minKinEnergy",this);
189  minEnCmd->SetGuidance("Set the min kinetic energy for EM tables");
190  minEnCmd->SetParameterName("emin",true);
191  minEnCmd->SetUnitCategory("Energy");
193 
194  maxEnCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/maxKinEnergy",this);
195  maxEnCmd->SetGuidance("Set the max kinetic energy for EM tables");
196  maxEnCmd->SetParameterName("emax",true);
197  maxEnCmd->SetUnitCategory("Energy");
199 
200  cenCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/maxKinEnergyCSDA",this);
201  cenCmd->SetGuidance("Set the max kinetic energy for CSDA table");
202  cenCmd->SetParameterName("emaxCSDA",true);
203  cenCmd->SetUnitCategory("Energy");
205 
206  max5DCmd = new G4UIcmdWithADoubleAndUnit("/process/em/max5DMuPairEnergy",this);
207  max5DCmd->SetGuidance("Set the max kinetic energy for 5D muon pair production");
208  max5DCmd->SetParameterName("emax5D",true);
209  max5DCmd->SetUnitCategory("Energy");
211 
212  lowEnCmd = new G4UIcmdWithADoubleAndUnit("/process/em/lowestElectronEnergy",this);
213  lowEnCmd->SetGuidance("Set the lowest kinetic energy for e+-");
214  lowEnCmd->SetParameterName("elow",true);
215  lowEnCmd->SetUnitCategory("Energy");
217 
218  lowhEnCmd = new G4UIcmdWithADoubleAndUnit("/process/em/lowestMuHadEnergy",this);
219  lowhEnCmd->SetGuidance("Set the lowest kinetic energy for muons and hadrons");
220  lowhEnCmd->SetParameterName("elowh",true);
221  lowhEnCmd->SetUnitCategory("Energy");
223 
224  lowEn3Cmd = new G4UIcmdWithADoubleAndUnit("/process/em/lowestTripletEnergy",this);
225  lowEn3Cmd->SetGuidance("Set the lowest kinetic energy for triplet production");
226  lowEn3Cmd->SetParameterName("elow3",true);
227  lowEn3Cmd->SetUnitCategory("Energy");
229 
230  lllCmd = new G4UIcmdWithADouble("/process/eLoss/linLossLimit",this);
231  lllCmd->SetGuidance("Set linearLossLimit parameter");
232  lllCmd->SetParameterName("linlim",true);
234 
235  brCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/bremThreshold",this);
236  brCmd->SetGuidance("Set bremsstrahlung energy threshold");
237  brCmd->SetParameterName("emaxBrem",true);
238  brCmd->SetUnitCategory("Energy");
240 
241  labCmd = new G4UIcmdWithADouble("/process/eLoss/LambdaFactor",this);
242  labCmd->SetGuidance("Set lambdaFactor parameter for integral option");
243  labCmd->SetParameterName("Fl",true);
245 
246  mscfCmd = new G4UIcmdWithADouble("/process/msc/FactorForAngleLimit",this);
247  mscfCmd->SetGuidance("Set factor for computation of a limit for -t (invariant transfer)");
248  mscfCmd->SetParameterName("Fact",true);
249  mscfCmd->SetRange("Fact>0");
252 
253  angCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/ThetaLimit",this);
254  angCmd->SetGuidance("Set the limit on the polar angle for msc and single scattering");
255  angCmd->SetParameterName("theta",true);
256  angCmd->SetUnitCategory("Angle");
258 
259  msceCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/EnergyLimit",this);
260  msceCmd->SetGuidance("Set the upper energy limit for msc");
261  msceCmd->SetParameterName("mscE",true);
262  msceCmd->SetUnitCategory("Energy");
264 
265  nielCmd = new G4UIcmdWithADoubleAndUnit("/process/em/MaxEnergyNIEL",this);
266  nielCmd->SetGuidance("Set the upper energy limit for NIEL");
267  nielCmd->SetParameterName("niel",true);
268  nielCmd->SetUnitCategory("Energy");
270 
271  frCmd = new G4UIcmdWithADouble("/process/msc/RangeFactor",this);
272  frCmd->SetGuidance("Set RangeFactor for msc processes of e+-");
273  frCmd->SetParameterName("Fr",true);
274  frCmd->SetRange("Fr>0");
275  frCmd->SetDefaultValue(0.04);
277 
278  fr1Cmd = new G4UIcmdWithADouble("/process/msc/RangeFactorMuHad",this);
279  fr1Cmd->SetGuidance("Set RangeFactor for msc processes of muons/hadrons");
280  fr1Cmd->SetParameterName("Fr1",true);
281  fr1Cmd->SetRange("Fr1>0");
282  fr1Cmd->SetDefaultValue(0.2);
284 
285  fgCmd = new G4UIcmdWithADouble("/process/msc/GeomFactor",this);
286  fgCmd->SetGuidance("Set GeomFactor parameter for msc processes");
287  fgCmd->SetParameterName("Fg",true);
288  fgCmd->SetRange("Fg>0");
289  fgCmd->SetDefaultValue(3.5);
291 
292  skinCmd = new G4UIcmdWithADouble("/process/msc/Skin",this);
293  skinCmd->SetGuidance("Set skin parameter for msc processes");
294  skinCmd->SetParameterName("skin",true);
296 
297  screCmd = new G4UIcmdWithADouble("/process/msc/ScreeningFactor",this);
298  screCmd->SetGuidance("Set screening factor");
299  screCmd->SetParameterName("screen",true);
301 
302  safCmd = new G4UIcmdWithADouble("/process/msc/SafetyFactor",this);
303  safCmd->SetGuidance("Set safety factor");
304  safCmd->SetParameterName("fsafe",true);
306 
307  llimCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/LambdaLimit",this);
308  llimCmd->SetGuidance("Set the upper energy limit for NIEL");
309  llimCmd->SetParameterName("ll",true);
310  llimCmd->SetUnitCategory("Length");
312 
313  dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this);
314  dedxCmd->SetGuidance("Set number of bins for EM tables");
315  dedxCmd->SetParameterName("binsDEDX",true);
318 
319  lamCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsLambda",this);
320  lamCmd->SetGuidance("Set number of bins for EM tables");
321  lamCmd->SetParameterName("binsL",true);
322  lamCmd->SetDefaultValue(84);
324 
325  amCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsPerDecade",this);
326  amCmd->SetGuidance("Set number of bins per decade for EM tables");
327  amCmd->SetParameterName("bins",true);
330 
331  verCmd = new G4UIcmdWithAnInteger("/process/eLoss/verbose",this);
332  verCmd->SetGuidance("Set verbose level for EM physics");
333  verCmd->SetParameterName("verb",true);
336 
337  ver1Cmd = new G4UIcmdWithAnInteger("/process/em/verbose",this);
338  ver1Cmd->SetGuidance("Set verbose level for EM physics");
339  ver1Cmd->SetParameterName("verb1",true);
342 
343  ver2Cmd = new G4UIcmdWithAnInteger("/process/em/workerVerbose",this);
344  ver2Cmd->SetGuidance("Set worker verbose level for EM physics");
345  ver2Cmd->SetParameterName("verb2",true);
348 
349  mscCmd = new G4UIcmdWithAString("/process/msc/StepLimit",this);
350  mscCmd->SetGuidance("Set msc step limitation type");
351  mscCmd->SetParameterName("StepLim",true);
352  mscCmd->SetCandidates("Minimal UseSafety UseSafetyPlus UseDistanceToBoundary");
354 
355  msc1Cmd = new G4UIcmdWithAString("/process/msc/StepLimitMuHad",this);
356  msc1Cmd->SetGuidance("Set msc step limitation type for muons/hadrons");
357  msc1Cmd->SetParameterName("StepLim1",true);
358  msc1Cmd->SetCandidates("Minimal UseSafety UseSafetyPlus UseDistanceToBoundary");
360 
361  dumpCmd = new G4UIcommand("/process/em/printParameters",this);
362  dumpCmd->SetGuidance("Print all EM parameters.");
363 
364  nffCmd = new G4UIcmdWithAString("/process/em/setNuclearFormFactor",this);
365  nffCmd->SetGuidance("Define typy of nuclear form-factor");
366  nffCmd->SetParameterName("NucFF",true);
367  nffCmd->SetCandidates("None Exponential Gaussian Flat");
369 
370  tripletCmd = new G4UIcmdWithAnInteger("/process/gconv/conversionType",this);
371  tripletCmd->SetGuidance("gamma conversion triplet/nuclear generation type:");
372  tripletCmd->SetGuidance("0 - (default) both triplet and nuclear");
373  tripletCmd->SetGuidance("1 - force nuclear");
374  tripletCmd->SetGuidance("2 - force triplet");
375  tripletCmd->SetParameterName("type",false);
376  tripletCmd->SetRange("type >= 0 && type <= 2");
379 
380  onIsolatedCmd = new G4UIcmdWithABool("/process/gconv/onIsolated",this);
381  onIsolatedCmd->SetGuidance("Conversion on isolated charged particles");
382  onIsolatedCmd->SetGuidance("false (default) : atomic electron screening");
383  onIsolatedCmd->SetGuidance("true : conversion on isolated particles.");
384  onIsolatedCmd->SetParameterName("flag",false);
387 }
388 
389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
390 
392 {
393  delete gconvDirectory;
394  delete eLossDirectory;
395  delete mscDirectory;
396  delete emDirectory;
397  delete dnaDirectory;
398 
399  delete flucCmd;
400  delete rangeCmd;
401  delete lpmCmd;
402  delete splCmd;
403  delete rsCmd;
404  delete aplCmd;
405  delete latCmd;
406  delete lat96Cmd;
407  delete mulatCmd;
408  delete catCmd;
409  delete delCmd;
410  delete IntegCmd;
411  delete mottCmd;
412  delete birksCmd;
413  delete sharkCmd;
414  delete onIsolatedCmd;
415  delete sampleTCmd;
416  delete icru90Cmd;
417  delete mudatCmd;
418 
419  delete minSubSecCmd;
420  delete minEnCmd;
421  delete maxEnCmd;
422  delete max5DCmd;
423  delete cenCmd;
424  delete lowEnCmd;
425  delete lowhEnCmd;
426  delete lowEn3Cmd;
427  delete lllCmd;
428  delete brCmd;
429  delete labCmd;
430  delete mscfCmd;
431  delete angCmd;
432  delete msceCmd;
433  delete nielCmd;
434  delete frCmd;
435  delete fr1Cmd;
436  delete fgCmd;
437  delete skinCmd;
438  delete safCmd;
439  delete llimCmd;
440  delete screCmd;
441 
442  delete dedxCmd;
443  delete lamCmd;
444  delete amCmd;
445  delete verCmd;
446  delete ver1Cmd;
447  delete ver2Cmd;
448  delete tripletCmd;
449 
450  delete mscCmd;
451  delete msc1Cmd;
452  delete nffCmd;
453 
454  delete dumpCmd;
455 }
456 
457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
458 
460  G4String newValue)
461 {
462  G4bool physicsModified = false;
463  if (command == flucCmd) {
465  physicsModified = true;
466  } else if (command == rangeCmd) {
468  } else if (command == lpmCmd) {
470  physicsModified = true;
471  } else if (command == splCmd) {
473  } else if (command == rsCmd) {
475  physicsModified = true;
476  } else if (command == aplCmd) {
478  physicsModified = true;
479  } else if (command == latCmd) {
481  physicsModified = true;
482  } else if (command == lat96Cmd) {
484  physicsModified = true;
485  } else if (command == mulatCmd) {
487  physicsModified = true;
488  } else if (command == catCmd) {
490  physicsModified = true;
491  } else if (command == delCmd) {
493  } else if (command == IntegCmd) {
495  physicsModified = true;
496  } else if (command == mottCmd) {
498  } else if (command == birksCmd) {
500  } else if (command == icru90Cmd) {
502  } else if (command == sharkCmd) {
504  } else if (command == sampleTCmd) {
506  } else if (command == mudatCmd) {
508 
509  } else if (command == minSubSecCmd) {
511  } else if (command == minEnCmd) {
513  } else if (command == maxEnCmd) {
515  } else if (command == max5DCmd) {
517  } else if (command == cenCmd) {
519  physicsModified = true;
520  } else if (command == lowEnCmd) {
522  physicsModified = true;
523  } else if (command == lowEn3Cmd) {
525  physicsModified = true;
526  } else if (command == lowhEnCmd) {
528  physicsModified = true;
529  } else if (command == lllCmd) {
531  physicsModified = true;
532  } else if (command == brCmd) {
534  physicsModified = true;
535  } else if (command == labCmd) {
537  physicsModified = true;
538  } else if (command == mscfCmd) {
540  } else if (command == angCmd) {
542  physicsModified = true;
543  } else if (command == msceCmd) {
545  } else if (command == nielCmd) {
547  } else if (command == frCmd) {
549  physicsModified = true;
550  } else if (command == fr1Cmd) {
552  physicsModified = true;
553  } else if (command == fgCmd) {
555  physicsModified = true;
556  } else if (command == skinCmd) {
558  physicsModified = true;
559  } else if (command == safCmd) {
561  physicsModified = true;
562  } else if (command == llimCmd) {
564  physicsModified = true;
565  } else if (command == screCmd) {
567  } else if (command == dedxCmd) {
569  } else if (command == lamCmd) {
571  } else if (command == amCmd) {
573  } else if (command == verCmd) {
575  } else if (command == ver1Cmd) {
577  physicsModified = true;
578  } else if (command == ver2Cmd) {
580  physicsModified = true;
581  } else if (command == dumpCmd) {
582  theParameters->Dump();
583  } else if (command == mscCmd || command == msc1Cmd) {
584  G4MscStepLimitType msctype = fUseSafety;
585  if(newValue == "Minimal") {
586  msctype = fMinimal;
587  } else if(newValue == "UseDistanceToBoundary") {
588  msctype = fUseDistanceToBoundary;
589  } else if(newValue == "UseSafety") {
590  msctype = fUseSafety;
591  } else if(newValue == "UseSafetyPlus") {
592  msctype = fUseSafetyPlus;
593  } else {
595  ed << " StepLimit type <" << newValue << "> unknown!";
596  G4Exception("G4EmParametersMessenger", "em0044", JustWarning, ed);
597  return;
598  }
599  if (command == mscCmd) {
601  } else {
603  }
604  physicsModified = true;
605  } else if (command == nffCmd) {
607  if(newValue == "Exponential") { x = fExponentialNF; }
608  else if(newValue == "Gaussian") { x = fGaussianNF; }
609  else if(newValue == "Flat") { x = fFlatNF; }
610  else if(newValue != "None") {
612  ed << " NuclearFormFactor type <" << newValue << "> unknown!";
613  G4Exception("G4EmParametersMessenger", "em0044", JustWarning, ed);
614  return;
615  }
617  } else if ( command==tripletCmd ) {
619  physicsModified = true;
620  } else if ( command==onIsolatedCmd ) {
622  physicsModified = true;
623  }
624 
625  if(physicsModified) {
626  G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
627  }
628 }
629 
630 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....