21 #include <gsl/gsl_complex.h>
22 #include <gsl/gsl_complex_math.h>
30 #ifdef HAVE_INIPARSER_H
31 #include <iniparser.h>
36 #define LOGTENEMIN 0.0
37 #define LOGTENEMAX 6.0
44 #define M_PI 3.14159265358979323846264338327950288
47 #define M_PI_2 1.57079632679489661923132169163975144
50 #define M_LN10 2.30258509299404568402
59 #define ALPHA 7.29735301383e-3
64 #ifndef ATOMICMASSUNIT
65 #define ATOMICMASSUNIT 931.4943
71 #define PROTONMASS 938.2723
77 #define ELECTRONMASS 0.511003e+6
82 #define SSWITCH_BA 0x001
83 #define SSWITCH_SH 0x002
84 #define SSWITCH_LE 0x004
85 #define SSWITCH_ND 0x008
86 #define SSWITCH_EC 0x010
87 #define SSWITCH_NS 0x020
88 #define SSWITCH_KI 0x040
89 #define SSWITCH_RA 0x080
90 #define SSWITCH_PA 0x100
91 #define SSWITCH_BR 0x200
92 #define SSWITCH_DEFAULT (SSWITCH_ND | SSWITCH_NS)
170 gsl_complex
complex_hyperg( gsl_complex a, gsl_complex b, gsl_complex z );
177 double bma(
double z1,
double b );
178 double relbloch(
double z12,
double b1,
double lambda,
double theta0 );
180 double Fbrems(
double x );
double bma(double z1, double b)
Computes the Bloch, Mott and Ahlen corrections.
double olddelta(double g, tdata *target)
Computes an obsolete version of the density effect.
double delta(double g, tdata *target)
Computes the density effect.
double lindhard(double zz, double aa, double bb, short sswitch)
Compute the Lindhard-Sørensen correction.
tdata * find_target(char *target, tdata *extratargets)
Finds target data corresponding to a target name.
void print_target(tdata *target)
Prints a target table entry in INI format.
double Fbrems(double x)
Compute a mathematical function related to bremsstrahlung.
double renergy(double e, double r0, double z1, double a1, short sswitch, tdata *target)
Extract energies from range tables.
double effective_charge(double z0, double e1, double z2, short sswitch)
Computes effective projectile charge.
double dedx(double e1, double rel0, double z0, double a1, short sswitch, tdata *target)
Computes dE/dx.
void run_range(FILE *finput, FILE *foutput, short sswitch, tdata *extratargets)
Parses and executes the task list.
gsl_complex complex_hyperg(gsl_complex a, gsl_complex b, gsl_complex z)
Confluent hypergeometric function.
Structure containing target data.
gsl_complex complex_lngamma(gsl_complex z)
Complex logarithm of the Gamma function.
range_table trange[MAXAB]
The range-energy table.
double djdx(double e1, double z0, double I0, double f0, double K, short sswitch, tdata *target)
Computes primary ionization.
double energy_table(int i)
Returns the energy corresponding to a value in a range table.
short init_switch(char *switchfile)
Initializes the value of of the switch bit field.
double qrange(double e, double z1, double a1, short sswitch, tdata *target)
Computes total range by direct integration of dE/dx.
Structure to store range tables.
double relbloch(double z12, double b1, double lambda, double theta0)
Compute the relativistic Bloch correction.
tdata * init_target(char *targetfile)
Read optional target data file.
void init_table(void)
Initialize range-energy tables.
double benton(double e, double z1, double a1, tdata *target)
Computes ranges at low energies.
double range(double e, double z1, double a1, short sswitch, tdata *target, int *tno)
Computes total range given initial energy.