Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:56:10

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //---------------------------------------------------------------------------
0028 //
0029 // ClassName:      G4HadronicParameters
0030 //
0031 // Author:         2018 Alberto Ribon
0032 //
0033 // Description:    Singleton to keep global hadronic parameters.
0034 //
0035 // Modified:
0036 //
0037 //----------------------------------------------------------------------------
0038 //
0039 #ifndef G4HadronicParameters_h
0040 #define G4HadronicParameters_h 1
0041 
0042 #include "globals.hh"
0043 
0044 class G4HadronicParametersMessenger;
0045 
0046 
0047 class G4HadronicParameters {
0048   public:
0049 
0050     static G4HadronicParameters* Instance();
0051     ~G4HadronicParameters();
0052 
0053     inline G4double GetMaxEnergy() const;
0054     void SetMaxEnergy( const G4double val );
0055     // Getter/Setter for the upper limit for Geant4 hadronic physics, for any application.
0056     // Any hadronic model, physics list builder and constructor should use this method
0057     // instead of putting an arbitrary value in the code.
0058     // Any application which tries to use hadronic physics for an energy higher than this limit
0059     // will get a run-time crash, because no model is found.
0060 
0061     inline G4double GetMinEnergyTransitionFTF_Cascade() const;
0062     inline G4double GetMaxEnergyTransitionFTF_Cascade() const;
0063     void SetMinEnergyTransitionFTF_Cascade( const G4double val );
0064     void SetMaxEnergyTransitionFTF_Cascade( const G4double val );
0065     // Getter/Setter of the recommended energy limits, for physics lists, of the
0066     // transition region between the Fritiof (FTF) string model and the
0067     // intranuclear cascade model, either Bertini (BERT) or Binary (BIC). 
0068 
0069     inline G4double GetMinEnergyTransitionQGS_FTF() const;
0070     inline G4double GetMaxEnergyTransitionQGS_FTF() const;
0071     void SetMinEnergyTransitionQGS_FTF( const G4double val );
0072     void SetMaxEnergyTransitionQGS_FTF( const G4double val );
0073     // Getter/Setter of the recommended energy limits, for physics lists, of the
0074     // transition region between the two strings models - the Quark Gluon String (QGS)
0075     // model and the Fritiof (FTF) model.
0076 
0077     inline G4double GetMinEnergyINCLXX_Pbar() const;
0078     inline G4double GetMaxEnergyINCLXX_Pbar() const;
0079     void SetMinEnergyINCLXX_Pbar( const G4double val );
0080     void SetMaxEnergyINCLXX_Pbar( const G4double val );
0081     // Getter/Setter of the recommended energy limits, for physics lists, of the
0082     // intranuclear cascade model INCLXX, for pbar interaction. 
0083 
0084     inline G4double EnergyThresholdForHeavyHadrons() const;
0085     void SetEnergyThresholdForHeavyHadrons( G4double val );
0086     // If max kinetic energy is below this limit, then EM and hadronic physics are not 
0087     // instantiated for hyperons, anti-hyperons, anti light ions, b-, c- particles.
0088 
0089     inline G4double XSFactorNucleonInelastic() const;
0090     void SetXSFactorNucleonInelastic( G4double val );
0091     inline G4double XSFactorNucleonElastic() const;
0092     void SetXSFactorNucleonElastic( G4double val );
0093     // Cross section factor for protons and neutrons.
0094 
0095     inline G4double XSFactorPionInelastic() const;
0096     void SetXSFactorPionInelastic( G4double val );
0097     inline G4double XSFactorPionElastic() const;
0098     void SetXSFactorPionElastic( G4double val );
0099     // Cross section factor for pions.
0100 
0101     inline G4double XSFactorHadronInelastic() const;
0102     void SetXSFactorHadronInelastic( G4double val );
0103     inline G4double XSFactorHadronElastic() const;
0104     void SetXSFactorHadronElastic( G4double val );
0105     // Cross section factor for other hadrons and ions.
0106 
0107     inline G4double XSFactorEM() const;
0108     void SetXSFactorEM( G4double val );
0109     // Cross section factor for gamma and leptons.
0110 
0111     inline G4bool EnableBCParticles() const;
0112     void SetEnableBCParticles( G4bool val );
0113     // Baryons and mesons with c- and b- quarks may be enabled/disabled.
0114     // This flag is used both by EM and hadronic physics constructors.
0115 
0116     inline G4bool EnableHyperNuclei() const;
0117     void SetEnableHyperNuclei( G4bool val );
0118     // Light hyper-nuclei may be enabled/disabled.
0119     // This flag is used both by EM and hadronic physics constructors.
0120 
0121     inline G4bool ApplyFactorXS() const;
0122     void SetApplyFactorXS( G4bool val );
0123     // Flag enabling cross section factor definition.
0124 
0125     inline G4int GetVerboseLevel() const;
0126     void SetVerboseLevel( const G4int val );
0127     // Getter/Setter of the general verbosity level for hadronics.
0128   
0129     inline G4bool EnableCRCoalescence() const;
0130     void SetEnableCRCoalescence( G4bool val );
0131     // Boolean switch that allows to apply the Cosmic Ray (CR) coalescence algorithm
0132     // to the secondaries produced by a string model. By default it is disabled.
0133 
0134     inline G4bool EnableIntegralInelasticXS() const;
0135     inline G4bool EnableIntegralElasticXS() const;
0136     void SetEnableIntegralInelasticXS( G4bool val );
0137     void SetEnableIntegralElasticXS( G4bool val );
0138     // Enable/disable integral method for main types of hadrons.
0139   
0140     inline G4bool EnableDiffDissociationForBGreater10() const;
0141     // For nucleon-hadron interactions, it's not decided what to do with diffraction
0142     // dissociation. For the moment, they are turned off. This option allows it to
0143     // be turned back on. Applies to Baryon Number > 10 or # target nucleons > 10.
0144     void SetEnableDiffDissociationForBGreater10(G4bool val);
0145 
0146     inline G4bool EnableCoherentChargeExchange() const;
0147     void SetEnableCoherentChargeExchange( G4bool val );
0148     // Coherent Charge exchange process may be enabled/disabled.
0149 
0150     inline G4bool EnableNeutronGeneralProcess() const;
0151     void SetEnableNeutronGeneralProcess( G4bool val );
0152     // Neutron general process may be enabled/disabled.
0153 
0154     inline G4bool EnableNUDEX() const;
0155     void SetEnableNUDEX( G4bool val );
0156     // NUDEX gamma de-excitation is enabled/disabled.
0157 
0158     inline const G4String& GetTypeTablePT() const;
0159     void SetTypeTablePT( const G4String& typeTablePT );
0160     // Specify the type of PT table - between  "calendf"  and  "njoy"  for
0161     // the URR (Unresolved Resonance Region) treatment of low-energy neutrons.
0162     // ( Note that there is no default: an empty string "" is returned if
0163     //   it is not set explicitly. )
0164 
0165     inline G4double GetEPRelativeLevel() const;
0166     inline G4double GetEPAbsoluteLevel() const;
0167     inline G4int GetEPReportLevel() const;
0168     inline G4bool GetBinaryDebug() const;
0169     inline const G4String& GetDirPARTICLEXS() const;
0170     inline const G4String& GetPhysListDocDir() const;
0171     inline const G4String& GetPhysListName() const;
0172     // Access to environment variables.
0173 
0174     inline G4double GetNeutronKineticEnergyThresholdForSVT() const;
0175     void SetNeutronKineticEnergyThresholdForSVT( const G4double val );
0176     // Getter/Setter for the neutron kinetic energy threshold for 
0177     // applying the SVT (Sampling of the Velocity of the Target) algorithm.
0178 
0179     inline G4double GetTimeThresholdForRadioactiveDecay() const;
0180     void SetTimeThresholdForRadioactiveDecay( const G4double val );
0181     // Getter/Setter for the time threshold of radioactive decays
0182     // (i.e. radioactive decays that happen later than this value are ignored).
0183 
0184     inline G4bool IsBertiniAs11_2() const;
0185     void SetBertiniAs11_2( G4bool val );
0186     inline G4bool IsBertiniAngularEmissionsAs11_2() const;
0187     void SetBertiniAngularEmissionsAs11_2( G4bool val );
0188     inline G4bool IsBertiniNucleiModelAs11_2() const;
0189     void SetBertiniNucleiModelAs11_2( G4bool val );
0190     // Getter/Setter for the Bertini model behavior with respect to the
0191     // Geant4 version 11.2.
0192     // The first two methods "*BertiniAs11_2" refer to the overall behavior
0193     // of the Bertini model - the one which should matter the most for the
0194     // majority of applications.
0195     // The methods "*BertiniAngularEmissionsAs11_2" refer to the angular
0196     // distributions of the >= 4-body final state emissions.
0197     // The last two methods "*BertiniNucleiModelAs11_2" refer to the
0198     // modelling of nuclei.
0199     // The overall behavior of Bertini with respect to the version Geant4
0200     // version 11.2 depends on both the angular distributios of the
0201     // >= 4-body final state emissions, and the modelling of nuclei.
0202     // "True" in these methods means that the corresponding behavior of
0203     // the Geant4 version 11.2 is retrieved;
0204     // "False" means that the corresponding behavior of the Geant4 version
0205     // 11.3 is retrieved.
0206   
0207   private:
0208 
0209     G4HadronicParameters();
0210 
0211     G4bool IsLocked() const;
0212 
0213     static G4HadronicParameters* sInstance;
0214 
0215     G4HadronicParametersMessenger* fMessenger;
0216 
0217     G4double fMaxEnergy;
0218     G4double fMinEnergyTransitionFTF_Cascade;
0219     G4double fMaxEnergyTransitionFTF_Cascade;
0220     G4double fMinEnergyTransitionQGS_FTF;
0221     G4double fMaxEnergyTransitionQGS_FTF;
0222     G4double fMinEnergyINCLXX_Pbar;
0223     G4double fMaxEnergyINCLXX_Pbar;
0224     G4double fEnergyThresholdForHeavyHadrons;
0225     G4double fXSFactorNucleonInelastic = 1.0;
0226     G4double fXSFactorPionInelastic = 1.0;
0227     G4double fXSFactorHadronInelastic = 1.0;
0228     G4double fXSFactorNucleonElastic = 1.0;
0229     G4double fXSFactorPionElastic = 1.0;
0230     G4double fXSFactorHadronElastic = 1.0;
0231     G4double fXSFactorEM = 1.0;
0232     G4double fXSFactorLimit = 0.2;
0233     G4double fRelativeDiff = DBL_MAX;
0234     G4double fAbsoluteDiff = DBL_MAX;
0235     G4double fNeutronEkinThresholdForSVT = -1.0;
0236     G4double fTimeThresholdForRadioactiveDecays = -1.0;
0237     
0238     G4int fVerboseLevel = 1;
0239     G4int fReportLevel = 0;
0240 
0241     G4bool fEnableBC = false;
0242     G4bool fEnableHyperNuclei = false;
0243     G4bool fApplyFactorXS = false;
0244     G4bool fEnableCRCoalescence = false;
0245     G4bool fEnableIntegralInelasticXS = true;
0246     G4bool fEnableIntegralElasticXS = true;
0247     G4bool fEnableDiffDissociationForBGreater10 = false;
0248     G4bool fEnableNUDEX = false;
0249     G4bool fNeutronGeneral = false;
0250     G4bool fChargeExchange = false;
0251     G4bool fBinaryDebug = false;
0252     G4bool fBertiniAngularEmissionsAs11_2 = false;  // Keep the new G4 11.3 behavior
0253     G4bool fBertiniNucleiModelAs11_2 = false;       // Keep the new G4 11.3 behavior
0254 
0255     G4String fTypeTablePT = "";
0256     G4String fDirPARTICLEXS = "";
0257     G4String fPhysListDocDir = "";
0258     G4String fPhysListName = "";
0259 };
0260 
0261 inline G4double G4HadronicParameters::GetMaxEnergy() const { 
0262   return fMaxEnergy;
0263 }
0264 
0265 inline G4double G4HadronicParameters::GetMinEnergyTransitionFTF_Cascade() const { 
0266   return fMinEnergyTransitionFTF_Cascade;
0267 }
0268 inline G4double G4HadronicParameters::GetMaxEnergyTransitionFTF_Cascade() const { 
0269   return fMaxEnergyTransitionFTF_Cascade;
0270 }
0271 
0272 inline G4double G4HadronicParameters::GetMinEnergyTransitionQGS_FTF() const { 
0273   return fMinEnergyTransitionQGS_FTF;
0274 }
0275 
0276 inline G4double G4HadronicParameters::GetMaxEnergyTransitionQGS_FTF() const { 
0277   return fMaxEnergyTransitionQGS_FTF;
0278 }
0279 
0280 inline G4double G4HadronicParameters::GetMinEnergyINCLXX_Pbar() const { 
0281   return fMinEnergyINCLXX_Pbar;
0282 }
0283 inline G4double G4HadronicParameters::GetMaxEnergyINCLXX_Pbar() const { 
0284   return fMaxEnergyINCLXX_Pbar;
0285 } 
0286 
0287 inline G4double G4HadronicParameters::EnergyThresholdForHeavyHadrons() const {
0288   return fEnergyThresholdForHeavyHadrons;
0289 }
0290 
0291 inline G4double G4HadronicParameters::XSFactorNucleonInelastic() const {
0292   return fXSFactorNucleonInelastic;
0293 }
0294 
0295 inline G4double G4HadronicParameters::XSFactorNucleonElastic() const {
0296   return fXSFactorNucleonElastic;
0297 }
0298 
0299 inline G4double G4HadronicParameters::XSFactorPionInelastic() const {
0300   return fXSFactorPionInelastic;
0301 }
0302 
0303 inline G4double G4HadronicParameters::XSFactorPionElastic() const {
0304   return fXSFactorPionElastic;
0305 }
0306 
0307 inline G4double G4HadronicParameters::XSFactorHadronInelastic() const {
0308   return fXSFactorHadronInelastic;
0309 }
0310 
0311 inline G4double G4HadronicParameters::XSFactorHadronElastic() const {
0312   return fXSFactorHadronElastic;
0313 }
0314 
0315 inline G4double G4HadronicParameters::XSFactorEM() const {
0316   return fXSFactorEM;
0317 }
0318 
0319 inline G4int G4HadronicParameters::GetVerboseLevel() const { 
0320   return fVerboseLevel;
0321 }
0322 
0323 inline G4bool G4HadronicParameters::EnableBCParticles() const {
0324   return fEnableBC;
0325 }
0326 
0327 inline G4bool G4HadronicParameters::EnableHyperNuclei() const {
0328   return fEnableHyperNuclei;
0329 }
0330 
0331 inline G4bool G4HadronicParameters::ApplyFactorXS() const {
0332   return fApplyFactorXS;
0333 }
0334 
0335 inline G4bool G4HadronicParameters::EnableCRCoalescence() const {
0336   return fEnableCRCoalescence;
0337 }
0338 
0339 inline G4bool G4HadronicParameters::EnableIntegralInelasticXS() const {
0340   return fEnableIntegralInelasticXS;
0341 }
0342 
0343 inline G4bool G4HadronicParameters::EnableIntegralElasticXS() const {
0344   return fEnableIntegralElasticXS;
0345 }
0346 
0347 inline G4bool G4HadronicParameters::EnableDiffDissociationForBGreater10() const {
0348   return fEnableDiffDissociationForBGreater10;
0349 }
0350 
0351 inline G4bool G4HadronicParameters::EnableNeutronGeneralProcess() const {
0352   return fNeutronGeneral;
0353 }
0354 
0355 inline G4bool G4HadronicParameters::EnableNUDEX() const {
0356   return fEnableNUDEX;
0357 }
0358 
0359 inline const G4String& G4HadronicParameters::GetTypeTablePT() const {
0360   return fTypeTablePT;
0361 }
0362 
0363 inline G4bool G4HadronicParameters::EnableCoherentChargeExchange() const {
0364   return fChargeExchange;
0365 }
0366 
0367 inline G4bool G4HadronicParameters::GetBinaryDebug() const {
0368   return fBinaryDebug;
0369 }
0370 
0371 inline G4double G4HadronicParameters::GetEPRelativeLevel() const {
0372   return fRelativeDiff;
0373 }
0374 
0375 inline G4double G4HadronicParameters::GetEPAbsoluteLevel() const {
0376   return fAbsoluteDiff;
0377 }
0378 
0379 inline G4int G4HadronicParameters::GetEPReportLevel() const {
0380   return fReportLevel;
0381 }
0382 
0383 inline const G4String& G4HadronicParameters::GetDirPARTICLEXS() const {
0384   return fDirPARTICLEXS;
0385 }
0386 
0387 inline const G4String& G4HadronicParameters::GetPhysListDocDir() const {
0388   return fPhysListDocDir;
0389 }
0390 
0391 inline const G4String& G4HadronicParameters::GetPhysListName() const {
0392   return fPhysListName;
0393 }
0394 
0395 inline G4double G4HadronicParameters::GetNeutronKineticEnergyThresholdForSVT() const { 
0396   return fNeutronEkinThresholdForSVT;
0397 }
0398 
0399 inline G4double G4HadronicParameters::GetTimeThresholdForRadioactiveDecay() const { 
0400   return fTimeThresholdForRadioactiveDecays;
0401 }
0402 
0403 inline G4bool G4HadronicParameters::IsBertiniAs11_2() const {
0404   return ( fBertiniAngularEmissionsAs11_2 && fBertiniNucleiModelAs11_2 );
0405 }  
0406 
0407 inline G4bool G4HadronicParameters::IsBertiniAngularEmissionsAs11_2() const {
0408   return fBertiniAngularEmissionsAs11_2;
0409 }
0410   
0411 inline G4bool G4HadronicParameters::IsBertiniNucleiModelAs11_2() const {
0412   return fBertiniNucleiModelAs11_2;
0413 }
0414 
0415 #endif