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.06 * |
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. |
13 |
|
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 |
15 |
|
C |
16 |
C 3.4.05 - 3.4.06: (2005-01-12) section order wrong in CLEARSEC, fixed. |
C 3.4.05 - 3.4.06: (2005-01-12) section order wrong in CLEARSEC, fixed. |
17 |
C |
C |
18 |
C 3.4.04 - 3.4.05: (2005-01-05) XE is section y odd not even, fixed. |
C 3.4.04 - 3.4.05: (2005-01-05) XE is section y odd not even, fixed. |
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 |
803 |
endif |
endif |
804 |
C |
C |
805 |
if (check.ne.vect(length)) then |
if (check.ne.vect(length)) then |
|
merror(contr) = 132 |
|
|
chi = chi + 4 |
|
|
lleng = 0 |
|
|
length2 = 0 |
|
|
length = 0 |
|
806 |
C |
C |
807 |
C clear vectors of that section in the common |
C clear vectors of that section in the common |
808 |
C |
C |
809 |
call clearsec |
call clearsec |
810 |
C |
C |
811 |
|
calselftrig(k,1) = check |
812 |
|
calselftrig(k,2) = vect(length) |
813 |
|
c |
814 |
|
merror(contr) = 132 |
815 |
|
chi = chi + 4 |
816 |
|
lleng = 0 |
817 |
|
length2 = 0 |
818 |
|
length = 0 |
819 |
|
c |
820 |
if (ke.eq.1.and.headcor.ne.2) then |
if (ke.eq.1.and.headcor.ne.2) then |
821 |
ic = 10 |
ic = 10 |
822 |
elseif (headcor.eq.2) then |
elseif (headcor.eq.2) then |
957 |
C |
C |
958 |
DO I = 1,11 |
DO I = 1,11 |
959 |
DO J = 1,96 |
DO J = 1,96 |
960 |
DEXY(2,2*I,J) = DEDX2(I,J) |
DEXY(2,2*I,97-J) = DEDX2(I,J) |
961 |
DEXY(1,2*I-1,J) = DEDX4(I,J) |
DEXY(1,2*I-1,J) = DEDX4(I,J) |
962 |
DEXY(2,2*I-1,97-J) = DEDX1(I,J) |
DEXY(2,2*I-1,J) = DEDX1(I,J) |
963 |
DEXY(1,2*I,J) = DEDX3(I,J) |
DEXY(1,2*I,J) = DEDX3(I,J) |
964 |
DEXYC(2,2*I,J) = DEDX2C(I,J) |
DEXYC(2,2*I,97-J) = DEDX2C(I,J) |
965 |
DEXYC(1,2*I-1,J) = DEDX4C(I,J) |
DEXYC(1,2*I-1,J) = DEDX4C(I,J) |
966 |
DEXYC(2,2*I-1,97-J) = DEDX1C(I,J) |
DEXYC(2,2*I-1,J) = DEDX1C(I,J) |
967 |
DEXYC(1,2*I,J) = DEDX3C(I,J) |
DEXYC(1,2*I,J) = DEDX3C(I,J) |
968 |
enddo |
enddo |
969 |
do j = 1,6 |
do j = 1,6 |
970 |
base(2,2*i,j) = base2(i,j) |
base(2,2*i,7-j) = base2(i,j) |
971 |
base(1,2*i-1,j) = base4(i,j) |
base(1,2*i-1,j) = base4(i,j) |
972 |
base(2,2*i-1,7-j) = base1(i,j) |
base(2,2*i-1,j) = base1(i,j) |
973 |
base(1,2*i,j) = base3(i,j) |
base(1,2*i,j) = base3(i,j) |
974 |
enddo |
enddo |
975 |
enddo |
enddo |
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 |
1449 |
DEXYC(1,2*I-1,J) = 0. |
DEXYC(1,2*I-1,J) = 0. |
1450 |
endif |
endif |
1451 |
if (contr.eq.1) then |
if (contr.eq.1) then |
1452 |
DEXY(2,2*I-1,97-J) = 0. |
DEXY(2,2*I-1,J) = 0. |
1453 |
DEXYC(2,2*I-1,97-J) = 0. |
DEXYC(2,2*I-1,J) = 0. |
1454 |
endif |
endif |
1455 |
if (contr.eq.2) then |
if (contr.eq.2) then |
1456 |
DEXY(2,2*I,J) = 0. |
DEXY(2,2*I,97-J) = 0. |
1457 |
DEXYC(2,2*I,J) = 0. |
DEXYC(2,2*I,97-J) = 0. |
1458 |
endif |
endif |
1459 |
enddo |
enddo |
1460 |
do j = 1,6 |
do j = 1,6 |