Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Pow Class Reference

#include <G4Pow.hh>

Public Member Functions

 ~G4Pow ()
 
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.

Constructor & Destructor Documentation

G4Pow::~G4Pow ( )

Definition at line 123 of file G4Pow.cc.

124 {}

Member Function Documentation

G4double G4Pow::A13 ( G4double  A) const
inline

Definition at line 132 of file G4Pow.hh.

133 {
134  G4double res = 0.0;
135  if(A > 0.0)
136  {
137  G4double a = (1.0 <= A) ? A : 1.0/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  }
151  return res;
152 }
int G4int
Definition: G4Types.hh:78
double A(double temperature)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Pow::A23 ( G4double  A) const
inline

Definition at line 160 of file G4Pow.hh.

161 {
162  G4double x = A13(A);
163  return x*x;
164 }
double A(double temperature)
G4double A13(G4double A) const
Definition: G4Pow.hh:132
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Pow::expA ( G4double  A) const
inline

Definition at line 235 of file G4Pow.hh.

236 {
237  G4double res;
238  G4double a = (0.0 <= A) ? A : -A;
239 
240  if(a <= maxAexp)
241  {
242  G4int i = G4int(2*a + 0.5);
243  G4double x = a - i*0.5;
244  res = fexp[i]*(1.0 + x*(1.0 + 0.5*(1.0 + onethird*x)*x));
245  }
246  else
247  {
248  res = G4Exp(a);
249  }
250  if(0.0 > A) { res = 1.0/res; }
251  return res;
252 }
int G4int
Definition: G4Types.hh:78
double A(double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Pow::factorial ( G4int  Z) const
inline

Definition at line 264 of file G4Pow.hh.

265 {
266  return fact[Z];
267 }

Here is the caller graph for this function:

G4Pow * G4Pow::GetInstance ( )
static

Definition at line 55 of file G4Pow.cc.

56 {
57  if (fpInstance == 0)
58  {
59  static G4Pow geant4pow;
60  fpInstance = &geant4pow;
61  }
62  return fpInstance;
63 }
Definition: G4Pow.hh:56
G4double G4Pow::log10A ( G4double  A) const
inline

Definition at line 230 of file G4Pow.hh.

231 {
232  return logX(A)/lz[10];
233 }
double A(double temperature)
G4double logX(G4double x) const
Definition: G4Pow.hh:199

Here is the call graph for this function:

G4double G4Pow::log10Z ( G4int  Z) const
inline

Definition at line 225 of file G4Pow.hh.

226 {
227  return lz[Z]/lz[10];
228 }
G4double G4Pow::logA ( G4double  A) const
inline

Definition at line 194 of file G4Pow.hh.

195 {
196  return (1.0 <= A ? logBase(A) : -logBase(1./A));
197 }
double A(double temperature)
G4double G4Pow::logfactorial ( G4int  Z) const
inline

Definition at line 269 of file G4Pow.hh.

270 {
271  return logfact[Z];
272 }

Here is the caller graph for this function:

G4double G4Pow::logX ( G4double  x) const
inline

Definition at line 199 of file G4Pow.hh.

200 {
201  G4double res = 0.0;
202  G4double a = (1.0 <= x) ? x : 1.0/x;
203 
204  if(a <= maxA)
205  {
206  res = logBase(a);
207  }
208  else if(a <= ener[2])
209  {
210  res = logen[1] + logBase(a/ener[1]);
211  }
212  else if(a <= ener[3])
213  {
214  res = logen[2] + logBase(a/ener[2]);
215  }
216  else
217  {
218  res = G4Log(a);
219  }
220 
221  if(1.0 > x) { res = -res; }
222  return res;
223 }
G4double G4Log(G4double x)
Definition: G4Log.hh:230
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Pow::logZ ( G4int  Z) const
inline

Definition at line 166 of file G4Pow.hh.

167 {
168  return lz[Z];
169 }

Here is the caller graph for this function:

G4double G4Pow::powA ( G4double  A,
G4double  y 
) const
inline

Definition at line 259 of file G4Pow.hh.

260 {
261  return (0.0 == A ? 0.0 : expA(y*logX(A)));
262 }
G4double expA(G4double A) const
Definition: G4Pow.hh:235
double A(double temperature)
G4double logX(G4double x) const
Definition: G4Pow.hh:199

Here is the call graph for this function:

G4double G4Pow::powN ( G4double  x,
G4int  n 
) const

Definition at line 128 of file G4Pow.cc.

129 {
130  if(0.0 == x) { return 0.0; }
131  if(std::abs(n) > 8) { return std::pow(x, G4double(n)); }
132  G4double res = 1.0;
133  if(n >= 0) { for(G4int i=0; i<n; ++i) { res *= x; } }
134  else if(n < 0)
135  {
136  G4double y = 1.0/x;
137  G4int nn = -n;
138  for(G4int i=0; i<nn; ++i) { res *= y; }
139  }
140  return res;
141 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4Pow::powZ ( G4int  Z,
G4double  y 
) const
inline

Definition at line 254 of file G4Pow.hh.

255 {
256  return expA(y*lz[Z]);
257 }
G4double expA(G4double A) const
Definition: G4Pow.hh:235

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Pow::Z13 ( G4int  Z) const
inline

Definition at line 127 of file G4Pow.hh.

128 {
129  return pz13[Z];
130 }

Here is the caller graph for this function:

G4double G4Pow::Z23 ( G4int  Z) const
inline

Definition at line 154 of file G4Pow.hh.

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

Here is the call graph for this function:

Here is the caller graph for this function:


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