Minor changes to comply with the new version of AliAltroRawStream (C.Cheshkov)
[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 *
2b11a8dc 68//* routine usrini has been called at least once *
b9d0a01d 69//* lnmgeo = set to true for a name-base geometry input *
70//* lnminp = set to true for a name-base fluka input *
2b11a8dc 71//* Lfrfmt = set to true for a free-format based Fluka input *
b9d0a01d 72//* lfdrtr = set to true for going in/out feeder/flukam at each *
73//* event *
74//* *
75//*---------------------------------------------------------------------*
76//* *
77const Int_t kalgnm = 2;
78const Int_t kalch8 = 1;
79const Int_t i2algn = 2;
80const Double_t anglgb = 5.0e-16;
81const Double_t anglsq = 2.5e-31;
82const Double_t axcssv = 0.2e+16;
83const Double_t andrfl = 1.0e-38;
84const Double_t avrflw = 1.0e+38;
85const Double_t ainfnt = 1.0e+30;
86const Double_t azrzrz = 1.0e-30;
87const Double_t einfnt = +69.07755278982137e+00;
88const Double_t ezrzrz = -69.07755278982137e+00;
89const Double_t excssv = +35.23192357547063e+00;
90const Double_t englgb = -35.23192357547063e+00;
91const Double_t onemns = 0.999999999999999e+00;
92const Double_t onepls = 1.000000000000001e+00;
93const Double_t csnnrm = 2.0e-15;
94const Double_t dmxtrn = 1.0e+08;
71dd9297 95const Double_t rhflmn = 1.0e-10;
b9d0a01d 96//*
97//*======================================================================*
98//*======================================================================*
99//*========= ==========*
100//*========= m a t h e m a t i c a l c o n s t a n t s ==========*
101//*========= ==========*
102//*======================================================================*
103//*======================================================================*
104//* *
105//* numerical constants (single precision): *
106//* *
107//* zersng = 0 *
108//* *
109//* numerical constants (double precision): *
110//* *
111//* zerzer = 0 *
112//* oneone = 1 *
113//* twotwo = 2 *
114//* thrthr = 3 *
115//* foufou = 4 *
116//* fivfiv = 5 *
117//* sixsix = 6 *
118//* sevsev = 7 *
119//* eigeig = 8 *
120//* aninen = 9 *
121//* tenten = 10 *
122//* eleven = 11 *
123//* twelve = 12 *
124//* fiften = 15 *
125//* sixten = 16 *
126//* hlfhlf = 1/2 *
127//* onethi = 1/3 *
128//* onefou = 1/4 *
129//* onefiv = 1/5 *
130//* onesix = 1/6 *
131//* onesev = 1/7 *
132//* oneeig = 1/8 *
133//* twothi = 2/3 *
134//* thrfou = 3/4 *
135//* thrtwo = 3/2 *
136//* pipipi = circumference / diameter *
137//* twopip = 2 x pipipi *
138//* pip5o2 = 5/2 x pipipi *
139//* pipisq = pipipi x pipipi *
140//* pihalf = 1/2 x pipipi *
141//* erfa00 = erf (oo) = 1/2 x square root of pi *
142//* sqtwpi = square root of 2xpi *
143//* eulero = eulero's constant *
144//* eulexp = exp ( eulero ) *
145//* e1m2eu = exp ( 1 - 2 eulero ) *
146//* eneper = "e", base of natural logarithm *
147//* sqrent = square root of "e" *
148//* sqrtwo = square root of 2 *
149//* sqrthr = square root of 3 *
150//* sqrfiv = square root of 5 *
151//* sqrsix = square root of 6 *
152//* sqrsev = square root of 7 *
153//* sqrt12 = square root of 12 *
2b11a8dc 154//* s2fwhm = 2 x square root of 2 x logarithm of 2 *
b9d0a01d 155//* *
156//*----------------------------------------------------------------------*
157//*
158const Float_t zersng = 0.e+00;
159const Double_t zerzer = 0.e+00;
160const Double_t oneone = 1.e+00;
161const Double_t twotwo = 2.e+00;
162const Double_t thrthr = 3.e+00;
163const Double_t foufou = 4.e+00;
164const Double_t fivfiv = 5.e+00;
165const Double_t sixsix = 6.e+00;
166const Double_t sevsev = 7.e+00;
167const Double_t eigeig = 8.e+00;
168const Double_t aninen = 9.e+00;
169const Double_t tenten = 10.e+00;
170const Double_t eleven = 11.e+00;
171const Double_t twelve = 12.e+00;
172const Double_t fiften = 15.e+00;
173const Double_t sixten = 16.e+00;
174const Double_t hlfhlf = 0.5e+00;
175const Double_t onethi = oneone/thrthr;
176const Double_t onefou = oneone/foufou;
177const Double_t onefiv = oneone/fivfiv;
178const Double_t onesix = oneone/sixsix;
179const Double_t onesev = oneone/sevsev;
180const Double_t oneeig = oneone/eigeig;
181const Double_t twothi = twotwo/thrthr;
182const Double_t thrfou = thrthr/foufou;
183const Double_t thrtwo = thrthr/twotwo;
380c2ff0 184const Double_t fouthr = foufou/thrthr;
b9d0a01d 185const Double_t pipipi = 3.141592653589793238462643383279e+00;
186const Double_t twopip = 6.283185307179586476925286766559e+00;
187const Double_t pip5o2 = 7.853981633974483096156608458199e+00;
188const Double_t pipisq = 9.869604401089358618834490999876e+00;
189const Double_t pihalf = 1.570796326794896619231321691640e+00;
190const Double_t erfa00 = 0.886226925452758013649083741671e+00;
191const Double_t sqrtpi = 1.772453850905516027298167483341e+00;
192const Double_t sqtwpi = 2.506628274631000502415765284811e+00;
193const Double_t eulero = 0.577215664901532860606512e+00;
194const Double_t eulexp = 1.781072417990197985236504e+00;
195const Double_t eullog = -0.5495393129816448223376619e+00;
196const Double_t e1m2eu = 0.8569023337737540831433017e+00;
197const Double_t eneper = 2.718281828459045235360287471353e+00;
198const Double_t sqrent = 1.648721270700128146848650787814e+00;
199const Double_t sqrtwo = 1.414213562373095048801688724210e+00;
200const Double_t sqrthr = 1.732050807568877293527446341506e+00;
201const Double_t sqrfiv = 2.236067977499789696409173668731e+00;
202const Double_t sqrsix = 2.449489742783178098197284074706e+00;
203const Double_t sqrsev = 2.645751311064590590501615753639e+00;
204const Double_t sqrt12 = 3.464101615137754587054892683012e+00;
2b11a8dc 205const Double_t s2fwhm = 2.354820045030949e+00;
380c2ff0 206const Double_t twolog = 0.693147180559945309417232121458e+00;
b9d0a01d 207//*
208//*======================================================================*
209//*======================================================================*
210//*========= ==========*
211//*========= p h y s i c a l c o n s t a n t s ==========*
212//*========= ==========*
213//*======================================================================*
214//*======================================================================*
215//* *
216//* primary constants: *
217//* *
218//* clight = speed of light in cm s-1 *
219//* avogad = avogadro number *
220//* boltzm = k boltzmann constant (j k-1) *
221//* amelgr = electron mass (g) *
222//* plckbr = reduced planck constant (erg s) *
223//* elccgs = elementary charge (cgs unit) *
224//* elcmks = elementary charge (mks unit) *
225//* amugrm = atomic mass unit (g) *
226//* ammumu = muon mass (amu) *
227//* amprmu = proton mass (amu) *
228//* amnemu = neutron mass (amu) *
229//* *
230//* derived constants: *
231//* *
232//* alpfsc = fine structure constant = e^2/(hbar c) (cgs units) *
233//* amelct = electron mass (gev) = 10^-16amelgr clight^2 / elcmks*
234//* amugev = atomic mass unit (gev) = 10^-16amugrm clight^2 *
235//* / elcmks *
236//* ammuon = muon mass (gev) = ammumu * amugev *
237//* amprtn = proton mass (gev) = amprmu * amugev *
238//* amntrn = neutron mass (gev) = amnemu * amugev *
239//* amdeut = deuteron mass (gev) *
240//* amalph = alpha mass (gev) (derived from the excess mass *
241//* and an (approximate) atomic binding not a really *
242//* measured constant) *
243//* cougfm = e^2 (gev fm) = elccgs^2 / elcmks * 10^-7 * 10^-9 *
244//* * 10^13 (10^..=erg cm->joule cm->gev cm->gev fm *
245//* it is equal to 0.00144 gev fm *
246//* fscto2 = (fine structure constant)^2 *
247//* fscto3 = (fine structure constant)^3 *
248//* fscto4 = (fine structure constant)^4 *
249//* plabrc = reduced planck constant times the light velocity *
250//* expressed in gev fm *
251//* rclsel = classical electron radius (cm) = e^2 / (m_e c^2) *
252//* bltzmn = k boltzmann constant in gev k-1 *
253//* a0bohr = bohr radius, hbar^2 / ( m_e e^2) (fm) = plabrc**2 *
254//* / amelct / cougfm, or equivalently, *
255//* plabrc / alpfsc / amelct *
256//* gfohb3 = fermi constant, g_f/(hbar c)^3, in gev^-2 *
257//* gfermi = fermi constant in gev fm^3 *
258//* sin2tw = sin^2 theta_weinberg *
259//* prmgnm = proton magnetic moment (magneton) *
260//* anmgnm = neutron magnetic moment (magneton) *
2b11a8dc 261//* s0thms = sigma_0 Thomson, 8/3 pi r_e^2 (mb) *
b9d0a01d 262//* *
263//* astronomical constants: *
264//* *
265//* rearth = earth equatorial radius (cm) *
266//* auastu = astronomical unit (cm) *
267//* *
268//* conversion constants: *
269//* *
270//* gevmev = from gev to mev *
271//* emvgev = from mev to gev *
272//* gev2ev = from gev to ev *
273//* ev2gev = from ev to gev *
274//* algvmv = from gev to mev, log *
275//* raddeg = from radians to degrees *
276//* degrad = from degrees to radians *
277//* gevomg = from (photon) energy [gev] in 2pi x frequency [s^-1]*
2b11a8dc 278//* cmq2mb = from square centimetres to millibarns *
b9d0a01d 279//* *
280//* useful constants: *
281//* *
282//* fertho = constant to be used in the fermi-thomas approxima- *
283//* ted expression for atomic binding energies *
284//* expebn = exponent to be used in the fermi-thomas approxima- *
285//* ted expression for atomic binding energies *
286//* b_atomic (z) = fertho x z^expebn (gev) *
287//* bexc12 = fermi-thomas approximated expression for 12-c ato- *
288//* mic binding energies (gev) *
289//* amunmu = difference between the atomic and nuclear mass units*
290//* amuc12 = "nuclear" mass unit = 1/12 m_nucl (12-c), *
291//* m_nucl (12-c) = m_atom (12-c) - 6 m_e + b_atom(12-c)*
292//* *
293//*----------------------------------------------------------------------*
294//*
295const Double_t clight = 2.99792458e+10;
296const Double_t avogad = 6.0221367e+23;
297const Double_t boltzm = 1.380658e-23;
298const Double_t amelgr = 9.1093897e-28;
299const Double_t plckbr = 1.05457266e-27;
300const Double_t elccgs = 4.8032068e-10;
301const Double_t elcmks = 1.60217733e-19;
302const Double_t amugrm = 1.6605402e-24;
303const Double_t ammumu = 0.113428913e+00;
304const Double_t amprmu = 1.007276470e+00;
305const Double_t amnemu = 1.008664904e+00;
2b11a8dc 306//* const Double_t alpfsc = 1.e+00 / 137.035989561e+00
307//* const Double_t fscto2 = alpfsc * alpfsc
308//* const Double_t fscto3 = fscto2 * alpfsc
309//* const Double_t fscto4 = fscto3 * alpfsc
b9d0a01d 310//* it is important to set the electron mass exactly with the same
311//* rounding as in the mass tables, so use the explicit expression
2b11a8dc 312//* const Double_t amelct = 1.e-16 * amelgr * clight * clight / elcmks
b9d0a01d 313//* it is important to set the amu mass exactly with the same
314//* rounding as in the mass tables, so use the explicit expression
2b11a8dc 315//* const Double_t amugev = 1.e-16 * amugrm * clight * clight / elcmks
b9d0a01d 316//* it is important to set the muon,proton,neutron masses exactly with
317//* the same rounding as in the mass tables, so use the explicit
318//* expression
2b11a8dc 319//* const Double_t ammuon = ammumu * amugev
320//* const Double_t amprtn = amprmu * amugev
321//* const Double_t amntrn = amnemu * amugev
322//* const Double_t rclsel = elccgs * elccgs / clight / clight / amelgr
323//* const Double_t bltzmn = boltzm / elcmks * 1.e-09
b9d0a01d 324const Double_t alpfsc = 7.2973530791728595e-3;
325const Double_t fscto2 = 5.3251361962113614e-5;
326const Double_t fscto3 = 3.8859399018437826e-7;
327const Double_t fscto4 = 2.8357075508200407e-9;
328const Double_t plabrc = 0.197327053e+00;
329const Double_t amelct = 0.51099906e-3;
330const Double_t amugev = 0.93149432e+00;
331const Double_t ammuon = 0.105658389e+00;
332const Double_t amprtn = 0.93827231e+00;
333const Double_t amntrn = 0.93956563e+00;
334const Double_t amdeut = 1.87561339e+00;
335const Double_t amalph = 3.72738025692891e+00;
2b11a8dc 336const Double_t cougfm = elccgs*elccgs/elcmks*(1.e-7)*(1.e+13)*(1.e-9);
b9d0a01d 337const Double_t rclsel = 2.8179409183694872e-13;
71dd9297 338const Double_t alamb0 = twotwo * pipipi * rclsel / alpfsc;
b9d0a01d 339const Double_t bltzmn = 8.617385e-14;
340const Double_t a0bohr = plabrc/alpfsc/amelct;
341const Double_t gfohb3 = 1.16639e-5;
342const Double_t gfermi = gfohb3*plabrc*plabrc*plabrc;
343const Double_t sin2tw = 0.2319e+00;
344const Double_t prmgnm = 2.792847386e+00;
345const Double_t anmgnm = -1.91304275e+00;
346const Double_t rearth = 6.378140e+8;
347const Double_t auastu = 1.4959787066e+13;
348const Double_t gevmev = 1.0e+3;
349const Double_t ev2gev = 1.0e-9;
350const Double_t gev2ev = 1.0e+9;
351const Double_t emvgev = 1.0e-3;
2b11a8dc 352const Double_t cmq2mb = 1.0e+27;
71dd9297 353const Double_t fmb2ba = 1.0e-3;
354const Double_t bar2mb = 1.0e+3;
355const Double_t fmb2fs = 1.0e-1;
356const Double_t fms2mb = 1.0e+1;
b9d0a01d 357const Double_t algvmv = 6.90775527898214e+00;
358const Double_t raddeg = (180.e+00)/pipipi;
359const Double_t degrad = pipipi/(180.e+00);
360const Double_t gevomg = clight*(1.e+13)/plabrc;
2b11a8dc 361const Double_t s0thms = eigeig / thrthr * pipipi * rclsel * rclsel * cmq2mb;
b9d0a01d 362//* old Fermi-Thomas parametrization of atomic binding energies:
2b11a8dc 363//* const Double_t fertho = 15.73 e-9
364//* const Double_t expebn = 7.e+00 / 3.e+00
365//* const Double_t bexc12 = fertho * 65.41634134195703e+00
b9d0a01d 366//* new Fermi-Thomas parametrization of atomic binding energies:
367const Double_t fertho = 14.33e-9;
368const Double_t expebn = 2.39e+00;
369const Double_t bexc12 = fertho*72.40715579499394e+00;
370const Double_t amunmu = hlfhlf*amelct-bexc12/12.e+00;
371const Double_t amuc12 = amugev-amunmu;
ba671b4d 372//* Old MeV units:
373const Double_t amemev = gevmev * amelct;
b9d0a01d 374//*
375
376typedef struct {
377 Int_t lfluka;
378 Int_t lgbias;
379 Int_t lgbana;
380 Int_t lflgeo;
381 Int_t loflts;
382 Int_t lusrin;
383 Int_t lnmgeo;
384 Int_t lnminp;
2b11a8dc 385 Int_t lfrfmt;
b9d0a01d 386 Int_t lfdrtr;
387 Int_t kflgeo;
388 Int_t kfldnr;
389} globalCommon;
390#define GLOBAL COMMON_BLOCK(GLOBAL,global)
391COMMON_BLOCK_DEF(globalCommon,GLOBAL);
392}
393
394#endif