Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPMessenger Class Reference

#include <G4ParticleHPMessenger.hh>

+ Inheritance diagram for G4ParticleHPMessenger:

Public Member Functions

 G4ParticleHPMessenger (G4ParticleHPManager *)
 
 ~G4ParticleHPMessenger () override
 
void SetNewValue (G4UIcommand *, G4String) override
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const G4String &s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 40 of file G4ParticleHPMessenger.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPMessenger()

G4ParticleHPMessenger::G4ParticleHPMessenger ( G4ParticleHPManager * man)

Definition at line 41 of file G4ParticleHPMessenger.cc.

41 : manager(man)
42{
43 ParticleHPDir = new G4UIdirectory("/process/had/particle_hp/");
44 ParticleHPDir->SetGuidance("UI commands of ParticleHP");
45
46 PhotoEvaCmd = new G4UIcmdWithAString("/process/had/particle_hp/use_photo_evaporation", this);
47 PhotoEvaCmd->SetGuidance(
48 " Force the use of the Photon Evaporation model, instead of the neutron capture final state "
49 "data.");
50 PhotoEvaCmd->SetParameterName("choice", false);
51 PhotoEvaCmd->SetCandidates("true false");
53
54 SkipMissingCmd = new G4UIcmdWithAString("/process/had/particle_hp/skip_missing_isotopes", this);
55 SkipMissingCmd->SetGuidance(
56 "Use only exact isotope data files, instead of allowing nearby isotope files to be used.");
57 SkipMissingCmd->SetGuidance(
58 "In this case if the exact file is not available, the cross section will be set to zero.");
59 SkipMissingCmd->SetParameterName("choice", false);
60 SkipMissingCmd->SetCandidates("true false");
62
63 NeglectDopplerCmd =
64 new G4UIcmdWithAString("/process/had/particle_hp/neglect_Doppler_broadening", this);
65 NeglectDopplerCmd->SetGuidance(
66 "Switch off the Doppler broadening due to the thermal motion of the target nucleus.");
67 NeglectDopplerCmd->SetGuidance("This option provides a significant CPU performance advantage.");
68 NeglectDopplerCmd->SetParameterName("choice", false);
69 NeglectDopplerCmd->SetCandidates("true false");
71
72 DoNotAdjustFSCmd =
73 new G4UIcmdWithAString("/process/had/particle_hp/do_not_adjust_final_state", this);
74 DoNotAdjustFSCmd->SetGuidance("Disable to adjust final state for getting better conservation.");
75 DoNotAdjustFSCmd->SetParameterName("choice", false);
76 DoNotAdjustFSCmd->SetCandidates("true false");
78
79 ProduceFissionFragementCmd =
80 new G4UIcmdWithAString("/process/had/particle_hp/produce_fission_fragment", this);
81 ProduceFissionFragementCmd->SetGuidance("Enable to generate fission fragments.");
82 ProduceFissionFragementCmd->SetParameterName("choice", false);
83 ProduceFissionFragementCmd->SetCandidates("true false");
84 ProduceFissionFragementCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
85
86 WendtFissionModelCmd =
87 new G4UIcmdWithAString("/process/had/particle_hp/use_Wendt_fission_model", this);
88 WendtFissionModelCmd->SetGuidance("Enable use of Wendt fission model.");
89 WendtFissionModelCmd->SetParameterName("choice", false);
90 WendtFissionModelCmd->SetCandidates("true false");
91 WendtFissionModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
92
93 NRESP71Cmd = new G4UIcmdWithAString("/process/had/particle_hp/use_NRESP71_model", this);
94 NRESP71Cmd->SetGuidance("Enable to use NRESP71 model for n on C reaction");
95 NRESP71Cmd->SetParameterName("choice", false);
96 NRESP71Cmd->SetCandidates("true false");
98
99 VerboseCmd = new G4UIcmdWithAnInteger("/process/had/particle_hp/verbose", this);
100 VerboseCmd->SetGuidance("Set Verbose level of ParticleHP package");
101 VerboseCmd->SetParameterName("verbose_level", true);
102 VerboseCmd->SetDefaultValue(1);
103 VerboseCmd->SetRange("verbose_level >=0");
105
106 UseDBRCCmd = new G4UIcmdWithABool("/process/had/particle_hp/use_DBRC", this);
107 UseDBRCCmd->SetGuidance("Enable use of Doppler Broadening Rejection Correction algorithm.");
108 UseDBRCCmd->SetDefaultValue(false);
110
111 MaxEnergySVTCmd = new G4UIcmdWithADoubleAndUnit("/process/had/particle_hp/SVT_E_max", this);
112 MaxEnergySVTCmd->SetGuidance("Energy threshold under which the SVT method is applied.");
113 MaxEnergySVTCmd->SetGuidance("The default is 400. kT.");
114 MaxEnergySVTCmd->SetParameterName("MaxEnergySVT", false);
115 MaxEnergySVTCmd->SetRange("MaxEnergySVT>=0.");
116 MaxEnergySVTCmd->SetUnitCategory("Energy");
118
119 MinADBRCCmd = new G4UIcmdWithADouble("/process/had/particle_hp/DBRC_A_min", this);
120 MinADBRCCmd->SetGuidance("Atomic mass in neutron mass above which the DBRC is applied.");
121 MinADBRCCmd->SetGuidance("The default is A=200.");
122 MinADBRCCmd->SetParameterName("MinASVT", false);
123 MinADBRCCmd->SetRange("MinASVT>=0.");
124 MinADBRCCmd->SetDefaultValue(200);
126
127 MinEnergyDBRCCmd = new G4UIcmdWithADoubleAndUnit("/process/had/particle_hp/DBRC_E_min", this);
128 MinEnergyDBRCCmd->SetGuidance(
129 "Energy threshold under which the DBRC method is not applied and only the SVT is used.");
130 MinEnergyDBRCCmd->SetGuidance("The default value is 0.1 eV.");
131 MinEnergyDBRCCmd->SetParameterName("MinEnergyDBRC", false);
132 MinEnergyDBRCCmd->SetRange("MinEnergyDBRC>0.");
133 MinEnergyDBRCCmd->SetUnitCategory("Energy");
134 MinEnergyDBRCCmd->SetDefaultValue(0.1 * CLHEP::eV);
136
137 MaxEnergyDBRCCmd = new G4UIcmdWithADoubleAndUnit("/process/had/particle_hp/DBRC_E_max", this);
138 MaxEnergyDBRCCmd->SetGuidance("Energy threshold under which the DBRC method is applied.");
139 MaxEnergyDBRCCmd->SetGuidance("The default value is 210. eV.");
140 MaxEnergyDBRCCmd->SetParameterName("MaxEnergyDBRC", false);
141 MaxEnergyDBRCCmd->SetRange("MaxEnergyDBRC>0.");
142 MaxEnergyDBRCCmd->SetUnitCategory("Energy");
143 MaxEnergyDBRCCmd->SetDefaultValue(210. * CLHEP::eV);
145}
@ G4State_Idle
@ G4State_PreInit
void SetDefaultValue(G4bool defVal)
void SetUnitCategory(const char *unitCategory)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4double defVal)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)

◆ ~G4ParticleHPMessenger()

G4ParticleHPMessenger::~G4ParticleHPMessenger ( )
override

Definition at line 147 of file G4ParticleHPMessenger.cc.

148{
149 delete ParticleHPDir;
150 delete PhotoEvaCmd;
151 delete SkipMissingCmd;
152 delete NeglectDopplerCmd;
153 delete DoNotAdjustFSCmd;
154 delete ProduceFissionFragementCmd;
155 delete WendtFissionModelCmd;
156 delete NRESP71Cmd;
157 delete VerboseCmd;
158 delete UseDBRCCmd;
159 delete MaxEnergySVTCmd;
160 delete MinADBRCCmd;
161 delete MinEnergyDBRCCmd;
162 delete MaxEnergyDBRCCmd;
163}

Member Function Documentation

◆ SetNewValue()

void G4ParticleHPMessenger::SetNewValue ( G4UIcommand * command,
G4String newValue )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 165 of file G4ParticleHPMessenger.cc.

166{
167 G4bool bValue = false;
168 if (newValue == "true") bValue = true;
169
170 if (command == PhotoEvaCmd) {
171 if (manager->GetUseOnlyPhotoEvaporation() != bValue) {
172 manager->SetUseOnlyPhotoEvaporation(bValue);
173#ifdef G4VERBOSE
174 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
175 G4cout << G4endl
176 << "=== G4ParticleHPMessenger CHANGED PARAMETER UseOnlyPhotoEvaporation TO "
177 << bValue << " ===" << G4endl;
178 }
179 if (bValue) {
180 G4cout << " -> Forced the use of the Photon Evaporation model (instead of the neutron "
181 "capture final state data)"
182 << G4endl;
183 }
184 else {
185 G4cout << " -> Go back to use the default neutron capture final state data !" << G4endl;
186 }
187#endif
188 }
189 }
190
191 if (command == SkipMissingCmd) {
192 if (manager->GetSkipMissingIsotopes() != bValue) {
193 manager->SetSkipMissingIsotopes(bValue);
194#ifdef G4VERBOSE
195 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
196 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER SkipMissingIsotopes TO "
197 << bValue << " ===" << G4endl;
198 }
199 if (bValue) {
200 G4cout
201 << " -> Use only exact isotope data files, instead of allowing nearby isotope files "
202 "to be used: \n"
203 << " if the exact file is not available, the cross section will be set to zero !"
204 << G4endl;
205 }
206 else {
207 G4cout << " -> Go back to the default, i.e. use nearby isotope files when the exact "
208 "isotope data files are not found !"
209 << G4endl;
210 }
211#endif
212 }
213 }
214
215 if (command == NeglectDopplerCmd) {
216 if (manager->GetNeglectDoppler() != bValue) {
217 manager->SetNeglectDoppler(bValue);
218#ifdef G4VERBOSE
219 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
220 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER NeglectDoppler TO "
221 << bValue << " ===" << G4endl;
222 }
223 if (bValue) {
224 G4cout << " -> Switched off the Doppler broadening due to the thermal motion of the "
225 "target nucleus: \n"
226 << " on-the-fly Doppler broadening will be neglected in the cross section "
227 "calculations of \n"
228 << " capture, elastic, fission and inelastic reactions/scatterings of "
229 "neutrons below 20 MeV.\n"
230 << " This option provides a significant CPU performance advantage !" << G4endl;
231 }
232 else {
233 G4cout
234 << " -> Go back to the default, i.e. switch on the Doppler broadening on-the-fly !"
235 << G4endl;
236 }
237#endif
238 }
239 }
240
241 if (command == DoNotAdjustFSCmd) {
242 if (manager->GetDoNotAdjustFinalState() != bValue) {
243 manager->SetDoNotAdjustFinalState(bValue);
244#ifdef G4VERBOSE
245 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
246 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER DoNotAdjustFinalState TO "
247 << bValue << " ===" << G4endl;
248 }
249 if (bValue) {
250 G4cout
251 << " -> Disabled the adjustment of the final state for getting better conservation !"
252 << G4endl;
253 }
254 else {
255 G4cout << " -> Go back to the default, i.e. adjust the final state to get better "
256 "conservation !"
257 << G4endl;
258 }
259#endif
260 }
261 }
262
263 if (command == ProduceFissionFragementCmd) {
264 if (manager->GetProduceFissionFragments() != bValue) {
265 manager->SetProduceFissionFragments(bValue);
266#ifdef G4VERBOSE
267 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
268 G4cout << G4endl
269 << "=== G4ParticleHPMessenger CHANGED PARAMETER ProduceFissionFragments TO "
270 << bValue << " ===" << G4endl;
271 }
272 if (bValue) {
273 G4cout << " -> Enabled the generation of fission fragments !" << G4endl;
274 }
275 else {
276 G4cout << " -> Go back to the default, i.e. do not generate fission fragments !"
277 << G4endl;
278 }
279#endif
280 }
281 }
282
283 if (command == WendtFissionModelCmd) {
284 if (manager->GetUseWendtFissionModel() != bValue) {
285 manager->SetUseWendtFissionModel(bValue);
286 // Make sure both fission fragment models are not active at same time
287 if (bValue) manager->SetProduceFissionFragments(false);
288#ifdef G4VERBOSE
289 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
290 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER UseWendtFissionModel TO "
291 << bValue << " ===" << G4endl;
292 }
293 if (bValue) {
294 G4cout << " -> Enabled the use of Wendt fission model !" << G4endl;
295 }
296 else {
297 G4cout << " -> Go back to the default, i.e. do not use the Wendt fission model !"
298 << G4endl;
299 }
300#endif
301 }
302 }
303
304 if (command == NRESP71Cmd) {
305 if (manager->GetUseNRESP71Model() != bValue) {
306 manager->SetUseNRESP71Model(bValue);
307#ifdef G4VERBOSE
308 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
309 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER UseNRESP71Model TO "
310 << bValue << " ===" << G4endl;
311 }
312 if (bValue) {
313 G4cout << " -> Enabled the use of NRESP71 model for n on C reaction !" << G4endl;
314 }
315 else {
316 G4cout << " -> Go back to the default, i.e. do not use the NRESP71 model !" << G4endl;
317 }
318#endif
319 }
320 }
321
322 if (command == VerboseCmd) {
323 G4int verboseLevel = VerboseCmd->ConvertToInt(newValue);
324 if (manager->GetVerboseLevel() != verboseLevel) {
325 manager->SetVerboseLevel(verboseLevel);
326#ifdef G4VERBOSE
327 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
328 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER VerboseLevel TO "
329 << verboseLevel << " ===" << G4endl;
330 }
331#endif
332 }
333 }
334
335 if (command == UseDBRCCmd) {
336 bValue = UseDBRCCmd->GetNewBoolValue(newValue);
337 if (manager->GetUseDBRC() != bValue) {
338 manager->SetUseDBRC(bValue);
339#ifdef G4VERBOSE
340 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
341 G4cout << G4endl << "=== G4ParticleHPMessenger CHANGED PARAMETER UseDBRC TO " << bValue
342 << " ===" << G4endl;
343 }
344 if (bValue) {
345 G4cout << " -> Using the DBRC algorithm!" << G4endl;
346 }
347 else {
348 G4cout << " -> Do not use the DBRC algorithm!" << G4endl;
349 }
350#endif
351 }
352 }
353
354 if (command == MaxEnergySVTCmd) {
355 G4double energymax = MaxEnergySVTCmd->GetNewDoubleValue(newValue);
356 if (G4HadronicParameters::Instance()->GetNeutronKineticEnergyThresholdForSVT() != energymax) {
358#ifdef G4VERBOSE
359 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
360 G4cout << G4endl
361 << "=== G4ParticleHPMessenger CHANGED PARAMETER for SVT algorithm ===" << G4endl;
362 G4cout << "max energy: " << G4BestUnit(energymax, "Energy") << G4endl;
363 }
364#endif
365 }
366 }
367
368 if (command == MinADBRCCmd) {
369 G4double Amin = MinADBRCCmd->GetNewDoubleValue(newValue);
370 if (manager->GetMinADBRC() != Amin) {
371 manager->SetMinADBRC(Amin);
372#ifdef G4VERBOSE
373 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
374 G4cout << G4endl
375 << "=== G4ParticleHPMessenger CHANGED PARAMETER for DBRC algorithm ===" << G4endl;
376 G4cout << "min A: " << Amin << G4endl;
377 }
378#endif
379 }
380 }
381
382 if (command == MinEnergyDBRCCmd) {
383 G4double energymin = MinEnergyDBRCCmd->GetNewDoubleValue(newValue);
384 if (manager->GetMinEnergyDBRC() != energymin) {
385 manager->SetMinEnergyDBRC(energymin);
386#ifdef G4VERBOSE
387 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
388 G4cout << G4endl
389 << "=== G4ParticleHPMessenger CHANGED PARAMETER for DBRC algorithm ===" << G4endl;
390 G4cout << "min energy: " << G4BestUnit(energymin, "Energy") << G4endl;
391 }
392#endif
393 }
394 }
395
396 if (command == MaxEnergyDBRCCmd) {
397 G4double energymax = MaxEnergyDBRCCmd->GetNewDoubleValue(newValue);
398 if (manager->GetMaxEnergyDBRC() != energymax) {
399 manager->SetMaxEnergyDBRC(energymax);
400#ifdef G4VERBOSE
401 if (G4HadronicParameters::Instance()->GetVerboseLevel() > 0) {
402 G4cout << G4endl
403 << "=== G4ParticleHPMessenger CHANGED PARAMETER for SVT algorithm ===" << G4endl;
404 G4cout << "max energy: " << G4BestUnit(energymax, "Energy") << G4endl;
405 }
406#endif
407 }
408 }
409}
#define G4BestUnit(a, b)
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4HadronicParameters * Instance()
void SetNeutronKineticEnergyThresholdForSVT(const G4double val)
void SetUseNRESP71Model(G4bool val)
void SetMinADBRC(G4double val)
void SetNeglectDoppler(G4bool val)
G4bool GetProduceFissionFragments() const
void SetMinEnergyDBRC(G4double val)
G4bool GetUseOnlyPhotoEvaporation() const
void SetProduceFissionFragments(G4bool val)
void SetSkipMissingIsotopes(G4bool val)
void SetDoNotAdjustFinalState(G4bool val)
G4bool GetUseWendtFissionModel() const
G4double GetMinEnergyDBRC() const
G4double GetMinADBRC() const
G4bool GetUseNRESP71Model() const
G4bool GetSkipMissingIsotopes() const
void SetUseDBRC(G4bool val)
void SetUseWendtFissionModel(G4bool val)
G4bool GetNeglectDoppler() const
void SetMaxEnergyDBRC(G4double val)
void SetUseOnlyPhotoEvaporation(G4bool val)
G4double GetMaxEnergyDBRC() const
G4bool GetDoNotAdjustFinalState() const
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int ConvertToInt(const char *st)

The documentation for this class was generated from the following files: