Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4Pow Class Reference

#include <G4Pow.hh>

Public Member Functions

G4double Z13 (G4int Z) const
 
G4double A13 (G4double A) const
 
G4double Z23 (G4int Z) const
 
G4double A23 (G4double A) const
 
G4double logZ (G4int Z) const
 
G4double logA (G4double A) const
 
G4double logX (G4double x) const
 
G4double log10Z (G4int Z) const
 
G4double log10A (G4double A) const
 
G4double expA (G4double A) const
 
G4double powZ (G4int Z, G4double y) const
 
G4double powA (G4double A, G4double y) const
 
G4double powN (G4double x, G4int n) const
 
G4double factorial (G4int Z) const
 
G4double logfactorial (G4int Z) const
 

Static Public Member Functions

static G4PowGetInstance ()
 

Detailed Description

Definition at line 56 of file G4Pow.hh.

Member Function Documentation

G4double G4Pow::A13 ( G4double  A) const
inline

Definition at line 134 of file G4Pow.hh.

References test::a, and test::x.

Referenced by A23(), G4AntiNuclElastic::CalculateAm(), G4ionEffectiveCharge::EffectiveCharge(), G4TripathiLightCrossSection::GetElementCrossSection(), G4IonsShenCrossSection::GetIsoCrossSection(), G4NistManager::GetZ13(), and G4BetheHeitlerModel::SampleSecondaries().

135 {
136  G4double res;
137  G4double a = A;
138  if(1.0 > A) { a = 1.0/A; }
139  if(a <= maxA)
140  {
141  G4int i = G4int(a + 0.5);
142  G4double x = (a/G4double(i) - 1.0)*onethird;
143  res = pz13[i]*(1.0 + x - x*x*(1.0 - 1.66666666*x));
144  if(1.0 > A) { res = 1.0/res; }
145  }
146  else
147  {
148  res = std::pow(A, onethird);
149  }
150  return res;
151 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
G4double G4Pow::A23 ( G4double  A) const
inline

Definition at line 159 of file G4Pow.hh.

References A13(), and test::x.

Referenced by G4ionEffectiveCharge::EffectiveCharge().

160 {
161  G4double x = A13(A);
162  return x*x;
163 }
G4double A13(G4double A) const
Definition: G4Pow.hh:134
double G4double
Definition: G4Types.hh:76
G4double G4Pow::expA ( G4double  A) const
inline

Definition at line 238 of file G4Pow.hh.

References G4Exp(), and test::x.

Referenced by powA(), and powZ().

239 {
240  G4double res;
241  G4double a = A;
242  if(0.0 > A) { a = -A; }
243 
244  if(a <= maxAexp)
245  {
246  G4int i = G4int(2*a + 0.5);
247  G4double x = a - i*0.5;
248  res = fexp[i]*(1.0 + x*(1.0 + 0.5*(1.0 + onethird*x)*x));
249  }
250  else
251  {
252  res = G4Exp(a);
253  }
254  if(0.0 > A) { res = 1.0/res; }
255  return res;
256 }
int G4int
Definition: G4Types.hh:78
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:180
double G4double
Definition: G4Types.hh:76
G4double G4Pow::factorial ( G4int  Z) const
inline

Definition at line 268 of file G4Pow.hh.

Referenced by G4PomeronCrossSection::GetCutPomeronProbability().

269 {
270  return fact[Z];
271 }
G4Pow * G4Pow::GetInstance ( void  )
static

Definition at line 53 of file G4Pow.cc.

Referenced by G4HadPhaseSpaceKopylov::BetaKopylov(), G4CascadeFinalStateAlgorithm::BetaKopylov(), G4GEMCoulombBarrier::CalcCompoundRadius(), G4GEMCoulombBarrierHE::CalcCompoundRadius(), G4AntiNuclElastic::CalculateAm(), G4UrbanMscModel::ComputeCrossSectionPerAtom(), G4E1SingleProbability1::EmissionProbDensity(), G4BetheHeitlerModel::G4BetheHeitlerModel(), G4BGGPionInelasticXS::G4BGGPionInelasticXS(), G4ContinuumGammaTransition::G4ContinuumGammaTransition(), G4E1Probability::G4E1Probability(), G4ExcitationHandler::G4ExcitationHandler(), G4FermiConfigurationList::G4FermiConfigurationList(), G4FermiPhaseSpaceDecay::G4FermiPhaseSpaceDecay(), G4GEMChannel::G4GEMChannel(), G4GEMProbability::G4GEMProbability(), G4Generator2BS::G4Generator2BS(), G4HadronCrossSections::G4HadronCrossSections(), G4ICRU49NuclearStoppingModel::G4ICRU49NuclearStoppingModel(), G4ionEffectiveCharge::G4ionEffectiveCharge(), G4IonFluctuations::G4IonFluctuations(), G4IonisParamElm::G4IonisParamElm(), G4IonisParamMat::G4IonisParamMat(), G4PreCompoundEmission::G4PreCompoundEmission(), G4PreCompoundTransitions::G4PreCompoundTransitions(), G4VEmissionProbability::G4VEmissionProbability(), G4VPreCompoundFragment::G4VPreCompoundFragment(), G4WentzelOKandVIxSection::G4WentzelOKandVIxSection(), G4WentzelVIRelModel::G4WentzelVIRelModel(), G4WentzelVIRelXSection::G4WentzelVIRelXSection(), G4AntiNuclElastic::GetcosTeta1(), G4CoulombBarrier::GetCoulombBarrier(), G4NeutronInelasticCrossSection::GetCrossSection(), G4PomeronCrossSection::GetCutPomeronProbability(), G4IonsSihverCrossSection::GetElementCrossSection(), G4TripathiLightCrossSection::GetElementCrossSection(), G4IonsShenCrossSection::GetIsoCrossSection(), G4InuclParamMomDst::GetMomentum(), G4InuclSpecialFunctions::randomInuclPowers(), G4AntiNuclElastic::SampleInvariantT(), G4HadronElastic::SampleInvariantT(), and G4DiscreteGammaTransition::SelectGamma().

54 {
55  if (fpInstance == 0)
56  {
57  fpInstance = new G4Pow;
58  }
59  return fpInstance;
60 }
Definition: G4Pow.hh:56
G4double G4Pow::log10A ( G4double  A) const
inline

Definition at line 233 of file G4Pow.hh.

References logX().

234 {
235  return logX(A)/lz[10];
236 }
G4double logX(G4double x) const
Definition: G4Pow.hh:201
G4double G4Pow::log10Z ( G4int  Z) const
inline

Definition at line 228 of file G4Pow.hh.

229 {
230  return lz[Z]/lz[10];
231 }
G4double G4Pow::logA ( G4double  A) const
inline

Definition at line 193 of file G4Pow.hh.

Referenced by G4NistManager::GetLOGA().

194 {
195  G4double res;
196  if(1.0 <= A) { res = logBase(A); }
197  else { res = -logBase(1./A); }
198  return res;
199 }
double G4double
Definition: G4Types.hh:76
G4double G4Pow::logfactorial ( G4int  Z) const
inline

Definition at line 273 of file G4Pow.hh.

274 {
275  return logfact[Z];
276 }
G4double G4Pow::logX ( G4double  x) const
inline

Definition at line 201 of file G4Pow.hh.

References G4Log(), and test::x.

Referenced by log10A(), and powA().

202 {
203  G4double res = 0.0;
204  G4double a = x;
205  if(1.0 > x) { a = 1.0/x; }
206 
207  if(a <= maxA)
208  {
209  res = logBase(a);
210  }
211  else if(a <= ener[2])
212  {
213  res = logen[1] + logBase(a/ener[1]);
214  }
215  else if(a <= ener[3])
216  {
217  res = logen[2] + logBase(a/ener[2]);
218  }
219  else
220  {
221  res = G4Log(a);
222  }
223 
224  if(1.0 > x) { res = -res; }
225  return res;
226 }
G4double G4Log(G4double x)
Definition: G4Log.hh:227
double G4double
Definition: G4Types.hh:76
G4double G4Pow::logZ ( G4int  Z) const
inline
G4double G4Pow::powA ( G4double  A,
G4double  y 
) const
inline

Definition at line 263 of file G4Pow.hh.

References expA(), and logX().

Referenced by G4NonEquilibriumEvaporator::deExcite().

264 {
265  return expA(y*logX(A));
266 }
G4double expA(G4double A) const
Definition: G4Pow.hh:238
G4double logX(G4double x) const
Definition: G4Pow.hh:201
G4double G4Pow::powN ( G4double  x,
G4int  n 
) const

Definition at line 125 of file G4Pow.cc.

References n, G4InuclParticleNames::nn, and test::x.

Referenced by G4HadPhaseSpaceKopylov::BetaKopylov(), G4CascadeFinalStateAlgorithm::BetaKopylov(), G4PreCompoundTransitions::CalculateProbability(), G4NonEquilibriumEvaporator::deExcite(), G4FermiConfigurationList::G4FermiConfigurationList(), G4InuclParamMomDst::GetMomentum(), G4PreCompoundNucleon::ProbabilityDistributionFunction(), G4PreCompoundIon::ProbabilityDistributionFunction(), and G4InuclSpecialFunctions::randomInuclPowers().

126 {
127  if(std::abs(n) > 8) { return std::pow(x, G4double(n)); }
128  G4double res = 1.0;
129  if(n >= 0) { for(G4int i=0; i<n; ++i) { res *= x; } }
130  else if((n < 0) && (x != 0.0))
131  {
132  G4double y = 1.0/x;
133  G4int nn = -n;
134  for(G4int i=0; i<nn; ++i) { res *= y; }
135  }
136  return res;
137 }
int G4int
Definition: G4Types.hh:78
const G4int n
double G4double
Definition: G4Types.hh:76
G4double G4Pow::powZ ( G4int  Z,
G4double  y 
) const
inline
G4double G4Pow::Z13 ( G4int  Z) const
inline
G4double G4Pow::Z23 ( G4int  Z) const
inline

Definition at line 153 of file G4Pow.hh.

References test::x, and Z13().

Referenced by G4GEMProbability::CalcBetaParam(), G4UrbanMscModel::ComputeCrossSectionPerAtom(), G4HETCNeutron::GetBeta(), G4AntiNuclElastic::GetcosTeta1(), G4HadronElastic::SampleInvariantT(), and G4WentzelOKandVIxSection::SetupTarget().

154 {
155  G4double x = Z13(Z);
156  return x*x;
157 }
G4double Z13(G4int Z) const
Definition: G4Pow.hh:129
double G4double
Definition: G4Types.hh:76

The documentation for this class was generated from the following files: