Working alice.inp (E. Futo).
[u/mrichter/AliRoot.git] / TFluka / Fdblprc.h
CommitLineData
b9d0a01d 1#ifndef FDBLPRC_H
2#define FDBLPRC_H 1
3
4#include "Rtypes.h"
5#include "cfortran.h"
6extern "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//* *
76const Int_t kalgnm = 2;
77const Int_t kalch8 = 1;
78const Int_t i2algn = 2;
79const Double_t anglgb = 5.0e-16;
80const Double_t anglsq = 2.5e-31;
81const Double_t axcssv = 0.2e+16;
82const Double_t andrfl = 1.0e-38;
83const Double_t avrflw = 1.0e+38;
84const Double_t ainfnt = 1.0e+30;
85const Double_t azrzrz = 1.0e-30;
86const Double_t einfnt = +69.07755278982137e+00;
87const Double_t ezrzrz = -69.07755278982137e+00;
88const Double_t excssv = +35.23192357547063e+00;
89const Double_t englgb = -35.23192357547063e+00;
90const Double_t onemns = 0.999999999999999e+00;
91const Double_t onepls = 1.000000000000001e+00;
92const Double_t csnnrm = 2.0e-15;
93const Double_t dmxtrn = 1.0e+08;
94const 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//*
156const Float_t zersng = 0.e+00;
157const Double_t zerzer = 0.e+00;
158const Double_t oneone = 1.e+00;
159const Double_t twotwo = 2.e+00;
160const Double_t thrthr = 3.e+00;
161const Double_t foufou = 4.e+00;
162const Double_t fivfiv = 5.e+00;
163const Double_t sixsix = 6.e+00;
164const Double_t sevsev = 7.e+00;
165const Double_t eigeig = 8.e+00;
166const Double_t aninen = 9.e+00;
167const Double_t tenten = 10.e+00;
168const Double_t eleven = 11.e+00;
169const Double_t twelve = 12.e+00;
170const Double_t fiften = 15.e+00;
171const Double_t sixten = 16.e+00;
172const Double_t hlfhlf = 0.5e+00;
173const Double_t onethi = oneone/thrthr;
174const Double_t onefou = oneone/foufou;
175const Double_t onefiv = oneone/fivfiv;
176const Double_t onesix = oneone/sixsix;
177const Double_t onesev = oneone/sevsev;
178const Double_t oneeig = oneone/eigeig;
179const Double_t twothi = twotwo/thrthr;
180const Double_t thrfou = thrthr/foufou;
181const Double_t thrtwo = thrthr/twotwo;
182const Double_t pipipi = 3.141592653589793238462643383279e+00;
183const Double_t twopip = 6.283185307179586476925286766559e+00;
184const Double_t pip5o2 = 7.853981633974483096156608458199e+00;
185const Double_t pipisq = 9.869604401089358618834490999876e+00;
186const Double_t pihalf = 1.570796326794896619231321691640e+00;
187const Double_t erfa00 = 0.886226925452758013649083741671e+00;
188const Double_t sqrtpi = 1.772453850905516027298167483341e+00;
189const Double_t sqtwpi = 2.506628274631000502415765284811e+00;
190const Double_t eulero = 0.577215664901532860606512e+00;
191const Double_t eulexp = 1.781072417990197985236504e+00;
192const Double_t eullog = -0.5495393129816448223376619e+00;
193const Double_t e1m2eu = 0.8569023337737540831433017e+00;
194const Double_t eneper = 2.718281828459045235360287471353e+00;
195const Double_t sqrent = 1.648721270700128146848650787814e+00;
196const Double_t sqrtwo = 1.414213562373095048801688724210e+00;
197const Double_t sqrthr = 1.732050807568877293527446341506e+00;
198const Double_t sqrfiv = 2.236067977499789696409173668731e+00;
199const Double_t sqrsix = 2.449489742783178098197284074706e+00;
200const Double_t sqrsev = 2.645751311064590590501615753639e+00;
201const 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//*
288const Double_t clight = 2.99792458e+10;
289const Double_t avogad = 6.0221367e+23;
290const Double_t boltzm = 1.380658e-23;
291const Double_t amelgr = 9.1093897e-28;
292const Double_t plckbr = 1.05457266e-27;
293const Double_t elccgs = 4.8032068e-10;
294const Double_t elcmks = 1.60217733e-19;
295const Double_t amugrm = 1.6605402e-24;
296const Double_t ammumu = 0.113428913e+00;
297const Double_t amprmu = 1.007276470e+00;
298const 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 )
317const Double_t alpfsc = 7.2973530791728595e-3;
318const Double_t fscto2 = 5.3251361962113614e-5;
319const Double_t fscto3 = 3.8859399018437826e-7;
320const Double_t fscto4 = 2.8357075508200407e-9;
321const Double_t plabrc = 0.197327053e+00;
322const Double_t amelct = 0.51099906e-3;
323const Double_t amugev = 0.93149432e+00;
324const Double_t ammuon = 0.105658389e+00;
325const Double_t amprtn = 0.93827231e+00;
326const Double_t amntrn = 0.93956563e+00;
327const Double_t amdeut = 1.87561339e+00;
328const Double_t amalph = 3.72738025692891e+00;
329const Double_t cougfm = elccgs*elccgs/elcmks*(1.e-7)*(1.e+1)*(1.e-9);
330const Double_t rclsel = 2.8179409183694872e-13;
331const Double_t bltzmn = 8.617385e-14;
332const Double_t a0bohr = plabrc/alpfsc/amelct;
333const Double_t gfohb3 = 1.16639e-5;
334const Double_t gfermi = gfohb3*plabrc*plabrc*plabrc;
335const Double_t sin2tw = 0.2319e+00;
336const Double_t prmgnm = 2.792847386e+00;
337const Double_t anmgnm = -1.91304275e+00;
338const Double_t rearth = 6.378140e+8;
339const Double_t auastu = 1.4959787066e+13;
340const Double_t gevmev = 1.0e+3;
341const Double_t ev2gev = 1.0e-9;
342const Double_t gev2ev = 1.0e+9;
343const Double_t emvgev = 1.0e-3;
344const Double_t algvmv = 6.90775527898214e+00;
345const Double_t raddeg = (180.e+00)/pipipi;
346const Double_t degrad = pipipi/(180.e+00);
347const 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:
353const Double_t fertho = 14.33e-9;
354const Double_t expebn = 2.39e+00;
355const Double_t bexc12 = fertho*72.40715579499394e+00;
356const Double_t amunmu = hlfhlf*amelct-bexc12/12.e+00;
357const Double_t amuc12 = amugev-amunmu;
358//*
359
360typedef 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)
374COMMON_BLOCK_DEF(globalCommon,GLOBAL);
375}
376
377#endif