Geant4 Cross Reference |
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 44 class G4HadronicParametersMessenger; 45 46 47 class G4HadronicParameters { 48 public: 49 50 static G4HadronicParameters* Instance(); 51 ~G4HadronicParameters(); 52 53 inline G4double GetMaxEnergy() const; 54 void SetMaxEnergy( const G4double val ); 55 // Getter/Setter for the upper limit for Geant4 hadronic physics, for any application. 56 // Any hadronic model, physics list builder and constructor should use this method 57 // instead of putting an arbitrary value in the code. 58 // Any application which tries to use hadronic physics for an energy higher than this limit 59 // will get a run-time crash, because no model is found. 60 61 inline G4double GetMinEnergyTransitionFTF_Cascade() const; 62 inline G4double GetMaxEnergyTransitionFTF_Cascade() const; 63 void SetMinEnergyTransitionFTF_Cascade( const G4double val ); 64 void SetMaxEnergyTransitionFTF_Cascade( const G4double val ); 65 // Getter/Setter of the recommended energy limits, for physics lists, of the 66 // transition region between the Fritiof (FTF) string model and the 67 // intranuclear cascade model, either Bertini (BERT) or Binary (BIC). 68 69 inline G4double GetMinEnergyTransitionQGS_FTF() const; 70 inline G4double GetMaxEnergyTransitionQGS_FTF() const; 71 void SetMinEnergyTransitionQGS_FTF( const G4double val ); 72 void SetMaxEnergyTransitionQGS_FTF( const G4double val ); 73 // Getter/Setter of the recommended energy limits, for physics lists, of the 74 // transition region between the two strings models - the Quark Gluon String (QGS) 75 // model and the Fritiof (FTF) model. 76 77 inline G4double GetMinEnergyINCLXX_Pbar() const; 78 inline G4double GetMaxEnergyINCLXX_Pbar() const; 79 void SetMinEnergyINCLXX_Pbar( const G4double val ); 80 void SetMaxEnergyINCLXX_Pbar( const G4double val ); 81 // Getter/Setter of the recommended energy limits, for physics lists, of the 82 // intranuclear cascade model INCLXX, for pbar interaction. 83 84 inline G4double EnergyThresholdForHeavyHadrons() const; 85 void SetEnergyThresholdForHeavyHadrons( G4double val ); 86 // If max kinetic energy is below this limit, then EM and hadronic physics are not 87 // instantiated for hyperons, anti-hyperons, anti light ions, b-, c- particles. 88 89 inline G4double XSFactorNucleonInelastic() const; 90 void SetXSFactorNucleonInelastic( G4double val ); 91 inline G4double XSFactorNucleonElastic() const; 92 void SetXSFactorNucleonElastic( G4double val ); 93 // Cross section factor for protons and neutrons. 94 95 inline G4double XSFactorPionInelastic() const; 96 void SetXSFactorPionInelastic( G4double val ); 97 inline G4double XSFactorPionElastic() const; 98 void SetXSFactorPionElastic( G4double val ); 99 // Cross section factor for pions. 100 101 inline G4double XSFactorHadronInelastic() const; 102 void SetXSFactorHadronInelastic( G4double val ); 103 inline G4double XSFactorHadronElastic() const; 104 void SetXSFactorHadronElastic( G4double val ); 105 // Cross section factor for other hadrons and ions. 106 107 inline G4double XSFactorEM() const; 108 void SetXSFactorEM( G4double val ); 109 // Cross section factor for gamma and leptons. 110 111 inline G4bool EnableBCParticles() const; 112 void SetEnableBCParticles( G4bool val ); 113 // Baryons and mesons with c- and b- quarks may be enabled/disabled. 114 // This flag is used both by EM and hadronic physics constructors. 115 116 inline G4bool EnableHyperNuclei() const; 117 void SetEnableHyperNuclei( G4bool val ); 118 // Light hyper-nuclei may be enabled/disabled. 119 // This flag is used both by EM and hadronic physics constructors. 120 121 inline G4bool ApplyFactorXS() const; 122 void SetApplyFactorXS( G4bool val ); 123 // Flag enabling cross section factor definition. 124 125 inline G4int GetVerboseLevel() const; 126 void SetVerboseLevel( const G4int val ); 127 // Getter/Setter of the general verbosity level for hadronics. 128 129 inline G4bool EnableCRCoalescence() const; 130 void SetEnableCRCoalescence( G4bool val ); 131 // Boolean switch that allows to apply the Cosmic Ray (CR) coalescence algorithm 132 // to the secondaries produced by a string model. By default it is disabled. 133 134 inline G4bool EnableIntegralInelasticXS() const; 135 inline G4bool EnableIntegralElasticXS() const; 136 void SetEnableIntegralInelasticXS( G4bool val ); 137 void SetEnableIntegralElasticXS( G4bool val ); 138 // Enable/disable integral method for main types of hadrons. 139 140 inline G4bool EnableDiffDissociationForBGreater10() const; 141 // For nucleon-hadron interactions, it's not decided what to do with diffraction 142 // dissociation. For the moment, they are turned off. This option allows it to 143 // be turned back on. Applies to Baryon Number > 10 or # target nucleons > 10. 144 void SetEnableDiffDissociationForBGreater10(G4bool val); 145 146 inline G4bool EnableCoherentChargeExchange() const; 147 void SetEnableCoherentChargeExchange( G4bool val ); 148 // Coherent Charge exchange process may be enabled/disabled. 149 150 inline G4bool EnableNeutronGeneralProcess() const; 151 void SetEnableNeutronGeneralProcess( G4bool val ); 152 // Neutron general process may be enabled/disabled. 153 154 inline G4bool EnableNUDEX() const; 155 void SetEnableNUDEX( G4bool val ); 156 // NUDEX gamma de-excitation is enabled/disabled. 157 158 inline const G4String& GetTypeTablePT() const; 159 void SetTypeTablePT( const G4String& typeTablePT ); 160 // Specify the type of PT table - between "calendf" and "njoy" for 161 // the URR (Unresolved Resonance Region) treatment of low-energy neutrons. 162 // ( Note that there is no default: an empty string "" is returned if 163 // it is not set explicitly. ) 164 165 inline G4double GetEPRelativeLevel() const; 166 inline G4double GetEPAbsoluteLevel() const; 167 inline G4int GetEPReportLevel() const; 168 inline G4bool GetBinaryDebug() const; 169 inline const G4String& GetDirPARTICLEXS() const; 170 inline const G4String& GetPhysListDocDir() const; 171 inline const G4String& GetPhysListName() const; 172 // Access to environment variables. 173 174 inline G4double GetNeutronKineticEnergyThresholdForSVT() const; 175 void SetNeutronKineticEnergyThresholdForSVT( const G4double val ); 176 // Getter/Setter for the neutron kinetic energy threshold for 177 // applying the SVT (Sampling of the Velocity of the Target) algorithm. 178 179 inline G4double GetTimeThresholdForRadioactiveDecay() const; 180 void SetTimeThresholdForRadioactiveDecay( const G4double val ); 181 // Getter/Setter for the time threshold of radioactive decays 182 // (i.e. radioactive decays that happen later than this value are ignored). 183 184 private: 185 186 G4HadronicParameters(); 187 188 G4bool IsLocked() const; 189 190 static G4HadronicParameters* sInstance; 191 192 G4HadronicParametersMessenger* fMessenger; 193 194 G4double fMaxEnergy; 195 G4double fMinEnergyTransitionFTF_Cascade; 196 G4double fMaxEnergyTransitionFTF_Cascade; 197 G4double fMinEnergyTransitionQGS_FTF; 198 G4double fMaxEnergyTransitionQGS_FTF; 199 G4double fMinEnergyINCLXX_Pbar; 200 G4double fMaxEnergyINCLXX_Pbar; 201 G4double fEnergyThresholdForHeavyHadrons; 202 G4double fXSFactorNucleonInelastic = 1.0; 203 G4double fXSFactorPionInelastic = 1.0; 204 G4double fXSFactorHadronInelastic = 1.0; 205 G4double fXSFactorNucleonElastic = 1.0; 206 G4double fXSFactorPionElastic = 1.0; 207 G4double fXSFactorHadronElastic = 1.0; 208 G4double fXSFactorEM = 1.0; 209 G4double fXSFactorLimit = 0.2; 210 G4double fRelativeDiff = DBL_MAX; 211 G4double fAbsoluteDiff = DBL_MAX; 212 G4double fNeutronEkinThresholdForSVT = -1.0; 213 G4double fTimeThresholdForRadioactiveDecays = -1.0; 214 215 G4int fVerboseLevel = 1; 216 G4int fReportLevel = 0; 217 218 G4bool fEnableBC = false; 219 G4bool fEnableHyperNuclei = false; 220 G4bool fApplyFactorXS = false; 221 G4bool fEnableCRCoalescence = false; 222 G4bool fEnableIntegralInelasticXS = true; 223 G4bool fEnableIntegralElasticXS = true; 224 G4bool fEnableDiffDissociationForBGreater10 = false; 225 G4bool fEnableNUDEX = false; 226 G4bool fNeutronGeneral = false; 227 G4bool fChargeExchange = false; 228 G4bool fBinaryDebug = false; 229 230 G4String fTypeTablePT = ""; 231 G4String fDirPARTICLEXS = ""; 232 G4String fPhysListDocDir = ""; 233 G4String fPhysListName = ""; 234 }; 235 236 inline G4double G4HadronicParameters::GetMaxEnergy() const { 237 return fMaxEnergy; 238 } 239 240 inline G4double G4HadronicParameters::GetMinEnergyTransitionFTF_Cascade() const { 241 return fMinEnergyTransitionFTF_Cascade; 242 } 243 inline G4double G4HadronicParameters::GetMaxEnergyTransitionFTF_Cascade() const { 244 return fMaxEnergyTransitionFTF_Cascade; 245 } 246 247 inline G4double G4HadronicParameters::GetMinEnergyTransitionQGS_FTF() const { 248 return fMinEnergyTransitionQGS_FTF; 249 } 250 251 inline G4double G4HadronicParameters::GetMaxEnergyTransitionQGS_FTF() const { 252 return fMaxEnergyTransitionQGS_FTF; 253 } 254 255 inline G4double G4HadronicParameters::GetMinEnergyINCLXX_Pbar() const { 256 return fMinEnergyINCLXX_Pbar; 257 } 258 inline G4double G4HadronicParameters::GetMaxEnergyINCLXX_Pbar() const { 259 return fMaxEnergyINCLXX_Pbar; 260 } 261 262 263 inline G4double G4HadronicParameters::EnergyThresholdForHeavyHadrons() const { 264 return fEnergyThresholdForHeavyHadrons; 265 } 266 267 inline G4double G4HadronicParameters::XSFactorNucleonInelastic() const { 268 return fXSFactorNucleonInelastic; 269 } 270 271 inline G4double G4HadronicParameters::XSFactorNucleonElastic() const { 272 return fXSFactorNucleonElastic; 273 } 274 275 inline G4double G4HadronicParameters::XSFactorPionInelastic() const { 276 return fXSFactorPionInelastic; 277 } 278 279 inline G4double G4HadronicParameters::XSFactorPionElastic() const { 280 return fXSFactorPionElastic; 281 } 282 283 inline G4double G4HadronicParameters::XSFactorHadronInelastic() const { 284 return fXSFactorHadronInelastic; 285 } 286 287 inline G4double G4HadronicParameters::XSFactorHadronElastic() const { 288 return fXSFactorHadronElastic; 289 } 290 291 inline G4double G4HadronicParameters::XSFactorEM() const { 292 return fXSFactorEM; 293 } 294 295 inline G4int G4HadronicParameters::GetVerboseLevel() const { 296 return fVerboseLevel; 297 } 298 299 inline G4bool G4HadronicParameters::EnableBCParticles() const { 300 return fEnableBC; 301 } 302 303 inline G4bool G4HadronicParameters::EnableHyperNuclei() const { 304 return fEnableHyperNuclei; 305 } 306 307 inline G4bool G4HadronicParameters::ApplyFactorXS() const { 308 return fApplyFactorXS; 309 } 310 311 inline G4bool G4HadronicParameters::EnableCRCoalescence() const { 312 return fEnableCRCoalescence; 313 } 314 315 inline G4bool G4HadronicParameters::EnableIntegralInelasticXS() const { 316 return fEnableIntegralInelasticXS; 317 } 318 319 inline G4bool G4HadronicParameters::EnableIntegralElasticXS() const { 320 return fEnableIntegralElasticXS; 321 } 322 323 inline G4bool G4HadronicParameters::EnableDiffDissociationForBGreater10() const { 324 return fEnableDiffDissociationForBGreater10; 325 } 326 327 inline G4bool G4HadronicParameters::EnableNeutronGeneralProcess() const { 328 return fNeutronGeneral; 329 } 330 331 inline G4bool G4HadronicParameters::EnableNUDEX() const { 332 return fEnableNUDEX; 333 } 334 335 inline const G4String& G4HadronicParameters::GetTypeTablePT() const { 336 return fTypeTablePT; 337 } 338 339 inline G4bool G4HadronicParameters::EnableCoherentChargeExchange() const { 340 return fChargeExchange; 341 } 342 343 inline G4bool G4HadronicParameters::GetBinaryDebug() const { 344 return fBinaryDebug; 345 } 346 347 inline G4double G4HadronicParameters::GetEPRelativeLevel() const { 348 return fRelativeDiff; 349 } 350 351 inline G4double G4HadronicParameters::GetEPAbsoluteLevel() const { 352 return fAbsoluteDiff; 353 } 354 355 inline G4int G4HadronicParameters::GetEPReportLevel() const { 356 return fReportLevel; 357 } 358 359 inline const G4String& G4HadronicParameters::GetDirPARTICLEXS() const { 360 return fDirPARTICLEXS; 361 } 362 363 inline const G4String& G4HadronicParameters::GetPhysListDocDir() const 364 { 365 return fPhysListDocDir; 366 } 367 368 inline const G4String& G4HadronicParameters::GetPhysListName() const 369 { 370 return fPhysListName; 371 } 372 373 inline G4double G4HadronicParameters::GetNeutronKineticEnergyThresholdForSVT() const { 374 return fNeutronEkinThresholdForSVT; 375 } 376 377 inline G4double G4HadronicParameters::GetTimeThresholdForRadioactiveDecay() const { 378 return fTimeThresholdForRadioactiveDecays; 379 } 380 381 #endif 382