]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TFluka/Fdblprc.h
User stepping methods added (E. Futo)
[u/mrichter/AliRoot.git] / TFluka / Fdblprc.h
1 #ifndef FDBLPRC_H
2 #define FDBLPRC_H 1
3
4 #include "Rtypes.h"
5 #include "cfortran.h"
6 extern "C" {
7 //*$ create dblprc.add
8 //*copy dblprc
9 //*                                                                     *
10 //*=== dblprc ==========================================================*
11 //*                                                                     *
12 //*---------------------------------------------------------------------*
13 //*                                                                     *
14 //*      dblprc: included in any routine, machine, mathematical and     *
15 //*              physical constants plus global declarations            *
16 //*                                                                     *
17 //*  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  *
18 //*  !!!! o n   m a c h i n e s   w h e r e   t h e   d o u b l e !!!!  *
19 //*  !!!! p r e c i s i o n   i s   n o t   r e q u i r e d  r e -!!!!  *
20 //*  !!!! m o v e   t h e   d o u b l e   p r e c i s i o n       !!!!  *
21 //*  !!!! s t a t e m e n t,  s e t   k a l g n m = 1   a n d     !!!!  *
22 //*  !!!! c h a n g e   a l l   n u m e r i c a l   c o n s -     !!!!  *
23 //*  !!!! t a n t s   t o   s i n g l e   p r e c i s i o n       !!!!  *
24 //*  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  *
25 //*                                                                     *
26 //*         kalgnm = real address alignment, 2 for double precision,    *
27 //*                  1 for single precision                             *
28 //*         kalch8 = character*8 address alignment wrt the precision    *
29 //*                  defined by kalgnm (mostly 1 in all situations)     *
30 //*         i2algn = integer*2 address alignment wrt the normal integer *
31 //*                  precision (mostly 2, 4 for 64 bit integers)        *
32 //*         anglgb = this parameter should be set equal to the machine  *
33 //*                  "zero" with respect to unit                        *
34 //*         anglsq = this parameter should be set equal to the square   *
35 //*                  of anglgb                                          *
36 //*         axcssv = this parameter should be set equal to the number   *
37 //*                  for which unity is negligible for the machine      *
38 //*                  accuracy                                           *
39 //*         andrfl = "underflow" of the machine for floating point      *
40 //*                  operation                                          *
41 //*         avrflw = "overflow"  of the machine for floating point      *
42 //*                  operation                                          *
43 //*         ainfnt = code "infinite"                                    *
44 //*         azrzrz = code "zero"                                        *
45 //*         einfnt = natural logarithm of the code "infinite"           *
46 //*         ezrzrz = natural logarithm of the code "zero"               *
47 //*         excssv = natural logarithm of the code number for which     *
48 //*                  unit is negligible                                 *
49 //*         englgb = natural logarithm of the code "zero" with respect  *
50 //*                  to unit                                            *
51 //*         onemns = 1- of the machine, it is 1 - 2 x anglgb            *
52 //*         onepls = 1+ of the machine, it is 1 + 2 x anglgb            *
53 //*         csnnrm = maximum tolerable error on cosine normalization,   *
54 //*                  u**2+v**2+w**2: assuming a typical anglgb relative *
55 //*                  error on each component we would get 2xanglgb: use *
56 //*                  4xanglgb to avoid too many normalizations          *
57 //*         dmxtrn = "infinite" distance for transport (cm)             *
58 //*         rhflmn = minimal density for fluka (g/cm^3)                 *
59 //*                                                                     *
60 //*   "global" declarations:                                            *
61 //*         lfluka = set to true for a real (full) fluka run            *
62 //*         lgbias = set to true for a fully biased run                 *
63 //*         lgbana = set to true for a fully analogue run               *
64 //*         lflgeo = set to true when using the standard fluka geometry *
65 //*         loflts = set to true for special off-line testing of speci- *
66 //*                  fic routines                                       *
67 //*         lusrin = set to true if the user dependent initialization   *
68 //*                  routine usrini has been called at least onec       *
69 //*         lnmgeo = set to true for a name-base geometry input         *
70 //*         lnminp = set to true for a name-base fluka input            *
71 //*         lfdrtr = set to true for going in/out feeder/flukam at each *
72 //*                  event                                              *
73 //*                                                                     *
74 //*---------------------------------------------------------------------*
75 //*                                                                     *
76 const Int_t kalgnm = 2;
77 const Int_t kalch8 = 1;
78 const Int_t i2algn = 2;
79 const Double_t anglgb = 5.0e-16;
80 const Double_t anglsq = 2.5e-31;
81 const Double_t axcssv = 0.2e+16;
82 const Double_t andrfl = 1.0e-38;
83 const Double_t avrflw = 1.0e+38;
84 const Double_t ainfnt = 1.0e+30;
85 const Double_t azrzrz = 1.0e-30;
86 const Double_t einfnt = +69.07755278982137e+00;
87 const Double_t ezrzrz = -69.07755278982137e+00;
88 const Double_t excssv = +35.23192357547063e+00;
89 const Double_t englgb = -35.23192357547063e+00;
90 const Double_t onemns = 0.999999999999999e+00;
91 const Double_t onepls = 1.000000000000001e+00;
92 const Double_t csnnrm = 2.0e-15;
93 const Double_t dmxtrn = 1.0e+08;
94 const Double_t rhflmn = 1.0e-06;
95 //*
96 //*======================================================================*
97 //*======================================================================*
98 //*=========                                                   ==========*
99 //*=========    m a t h e m a t i c a l   c o n s t a n t s    ==========*
100 //*=========                                                   ==========*
101 //*======================================================================*
102 //*======================================================================*
103 //*                                                                      *
104 //*   numerical constants (single precision):                            *
105 //*                                                                      *
106 //*         zersng = 0                                                   *
107 //*                                                                      *
108 //*   numerical constants (double precision):                            *
109 //*                                                                      *
110 //*         zerzer = 0                                                   *
111 //*         oneone = 1                                                   *
112 //*         twotwo = 2                                                   *
113 //*         thrthr = 3                                                   *
114 //*         foufou = 4                                                   *
115 //*         fivfiv = 5                                                   *
116 //*         sixsix = 6                                                   *
117 //*         sevsev = 7                                                   *
118 //*         eigeig = 8                                                   *
119 //*         aninen = 9                                                   *
120 //*         tenten = 10                                                  *
121 //*         eleven = 11                                                  *
122 //*         twelve = 12                                                  *
123 //*         fiften = 15                                                  *
124 //*         sixten = 16                                                  *
125 //*         hlfhlf = 1/2                                                 *
126 //*         onethi = 1/3                                                 *
127 //*         onefou = 1/4                                                 *
128 //*         onefiv = 1/5                                                 *
129 //*         onesix = 1/6                                                 *
130 //*         onesev = 1/7                                                 *
131 //*         oneeig = 1/8                                                 *
132 //*         twothi = 2/3                                                 *
133 //*         thrfou = 3/4                                                 *
134 //*         thrtwo = 3/2                                                 *
135 //*         pipipi = circumference / diameter                            *
136 //*         twopip = 2 x pipipi                                          *
137 //*         pip5o2 = 5/2 x pipipi                                        *
138 //*         pipisq = pipipi x pipipi                                     *
139 //*         pihalf = 1/2 x pipipi                                        *
140 //*         erfa00 = erf (oo) = 1/2 x square root of pi                  *
141 //*         sqtwpi = square root of 2xpi                                 *
142 //*         eulero = eulero's constant                                   *
143 //*         eulexp = exp ( eulero )                                      *
144 //*         e1m2eu = exp ( 1 - 2 eulero )                                *
145 //*         eneper = "e", base of natural logarithm                      *
146 //*         sqrent = square root of "e"                                  *
147 //*         sqrtwo = square root of  2                                   *
148 //*         sqrthr = square root of  3                                   *
149 //*         sqrfiv = square root of  5                                   *
150 //*         sqrsix = square root of  6                                   *
151 //*         sqrsev = square root of  7                                   *
152 //*         sqrt12 = square root of 12                                   *
153 //*                                                                      *
154 //*----------------------------------------------------------------------*
155 //*
156 const Float_t  zersng = 0.e+00;
157 const Double_t zerzer = 0.e+00;
158 const Double_t oneone = 1.e+00;
159 const Double_t twotwo = 2.e+00;
160 const Double_t thrthr = 3.e+00;
161 const Double_t foufou = 4.e+00;
162 const Double_t fivfiv = 5.e+00;
163 const Double_t sixsix = 6.e+00;
164 const Double_t sevsev = 7.e+00;
165 const Double_t eigeig = 8.e+00;
166 const Double_t aninen = 9.e+00;
167 const Double_t tenten = 10.e+00;
168 const Double_t eleven = 11.e+00;
169 const Double_t twelve = 12.e+00;
170 const Double_t fiften = 15.e+00;
171 const Double_t sixten = 16.e+00;
172 const Double_t hlfhlf = 0.5e+00;
173 const Double_t onethi = oneone/thrthr;
174 const Double_t onefou = oneone/foufou;
175 const Double_t onefiv = oneone/fivfiv;
176 const Double_t onesix = oneone/sixsix;
177 const Double_t onesev = oneone/sevsev;
178 const Double_t oneeig = oneone/eigeig;
179 const Double_t twothi = twotwo/thrthr;
180 const Double_t thrfou = thrthr/foufou;
181 const Double_t thrtwo = thrthr/twotwo;
182 const Double_t pipipi = 3.141592653589793238462643383279e+00;
183 const Double_t twopip = 6.283185307179586476925286766559e+00;
184 const Double_t pip5o2 = 7.853981633974483096156608458199e+00;
185 const Double_t pipisq = 9.869604401089358618834490999876e+00;
186 const Double_t pihalf = 1.570796326794896619231321691640e+00;
187 const Double_t erfa00 = 0.886226925452758013649083741671e+00;
188 const Double_t sqrtpi = 1.772453850905516027298167483341e+00;
189 const Double_t sqtwpi = 2.506628274631000502415765284811e+00;
190 const Double_t eulero = 0.577215664901532860606512e+00;
191 const Double_t eulexp = 1.781072417990197985236504e+00;
192 const Double_t eullog = -0.5495393129816448223376619e+00;
193 const Double_t e1m2eu = 0.8569023337737540831433017e+00;
194 const Double_t eneper = 2.718281828459045235360287471353e+00;
195 const Double_t sqrent = 1.648721270700128146848650787814e+00;
196 const Double_t sqrtwo = 1.414213562373095048801688724210e+00;
197 const Double_t sqrthr = 1.732050807568877293527446341506e+00;
198 const Double_t sqrfiv = 2.236067977499789696409173668731e+00;
199 const Double_t sqrsix = 2.449489742783178098197284074706e+00;
200 const Double_t sqrsev = 2.645751311064590590501615753639e+00;
201 const Double_t sqrt12 = 3.464101615137754587054892683012e+00;
202 //*
203 //*======================================================================*
204 //*======================================================================*
205 //*=========                                                   ==========*
206 //*=========       p h y s i c a l   c o n s t a n t s         ==========*
207 //*=========                                                   ==========*
208 //*======================================================================*
209 //*======================================================================*
210 //*                                                                      *
211 //*   primary constants:                                                 *
212 //*                                                                      *
213 //*         clight = speed of light in cm s-1                            *
214 //*         avogad = avogadro number                                     *
215 //*         boltzm = k boltzmann constant (j k-1)                        *
216 //*         amelgr = electron mass (g)                                   *
217 //*         plckbr = reduced planck constant (erg s)                     *
218 //*         elccgs = elementary charge (cgs unit)                        *
219 //*         elcmks = elementary charge (mks unit)                        *
220 //*         amugrm = atomic mass unit (g)                                *
221 //*         ammumu = muon    mass (amu)                                  *
222 //*         amprmu = proton  mass (amu)                                  *
223 //*         amnemu = neutron mass (amu)                                  *
224 //*                                                                      *
225 //*   derived constants:                                                 *
226 //*                                                                      *
227 //*         alpfsc = fine structure constant  = e^2/(hbar c) (cgs units) *
228 //*         amelct = electron mass (gev) = 10^-16amelgr clight^2 / elcmks*
229 //*         amugev = atomic mass unit (gev) = 10^-16amugrm clight^2      *
230 //*                                           / elcmks                   *
231 //*         ammuon = muon    mass (gev) = ammumu * amugev                *
232 //*         amprtn = proton  mass (gev) = amprmu * amugev                *
233 //*         amntrn = neutron mass (gev) = amnemu * amugev                *
234 //*         amdeut = deuteron mass (gev)                                 *
235 //*         amalph = alpha    mass (gev) (derived from the excess mass   *
236 //*                  and an (approximate) atomic binding not a really    *
237 //*                  measured constant)                                  *
238 //*         cougfm = e^2 (gev fm) = elccgs^2 / elcmks * 10^-7 * 10^-9    *
239 //*                * 10^13 (10^..=erg cm->joule cm->gev cm->gev fm       *
240 //*                it is equal to 0.00144 gev fm                         *
241 //*         fscto2 = (fine structure constant)^2                         *
242 //*         fscto3 = (fine structure constant)^3                         *
243 //*         fscto4 = (fine structure constant)^4                         *
244 //*         plabrc = reduced planck constant times the light velocity    *
245 //*                  expressed in gev fm                                 *
246 //*         rclsel = classical electron radius (cm) = e^2 / (m_e c^2)    *
247 //*         bltzmn = k boltzmann constant in gev k-1                     *
248 //*         a0bohr = bohr radius, hbar^2 / ( m_e e^2) (fm) = plabrc**2   *
249 //*                / amelct / cougfm, or equivalently,                   *
250 //*                plabrc / alpfsc / amelct                              *
251 //*         gfohb3 = fermi constant, g_f/(hbar c)^3, in gev^-2           *
252 //*         gfermi = fermi constant in gev fm^3                          *
253 //*         sin2tw = sin^2 theta_weinberg                                *
254 //*         prmgnm = proton  magnetic moment (magneton)                  *
255 //*         anmgnm = neutron magnetic moment (magneton)                  *
256 //*                                                                      *
257 //*   astronomical constants:                                            *
258 //*                                                                      *
259 //*         rearth = earth equatorial radius (cm)                        *
260 //*         auastu = astronomical unit       (cm)                        *
261 //*                                                                      *
262 //*   conversion constants:                                              *
263 //*                                                                      *
264 //*         gevmev = from gev to mev                                     *
265 //*         emvgev = from mev to gev                                     *
266 //*         gev2ev = from gev to  ev                                     *
267 //*         ev2gev = from ev  to gev                                     *
268 //*         algvmv = from gev to mev, log                                *
269 //*         raddeg = from radians to degrees                             *
270 //*         degrad = from degrees to radians                             *
271 //*         gevomg = from (photon) energy [gev] in 2pi x frequency [s^-1]*
272 //*                                                                      *
273 //*   useful constants:                                                  *
274 //*                                                                      *
275 //*         fertho = constant to be used in the fermi-thomas approxima-  *
276 //*                  ted expression for atomic binding energies          *
277 //*         expebn = exponent to be used in the fermi-thomas approxima-  *
278 //*                  ted expression for atomic binding energies          *
279 //*                    b_atomic (z) = fertho x z^expebn (gev)            *
280 //*         bexc12 = fermi-thomas approximated expression for 12-c ato-  *
281 //*                  mic binding energies (gev)                          *
282 //*         amunmu = difference between the atomic and nuclear mass units*
283 //*         amuc12 = "nuclear" mass unit = 1/12 m_nucl (12-c),           *
284 //*                  m_nucl (12-c) = m_atom (12-c) - 6 m_e + b_atom(12-c)*
285 //*                                                                      *
286 //*----------------------------------------------------------------------*
287 //*
288 const Double_t clight = 2.99792458e+10;
289 const Double_t avogad = 6.0221367e+23;
290 const Double_t boltzm = 1.380658e-23;
291 const Double_t amelgr = 9.1093897e-28;
292 const Double_t plckbr = 1.05457266e-27;
293 const Double_t elccgs = 4.8032068e-10;
294 const Double_t elcmks = 1.60217733e-19;
295 const Double_t amugrm = 1.6605402e-24;
296 const Double_t ammumu = 0.113428913e+00;
297 const Double_t amprmu = 1.007276470e+00;
298 const Double_t amnemu = 1.008664904e+00;
299 //*     parameter ( alpfsc = 1.e+00 / 137.035989561e+00 )
300 //*     parameter ( fscto2 = alpfsc * alpfsc )
301 //*     parameter ( fscto3 = fscto2 * alpfsc )
302 //*     parameter ( fscto4 = fscto3 * alpfsc )
303 //*    it is important to set the electron mass exactly with the same
304 //*    rounding as in the mass tables, so use the explicit expression
305 //*     parameter ( amelct = 1.e-16 * amelgr * clight * clight / elcmks )
306 //*    it is important to set the amu mass exactly with the same
307 //*    rounding as in the mass tables, so use the explicit expression
308 //*     parameter ( amugev = 1.e-16 * amugrm * clight * clight / elcmks )
309 //*    it is important to set the muon,proton,neutron masses exactly with
310 //*    the same rounding as in the mass tables, so use the explicit
311 //*    expression
312 //*     parameter ( ammuon = ammumu * amugev )
313 //*     parameter ( amprtn = amprmu * amugev )
314 //*     parameter ( amntrn = amnemu * amugev )
315 //*     parameter ( rclsel = elccgs * elccgs / clight / clight / amelgr )
316 //*     parameter ( bltzmn = boltzm / elcmks * 1.e-09 )
317 const Double_t alpfsc = 7.2973530791728595e-3;
318 const Double_t fscto2 = 5.3251361962113614e-5;
319 const Double_t fscto3 = 3.8859399018437826e-7;
320 const Double_t fscto4 = 2.8357075508200407e-9;
321 const Double_t plabrc = 0.197327053e+00;
322 const Double_t amelct = 0.51099906e-3;
323 const Double_t amugev = 0.93149432e+00;
324 const Double_t ammuon = 0.105658389e+00;
325 const Double_t amprtn = 0.93827231e+00;
326 const Double_t amntrn = 0.93956563e+00;
327 const Double_t amdeut = 1.87561339e+00;
328 const Double_t amalph = 3.72738025692891e+00;
329 const Double_t cougfm = elccgs*elccgs/elcmks*(1.e-7)*(1.e+1)*(1.e-9);
330 const Double_t rclsel = 2.8179409183694872e-13;
331 const Double_t bltzmn = 8.617385e-14;
332 const Double_t a0bohr = plabrc/alpfsc/amelct;
333 const Double_t gfohb3 = 1.16639e-5;
334 const Double_t gfermi = gfohb3*plabrc*plabrc*plabrc;
335 const Double_t sin2tw = 0.2319e+00;
336 const Double_t prmgnm = 2.792847386e+00;
337 const Double_t anmgnm = -1.91304275e+00;
338 const Double_t rearth = 6.378140e+8;
339 const Double_t auastu = 1.4959787066e+13;
340 const Double_t gevmev = 1.0e+3;
341 const Double_t ev2gev = 1.0e-9;
342 const Double_t gev2ev = 1.0e+9;
343 const Double_t emvgev = 1.0e-3;
344 const Double_t algvmv = 6.90775527898214e+00;
345 const Double_t raddeg = (180.e+00)/pipipi;
346 const Double_t degrad = pipipi/(180.e+00);
347 const Double_t gevomg = clight*(1.e+13)/plabrc;
348 //*  old Fermi-Thomas parametrization of atomic binding energies:
349 //*     parameter ( fertho = 15.73       e-9 )
350 //*     parameter ( expebn = 7.e+00 / 3.e+00  )
351 //*     parameter ( bexc12 = fertho * 65.41634134195703e+00 )
352 //*  new Fermi-Thomas parametrization of atomic binding energies:
353 const Double_t fertho = 14.33e-9;
354 const Double_t expebn = 2.39e+00;
355 const Double_t bexc12 = fertho*72.40715579499394e+00;
356 const Double_t amunmu = hlfhlf*amelct-bexc12/12.e+00;
357 const Double_t amuc12 = amugev-amunmu;
358 //*
359
360 typedef struct {
361    Int_t    lfluka;
362    Int_t    lgbias;
363    Int_t    lgbana;
364    Int_t    lflgeo;
365    Int_t    loflts;
366    Int_t    lusrin;
367    Int_t    lnmgeo;
368    Int_t    lnminp;
369    Int_t    lfdrtr;
370    Int_t    kflgeo;
371    Int_t    kfldnr;
372 } globalCommon;
373 #define GLOBAL COMMON_BLOCK(GLOBAL,global)
374 COMMON_BLOCK_DEF(globalCommon,GLOBAL);
375 }
376
377 #endif