Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPMessenger.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//
28#include "G4UIdirectory.hh"
29#include "G4UIcmdWithAString.hh"
32
33
35:manager(man)
36{
37 ParticleHPDir = new G4UIdirectory( "/process/had/particle_hp/" );
38 ParticleHPDir->SetGuidance( "UI commands of ParticleHP" );
39
40 PhotoEvaCmd = new G4UIcmdWithAString("/process/had/particle_hp/use_photo_evaporation",this);
41 PhotoEvaCmd->SetGuidance(" Force the use of the Photon Evaporation model, instead of the neutron capture final state data.");
42 PhotoEvaCmd->SetParameterName("choice",false);
43 PhotoEvaCmd->SetCandidates("true false");
45
46 SkipMissingCmd = new G4UIcmdWithAString("/process/had/particle_hp/skip_missing_isotopes",this);
47 SkipMissingCmd->SetGuidance("Use only exact isotope data files, instead of allowing nearby isotope files to be used.");
48 SkipMissingCmd->SetGuidance("In this case if the exact file is not available, the cross section will be set to zero.");
49 SkipMissingCmd->SetParameterName("choice",false);
50 SkipMissingCmd->SetCandidates("true false");
52
53 NeglectDopplerCmd = new G4UIcmdWithAString("/process/had/particle_hp/neglect_Doppler_broadening",this);
54 NeglectDopplerCmd->SetGuidance("Switch off the Doppler broadening due to the thermal motion of the target nucleus.");
55 NeglectDopplerCmd->SetGuidance("This option provides a significant CPU performance advantage.");
56 NeglectDopplerCmd->SetParameterName("choice",false);
57 NeglectDopplerCmd->SetCandidates("true false");
59
60 DoNotAdjustFSCmd = new G4UIcmdWithAString("/process/had/particle_hp/do_not_adjust_final_state",this);
61 DoNotAdjustFSCmd->SetGuidance("Disable to adjust final state for getting better conservation.");
62 DoNotAdjustFSCmd->SetParameterName("choice",false);
63 DoNotAdjustFSCmd->SetCandidates("true false");
65
66 ProduceFissionFragementCmd = new G4UIcmdWithAString("/process/had/particle_hp/produce_fission_fragment",this);
67 ProduceFissionFragementCmd->SetGuidance("Enable to generate fission fragments.");
68 ProduceFissionFragementCmd->SetParameterName("choice",false);
69 ProduceFissionFragementCmd->SetCandidates("true false");
70 ProduceFissionFragementCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
71
72 WendtFissionModelCmd = new G4UIcmdWithAString("/process/had/particle_hp/use_Wendt_fission_model",this);
73 WendtFissionModelCmd->SetGuidance("Enable use of Wendt fission model.");
74 WendtFissionModelCmd->SetParameterName("choice",false);
75 WendtFissionModelCmd->SetCandidates("true false");
76 WendtFissionModelCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
77
78 NRESP71Cmd = new G4UIcmdWithAString("/process/had/particle_hp/use_NRESP71_model",this);
79 NRESP71Cmd->SetGuidance("Enable to use NRESP71 model for n on C reaction");
80 NRESP71Cmd->SetParameterName("choice",false);
81 NRESP71Cmd->SetCandidates("true false");
83
84 VerboseCmd = new G4UIcmdWithAnInteger("/process/had/particle_hp/verbose",this);
85 VerboseCmd->SetGuidance("Set Verbose level of ParticleHP package");
86 VerboseCmd->SetParameterName("verbose_level",true);
87 VerboseCmd->SetDefaultValue(1);
88 VerboseCmd->SetRange("verbose_level >=0");
90}
91
93{
94 delete ParticleHPDir;
95 delete PhotoEvaCmd;
96 delete SkipMissingCmd;
97 delete NeglectDopplerCmd;
98 delete DoNotAdjustFSCmd;
99 delete ProduceFissionFragementCmd;
100 delete WendtFissionModelCmd;
101 delete NRESP71Cmd;
102 delete VerboseCmd;
103}
104
106{
107 G4bool bValue = false;
108 if ( newValue == "true" ) bValue = true;
109
110 if ( command == PhotoEvaCmd ) {
111 if ( manager->GetUseOnlyPhotoEvaporation() != bValue ) {
112 manager->SetUseOnlyPhotoEvaporation( bValue );
113 #ifdef G4VERBOSE
114 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
115 G4cout << G4endl
116 << "=== G4ParticleHPMessenger CHANGED PARAMETER UseOnlyPhotoEvaporation TO "
117 << bValue << " ===" << G4endl;
118 }
119 if ( bValue ) {
120 G4cout << " -> Forced the use of the Photon Evaporation model (instead of the neutron capture final state data)"
121 << G4endl;
122 } else {
123 G4cout << " -> Go back to use the default neutron capture final state data !" << G4endl;
124 }
125 #endif
126 }
127 }
128
129 if ( command == SkipMissingCmd) {
130 if ( manager->GetSkipMissingIsotopes() != bValue ) {
131 manager->SetSkipMissingIsotopes( bValue );
132 #ifdef G4VERBOSE
133 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
134 G4cout << G4endl
135 << "=== G4ParticleHPMessenger CHANGED PARAMETER SkipMissingIsotopes TO "
136 << bValue << " ===" << G4endl;
137 }
138 if ( bValue ) {
139 G4cout << " -> Use only exact isotope data files, instead of allowing nearby isotope files to be used: \n"
140 << " if the exact file is not available, the cross section will be set to zero !"
141 << G4endl;
142 } else {
143 G4cout << " -> Go back to the default, i.e. use nearby isotope files when the exact isotope data files are not found !"
144 << G4endl;
145 }
146 #endif
147 }
148 }
149
150 if ( command == NeglectDopplerCmd ) {
151 if ( manager->GetNeglectDoppler() != bValue ) {
152 manager->SetNeglectDoppler( bValue );
153 #ifdef G4VERBOSE
154 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
155 G4cout << G4endl
156 << "=== G4ParticleHPMessenger CHANGED PARAMETER NeglectDoppler TO "
157 << bValue << " ===" << G4endl;
158 }
159 if ( bValue ) {
160 G4cout << " -> Switched off the Doppler broadening due to the thermal motion of the target nucleus: \n"
161 << " on-the-fly Doppler broadening will be neglected in the cross section calculations of \n"
162 << " capture, elastic, fission and inelastic reactions/scatterings of neutrons below 20 MeV.\n"
163 << " This option provides a significant CPU performance advantage !"
164 << G4endl;
165 } else {
166 G4cout << " -> Go back to the default, i.e. switch on the Doppler broadening on-the-fly !" << G4endl;
167 }
168 #endif
169 }
170 }
171
172 if ( command == DoNotAdjustFSCmd ) {
173 if ( manager->GetDoNotAdjustFinalState() != bValue ) {
174 manager->SetDoNotAdjustFinalState( bValue );
175 #ifdef G4VERBOSE
176 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
177 G4cout << G4endl
178 << "=== G4ParticleHPMessenger CHANGED PARAMETER DoNotAdjustFinalState TO "
179 << bValue << " ===" << G4endl;
180 }
181 if ( bValue ) {
182 G4cout << " -> Disabled the adjustment of the final state for getting better conservation !"
183 << G4endl;
184 } else {
185 G4cout << " -> Go back to the default, i.e. adjust the final state to get better conservation !"
186 << G4endl;
187 }
188 #endif
189 }
190 }
191
192 if ( command == ProduceFissionFragementCmd ) {
193 if ( manager->GetProduceFissionFragments() != bValue ) {
194 manager->SetProduceFissionFragments( bValue );
195 #ifdef G4VERBOSE
196 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
197 G4cout << G4endl
198 << "=== G4ParticleHPMessenger CHANGED PARAMETER ProduceFissionFragments TO "
199 << bValue << " ===" << G4endl;
200 }
201 if ( bValue ) {
202 G4cout << " -> Enabled the generation of fission fragments !"
203 << G4endl;
204 } else {
205 G4cout << " -> Go back to the default, i.e. do not generate fission fragments !" << G4endl;
206 }
207 #endif
208 }
209 }
210
211 if ( command == WendtFissionModelCmd ) {
212 if ( manager->GetUseWendtFissionModel() != bValue ) {
213 manager->SetUseWendtFissionModel( bValue );
214 // Make sure both fission fragment models are not active at same time
215 if ( bValue ) manager->SetProduceFissionFragments( false );
216 #ifdef G4VERBOSE
217 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
218 G4cout << G4endl
219 << "=== G4ParticleHPMessenger CHANGED PARAMETER UseWendtFissionModel TO "
220 << bValue << " ===" << G4endl;
221 }
222 if ( bValue ) {
223 G4cout << " -> Enabled the use of Wendt fission model !" << G4endl;
224 } else {
225 G4cout << " -> Go back to the default, i.e. do not use the Wendt fission model !" << G4endl;
226 }
227 #endif
228 }
229 }
230
231 if ( command == NRESP71Cmd ) {
232 if ( manager->GetUseNRESP71Model() != bValue ) {
233 manager->SetUseNRESP71Model( bValue );
234 #ifdef G4VERBOSE
235 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
236 G4cout << G4endl
237 << "=== G4ParticleHPMessenger CHANGED PARAMETER UseNRESP71Model TO "
238 << bValue << " ===" << G4endl;
239 }
240 if ( bValue ) {
241 G4cout << " -> Enabled the use of NRESP71 model for n on C reaction !" << G4endl;
242 } else {
243 G4cout << " -> Go back to the default, i.e. do not use the NRESP71 model !" << G4endl;
244 }
245 #endif
246 }
247 }
248
249 if ( command == VerboseCmd ) {
250 G4int verboseLevel = VerboseCmd->ConvertToInt( newValue );
251 if ( manager->GetVerboseLevel() != verboseLevel ) {
252 manager->SetVerboseLevel( verboseLevel );
253 #ifdef G4VERBOSE
254 if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 0 ) {
255 G4cout << G4endl
256 << "=== G4ParticleHPMessenger CHANGED PARAMETER VerboseLevel TO "
257 << verboseLevel << " ===" << G4endl;
258 }
259 #endif
260 }
261 }
262}
263
@ G4State_Idle
@ G4State_PreInit
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4HadronicParameters * Instance()
void SetUseNRESP71Model(G4bool val)
void SetNeglectDoppler(G4bool val)
void SetProduceFissionFragments(G4bool val)
void SetSkipMissingIsotopes(G4bool val)
void SetDoNotAdjustFinalState(G4bool val)
void SetUseWendtFissionModel(G4bool val)
void SetUseOnlyPhotoEvaporation(G4bool val)
void SetNewValue(G4UIcommand *, G4String)
G4ParticleHPMessenger(G4ParticleHPManager *)
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)
Definition: G4UIcommand.hh:157
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:561
void SetRange(const char *rs)
Definition: G4UIcommand.hh:121
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:287