/[PAMELA software]/DarthVader/ToFLevel2/src/rdtofcal.for
ViewVC logotype

Annotation of /DarthVader/ToFLevel2/src/rdtofcal.for

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Tue Aug 11 12:58:23 2009 UTC (15 years, 3 months ago) by mocchiut
Branch: MAIN
CVS Tags: v9r00, v9r01
Changes since 1.6: +1 -1 lines
Compilation warnings with gcc >= 4.3 fixed

1 mocchiut 1.1 C------------------------------------------------
2 mocchiut 1.5 REAL FUNCTION RDTOFCAL(calname,cnlen)
3 mocchiut 1.1 C------------------------------------------------
4    
5     include 'input_tof.txt'
6    
7     c----- HBOOK
8     INTEGER HMEM
9 mocchiut 1.6 c REAL RDTOFCAL
10 mocchiut 1.1 parameter (NWPAWC=8500000)
11     common/PAWC/HMEM(NWPAWC)
12    
13     parameter (ntp_tofcalib=60)
14     c------------------------------------------------------------------------
15     c local variables
16     c------------------------------------------------------------------------
17     character*250 calname
18     character*250 calname1
19 mocchiut 1.3 c character ch
20 mocchiut 1.4 c character*2 ch2
21     integer cnlen
22 mocchiut 1.1 c------------------------------------------------------------------
23    
24     COMMON/QUEST/IQUEST(100)
25    
26     C
27     C------------------------------------------------------------------
28     C
29    
30     INTEGER lrec
31     INTEGER istat, ierr, icycle
32     PARAMETER (lrec=4096)
33    
34     C-------------------------------------------------------------------------
35     c
36     c HBOOK initialization
37     c
38     c------------------------------------------------------------------------
39    
40 mocchiut 1.5 RDTOFCAL = 0.
41 mocchiut 1.1 call HLIMIT(NWPAWC)
42    
43     c------------------------------------------------------------------------
44     c--------------- open ToF calib rz file
45     c------------------------------------------------------------------------
46    
47 mocchiut 1.3 c do ii=1,250
48     c ch=calname(ii:ii)
49     c if (ch.eq.'.') goto 100
50     c enddo
51     c100 continue
52     c calname1 = calname(1:ii)//'rz'
53    
54 mocchiut 1.4 c do ii=1,250
55     cc ch=calname(ii:ii)
56     c ch2=calname(ii:ii+1)
57     cc write(*,*) ii,ch
58     cc if (ch.eq.'.') goto 100
59     c if (ch2.eq.'rz') goto 100
60     c enddo
61     c100 continue
62 pam-de 1.2 c calname1 = calname(1:ii)//'rz'
63 mocchiut 1.4 c calname1 = calname(1:ii+1)
64    
65     calname1 = calname(1:cnlen)
66 pam-de 1.2
67 mocchiut 1.3
68    
69 mocchiut 1.1
70 mocchiut 1.3 CALL HROPEN(59,'TOFK1131',calname1,'QP',4096,istat)
71 mocchiut 1.1
72     if (istat.ne.0) then ! check if HROPEN was OK
73     write(*,*) 'Can''t open correct ToF calibration File !!!'
74     stop
75     endif
76    
77     call HRIN(ntp_tofcalib,9999,0)
78    
79     call HBNAME(ntp_tofcalib,' ',0,'$CLEAR')
80    
81 mocchiut 1.3 call HBNAME(ntp_tofcalib,'TOFK1131',k_s11s31,'$SET')
82     call HBNAME(ntp_tofcalib,'TOFK1132',k_s11s32,'$SET')
83     call HBNAME(ntp_tofcalib,'TOFK1231',k_s12s31,'$SET')
84     call HBNAME(ntp_tofcalib,'TOFK1232',k_s12s32,'$SET')
85    
86     call HBNAME(ntp_tofcalib,'TOFK2131',k_s21s31,'$SET')
87     call HBNAME(ntp_tofcalib,'TOFK2132',k_s21s32,'$SET')
88     call HBNAME(ntp_tofcalib,'TOFK2231',k_s22s31,'$SET')
89     call HBNAME(ntp_tofcalib,'TOFK2232',k_s22s32,'$SET')
90    
91     call HBNAME(ntp_tofcalib,'TOFK1121',k_s11s21,'$SET')
92     call HBNAME(ntp_tofcalib,'TOFK1122',k_s11s22,'$SET')
93     call HBNAME(ntp_tofcalib,'TOFK1221',k_s12s21,'$SET')
94     call HBNAME(ntp_tofcalib,'TOFK1222',k_s12s22,'$SET')
95    
96     C--------------
97 mocchiut 1.1
98     call HBNAME(ntp_tofcalib,'TOFLIN11',y_coor_lin11,'$SET')
99     call HBNAME(ntp_tofcalib,'TOFLIN12',x_coor_lin12,'$SET')
100     call HBNAME(ntp_tofcalib,'TOFLIN21',x_coor_lin21,'$SET')
101     call HBNAME(ntp_tofcalib,'TOFLIN22',y_coor_lin22,'$SET')
102     call HBNAME(ntp_tofcalib,'TOFLIN31',y_coor_lin31,'$SET')
103     call HBNAME(ntp_tofcalib,'TOFLIN32',x_coor_lin32,'$SET')
104    
105     call HBNAME(ntp_tofcalib,'TOFTW11',tw11,'$SET')
106     call HBNAME(ntp_tofcalib,'TOFTW12',tw12,'$SET')
107     call HBNAME(ntp_tofcalib,'TOFTW21',tw21,'$SET')
108     call HBNAME(ntp_tofcalib,'TOFTW22',tw22,'$SET')
109     call HBNAME(ntp_tofcalib,'TOFTW31',tw31,'$SET')
110     call HBNAME(ntp_tofcalib,'TOFTW32',tw32,'$SET')
111    
112     call HBNAME(ntp_tofcalib,'TOFADC11',adcx11,'$SET')
113     call HBNAME(ntp_tofcalib,'TOFADC12',adcx12,'$SET')
114     call HBNAME(ntp_tofcalib,'TOFADC21',adcx21,'$SET')
115     call HBNAME(ntp_tofcalib,'TOFADC22',adcx22,'$SET')
116     call HBNAME(ntp_tofcalib,'TOFADC31',adcx31,'$SET')
117     call HBNAME(ntp_tofcalib,'TOFADC32',adcx32,'$SET')
118    
119     c call HPRNTU(ntp_tofcalib)
120    
121     call HNOENT(ntp_tofcalib,iemax_cal)
122    
123     do iev=1,iemax_cal
124     call HGNT(ntp_tofcalib,iev,ierr) !reads an event
125     enddo
126    
127     call hrout(ntp_tofcalib,icycle,' ')
128 mocchiut 1.3 call hrend('TOFK1131')
129 mocchiut 1.1 close(0)
130    
131 mocchiut 1.5 return
132 mocchiut 1.7 end
133 mocchiut 1.1

  ViewVC Help
Powered by ViewVC 1.1.23