14 #include "G4UIcommand.hh"
15 #include "G4UIparameter.hh"
16 #include "G4UIdirectory.hh"
17 #include "G4UIcmdWithAString.hh"
18 #include "G4UIcmdWithADoubleAndUnit.hh"
19 #include "G4UIcmdWithoutParameter.hh"
24 G4UIparameter* param =
nullptr;
26 physDir =
new G4UIdirectory(
"/eAST/physics/");
27 physDir->SetGuidance(
"eAST physics selection");
35 addRDMCmd =
new G4UIcmdWithoutParameter(
"/eAST/physics/addRDM",
this);
36 addRDMCmd->AvailableForStates(G4State_PreInit);
38 addRDMCmd->SetGuidance(
"Add Radioactive Decay model.");
39 addRDMCmd->SetGuidance(
" Note: Shielding option has already had RDM. This command does not make effect to Shielding option.");
41 addOpticalCmd =
new G4UIcmdWithoutParameter(
"/eAST/physics/addOptical",
this);
46 addStepLimitCmd =
new G4UIcmdWithAString(
"/eAST/physics/addStepLimit",
this);
49 addStepLimitCmd->SetGuidance(
"Add step-limiter process to artificially limit step length.");
51 addStepLimitCmd->SetGuidance(
" charged (default) : applied only to the charged particles");
52 addStepLimitCmd->SetGuidance(
" neutral : applied only to the neutral particles");
55 addStepLimitCmd->SetGuidance(
" Note: In addition to this command, you need to specify the limitation value by");
56 addStepLimitCmd->SetGuidance(
" /eAST/physics/limit/stepLimit or /eAST/physics/limit/localStepLimt command.");
61 physLimitDir =
new G4UIdirectory(
"/eAST/physics/limit/");
64 setStepLimitCmd =
new G4UIcmdWithADoubleAndUnit(
"/eAST/physics/limit/stepLimit",
this);
69 setStepLimitCmd->SetGuidance(
"Define the limitation of the step length");
70 setStepLimitCmd->SetGuidance(
"This limitation is applied to the entire geometry except regions that has its dedicated limit.");
75 setRegionStepLimitCmd->SetGuidance(
"Define the limitation of the step length for the specified region");
76 setRegionStepLimitCmd->SetGuidance(
" [usage] /eAST/physics/limit/regionStepLimit region length [unit]");
79 setRegionStepLimitCmd->SetGuidance(
" If new region is necessary, use /eAST/geometry/createRegion to create it.");
80 param =
new G4UIparameter(
"region",
's',
false);
82 param =
new G4UIparameter(
"length",
'd',
false);
84 param =
new G4UIparameter(
"unit",
's',
true);
85 param->SetDefaultUnit(
"mm");
88 physCutDir =
new G4UIdirectory(
"/eAST/physics/cuts/");
89 physCutDir->SetGuidance(
"Specify production thresholds (a.k.a. cuts)");
91 setCutCmd =
new G4UIcmdWithADoubleAndUnit(
"/eAST/physics/cuts/setCuts",
this);
92 setCutCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
94 setCutCmd->SetParameterName(
"length",
false);
96 setCutCmd->SetGuidance(
"Specify production thresholds (a.k.a. cuts) that is applied to the entire geometry");
97 setCutCmd->SetGuidance(
"This threshold is applied to all of e-, e+, gamma and proton.");
98 setCutCmd->SetGuidance(
"Threshold of each particle can be overwitted by /eAST/physics/cuts/setParticleCut command");
103 setCutParticleCmd->SetGuidance(
"Specify production threshold (a.k.a. cut) for the specified particle that is applied to the entire geometry");
104 setCutParticleCmd->SetGuidance(
" [usage] /eAST/physics/setParticleCut particle cut unit");
105 param =
new G4UIparameter(
"particle",
's',
false);
106 param->SetParameterCandidates(
"e- e+ gamma proton");
108 param =
new G4UIparameter(
"cut",
'd',
false);
110 param =
new G4UIparameter(
"unit",
's',
true);
111 param->SetDefaultUnit(
"mm");
114 setCutRegionCmd =
new G4UIcommand(
"/eAST/physics/cuts/setRegionCut",
this);
117 setCutRegionCmd->SetGuidance(
"Specify production threshold (a.k.a. cut) that is applied to the specified region");
118 setCutRegionCmd->SetGuidance(
" [usage] /eAST/physics/setRegionCut region cut unit");
119 setCutRegionCmd->SetGuidance(
"This threshold is applied to all of e-, e+, gamma and proton.");
120 setCutRegionCmd->SetGuidance(
"Threshold of each particle can be overwitted by /eAST/physics/cuts/setRegionParticleCut command");
121 setCutRegionCmd->SetGuidance(
" Note: Region has to be defined in advance to this command.");
122 setCutRegionCmd->SetGuidance(
" If new region is necessary, use /eAST/geometry/createRegion to create it.");
123 param =
new G4UIparameter(
"region",
's',
false);
125 param =
new G4UIparameter(
"cut",
'd',
false);
127 param =
new G4UIparameter(
"unit",
's',
true);
128 param->SetDefaultUnit(
"mm");
134 setCutRegionParticleCmd->SetGuidance(
"Specify production threshold (a.k.a. cut) that is applied to the specified region");
137 setCutRegionParticleCmd->SetGuidance(
" If new region is necessary, use /eAST/geometry/createRegion to create it.");
138 param =
new G4UIparameter(
"region",
's',
false);
140 param =
new G4UIparameter(
"particle",
's',
false);
141 param->SetParameterCandidates(
"e- e+ gamma proton");
143 param =
new G4UIparameter(
"cut",
'd',
false);
145 param =
new G4UIparameter(
"unit",
's',
true);
146 param->SetDefaultUnit(
"mm");
169 #include "G4Tokenizer.hh"
183 if(val==
"neutral") opt = 1;
184 else if(val==
"all") opt = 2;
185 else if(val==
"e+/-") opt = 3;
192 G4Tokenizer next(val);
193 G4String reg = next();
194 G4String newVal = next();
200 G4ExceptionDescription ed;
201 ed <<
"Region <" << reg <<
"> is not defined.";
209 G4Tokenizer next(val);
210 G4String pat = next();
211 G4String newVal = next();
216 else if(pat==
"e+") i = 1;
217 else if(pat==
"gamma") i = 2;
218 else if(pat==
"proton") i = 3;
223 G4Tokenizer next(val);
224 G4String reg = next();
225 G4String newVal = next();
231 G4ExceptionDescription ed;
232 ed <<
"Region <" << reg <<
"> is not defined.";
238 G4Tokenizer next(val);
239 G4String reg = next();
240 G4String pat = next();
243 else if(pat==
"e+") i = 1;
244 else if(pat==
"gamma") i = 2;
245 else if(pat==
"proton") i = 3;
246 G4String newVal = next();
252 G4ExceptionDescription ed;
253 ed <<
"Region <" << reg <<
"> is not defined.";
268 { val = cmd->ConvertToString(
pPL->
IfRDM()); }
276 case 0: val =
"charged";
break;
277 case 1: val =
"neutral";
break;
278 case 2: val =
"all";
break;
279 case 3: val =
"e+/-";
break;
280 default : val =
"undefined";
break;