31 |
c if(runerror.eq.-1) goto 24 |
c if(runerror.eq.-1) goto 24 |
32 |
if(runerror.eq.-1) goto 2222 |
if(runerror.eq.-1) goto 2222 |
33 |
if(runerror.eq.1) then |
if(runerror.eq.1) then |
34 |
print*,' ' |
c print*,' ' |
35 |
print*,'readraw: END OF CPU PACKET ' |
c print*,'readraw: END OF CPU PACKET ' |
36 |
print*,'______________________________________ ' |
c print*,'______________________________________ ' |
37 |
c goto 9900 !end loop on files |
c goto 9900 !end loop on files |
38 |
c goto 8800 !end loop on views (DSP pkt) |
c goto 8800 !end loop on views (DSP pkt) |
39 |
goto 2222 |
goto 2222 |
40 |
endif |
endif |
41 |
|
|
42 |
if(checkheader.ne.2) then |
if(checkheader.ne.2) then |
43 |
print*,'>>>> ERROR <<<< (trkeventpkt)' |
c print*,'>>>> ERROR <<<< (trkeventpkt)' |
44 |
print*,'>>>> CPU packet type ',!pkt_type, |
c print*,'>>>> CPU packet type ',!pkt_type, |
45 |
$ ' does not match DSP type ',checkheader |
c $ ' does not match DSP type ',checkheader |
46 |
c goto 9909 ! next event (==> search another CPU header) |
c goto 9909 ! next event (==> search another CPU header) |
47 |
DAQmode_temp = ishft(iand(header(1),z'03f0'),-4) |
DAQmode_temp = ishft(iand(header(1),z'03f0'),-4) |
48 |
DSPnumber_temp = iand(header(1),z'000f') |
DSPnumber_temp = iand(header(1),z'000f') |
49 |
print*,' -----------------------------------' |
c print*,' -----------------------------------' |
50 |
$ ,iview |
c $ ,iview |
51 |
print*,' DSP number-----',int(DSPnumber_temp) |
c print*,' DSP number-----',int(DSPnumber_temp) |
52 |
print*,' DAQ mode-------',int(DAQmode_temp) |
c print*,' DAQ mode-------',int(DAQmode_temp) |
53 |
print*,' -----------------------------------' |
c print*,' -----------------------------------' |
54 |
goto 2525 !next view (==> search another DSP header) |
goto 2525 !next view (==> search another DSP header) |
55 |
endif |
endif |
56 |
|
|
60 |
c if(runerror.eq.1) goto 23 |
c if(runerror.eq.1) goto 23 |
61 |
if(runerror.eq.1) goto 2222 |
if(runerror.eq.1) goto 2222 |
62 |
|
|
63 |
print*,' ' |
c print*,' ' |
64 |
print*,' -----------------------------------',iview |
c print*,' -----------------------------------',iview |
65 |
print*,' DSP number-----',DSPnumber_dat |
c print*,' DSP number-----',DSPnumber_dat |
66 |
print*,' DAQ mode-------',DAQmode_dat |
c print*,' DAQ mode-------',DAQmode_dat |
67 |
print*,' event number ',eventn_dat |
c print*,' event number ',eventn_dat |
68 |
|
|
69 |
trk_DSP_ok(DSPnumber_dat)=1 |
trk_DSP_ok(DSPnumber_dat)=1 |
70 |
|
|
95 |
integer ffd_pkt !pkt file descriptor |
integer ffd_pkt !pkt file descriptor |
96 |
!(file temporaneo) |
!(file temporaneo) |
97 |
character*60 event_file_name !nome file |
character*60 event_file_name !nome file |
98 |
|
integer lun_pkt |
99 |
|
parameter (lun_pkt=10) |
100 |
open(unit=lun_pkt, |
open(unit=lun_pkt, |
101 |
$ name=EVENT_FILE_NAME(1:lnblnk(EVENT_FILE_NAME)), |
$ name=EVENT_FILE_NAME(1:lnblnk(EVENT_FILE_NAME)), |
102 |
$ status='old', |
$ status='old', |
110 |
c if(runerror.eq.-1) goto 24 |
c if(runerror.eq.-1) goto 24 |
111 |
if(runerror.eq.-1) goto 2222 |
if(runerror.eq.-1) goto 2222 |
112 |
if(runerror.eq.1) then |
if(runerror.eq.1) then |
113 |
print*,' ' |
c print*,' ' |
114 |
print*,'readraw: END OF CPU PACKET ' |
c print*,'readraw: END OF CPU PACKET ' |
115 |
print*,'______________________________________ ' |
c print*,'______________________________________ ' |
116 |
goto 2222 !end loop on views (DSP pkt) |
goto 2222 !end loop on views (DSP pkt) |
117 |
endif |
endif |
118 |
if(checkheader.ne.3) then |
if(checkheader.ne.3) then |
119 |
print*,'>>>> ERROR <<<< (trkcalibpkt)' |
c print*,'>>>> ERROR <<<< (trkcalibpkt)' |
120 |
print*,'>>>> CPU packet type ',!pkt_type, |
c print*,'>>>> CPU packet type ',!pkt_type, |
121 |
$ ' does not match DSP type ',checkheader |
c $ ' does not match DSP type ',checkheader |
122 |
DAQmode_temp = ishft(iand(header(1),z'03f0'),-4) |
DAQmode_temp = ishft(iand(header(1),z'03f0'),-4) |
123 |
DSPnumber_temp = iand(header(1),z'000f') |
DSPnumber_temp = iand(header(1),z'000f') |
124 |
print*,' -----------------------------------' |
c print*,' -----------------------------------' |
125 |
$ ,iview |
c $ ,iview |
126 |
print*,' DSP number-----',int(DSPnumber_temp) |
c print*,' DSP number-----',int(DSPnumber_temp) |
127 |
print*,' DAQ mode-------',int(DAQmode_temp) |
c print*,' DAQ mode-------',int(DAQmode_temp) |
128 |
print*,' -----------------------------------' |
c print*,' -----------------------------------' |
129 |
goto 2424 !next view (==> search another DSP header) |
goto 2424 !next view (==> search another DSP header) |
130 |
endif |
endif |
131 |
|
|
136 |
if(runerror.eq.1) goto 2222 |
if(runerror.eq.1) goto 2222 |
137 |
|
|
138 |
|
|
139 |
print*,'Calibration packet ==> ',iview |
c print*,'Calibration packet ==> ',iview |
140 |
|
|
141 |
print*,'---- Calibration packet ',iview,' ----' |
c print*,'---- Calibration packet ',iview,' ----' |
142 |
print*,' DSP number ',DSPnumber_cal |
c print*,' DSP number ',DSPnumber_cal |
143 |
print*,' DAQ mode ',DAQmode_cal |
c print*,' DAQ mode ',DAQmode_cal |
144 |
print*,' calibration run ',calibrationnumber |
c print*,' calibration run ',calibrationnumber |
145 |
print*,' n. event used ',nused_event |
c print*,' n. event used ',nused_event |
146 |
print*,' <PED> ladder 1 ',ped_1 |
c print*,' <PED> ladder 1 ',ped_1 |
147 |
print*,' <PED> ladder 2 ',ped_2 |
c print*,' <PED> ladder 2 ',ped_2 |
148 |
print*,' <PED> ladder 3 ',ped_3 |
c print*,' <PED> ladder 3 ',ped_3 |
149 |
print*,' <SIG> ladder 1 ',sig_1 |
c print*,' <SIG> ladder 1 ',sig_1 |
150 |
print*,' <SIG> ladder 2 ',sig_2 |
c print*,' <SIG> ladder 2 ',sig_2 |
151 |
print*,' <SIG> ladder 3 ',sig_3 |
c print*,' <SIG> ladder 3 ',sig_3 |
152 |
print*,' n.BAD ladder 1 ',nbad_1 |
c print*,' n.BAD ladder 1 ',nbad_1 |
153 |
print*,' n.BAD ladder 2 ',nbad_2 |
c print*,' n.BAD ladder 2 ',nbad_2 |
154 |
print*,' n.BAD ladder 3 ',nbad_3 |
c print*,' n.BAD ladder 3 ',nbad_3 |
155 |
print*,' error flag ',ff |
c print*,' error flag ',ff |
156 |
if(nused_event.ne.0.or.ff.ne.0)then |
if(nused_event.ne.0.or.ff.ne.0)then |
157 |
print*,'*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*' |
c print*,'*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*' |
158 |
print*,'* !!! CALIBRATION FAILURE !!! *' |
c print*,'* !!! CALIBRATION FAILURE !!! *' |
159 |
print*,'*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*' |
c print*,'*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*' |
160 |
endif |
endif |
161 |
|
|
162 |
|
|
507 |
bid_dat = bid_dat_sum/7 |
bid_dat = bid_dat_sum/7 |
508 |
|
|
509 |
if (bid_dat.ne.1.and.bid_dat.ne.2) then |
if (bid_dat.ne.1.and.bid_dat.ne.2) then |
510 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
511 |
write (*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
c write (*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
512 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
513 |
endif |
endif |
514 |
if (mod(bid_dat_sum,7).ne.0) then |
if (mod(bid_dat_sum,7).ne.0) then |
515 |
bid_dat = 0 |
bid_dat = 0 |
516 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
517 |
write (*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
c write (*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
518 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
519 |
endif |
endif |
520 |
|
|
521 |
if (alarm_dat.eq.3) then |
if (alarm_dat.eq.3) then |
522 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
523 |
write(*,*) 'unpack_data: AQUISITION ALARM' |
c write(*,*) 'unpack_data: AQUISITION ALARM' |
524 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
525 |
|
|
526 |
endif |
endif |
527 |
|
|
528 |
if (alarm_dat.ne.3.and.alarm_dat.ne.0) then |
if (alarm_dat.ne.3.and.alarm_dat.ne.0) then |
529 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
530 |
write(*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
c write(*,*) 'unpack_data: TRAILER PACKET CORRUPTED' |
531 |
write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
c write(*,*) '*** *** *** *** *** *** *** *** *** ***' |
532 |
|
|
533 |
endif |
endif |
534 |
|
|
633 |
alarm(i)= alarm_dat |
alarm(i)= alarm_dat |
634 |
aswr(i) = aswr_dat |
aswr(i) = aswr_dat |
635 |
|
|
636 |
print*,'*-*-*-*-*-*-TRAILER-*-*-*-*-*-*' |
c print*,'*-*-*-*-*-*-TRAILER-*-*-*-*-*-*' |
637 |
print*,'* PNUM (periferal num) ',pnum_dat |
c print*,'* PNUM (periferal num) ',pnum_dat |
638 |
print*,'* CMDNUM (command) ',cmdnum_dat |
c print*,'* CMDNUM (command) ',cmdnum_dat |
639 |
print*,'* BID (board id) ',bid_dat |
c print*,'* BID (board id) ',bid_dat |
640 |
print*,'* ALARM ',alarm_dat |
c print*,'* ALARM ',alarm_dat |
641 |
print*,'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*' |
c print*,'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*' |
642 |
|
|
643 |
do idat=1,datalength_dat |
do idat=1,datalength_dat |
644 |
id = TOTDATAlength + idat |
id = TOTDATAlength + idat |
645 |
datatracker(id) = b_tra(idat) |
datatracker(id) = b_tra(idat) |
646 |
enddo |
enddo |
647 |
TOTDATAlength = TOTDATAlength + datalength_dat |
TOTDATAlength = TOTDATAlength + datalength_dat |
648 |
|
|
649 |
return |
return |
650 |
end |
end |
651 |
|
|