1 |
*********************************************************************** |
2 |
* |
3 |
C |
4 |
C DBLSC AND DUBSC (LOOK AT THE ROUTINES FOR MORE EXPLANATIONS) , ROUTINES TO |
5 |
C CHECK FOR DOUBLE SHOWER . DBLS IS THE CONTROL FLAG . MEANING : |
6 |
C 0 : NO DOUBLE SHOWER |
7 |
C 1 : DOUBLE SHOWER ONLY ACCORDING TO DBLSC |
8 |
C 3 : TOO LITTLE BENDING FOR THE CHARGED PARTICLE AND SO NO DOUBLE SHOWER |
9 |
C ACCORDING TO DBLSC |
10 |
C 10 : DOUBLE SHOWER ONLY ACCORDING TO DUBSC |
11 |
C 11 : DOUBLE SHOWER ACCORDING TO DBLSC AND TO DUBSC |
12 |
C 13 : CASE 3 + CASE 10 |
13 |
C |
14 |
* |
15 |
***************************************************************************** |
16 |
INTEGER FUNCTION GETDBLSH() |
17 |
c |
18 |
IMPLICIT NONE |
19 |
C |
20 |
INCLUDE 'INTEST.TXT' |
21 |
C |
22 |
C Normal variables definition |
23 |
C |
24 |
C |
25 |
DOUBLE PRECISION al_p(5), |
26 |
& xout(nplav),yout(nplav),zin(nplav) |
27 |
C |
28 |
REAL POS, ANGOL, DEVT |
29 |
REAL DIFX, EQQ,DBLS |
30 |
REAL DBLSQ,RIMP |
31 |
REAL CX,CY, PIANO(NPLAV) |
32 |
REAL BAR(2,NPLAV),DISTX,SHIFT |
33 |
C |
34 |
INTEGER IBAR(2,NPLAV) |
35 |
INTEGER I,J,M,IFAIL,NN |
36 |
INTEGER INDIC |
37 |
C |
38 |
COMMON /SDOUBLE/ POS,ANGOL,DBLSQ,DBLS |
39 |
SAVE /SDOUBLE/ |
40 |
C |
41 |
COMMON / WHERE / CX, CY, PIANO |
42 |
SAVE / WHERE / |
43 |
C |
44 |
COMMON / ANGOLO / BAR, IBAR |
45 |
SAVE / ANGOLO / |
46 |
C |
47 |
C |
48 |
C Begin ! |
49 |
C |
50 |
PIANO(1) = 0. |
51 |
DO I = 2, NPLA |
52 |
IF ( MOD(I,2).EQ.0 ) THEN |
53 |
PIANO(I) = PIANO(I-1) - 8.09 |
54 |
ELSE |
55 |
PIANO(I) = PIANO(I-1) - 10.09 |
56 |
ENDIF |
57 |
ENDDO |
58 |
C |
59 |
CALL VZERO(BAR,2*NPLAV) |
60 |
CALL VZERO(IBAR,2*NPLAV) |
61 |
CALL VZERO(XOUT,NPLAV) |
62 |
CALL VZERO(YOUT,NPLAV) |
63 |
CALL VZERO(DEXY,2*LENSEV) |
64 |
C |
65 |
C FILL THE DEXY MATRIX |
66 |
C |
67 |
DO I = 1,NPLA |
68 |
DO J = 1,96 |
69 |
IF ( MOD(I,2).NE.0 ) THEN |
70 |
IF ( ESTRIP(2,I,J).GT.EMIN ) THEN |
71 |
DEXY(2,I,J) = ESTRIP(2,I,J) |
72 |
ENDIF |
73 |
IF ( ESTRIP(1,I,J).GT.EMIN ) THEN |
74 |
DEXY(1,I,J) = ESTRIP(1,I,J) |
75 |
ENDIF |
76 |
ENDIF |
77 |
IF ( MOD(I,2).EQ.0 ) THEN |
78 |
IF (ESTRIP(2,I,J).GT.EMIN) THEN |
79 |
DEXY(2,I,J) = ESTRIP(2,I,J) |
80 |
ENDIF |
81 |
IF (ESTRIP(1,I,J).GT.EMIN) THEN |
82 |
DEXY(1,I,J) = ESTRIP(1,I,J) |
83 |
ENDIF |
84 |
ENDIF |
85 |
ENDDO |
86 |
ENDDO |
87 |
C |
88 |
C PROJECT TRACK INSIDE THE CALORIMETER |
89 |
C |
90 |
do M = 1, 5 |
91 |
al_p(M) = al_pp(1,M) |
92 |
enddo |
93 |
if (al_p(5).eq.0.) THEN |
94 |
PRINT *,' WARNING: track with R = 0, discarded' |
95 |
GOTO 50 |
96 |
ENDIF |
97 |
C |
98 |
RIMP = ABS(1./AL_P(5)) |
99 |
C |
100 |
DO M = 1,2 |
101 |
DO I = 1,NPLA |
102 |
XOUT(I) = 0. |
103 |
YOUT(I) = 0. |
104 |
IF (MOD(M,2).EQ.0) THEN |
105 |
DISTX = PIANO(I) + ZALIG |
106 |
ELSE |
107 |
DISTX = PIANO(I) - 5.81 + ZALIG |
108 |
ENDIF |
109 |
ZIN(I) = distx / 10. |
110 |
enddo |
111 |
IFAIL = 0 |
112 |
call DOTRACK(NPLA,ZIN,XOUT,YOUT,AL_P,IFAIL) |
113 |
if(IFAIL.ne.0)then |
114 |
goto 50 |
115 |
endif |
116 |
DO I = 1, NPLA |
117 |
NN = 0 |
118 |
IF (M.EQ.2) NN = 1 |
119 |
IF (MOD(I,2).EQ.NN) THEN |
120 |
SHIFT = +0.5 |
121 |
ELSE |
122 |
SHIFT = -0.5 |
123 |
ENDIF |
124 |
C |
125 |
C CHECK IF XOUT OR YOUT ARE NaN |
126 |
C |
127 |
IF (XOUT(I).NE.XOUT(I).OR.YOUT(I).NE.YOUT(I)) THEN |
128 |
GOTO 50 |
129 |
ENDIF |
130 |
C |
131 |
IF (M.EQ.1) THEN |
132 |
BAR(M,I) = XOUT(I)*10. + XALIG |
133 |
ELSE |
134 |
BAR(M,I) = YOUT(I)*10. + YALIG |
135 |
ENDIF |
136 |
C |
137 |
CALL LASTRISCIA(BAR(M,I),IBAR(M,I)) |
138 |
C |
139 |
ENDDO |
140 |
ENDDO |
141 |
C |
142 |
C CALL CLUSTER4 ROUTINE |
143 |
C |
144 |
CALL CLUSTER4 |
145 |
C |
146 |
C CALL DOUBLE SHOWER FINDING ALGORITMHS |
147 |
C |
148 |
DBLSQ = 0. |
149 |
EQQ = 0. |
150 |
INDIC = 0 |
151 |
|
152 |
C DISTD = -870.06 - 0.68 - 5.81 |
153 |
C POS(1) = -DISTD * TAN(THETA) * COS(PHI) + X0 * 10. |
154 |
C & + 122.3 - 1.19 |
155 |
C ANGOL(1) = -TAN(THETA) * COS(PHI) |
156 |
|
157 |
C |
158 |
C POS IS THE PROJECTION OF THE STRAIGHT TRACK FROM S1 TO THE FIRST PLANE OF THE CALO |
159 |
C ANGOL IS THE PROJECTION OF THE ANGLE ON THE X VIEW |
160 |
C BOTH THESE COME FROM THE C++ CODE |
161 |
C |
162 |
C |
163 |
DIFX = ABS(BAR(1,1) - POS) |
164 |
C |
165 |
C |
166 |
C |
167 |
IF (DIFX.LE.10.OR.RIMP.GT.5) THEN |
168 |
INDIC = 3 |
169 |
GO TO 125 |
170 |
ENDIF |
171 |
C |
172 |
DEVT = 0. |
173 |
CALL DBLSC(INDIC,EQQ,DEVT) |
174 |
125 CONTINUE |
175 |
DBLS = FLOAT(INDIC) |
176 |
IF (DBLS.EQ.1.) THEN |
177 |
DBLSQ = EQQ |
178 |
ENDIF |
179 |
C |
180 |
INDIC = 0 |
181 |
EQQ = 0. |
182 |
CALL DUBSC(INDIC,EQQ) |
183 |
IF (INDIC.EQ.1.AND.DBLS.NE.1) DBLSQ = EQQ |
184 |
DBLS = DBLS + 10. * FLOAT(INDIC) |
185 |
C |
186 |
50 CONTINUE |
187 |
RETURN |
188 |
END |
189 |
|