Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:22

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