1 |
C |
C |
2 |
C Written by Emiliano Mocchiutti and Mirko Boezio |
C Written by Emiliano Mocchiutti and Mirko Boezio |
3 |
C |
C |
4 |
C * Version: 3.4.08 * |
C * Version: 3.4.10 * |
5 |
C |
C |
6 |
C Changelog: |
C Changelog: |
7 |
C |
C |
8 |
|
C 3.4.09 - 3.4.10: (2006-10-19) Bug, crash when length is too big, fixed (introduced error code 143 = packet length problems); |
9 |
|
C |
10 |
|
C 3.4.08 - 3.4.09: (2006-09-28) XE is not always correctly found, fixed. |
11 |
|
C |
12 |
C 3.4.07 - 3.4.08: (2006-06-29) XO is rotated, not XE!! fixed. |
C 3.4.07 - 3.4.08: (2006-06-29) XO is rotated, not XE!! fixed. |
13 |
C |
C |
14 |
C 3.4.06 - 3.4.07: (2006-06-29) save CRC values in calselftrig(section,1) and calselftrig(section,2) in case of CRC errors |
C 3.4.06 - 3.4.07: (2006-06-29) save CRC values in calselftrig(section,1) and calselftrig(section,2) in case of CRC errors |
116 |
INTEGER NPLA, NCHA, LENSEV |
INTEGER NPLA, NCHA, LENSEV |
117 |
INTEGER*2 ival |
INTEGER*2 ival |
118 |
C |
C |
119 |
PARAMETER (START=50,SEC1ST=1200) |
c PARAMETER (START=50,SEC1ST=1200) |
120 |
|
c PARAMETER (START=300,SEC1ST=1200) |
121 |
|
c PARAMETER (START=500,SEC1ST=1200) |
122 |
|
PARAMETER (SEC1ST=1200) |
123 |
PARAMETER (NPLA=22,NCHA=96,LENSEV=NPLA*NCHA) |
PARAMETER (NPLA=22,NCHA=96,LENSEV=NPLA*NCHA) |
124 |
PARAMETER (ival='FFFF'x) |
PARAMETER (ival='FFFF'x) |
125 |
C |
C |
127 |
C |
C |
128 |
integer lung, SOGLIA0, SEC2ND |
integer lung, SOGLIA0, SEC2ND |
129 |
INTEGER*1 VECTA(lung) |
INTEGER*1 VECTA(lung) |
130 |
INTEGER*2 vect(60000), test |
INTEGER*2 vect(120000), test |
131 |
integer*2 check, crc, e2(4) |
integer*2 check, crc, e2(4) |
132 |
INTEGER*2 length, length2 |
INTEGER*2 length, length2 |
133 |
integer me, m, dumpo, finoa |
integer me, m, dumpo, finoa |
142 |
integer stwerr(4),yescbra, chis, esci, icprima |
integer stwerr(4),yescbra, chis, esci, icprima |
143 |
integer seemcomp, seemfull, cberaw, yesisco, yesisfu,yesisra |
integer seemcomp, seemfull, cberaw, yesisco, yesisfu,yesisra |
144 |
integer ca50, ca50a, ca50b |
integer ca50, ca50a, ca50b |
145 |
|
integer firsttime |
146 |
C |
C |
147 |
real dedx1(11,96),dedx2(11,96),dedx3(11,96),dedx4(11,96) |
real dedx1(11,96),dedx2(11,96),dedx3(11,96),dedx4(11,96) |
148 |
real dedx1c(11,96),dedx2c(11,96),dedx3c(11,96),dedx4c(11,96) |
real dedx1c(11,96),dedx2c(11,96),dedx3c(11,96),dedx4c(11,96) |
169 |
C |
C |
170 |
C Begin ! |
C Begin ! |
171 |
C |
C |
172 |
|
start = 320 |
173 |
|
firsttime = 1 |
174 |
SOGLIA0 = 70 |
SOGLIA0 = 70 |
175 |
|
2 continue |
176 |
C |
C |
177 |
C input length must be > 0, if not go out with error code 142 |
C input length must be > 0, if not go out with error code 142 |
178 |
C |
C |
195 |
write(*,17)l,vecta(l) |
write(*,17)l,vecta(l) |
196 |
enddo |
enddo |
197 |
endif |
endif |
198 |
|
C dumpo = iev |
199 |
C |
C |
200 |
C DETERMINE LENGTH IN WORDS FROM LENGTH IN BYTES |
C DETERMINE LENGTH IN WORDS FROM LENGTH IN BYTES |
201 |
C |
C |
209 |
C |
C |
210 |
C IS LENGTH IS TOO LONG? |
C IS LENGTH IS TOO LONG? |
211 |
C |
C |
212 |
if (lunga.gt.60000.and.dumpo.gt.0) then |
if (lunga.ge.60000.and.dumpo.gt.0) then |
213 |
print *,'Calorimeter WARNING: more than 60000 words!' |
print *,'Calorimeter ERROR: more than 60000 words!' |
214 |
lunga = 60000 |
endif |
215 |
|
if (lunga.ge.60000) then |
216 |
|
if (dumpo.eq.iev) print *,'lung = ',lung |
217 |
|
do i=1,4 |
218 |
|
merror(i)=143 |
219 |
|
enddo |
220 |
|
goto 999 |
221 |
endif |
endif |
222 |
C |
C |
223 |
C PRE-CLEAR VARIABLES |
C PRE-CLEAR VARIABLES |
313 |
C IF WE HAVE NO ROOM FOR A SECTION GO OUT |
C IF WE HAVE NO ROOM FOR A SECTION GO OUT |
314 |
C |
C |
315 |
if ((ic+4).gt.lung.or.esci.eq.1) then |
if ((ic+4).gt.lung.or.esci.eq.1) then |
316 |
|
if (contr.eq.1.and.firsttime.eq.1) then |
317 |
|
if (iev.eq.dumpo) |
318 |
|
& print *,' first section not found retry from zero' |
319 |
|
firsttime = 0 |
320 |
|
start = 1 |
321 |
|
goto 1 |
322 |
|
endif |
323 |
if (headcor.eq.1.and.contr.lt.5) then |
if (headcor.eq.1.and.contr.lt.5) then |
324 |
headcor=-1 |
headcor=-1 |
325 |
ic=ichc |
ic=ichc |
1085 |
enddo |
enddo |
1086 |
c |
c |
1087 |
if ( iev.eq.dumpo ) then |
if ( iev.eq.dumpo ) then |
1088 |
|
do i = 1, 4 |
1089 |
|
print *,' perror(',i,') = ',perror(i) |
1090 |
|
print *,' stwerr(',i,') = ',stwerr(i) |
1091 |
|
enddo |
1092 |
if (perror(3).eq.132.and.perror(4).eq.129) then |
if (perror(3).eq.132.and.perror(4).eq.129) then |
1093 |
do i = 1, 2 |
do i = 1, 2 |
1094 |
do j = 1, 22 |
do j = 1, 22 |
1097 |
enddo |
enddo |
1098 |
enddo |
enddo |
1099 |
enddo |
enddo |
|
do l=1,lung |
|
|
write(*,17)l,vecta(l) |
|
|
enddo |
|
1100 |
endif |
endif |
1101 |
|
do l=1,lung |
1102 |
|
write(*,17)l,vecta(l) |
1103 |
|
enddo |
1104 |
endif |
endif |
1105 |
iev = iev + 1 |
iev = iev + 1 |
1106 |
RETURN |
RETURN |