Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-27 09:27:50

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 G4double GetEPRelativeLevel() const;
0159     inline G4double GetEPAbsoluteLevel() const;
0160     inline G4int GetEPReportLevel() const;
0161     inline G4bool GetBinaryDebug() const;
0162     inline const G4String& GetDirPARTICLEXS() const;
0163     inline const G4String& GetPhysListDocDir() const;
0164     inline const G4String& GetPhysListName() const;
0165     // Access to environment variables.
0166 
0167     inline G4double GetNeutronKineticEnergyThresholdForSVT() const;
0168     void SetNeutronKineticEnergyThresholdForSVT( const G4double val );
0169     // Getter/Setter for the neutron kinetic energy threshold for 
0170     // applying the SVT (Sampling of the Velocity of the Target) algorithm.
0171 
0172     inline G4double GetTimeThresholdForRadioactiveDecay() const;
0173     void SetTimeThresholdForRadioactiveDecay( const G4double val );
0174     // Getter/Setter for the time threshold of radioactive decays
0175     // (i.e. radioactive decays that happen later than this value are ignored).
0176 
0177   private:
0178 
0179     G4HadronicParameters();
0180 
0181     G4bool IsLocked() const;
0182 
0183     static G4HadronicParameters* sInstance;
0184 
0185     G4HadronicParametersMessenger* fMessenger;
0186 
0187     G4double fMaxEnergy;
0188     G4double fMinEnergyTransitionFTF_Cascade;
0189     G4double fMaxEnergyTransitionFTF_Cascade;
0190     G4double fMinEnergyTransitionQGS_FTF;
0191     G4double fMaxEnergyTransitionQGS_FTF;
0192     G4double fMinEnergyINCLXX_Pbar;
0193     G4double fMaxEnergyINCLXX_Pbar;
0194     G4double fEnergyThresholdForHeavyHadrons;
0195     G4double fXSFactorNucleonInelastic = 1.0;
0196     G4double fXSFactorPionInelastic = 1.0;
0197     G4double fXSFactorHadronInelastic = 1.0;
0198     G4double fXSFactorNucleonElastic = 1.0;
0199     G4double fXSFactorPionElastic = 1.0;
0200     G4double fXSFactorHadronElastic = 1.0;
0201     G4double fXSFactorEM = 1.0;
0202     G4double fXSFactorLimit = 0.2;
0203     G4double fRelativeDiff = DBL_MAX;
0204     G4double fAbsoluteDiff = DBL_MAX;
0205     G4double fNeutronEkinThresholdForSVT = -1.0;
0206     G4double fTimeThresholdForRadioactiveDecays = -1.0;
0207     
0208     G4int fVerboseLevel = 1;
0209     G4int fReportLevel = 0;
0210 
0211     G4bool fEnableBC = false;
0212     G4bool fEnableHyperNuclei = false;
0213     G4bool fApplyFactorXS = false;
0214     G4bool fEnableCRCoalescence = false;
0215     G4bool fEnableIntegralInelasticXS = true;
0216     G4bool fEnableIntegralElasticXS = true;
0217     G4bool fEnableDiffDissociationForBGreater10 = false;
0218     G4bool fEnableNUDEX = false;
0219     G4bool fNeutronGeneral = false;
0220     G4bool fChargeExchange = false;
0221     G4bool fBinaryDebug = false;
0222 
0223     G4String fDirPARTICLEXS = "";
0224     G4String fPhysListDocDir = "";
0225     G4String fPhysListName = "";
0226 };
0227 
0228 inline G4double G4HadronicParameters::GetMaxEnergy() const { 
0229   return fMaxEnergy;
0230 }
0231 
0232 inline G4double G4HadronicParameters::GetMinEnergyTransitionFTF_Cascade() const { 
0233   return fMinEnergyTransitionFTF_Cascade;
0234 }
0235 inline G4double G4HadronicParameters::GetMaxEnergyTransitionFTF_Cascade() const { 
0236   return fMaxEnergyTransitionFTF_Cascade;
0237 }
0238 
0239 inline G4double G4HadronicParameters::GetMinEnergyTransitionQGS_FTF() const { 
0240   return fMinEnergyTransitionQGS_FTF;
0241 }
0242 
0243 inline G4double G4HadronicParameters::GetMaxEnergyTransitionQGS_FTF() const { 
0244   return fMaxEnergyTransitionQGS_FTF;
0245 }
0246 
0247 inline G4double G4HadronicParameters::GetMinEnergyINCLXX_Pbar() const { 
0248   return fMinEnergyINCLXX_Pbar;
0249 }
0250 inline G4double G4HadronicParameters::GetMaxEnergyINCLXX_Pbar() const { 
0251   return fMaxEnergyINCLXX_Pbar;
0252 } 
0253   
0254 
0255 inline G4double G4HadronicParameters::EnergyThresholdForHeavyHadrons() const {
0256   return fEnergyThresholdForHeavyHadrons;
0257 }
0258 
0259 inline G4double G4HadronicParameters::XSFactorNucleonInelastic() const {
0260   return fXSFactorNucleonInelastic;
0261 }
0262 
0263 inline G4double G4HadronicParameters::XSFactorNucleonElastic() const {
0264   return fXSFactorNucleonElastic;
0265 }
0266 
0267 inline G4double G4HadronicParameters::XSFactorPionInelastic() const {
0268   return fXSFactorPionInelastic;
0269 }
0270 
0271 inline G4double G4HadronicParameters::XSFactorPionElastic() const {
0272   return fXSFactorPionElastic;
0273 }
0274 
0275 inline G4double G4HadronicParameters::XSFactorHadronInelastic() const {
0276   return fXSFactorHadronInelastic;
0277 }
0278 
0279 inline G4double G4HadronicParameters::XSFactorHadronElastic() const {
0280   return fXSFactorHadronElastic;
0281 }
0282 
0283 inline G4double G4HadronicParameters::XSFactorEM() const {
0284   return fXSFactorEM;
0285 }
0286 
0287 inline G4int G4HadronicParameters::GetVerboseLevel() const { 
0288   return fVerboseLevel;
0289 }
0290 
0291 inline G4bool G4HadronicParameters::EnableBCParticles() const {
0292   return fEnableBC;
0293 }
0294 
0295 inline G4bool G4HadronicParameters::EnableHyperNuclei() const {
0296   return fEnableHyperNuclei;
0297 }
0298 
0299 inline G4bool G4HadronicParameters::ApplyFactorXS() const {
0300   return fApplyFactorXS;
0301 }
0302 
0303 inline G4bool G4HadronicParameters::EnableCRCoalescence() const {
0304   return fEnableCRCoalescence;
0305 }
0306 
0307 inline G4bool G4HadronicParameters::EnableIntegralInelasticXS() const {
0308   return fEnableIntegralInelasticXS;
0309 }
0310 
0311 inline G4bool G4HadronicParameters::EnableIntegralElasticXS() const {
0312   return fEnableIntegralElasticXS;
0313 }
0314 
0315 inline G4bool G4HadronicParameters::EnableDiffDissociationForBGreater10() const {
0316   return fEnableDiffDissociationForBGreater10;
0317 }
0318 
0319 inline G4bool G4HadronicParameters::EnableNeutronGeneralProcess() const {
0320   return fNeutronGeneral;
0321 }
0322 
0323 inline G4bool G4HadronicParameters::EnableNUDEX() const {
0324   return fEnableNUDEX;
0325 }
0326 
0327 inline G4bool G4HadronicParameters::EnableCoherentChargeExchange() const {
0328   return fChargeExchange;
0329 }
0330 
0331 inline G4bool G4HadronicParameters::GetBinaryDebug() const {
0332   return fBinaryDebug;
0333 }
0334 
0335 inline G4double G4HadronicParameters::GetEPRelativeLevel() const {
0336   return fRelativeDiff;
0337 }
0338 
0339 inline G4double G4HadronicParameters::GetEPAbsoluteLevel() const {
0340   return fAbsoluteDiff;
0341 }
0342 
0343 inline G4int G4HadronicParameters::GetEPReportLevel() const {
0344   return fReportLevel;
0345 }
0346 
0347 inline const G4String& G4HadronicParameters::GetDirPARTICLEXS() const {
0348   return fDirPARTICLEXS;
0349 }
0350 
0351 inline const G4String& G4HadronicParameters::GetPhysListDocDir() const
0352 {
0353   return fPhysListDocDir;
0354 }
0355 
0356 inline const G4String& G4HadronicParameters::GetPhysListName() const
0357 {
0358   return fPhysListName;
0359 }
0360 
0361 inline G4double G4HadronicParameters::GetNeutronKineticEnergyThresholdForSVT() const { 
0362   return fNeutronEkinThresholdForSVT;
0363 }
0364 
0365 inline G4double G4HadronicParameters::GetTimeThresholdForRadioactiveDecay() const { 
0366   return fTimeThresholdForRadioactiveDecays;
0367 }
0368 
0369 #endif