Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HadronicParameters.hh
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//
27//---------------------------------------------------------------------------
28//
29// ClassName: G4HadronicParameters
30//
31// Author: 2018 Alberto Ribon
32//
33// Description: Singleton to keep global hadronic parameters.
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39#ifndef G4HadronicParameters_h
40#define G4HadronicParameters_h 1
41
42#include "globals.hh"
43
45
46
47class G4HadronicParameters {
48 public:
49
50 static G4HadronicParameters* Instance();
52
53 // printing
54 void StreamInfo(std::ostream& os) const;
55 void Dump() const;
56
57 inline G4double GetMaxEnergy() const;
58 void SetMaxEnergy( const G4double val );
59 // Getter/Setter for the upper limit for Geant4 hadronic physics, for any application.
60 // Any hadronic model, physics list builder and constructor should use this method
61 // instead of putting an arbitrary value in the code.
62 // Any application which tries to use hadronic physics for an energy higher than this limit
63 // will get a run-time crash, because no model is found.
64
69 // Getter/Setter of the recommended energy limits, for physics lists, of the
70 // transition region between the Fritiof (FTF) string model and the
71 // intranuclear cascade model, either Bertini (BERT) or Binary (BIC).
72
77 // Getter/Setter of the recommended energy limits, for physics lists, of the
78 // transition region between the two strings models - the Quark Gluon String (QGS)
79 // model and the Fritiof (FTF) model.
80
81 inline G4double GetMinEnergyINCLXX_Pbar() const;
82 inline G4double GetMaxEnergyINCLXX_Pbar() const;
83 void SetMinEnergyINCLXX_Pbar( const G4double val );
84 void SetMaxEnergyINCLXX_Pbar( const G4double val );
85 // Getter/Setter of the recommended energy limits, for physics lists, of the
86 // intranuclear cascade model INCLXX, for pbar interaction.
87
90 // If max kinetic energy is below this limit, then EM and hadronic physics are not
91 // instantiated for hyperons, anti-hyperons, anti light ions, b-, c- particles.
92
95 inline G4double XSFactorNucleonElastic() const;
97 // Cross section factor for protons and neutrons.
98
99 inline G4double XSFactorPionInelastic() const;
101 inline G4double XSFactorPionElastic() const;
103 // Cross section factor for pions.
104
105 inline G4double XSFactorHadronInelastic() const;
107 inline G4double XSFactorHadronElastic() const;
109 // Cross section factor for other hadrons and ions.
110
111 inline G4double XSFactorEM() const;
112 void SetXSFactorEM( G4double val );
113 // Cross section factor for gamma and leptons.
114
115 inline G4bool EnableBCParticles() const;
116 void SetEnableBCParticles( G4bool val );
117 // Baryons and mesons with c- and b- quarks may be enabled/disabled.
118 // This flag is used both by EM and hadronic physics constructors.
119
120 inline G4bool EnableHyperNuclei() const;
121 void SetEnableHyperNuclei( G4bool val );
122 // Light hyper-nuclei may be enabled/disabled.
123 // This flag is used both by EM and hadronic physics constructors.
124
125 inline G4bool ApplyFactorXS() const;
126 void SetApplyFactorXS( G4bool val );
127 // Flag enabling cross section factor definition.
128
129 inline G4int GetVerboseLevel() const;
130 void SetVerboseLevel( const G4int val );
131 // Getter/Setter of the general verbosity level for hadronics.
132
133 inline G4bool EnableCRCoalescence() const;
134 void SetEnableCRCoalescence( G4bool val );
135 // Boolean switch that allows to apply the Cosmic Ray (CR) coalescence algorithm
136 // to the secondaries produced by a string model. By default it is disabled.
137
138 inline G4bool EnableIntegralInelasticXS() const;
139 inline G4bool EnableIntegralElasticXS() const;
142 // Enable/disable integral method for main types of hadrons.
143
145 // For nucleon-hadron interactions, it's not decided what to do with diffraction
146 // dissociation. For the moment, they are turned off. This option allows it to
147 // be turned back on. Applies to Baryon Number > 10 or # target nucleons > 10.
149
152 // Coherent Charge exchange process may be enabled/disabled.
153
154 inline G4bool EnableNeutronGeneralProcess() const;
156 // Neutron general process may be enabled/disabled.
157
158 inline G4bool EnableNUDEX() const;
159 void SetEnableNUDEX( G4bool val );
160 // NUDEX gamma de-excitation is enabled/disabled.
161
162 inline const G4String& GetTypeTablePT() const;
163 void SetTypeTablePT( const G4String& typeTablePT );
164 // Specify the type of PT table - between "calendf" and "njoy" for
165 // the URR (Unresolved Resonance Region) treatment of low-energy neutrons.
166 // ( Note that there is no default: an empty string "" is returned if
167 // it is not set explicitly. )
168
169 inline G4double GetEPRelativeLevel() const;
170 inline G4double GetEPAbsoluteLevel() const;
171 inline G4int GetEPReportLevel() const;
172 inline G4bool GetBinaryDebug() const;
173 inline const G4String& GetDirPARTICLEXS() const;
174 inline const G4String& GetPhysListDocDir() const;
175 inline const G4String& GetPhysListName() const;
176 // Access to environment variables.
177
180 // Getter/Setter for the neutron kinetic energy threshold for
181 // applying the SVT (Sampling of the Velocity of the Target) algorithm.
182
185 // Getter/Setter for the time threshold of radioactive decays
186 // (i.e. radioactive decays that happen later than this value are ignored).
187
188 inline G4bool IsBertiniAs11_2() const;
189 void SetBertiniAs11_2( G4bool val );
192 inline G4bool IsBertiniNucleiModelAs11_2() const;
194 // Getter/Setter for the Bertini model behavior with respect to the
195 // Geant4 version 11.2.
196 // The first two methods "*BertiniAs11_2" refer to the overall behavior
197 // of the Bertini model - the one which should matter the most for the
198 // majority of applications.
199 // The methods "*BertiniAngularEmissionsAs11_2" refer to the angular
200 // distributions of the >= 4-body final state emissions.
201 // The last two methods "*BertiniNucleiModelAs11_2" refer to the
202 // modelling of nuclei.
203 // The overall behavior of Bertini with respect to the version Geant4
204 // version 11.2 depends on both the angular distributios of the
205 // >= 4-body final state emissions, and the modelling of nuclei.
206 // "True" in these methods means that the corresponding behavior of
207 // the Geant4 version 11.2 is retrieved;
208 // "False" means that the corresponding behavior of the Geant4 version
209 // 11.3 is retrieved.
210
211 inline G4bool UseRFilesForXS() const;
212 void SetUseRFilesForXS( G4bool val );
213
214 private:
215
216 G4HadronicParameters();
217
218 G4bool IsLocked() const;
219
220 static G4HadronicParameters* sInstance;
221
223
224 G4double fMaxEnergy;
225 G4double fMinEnergyTransitionFTF_Cascade;
226 G4double fMaxEnergyTransitionFTF_Cascade;
227 G4double fMinEnergyTransitionQGS_FTF;
228 G4double fMaxEnergyTransitionQGS_FTF;
229 G4double fMinEnergyINCLXX_Pbar;
230 G4double fMaxEnergyINCLXX_Pbar;
231 G4double fEnergyThresholdForHeavyHadrons;
232 G4double fXSFactorNucleonInelastic = 1.0;
233 G4double fXSFactorPionInelastic = 1.0;
234 G4double fXSFactorHadronInelastic = 1.0;
235 G4double fXSFactorNucleonElastic = 1.0;
236 G4double fXSFactorPionElastic = 1.0;
237 G4double fXSFactorHadronElastic = 1.0;
238 G4double fXSFactorEM = 1.0;
239 G4double fXSFactorLimit = 0.2;
240 G4double fRelativeDiff = DBL_MAX;
241 G4double fAbsoluteDiff = DBL_MAX;
242 G4double fNeutronEkinThresholdForSVT = -1.0;
243 G4double fTimeThresholdForRadioactiveDecays = -1.0;
244
245 G4int fVerboseLevel = 1;
246 G4int fReportLevel = 0;
247
248 G4bool fEnableBC = false;
249 G4bool fEnableHyperNuclei = false;
250 G4bool fApplyFactorXS = false;
251 G4bool fEnableCRCoalescence = false;
252 G4bool fEnableIntegralInelasticXS = true;
253 G4bool fEnableIntegralElasticXS = true;
254 G4bool fEnableDiffDissociationForBGreater10 = false;
255 G4bool fEnableNUDEX = false;
256 G4bool fNeutronGeneral = false;
257 G4bool fChargeExchange = false;
258 G4bool fBinaryDebug = false;
259 G4bool fBertiniAngularEmissionsAs11_2 = false; // Keep the new G4 11.3 behavior
260 G4bool fBertiniNucleiModelAs11_2 = false; // Keep the new G4 11.3 behavior
261 G4bool fUseRFilesForXS = false;
262
263 G4String fTypeTablePT = "";
264 G4String fDirPARTICLEXS = "";
265 G4String fPhysListDocDir = "";
266 G4String fPhysListName = "";
267};
268
270 return fMaxEnergy;
271}
272
274 return fMinEnergyTransitionFTF_Cascade;
275}
277 return fMaxEnergyTransitionFTF_Cascade;
278}
279
281 return fMinEnergyTransitionQGS_FTF;
282}
283
285 return fMaxEnergyTransitionQGS_FTF;
286}
287
289 return fMinEnergyINCLXX_Pbar;
290}
292 return fMaxEnergyINCLXX_Pbar;
293}
294
296 return fEnergyThresholdForHeavyHadrons;
297}
298
300 return fXSFactorNucleonInelastic;
301}
302
304 return fXSFactorNucleonElastic;
305}
306
308 return fXSFactorPionInelastic;
309}
310
312 return fXSFactorPionElastic;
313}
314
316 return fXSFactorHadronInelastic;
317}
318
320 return fXSFactorHadronElastic;
321}
322
324 return fXSFactorEM;
325}
326
328 return fVerboseLevel;
329}
330
332 return fEnableBC;
333}
334
336 return fEnableHyperNuclei;
337}
338
340 return fApplyFactorXS;
341}
342
344 return fEnableCRCoalescence;
345}
346
348 return fEnableIntegralInelasticXS;
349}
350
352 return fEnableIntegralElasticXS;
353}
354
356 return fEnableDiffDissociationForBGreater10;
357}
358
360 return fNeutronGeneral;
361}
362
364 return fEnableNUDEX;
365}
366
368 return fTypeTablePT;
369}
370
372 return fChargeExchange;
373}
374
376 return fBinaryDebug;
377}
378
380 return fUseRFilesForXS;
381}
382
384 return fRelativeDiff;
385}
386
388 return fAbsoluteDiff;
389}
390
392 return fReportLevel;
393}
394
396 return fDirPARTICLEXS;
397}
398
400 return fPhysListDocDir;
401}
402
404 return fPhysListName;
405}
406
408 return fNeutronEkinThresholdForSVT;
409}
410
412 return fTimeThresholdForRadioactiveDecays;
413}
414
416 return ( fBertiniAngularEmissionsAs11_2 && fBertiniNucleiModelAs11_2 );
417}
418
420 return fBertiniAngularEmissionsAs11_2;
421}
422
424 return fBertiniNucleiModelAs11_2;
425}
426
427inline std::ostream& operator<<(std::ostream& os, const G4HadronicParameters& p)
428{
429 p.StreamInfo(os);
430 return os;
431}
432
433#endif
std::ostream & operator<<(std::ostream &os, const G4HadronicParameters &p)
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
void SetEnableIntegralElasticXS(G4bool val)
G4bool EnableIntegralInelasticXS() const
G4double XSFactorPionElastic() const
void SetEnableDiffDissociationForBGreater10(G4bool val)
const G4String & GetTypeTablePT() const
void SetEnableNUDEX(G4bool val)
void StreamInfo(std::ostream &os) const
void SetEnableCoherentChargeExchange(G4bool val)
static G4HadronicParameters * Instance()
G4bool EnableDiffDissociationForBGreater10() const
void SetBertiniAngularEmissionsAs11_2(G4bool val)
G4double GetTimeThresholdForRadioactiveDecay() const
const G4String & GetPhysListName() const
G4double XSFactorNucleonElastic() const
G4double GetMinEnergyTransitionFTF_Cascade() const
G4double GetEPRelativeLevel() const
G4bool IsBertiniNucleiModelAs11_2() const
G4bool EnableCoherentChargeExchange() const
void SetNeutronKineticEnergyThresholdForSVT(const G4double val)
void SetXSFactorNucleonInelastic(G4double val)
void SetEnableIntegralInelasticXS(G4bool val)
G4double GetEPAbsoluteLevel() const
G4double GetMinEnergyTransitionQGS_FTF() const
void SetXSFactorPionInelastic(G4double val)
G4bool EnableNeutronGeneralProcess() const
G4double GetMaxEnergyTransitionFTF_Cascade() const
void SetTypeTablePT(const G4String &typeTablePT)
void SetVerboseLevel(const G4int val)
const G4String & GetDirPARTICLEXS() const
G4double GetNeutronKineticEnergyThresholdForSVT() const
void SetXSFactorPionElastic(G4double val)
void SetTimeThresholdForRadioactiveDecay(const G4double val)
void SetEnableHyperNuclei(G4bool val)
G4double EnergyThresholdForHeavyHadrons() const
void SetMaxEnergyINCLXX_Pbar(const G4double val)
G4bool EnableIntegralElasticXS() const
void SetMaxEnergy(const G4double val)
G4double GetMaxEnergyINCLXX_Pbar() const
void SetApplyFactorXS(G4bool val)
void SetEnergyThresholdForHeavyHadrons(G4double val)
void SetMinEnergyTransitionQGS_FTF(const G4double val)
void SetMinEnergyTransitionFTF_Cascade(const G4double val)
G4double XSFactorHadronInelastic() const
void SetEnableBCParticles(G4bool val)
G4double GetMaxEnergyTransitionQGS_FTF() const
const G4String & GetPhysListDocDir() const
void SetXSFactorHadronElastic(G4double val)
void SetXSFactorEM(G4double val)
void SetEnableCRCoalescence(G4bool val)
void SetMaxEnergyTransitionQGS_FTF(const G4double val)
void SetMinEnergyINCLXX_Pbar(const G4double val)
void SetXSFactorHadronInelastic(G4double val)
void SetBertiniNucleiModelAs11_2(G4bool val)
void SetEnableNeutronGeneralProcess(G4bool val)
void SetXSFactorNucleonElastic(G4double val)
void SetMaxEnergyTransitionFTF_Cascade(const G4double val)
G4bool IsBertiniAngularEmissionsAs11_2() const
void SetUseRFilesForXS(G4bool val)
G4double XSFactorPionInelastic() const
G4double XSFactorHadronElastic() const
G4double GetMinEnergyINCLXX_Pbar() const
void SetBertiniAs11_2(G4bool val)
G4double XSFactorNucleonInelastic() const
#define DBL_MAX
Definition templates.hh:62