1 |
|
subroutine fillpedsigfromdefault() |
2 |
|
|
3 |
|
include 'commontracker.f' |
4 |
|
include 'calib.f' |
5 |
|
include 'common_c2f.f' !<<<< C2F |
6 |
|
|
7 |
|
integer dsp(2,6) |
8 |
|
character*60 fname_param |
9 |
|
|
10 |
|
c2f_error = 0 |
11 |
|
|
12 |
|
fname_param='cabling.dat' |
13 |
|
c if(DEBUG.EQ.1)print * |
14 |
|
c $ ,c2f_path(1:c2f_pathlen) !<<<< C2F |
15 |
|
c $ //fname_param(1:LNBLNK(fname_param)) |
16 |
|
open(10, |
17 |
|
$ FILE=c2f_path(1:c2f_pathlen) !<<<< C2F |
18 |
|
$ //fname_param(1:LNBLNK(fname_param)) |
19 |
|
$ ,STATUS='OLD' |
20 |
|
$ ,IOSTAT=iostat |
21 |
|
$ ) |
22 |
|
if(iostat.ne.0)then |
23 |
|
c if(C2F_DEBUG.EQ.1.eq.1)print* |
24 |
|
if(DEBUG.EQ.1)print* |
25 |
|
$ ,'READPEDSIGFROMDEFAULT: *** Error opening file *** ' |
26 |
|
c2f_error = 1 |
27 |
|
return |
28 |
|
endif |
29 |
|
do iv=1,nviews |
30 |
|
read(10,* |
31 |
|
$ ,IOSTAT=iostat |
32 |
|
$ )ilink,ipn,dsp(ilink,ipn+1) |
33 |
|
if(iostat.ne.0)then |
34 |
|
c2f_error = 1 |
35 |
|
goto 100 |
36 |
|
endif |
37 |
|
enddo |
38 |
|
100 close(10) |
39 |
|
|
40 |
|
300 format('link',i1,'/param2_',i1,'_',i1,'.dat') |
41 |
|
do ilink=1,2 !loop over links |
42 |
|
if(VERBOSE.EQ.1)print *,'Opening default calibration - link' |
43 |
|
$ ,ilink |
44 |
|
do ipn=0,5 !loop over peripheral numbers |
45 |
|
do iladder=1,3 !loop over DSP |
46 |
|
write(fname_param,300)ilink,ipn,iladder |
47 |
|
c if(DEBUG.EQ.1)print*, |
48 |
|
c $ ,c2f_path(1:c2f_pathlen) !<<<< C2F |
49 |
|
c $ //fname_param(1:LNBLNK(fname_param)) |
50 |
|
open(10, |
51 |
|
$ FILE=c2f_path(1:c2f_pathlen) !<<<< C2F |
52 |
|
$ //fname_param(1:LNBLNK(fname_param)) |
53 |
|
$ ,STATUS='OLD' |
54 |
|
$ ,IOSTAT=iostat |
55 |
|
$ ) |
56 |
|
if(iostat.ne.0)then |
57 |
|
c if(C2F_DEBUG.EQ.1.eq.1)print* |
58 |
|
if(DEBUG.EQ.1)print* |
59 |
|
$ ,'READPEDSIGFROMDEFAULT:' |
60 |
|
$ ,' *** Error opening file *** ' |
61 |
|
c2f_error = 1 |
62 |
|
return |
63 |
|
endif |
64 |
|
* PEDESTAL ---------------------- |
65 |
|
do is=1,nstrips_ladder |
66 |
|
read(10,* |
67 |
|
$ ,IOSTAT=iostat) |
68 |
|
$ pedestal_t( dsp(ilink,ipn+1) |
69 |
|
$ ,(nvk(is)+(iladder-1)*nva1_ladder) |
70 |
|
$ ,nst(is)) |
71 |
|
c print*,ilink,ipn,is,' --- ',dsp(ilink,ipn+1) |
72 |
|
c $ ,(nvk(is)+(iladder-1)*nva1_ladder) |
73 |
|
c $ ,nst(is) |
74 |
|
if(iostat.ne.0)then |
75 |
|
c2f_error = 1 |
76 |
|
print*,'ped ',is |
77 |
|
goto 1000 |
78 |
|
endif |
79 |
|
enddo |
80 |
|
* SIGMA ------------------------- |
81 |
|
do is=1,nstrips_ladder |
82 |
|
read(10,* |
83 |
|
$ ,IOSTAT=iostat) |
84 |
|
$ sigma_t( |
85 |
|
$ dsp(ilink,ipn+1) |
86 |
|
$ ,(nvk(is)+(iladder-1)*nva1_ladder) |
87 |
|
$ ,nst(is)) |
88 |
|
if(iostat.ne.0)then |
89 |
|
c2f_error = 1 |
90 |
|
print*,'sig ',is |
91 |
|
goto 1000 |
92 |
|
endif |
93 |
|
enddo |
94 |
|
* ------------------------------- |
95 |
|
|
96 |
|
1000 close(10) |
97 |
|
|
98 |
|
enddo !end loop over DSP |
99 |
|
enddo !end loop over peripheral numbers |
100 |
|
enddo !end loop over links |
101 |
|
return |
102 |
|
end |
103 |
|
|
104 |
|
|
105 |
************************************************************************* |
************************************************************************* |
106 |
* |
* |
107 |
* Subroutine fillpedsig.f |
* Subroutine fillpedsig.f |
126 |
************************************************************************* |
************************************************************************* |
127 |
|
|
128 |
|
|
129 |
subroutine fillpedsigfromdefault() |
subroutine fillpedsigfromdefaultrz() |
130 |
|
|
131 |
include 'commontracker.f' |
include 'commontracker.f' |
132 |
|
include 'level1.f' |
133 |
include 'common_reduction.f' |
include 'common_reduction.f' |
134 |
include 'common_c2f.f' |
include 'common_c2f.f' |
135 |
include 'calib.f' |
include 'calib.f' |
164 |
c2f_error=0 |
c2f_error=0 |
165 |
|
|
166 |
|
|
167 |
if(C2F_DEBUG.eq.1)print*,c2f_path(1:c2f_pathlen) |
if(DEBUG.eq.1)print*,c2f_path(1:c2f_pathlen) |
168 |
call HROPEN(lun_data_file, |
call HROPEN(lun_data_file, |
169 |
$ 'CALIB' |
$ 'CALIB' |
170 |
$ ,c2f_path(1:c2f_pathlen) !<<<< C2F |
$ ,c2f_path(1:c2f_pathlen) !<<<< C2F |