Geant4-11
G4HadronicParameters.cc
Go to the documentation of this file.
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
41#include "G4ApplicationState.hh"
42#include "G4StateManager.hh"
44
45
47
48#ifdef G4MULTITHREADED
49G4Mutex G4HadronicParameters::paramMutex = G4MUTEX_INITIALIZER;
50#endif
51
53 if ( sInstance == nullptr ) {
54 #ifdef G4MULTITHREADED
55 G4MUTEXLOCK( &paramMutex );
56 if ( sInstance == nullptr ) {
57 #endif
58 static G4HadronicParameters theHadronicParametersObject;
59 sInstance = &theHadronicParametersObject;
60 #ifdef G4MULTITHREADED
61 }
62 G4MUTEXUNLOCK(&paramMutex);
63 #endif
64 }
65 return sInstance;
66}
67
68
70 delete fMessenger;
71}
72
73
75 fMaxEnergy = 100.0*CLHEP::TeV;
82}
83
84
86 return ( ! G4Threading::IsMasterThread() ||
87 G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit );
88}
89
90
92 if ( ! IsLocked() && val > 0.0 ) {
93 fMaxEnergy = val;
94 }
95}
96
97
99 if ( ! IsLocked() && val > 0.0 ) {
101 }
102}
103
104
106 if ( ! IsLocked() && val > fMinEnergyTransitionFTF_Cascade ) {
108 }
109}
110
111
113 if ( ! IsLocked() && val > 0.0 ) {
115 }
116}
117
119 if ( ! IsLocked() && val > fMinEnergyTransitionQGS_FTF ) {
121 }
122}
123
125 if ( ! IsLocked() ) fEnableBC = val;
126}
127
128
130 if ( ! IsLocked() ) fEnableHyperNuclei = val;
131}
132
133
135 if ( ! IsLocked() && val >= 0 ) fVerboseLevel = val;
136}
137
138
140 if ( ! IsLocked() && val >= 0 && val < 5*CLHEP::GeV ) {
142 }
143}
144
145
147 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
149 }
150}
151
152
154 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
156 }
157}
158
159
161 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
163 }
164}
165
166
168 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
170 }
171}
172
173
175 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
177 }
178}
179
180
182 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
184 }
185}
186
187
189 if ( ! IsLocked() && std::abs(val - 1.0) < fXSFactorLimit ) {
190 fXSFactorEM = val;
191 }
192}
193
194
196 if ( ! IsLocked() ) fApplyFactorXS = val;
197}
198
199
201 if ( ! IsLocked() ) fEnableCRCoalescence = val;
202}
@ G4State_PreInit
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:85
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4HadronicParameters * sInstance
static G4HadronicParameters * Instance()
void SetXSFactorNucleonInelastic(G4double val)
void SetXSFactorPionInelastic(G4double val)
void SetVerboseLevel(const G4int val)
void SetXSFactorPionElastic(G4double val)
void SetEnableHyperNuclei(G4bool 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 SetXSFactorHadronInelastic(G4double val)
void SetXSFactorNucleonElastic(G4double val)
void SetMaxEnergyTransitionFTF_Cascade(const G4double val)
G4HadronicParametersMessenger * fMessenger
static G4StateManager * GetStateManager()
static constexpr double TeV
static constexpr double GeV
G4bool IsMasterThread()
Definition: G4Threading.cc:124