56 if ( sInstance ==
nullptr ) {
58 if ( sInstance ==
nullptr ) {
59 static G4HadronicParameters theHadronicParametersObject;
60 sInstance = &theHadronicParametersObject;
73G4HadronicParameters::G4HadronicParameters() {
74 fMaxEnergy = 100.0*CLHEP::TeV;
75 fMinEnergyTransitionFTF_Cascade = 3.0*CLHEP::GeV;
76 fMaxEnergyTransitionFTF_Cascade = 6.0*CLHEP::GeV;
77 fMinEnergyTransitionQGS_FTF = 12.0*CLHEP::GeV;
78 fMaxEnergyTransitionQGS_FTF = 25.0*CLHEP::GeV;
79 fMinEnergyINCLXX_Pbar = 0.0*CLHEP::GeV;
80 fMaxEnergyINCLXX_Pbar = 10.0*CLHEP::GeV;
81 fEnergyThresholdForHeavyHadrons = 1.1*CLHEP::GeV;
86 const char* ep1 = std::getenv(
"G4Hadronic_epCheckRelativeLevel");
87 if(
nullptr != ep1) { fRelativeDiff = std::strtod(ep1, 0); }
88 const char* ep2 = std::getenv(
"G4Hadronic_epCheckAbsoluteLevel");
89 if(
nullptr != ep2) { fAbsoluteDiff = std::strtod(ep2, 0); }
92 fDirPARTICLEXS = G4String(v);
94 if(1 < fVerboseLevel) {
96 ed <<
"Environment variable G4PARTICLEXSDATA is not defined or "
97 <<
" it is pointing out to not existing directory";
98 G4Exception(
"G4LevelReader::LevelManager(..)",
"had014",
102 const char* x = std::getenv(
"G4PhysListDocDir");
103 if(
nullptr != x) { fPhysListDocDir = G4String(x); }
104 const char* y = std::getenv(
"G4PhysListName");
105 if(
nullptr != y) { fPhysListName = G4String(y); }
106 const char* z = std::getenv(
"BINARY_CASCADE_DEBUG");
107 if(
nullptr != z) { fBinaryDebug =
true; }
111G4bool G4HadronicParameters::IsLocked()
const {
118 G4long prec = os.precision(5);
121 auto boolToString = [](
G4bool value) ->
const char* {
122 return value ?
"true" :
"false";
125 os <<
"=======================================================================" <<
"\n";
126 os <<
"====== Hadronic Physics Parameters ========" <<
"\n";
127 os <<
"=======================================================================" <<
"\n";
128 os <<
"Maximum energy for hadronic physics "
130 os <<
"Energy threshold for heavy hadrons "
131 <<
G4BestUnit(fEnergyThresholdForHeavyHadrons,
"Energy") <<
"\n";
132 os <<
"Neutron kinetic energy threshold for SVT algorithm ";
133 if (fNeutronEkinThresholdForSVT < 0.0) {
134 os <<
"not set" <<
"\n";
136 os <<
G4BestUnit(fNeutronEkinThresholdForSVT,
"Energy") <<
"\n";
138 os <<
"Time threshold for radioactive decays ";
139 if (fTimeThresholdForRadioactiveDecays < 0.0) {
140 os <<
"not set" <<
"\n";
142 os <<
G4BestUnit(fTimeThresholdForRadioactiveDecays,
"Time") <<
"\n";
145 os <<
"=======================================================================" <<
"\n";
146 os <<
"====== Model Transition Regions ========" <<
"\n";
147 os <<
"=======================================================================" <<
"\n";
148 os <<
"FTF to Cascade transition region "
149 <<
G4BestUnit(fMinEnergyTransitionFTF_Cascade,
"Energy") <<
" - "
150 <<
G4BestUnit(fMaxEnergyTransitionFTF_Cascade,
"Energy") <<
"\n";
151 os <<
"QGS to FTF transition region "
152 <<
G4BestUnit(fMinEnergyTransitionQGS_FTF,
"Energy") <<
" - "
153 <<
G4BestUnit(fMaxEnergyTransitionQGS_FTF,
"Energy") <<
"\n";
154 os <<
"INCLXX antiproton model energy range "
155 <<
G4BestUnit(fMinEnergyINCLXX_Pbar,
"Energy") <<
" - "
156 <<
G4BestUnit(fMaxEnergyINCLXX_Pbar,
"Energy") <<
"\n";
158 os <<
"=======================================================================" <<
"\n";
159 os <<
"====== Cross Section Factors ========" <<
"\n";
160 os <<
"=======================================================================" <<
"\n";
161 os <<
"Apply cross section factors " << boolToString(fApplyFactorXS) <<
"\n";
162 os <<
"Nucleon inelastic cross section factor " << fXSFactorNucleonInelastic <<
"\n";
163 os <<
"Nucleon elastic cross section factor " << fXSFactorNucleonElastic <<
"\n";
164 os <<
"Pion inelastic cross section factor " << fXSFactorPionInelastic <<
"\n";
165 os <<
"Pion elastic cross section factor " << fXSFactorPionElastic <<
"\n";
166 os <<
"Hadron inelastic cross section factor " << fXSFactorHadronInelastic <<
"\n";
167 os <<
"Hadron elastic cross section factor " << fXSFactorHadronElastic <<
"\n";
168 os <<
"EM cross section factor " << fXSFactorEM <<
"\n";
169 os <<
"For XS neutron cross sections use detailed R-data " << fUseRFilesForXS <<
"\n";
171 os <<
"=======================================================================" <<
"\n";
172 os <<
"====== Process Control Parameters ========" <<
"\n";
173 os <<
"=======================================================================" <<
"\n";
174 os <<
"Enable integral method for inelastic cross sections " << boolToString(fEnableIntegralInelasticXS) <<
"\n";
175 os <<
"Enable integral method for elastic cross sections " << boolToString(fEnableIntegralElasticXS) <<
"\n";
176 os <<
"Enable diffraction dissociation for B > 10 " << boolToString(fEnableDiffDissociationForBGreater10) <<
"\n";
177 os <<
"Enable neutron general process " << boolToString(fNeutronGeneral) <<
"\n";
178 os <<
"Enable NUDEX gamma de-excitation " << boolToString(fEnableNUDEX) <<
"\n";
179 os <<
"Enable coherent charge exchange " << boolToString(fChargeExchange) <<
"\n";
181 os <<
"=======================================================================" <<
"\n";
182 os <<
"====== Particle Production Control ========" <<
"\n";
183 os <<
"=======================================================================" <<
"\n";
184 os <<
"Enable B/C particles " << boolToString(fEnableBC) <<
"\n";
185 os <<
"Enable hyper-nuclei " << boolToString(fEnableHyperNuclei) <<
"\n";
186 os <<
"Enable cosmic ray coalescence " << boolToString(fEnableCRCoalescence) <<
"\n";
188 os <<
"=======================================================================" <<
"\n";
189 os <<
"====== Model Control Parameters ========" <<
"\n";
190 os <<
"=======================================================================" <<
"\n";
191 os <<
"PT table type for URR neutrons ";
193 if (fTypeTablePT.empty()) {
194 os <<
"not set" <<
"\n";
196 os << fTypeTablePT <<
"\n";
198 os <<
"Bertini angular emissions as in G4 11.2 " << boolToString(fBertiniAngularEmissionsAs11_2) <<
"\n";
199 os <<
"Bertini nuclei model as in G4 11.2 " << boolToString(fBertiniNucleiModelAs11_2) <<
"\n";
200 os <<
"Bertini overall behavior as in G4 11.2 " << boolToString(
IsBertiniAs11_2()) <<
"\n";
202 os <<
"=======================================================================" <<
"\n";
203 os <<
"====== Debugging Options ========" <<
"\n";
204 os <<
"=======================================================================" <<
"\n";
205 os <<
"Verbose level " << fVerboseLevel <<
"\n";
206 os <<
"Binary cascade debug " << boolToString(fBinaryDebug) <<
"\n";
207 os <<
"Environment reporting level " << fReportLevel <<
"\n";
209 os <<
"Environment relative difference level " << fRelativeDiff <<
"\n";
212 os <<
"Environment absolute difference level " << fAbsoluteDiff <<
"\n";
215 os <<
"=======================================================================" <<
G4endl;
226 if ( ! IsLocked() && val > 0.0 ) {
233 if ( ! IsLocked() && val > 0.0 ) {
234 fMinEnergyTransitionFTF_Cascade = val;
240 if ( ! IsLocked() && val > fMinEnergyTransitionFTF_Cascade ) {
241 fMaxEnergyTransitionFTF_Cascade = val;
247 if ( ! IsLocked() && val > 0.0 ) {
248 fMinEnergyTransitionQGS_FTF = val;
254 if ( ! IsLocked() && val > fMinEnergyTransitionQGS_FTF ) {
255 fMaxEnergyTransitionQGS_FTF = val;
261 if ( ! IsLocked() && val >= 0.0 ) {
262 fMinEnergyINCLXX_Pbar = val;
268 if ( ! IsLocked() && val > fMinEnergyINCLXX_Pbar ) {
269 fMaxEnergyINCLXX_Pbar = val;
275 if ( ! IsLocked() ) fEnableBC = val;
280 if ( ! IsLocked() ) fEnableHyperNuclei = val;
285 if ( ! IsLocked() && val >= 0 ) fVerboseLevel = val;
290 if ( ! IsLocked() && val >= 0 && val < 5*CLHEP::GeV ) {
291 fEnergyThresholdForHeavyHadrons = val;
297 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
298 fXSFactorNucleonInelastic = val;
304 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
305 fXSFactorNucleonElastic = val;
311 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
312 fXSFactorPionInelastic = val;
318 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
319 fXSFactorPionElastic = val;
325 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
326 fXSFactorHadronInelastic = val;
332 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
333 fXSFactorHadronElastic = val;
339 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
349 fNeutronEkinThresholdForSVT = val;
358 fTimeThresholdForRadioactiveDecays = val;
364 if ( ! IsLocked() ) fApplyFactorXS = val;
369 if ( ! IsLocked() ) fEnableCRCoalescence = val;
374 if ( ! IsLocked() ) fEnableIntegralInelasticXS = val;
379 if ( ! IsLocked() ) fEnableIntegralElasticXS = val;
384 if ( ! IsLocked() ) fEnableDiffDissociationForBGreater10 = val;
389 if ( ! IsLocked() ) fNeutronGeneral = val;
394 if ( ! IsLocked() ) fEnableNUDEX = val;
399 if ( ! IsLocked() ) fTypeTablePT = typeTablePT;
404 if ( ! IsLocked() ) fChargeExchange = val;
409 if ( ! IsLocked() ) {
410 fBertiniAngularEmissionsAs11_2 = val;
411 fBertiniNucleiModelAs11_2 = val;
417 if ( ! IsLocked() ) fBertiniAngularEmissionsAs11_2 = val;
422 if ( ! IsLocked() ) fBertiniNucleiModelAs11_2 = val;
427 if ( ! IsLocked() ) fUseRFilesForXS = val;
G4TemplateAutoLock< G4Mutex > G4AutoLock
_Tp G4GetEnv(const std::string &env_id, _Tp _default=_Tp())
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
void SetEnableIntegralElasticXS(G4bool val)
void SetEnableDiffDissociationForBGreater10(G4bool val)
void SetEnableNUDEX(G4bool val)
void StreamInfo(std::ostream &os) const
void SetEnableCoherentChargeExchange(G4bool val)
static G4HadronicParameters * Instance()
void SetBertiniAngularEmissionsAs11_2(G4bool val)
G4bool IsBertiniAs11_2() const
void SetNeutronKineticEnergyThresholdForSVT(const G4double val)
void SetXSFactorNucleonInelastic(G4double val)
void SetEnableIntegralInelasticXS(G4bool val)
void SetXSFactorPionInelastic(G4double val)
void SetTypeTablePT(const G4String &typeTablePT)
void SetVerboseLevel(const G4int val)
void SetXSFactorPionElastic(G4double val)
void SetTimeThresholdForRadioactiveDecay(const G4double val)
void SetEnableHyperNuclei(G4bool val)
void SetMaxEnergyINCLXX_Pbar(const G4double val)
void SetMaxEnergy(const G4double val)
void SetApplyFactorXS(G4bool val)
void SetEnergyThresholdForHeavyHadrons(G4double val)
void SetMinEnergyTransitionQGS_FTF(const G4double val)
void SetMinEnergyTransitionFTF_Cascade(const G4double val)
void SetEnableBCParticles(G4bool val)
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)
void SetUseRFilesForXS(G4bool val)
void SetBertiniAs11_2(G4bool val)
static G4StateManager * GetStateManager()