1 |
cafagna |
3.1 |
* |
2 |
pamela |
3.2 |
* $Id: gpgacl.F,v 3.1.1.1 2002/07/11 16:02:15 cafagna Exp $ |
3 |
|
|
* |
4 |
|
|
* $Log: gpgacl.F,v $ |
5 |
|
|
* Revision 3.1.1.1 2002/07/11 16:02:15 cafagna |
6 |
|
|
* First GPAMELA release on CVS |
7 |
cafagna |
3.1 |
* |
8 |
|
|
* |
9 |
|
|
#if defined(GPAMELA_GARFIELD) |
10 |
|
|
*CMZ : 3.00/00 16/07/2001 17.26.37 by Unknown |
11 |
|
|
*-- Author : Marialuigia Ambriola 02/05/2001 |
12 |
|
|
SUBROUTINE GPGACL(IDPART,VPART,VXYZ,ECLTOT,NCLUS) |
13 |
|
|
******************************************************************************** |
14 |
|
|
* |
15 |
|
|
* A silly subroutine to interface GARFIELD. It needs the particle and |
16 |
|
|
* track parameter to be passed to GARFIELD. It returns the number of |
17 |
|
|
* clusters generated and the total energy released in MeV |
18 |
|
|
* |
19 |
|
|
* Varibles definitions: |
20 |
|
|
* IN |
21 |
|
|
* - IDPART, GEANT particle ID |
22 |
|
|
* - VPART , real array containing particle characteristics. |
23 |
|
|
* VPART(1) = particle MASS (MeV) |
24 |
|
|
* VPART(2) = particle charge |
25 |
|
|
* VPART(3) = particle KInetic Energy |
26 |
|
|
* - VXYZ, real array containing the track starting and ending points |
27 |
|
|
* VXYZ(1) = X starting point |
28 |
|
|
* VXYZ(2) = Y starting point |
29 |
|
|
* VXYZ(3) = Z starting point |
30 |
|
|
* VXYZ(4) = X ending point |
31 |
|
|
* VXYZ(5) = Y ending point |
32 |
|
|
* VXYZ(6) = Z ending point |
33 |
|
|
* |
34 |
|
|
* OUT |
35 |
|
|
* - ECLTOT, Total energy released in the track, in MeV |
36 |
|
|
* - NCLUS , Number of clusters generated along the track |
37 |
|
|
* |
38 |
|
|
* Called by: <USER> |
39 |
|
|
* |
40 |
|
|
* By Caf & ML on 2 May 2001 |
41 |
|
|
* |
42 |
|
|
******************************************************************************** |
43 |
|
|
IMPLICIT NONE |
44 |
|
|
* |
45 |
|
|
* Garfield commons |
46 |
|
|
* |
47 |
|
|
#include "dimensions.inc" |
48 |
|
|
#include "parameters.inc" |
49 |
|
|
* |
50 |
|
|
* |
51 |
|
|
* Local variables |
52 |
|
|
* |
53 |
|
|
#include "gcunit.inc" |
54 |
|
|
REAL VPART(3),VXYZ(6),ECLTOT |
55 |
|
|
INTEGER IDPART,NCLUS,IFAIL |
56 |
|
|
LOGICAL DONE |
57 |
pamela |
3.2 |
LOGICAL MASS,CHARGE,ENER |
58 |
cafagna |
3.1 |
REAL XCLS,YCLS,ZCLS,ECLS |
59 |
|
|
INTEGER NPAIR |
60 |
|
|
* |
61 |
|
|
* Start filling in the particle properties and the track mode type (ITRTYPE) |
62 |
|
|
* |
63 |
pamela |
3.2 |
MASS=.FALSE. |
64 |
|
|
CHARGE=.FALSE. |
65 |
|
|
ENER=.FALSE. |
66 |
|
|
* |
67 |
cafagna |
3.1 |
CALL GPGAPART(IDPART,IFAIL) |
68 |
|
|
* |
69 |
|
|
* No HEED corrispondence |
70 |
|
|
* |
71 |
pamela |
3.2 |
cml WRITE(CHMAIL,10100) |
72 |
|
|
cml CALL GMAIL(1,0) |
73 |
cafagna |
3.1 |
TRMASS=VPART(1) |
74 |
|
|
TRCHAR=VPART(2) |
75 |
|
|
WRITE(PNAME,10000)IDPART |
76 |
|
|
10000 FORMAT('GEANT',I3) |
77 |
|
|
NCPNAM=8 |
78 |
|
|
ITRTYP=4 |
79 |
pamela |
3.2 |
IF(TRMASS.LT.0.) THEN |
80 |
|
|
WRITE(CHMAIL,10300) |
81 |
|
|
CALL GMAIL(1,0) |
82 |
|
|
ELSE |
83 |
|
|
MASS=.TRUE. |
84 |
|
|
ENDIF |
85 |
|
|
IF(ABS(TRCHAR).LT.0.99.OR.ABS(TRCHAR).GT.1.01) THEN |
86 |
|
|
WRITE(CHMAIL,10400) |
87 |
|
|
CALL GMAIL(1,0) |
88 |
|
|
ELSE |
89 |
|
|
CHARGE=.TRUE. |
90 |
|
|
ENDIF |
91 |
cafagna |
3.1 |
* |
92 |
|
|
* The particle is definited |
93 |
|
|
* |
94 |
|
|
TRENER = VPART(3) |
95 |
pamela |
3.2 |
IF(TRENER.LE.0.) THEN |
96 |
|
|
WRITE(CHMAIL,10100) |
97 |
|
|
CALL GMAIL(1,0) |
98 |
|
|
ELSE |
99 |
|
|
ENER=.TRUE. |
100 |
|
|
ENDIF |
101 |
|
|
IF(MASS.AND.CHARGE.AND.ENER)THEN |
102 |
|
|
TRFLAG(2)=.TRUE. |
103 |
|
|
ELSE |
104 |
|
|
TRFLAG(2)=.FALSE. |
105 |
|
|
ENDIF |
106 |
cafagna |
3.1 |
* PRINT*,'TRFLAG=',TRFLAG(1),TRFLAG(2),TRFLAG(3),TRFLAG(4),TRFLAG(5) |
107 |
|
|
* TRFLAG(2) = .TRUE. |
108 |
|
|
* |
109 |
|
|
* Store the track parameters |
110 |
|
|
* |
111 |
|
|
XT0 = VXYZ(1) |
112 |
|
|
YT0 = VXYZ(2) |
113 |
|
|
ZT0 = VXYZ(3) |
114 |
|
|
XT1 = VXYZ(4) |
115 |
|
|
YT1 = VXYZ(5) |
116 |
|
|
ZT1 = VXYZ(6) |
117 |
|
|
* TRFLAG(1) = .TRUE. |
118 |
|
|
* |
119 |
|
|
* Initialize the track |
120 |
|
|
* |
121 |
|
|
CALL TRACLI |
122 |
|
|
* |
123 |
|
|
* Track it until DONE |
124 |
|
|
* |
125 |
|
|
ECLTOT = 0 |
126 |
|
|
NCLUS = 0 |
127 |
|
|
* PRINT*,'LTRMS,LTRDEL,LTREXB=',LTRMS,LTRDEL,LTREXB |
128 |
|
|
* PRINT*,'BEFORE' |
129 |
|
|
* PRINT*,'XT0,YT0,ZT0=',XT0,YT0,ZT0 |
130 |
|
|
* PRINT*,'VPART(1)=',VPART(1) |
131 |
|
|
10 CALL TRACLS(XCLS,YCLS,ZCLS,ECLS,NPAIR,DONE,IFAIL) |
132 |
|
|
IF(DONE) THEN |
133 |
|
|
C # The cluster generation is over |
134 |
|
|
GO TO 20 |
135 |
|
|
ENDIF |
136 |
|
|
IF(IFAIL.NE.0. ) THEN |
137 |
|
|
C # An error occurred |
138 |
|
|
WRITE(CHMAIL,10200) |
139 |
|
|
CALL GMAIL(1,0) |
140 |
|
|
GO TO 20 |
141 |
|
|
ENDIF |
142 |
|
|
c ML: |
143 |
|
|
IF(ECLS.LE.0.) THEN |
144 |
|
|
PRINT*,'ATTENZIONE IN GPGACL, Energia del cluster negativa:' |
145 |
|
|
PRINT*,'ECLS=',ECLS |
146 |
|
|
GO TO 20 |
147 |
|
|
ENDIF |
148 |
|
|
c END ML. |
149 |
|
|
ECLTOT = ECLTOT + ECLS |
150 |
|
|
NCLUS = NCLUS + 1 |
151 |
|
|
GO TO 10 |
152 |
pamela |
3.2 |
C 10100 FORMAT(' GPGACL: ERROR !!!! GEANT particle ID not found in ', |
153 |
|
|
C + 'HEED data base') |
154 |
|
|
10100 FORMAT(' GPGACL: ERROR !!!! Energy is not positive ') |
155 |
cafagna |
3.1 |
10200 FORMAT(' GPGACL: ERROR !!!! Error in cluster generation from ', |
156 |
|
|
+ 'TRACLS') |
157 |
pamela |
3.2 |
10300 FORMAT(' GPGACL: ERROR !!!! Mass is negative ') |
158 |
|
|
10400 FORMAT(' GPGACL: ERROR !!!! Currently only charge +1 or -1') |
159 |
cafagna |
3.1 |
20 RETURN |
160 |
|
|
END |
161 |
|
|
#endif |