]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEANT321/gphys/gdrela.F
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gphys / gdrela.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:21:23 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.21 by S.Giani
11*-- Author :
12 SUBROUTINE GDRELA
13C.
14C. ******************************************************************
15C. * *
16C. * Initialise ionisation energy loss by filling proton DE/DX *
17C. * tables for each material. *
18C. * *
19C. * For chemical mixtures,compounds & molecules the approximation *
20C. * is made that *
21C. * *
22C. * DE/DX = W(1)*DE/DX(1)+W(2)*DE/DX(2)...+W(N)*DE/DX(N) *
23C. * with, *
24C. * DE/DX(i) appropriate to the i'th constituent. *
25C. * *
26C. * For mixtures W(i) = fractional wght of each element. *
27C. * For molecules W(i) = No. atoms*atomic wght/molecular wght. *
28C. * *
29C. * ==>Called by : GPHYSI *
30C. * Authors R.Brun, G.Patrick ********* *
31C. * *
32C. ******************************************************************
33C.
34#include "geant321/gcbank.inc"
35#include "geant321/gcmulo.inc"
36#include "geant321/gcjloc.inc"
37#include "geant321/gctrak.inc"
38#include "geant321/gconsp.inc"
39#include "geant321/gcmate.inc"
40C.
41C. ------------------------------------------------------------------
42C.
43C Number of constituents(ie. element,mixture or compound).
44C
45 NLMAT = Q(JMA+11)
46 NLMAT = IABS(NLMAT)
47 IF (NLMAT.EQ.0) GO TO 999
48 IF(Z.LT.1.) GO TO 999
49C
50 JEL1=LQ(JMA-1)
51 JEL2=LQ(JMA-2)
52 JEL3=LQ(JMA-3)
53C
54 ICHAN=IEKBIN
55 T = ELOW(ICHAN)
56 T1 = 10.**(EKBIN(1)+(ICHAN-0.5)/GEKA)
57C
58C==========> A,Ionisation losses for particles other than electrons
59C Simple element.
60C
61 IF (NLMAT.EQ.1) THEN
62 CALL GDRELP(A,Z,DENS,T,DEDX)
63 IF(DEDX.LT.0.)DEDX=0.
64*
65* *** auxiliary integration point for Range tables
66 IF(ICHAN.NE.NEK1) THEN
67 CALL GDRELP(A,Z,DENS,T1,DEDX1)
68 IF(DEDX1.LT.0.)DEDX1=0.
69 ENDIF
70 ELSE
71C
72C Mixture/compound : Loop over chemical constituents.
73C
74 DEDX = 0.
75 DEDX1 = 0.
76 DO 10 L=1,NLMAT
77 AA = Q(JMIXT+L)
78 ZZ = Q(JMIXT+NLMAT+L)
79 WGHT = Q(JMIXT+2*NLMAT+L)
80 CALL GDRELP(AA,ZZ,DENS*WGHT,T,DEDXC)
81 IF(DEDXC.LT.0.)DEDXC=0.
82 DEDX = DEDX + WGHT*DEDXC
83*
84* *** auxiliary integration point for Range tables
85 IF(ICHAN.NE.NEK1) THEN
86 CALL GDRELP(AA,ZZ,DENS*WGHT,T1,DEDXC1)
87 IF(DEDXC1.LT.0.)DEDXC1=0.
88 DEDX1 = DEDX1 + WGHT*DEDXC1
89 ENDIF
90 10 CONTINUE
91 ENDIF
92C
93 Q(JEL3+ICHAN)=Q(JEL3+ICHAN)+DEDX*DENS
94 IF(ICHAN.NE.NEK1) THEN
95 WS(NEKBIN*3+ICHAN) = WS(NEKBIN*3+ICHAN)+DEDX1*DENS
96 ENDIF
97C
98C===========> B, Ionisation losses for muons
99C
100C Simple element
101 IF(NLMAT.EQ.1) THEN
102 CALL GDRELM(A,Z,DENS,T,DEDX)
103 IF(DEDX.LT.0.)DEDX=0.
104*
105* *** auxiliary integration point for Range tables
106 IF(ICHAN.NE.NEK1) THEN
107 CALL GDRELM(A,Z,DENS,T1,DEDX1)
108 IF(DEDX1.LT.0.)DEDX1=0.
109 ENDIF
110 ELSE
111C
112C Mixture/compound
113C
114 DEDX = 0.
115 DEDX1 = 0.
116 DO 20 L=1,NLMAT
117 AA=Q(JMIXT+L)
118 ZZ=Q(JMIXT+NLMAT+L)
119 WGHT=Q(JMIXT+2*NLMAT+L)
120 CALL GDRELM(AA,ZZ,DENS*WGHT,T,DEDXC)
121 IF(DEDXC.LT.0.)DEDXC=0.
122 DEDX=DEDX+WGHT*DEDXC
123*
124* *** auxiliary integration point for Range tables
125 IF(ICHAN.NE.NEK1) THEN
126 CALL GDRELM(AA,ZZ,DENS*WGHT,T1,DEDXC1)
127 IF(DEDXC1.LT.0.)DEDXC1=0.
128 DEDX1 = DEDX1 + WGHT*DEDXC1
129 ENDIF
130 20 CONTINUE
131 ENDIF
132C
133 Q(JEL2+ICHAN)=Q(JEL2+ICHAN)+DEDX*DENS
134 IF(ICHAN.NE.NEK1) THEN
135 WS(NEKBIN*2+ICHAN) = WS(NEKBIN*2+ICHAN)+DEDX1*DENS
136 ENDIF
137C
138C===========> C, Ionisation losses for electrons/positrons
139C
140 CALL GDRELE(T,-1.,JMA,DEDX)
141 Q(JEL1+ICHAN)=Q(JEL1+ICHAN)+DEDX
142 CALL GDRELE(T,+1.,JMA,DEDX)
143 Q(JEL1+ICHAN+NEK1)=Q(JEL1+ICHAN+NEK1)+DEDX
144*
145* *** auxiliary integration point for Range tables
146 IF(ICHAN.NE.NEK1) THEN
147 CALL GDRELE(T1,-1.,JMA,DEDX1)
148 WS(ICHAN)=WS(ICHAN)+DEDX1
149 CALL GDRELE(T1,+1.,JMA,DEDX1)
150 WS(NEKBIN+ICHAN)=WS(NEKBIN+ICHAN)+DEDX1
151 ENDIF
152C
153 999 END