20 INTEGER,
PARAMETER :: nplan=100
23 REAL,
PARAMETER :: detx= 10.0
24 REAL,
PARAMETER :: disx= 10.0
25 REAL,
PARAMETER :: thck= 2.0
26 REAL,
PARAMETER :: heit=100.0
27 REAL,
PARAMETER :: effp=0.90
28 REAL,
PARAMETER :: sgmp=0.0150
31 REAL,
DIMENSION(nplan) :: del
32 REAL,
DIMENSION(nplan) :: dvd
38 INTEGER,
DIMENSION(nplan) :: ihits
39 REAL,
DIMENSION(nplan) :: eff
40 REAL,
DIMENSION(nplan) :: sgm
41 REAL,
DIMENSION(nplan) :: ydrft
42 REAL,
DIMENSION(nplan) :: xhits
43 REAL,
DIMENSION(nplan) :: yhits
44 REAL,
DIMENSION(nplan) :: sigma
84 DOUBLE PRECISION :: s1
85 DOUBLE PRECISION :: s2
86 DOUBLE PRECISION :: sw
87 DOUBLE PRECISION :: sv
88 DOUBLE PRECISION :: sum1
89 DOUBLE PRECISION :: sum2
98 INQUIRE(file=
'mp2str.txt',iostat=ios,exist=ex1)
99 INQUIRE(file=
'mp2con.txt',iostat=ios,exist=ex2)
101 INQUIRE(file=
'mp2tst.bin',iostat=ios,exist=ex3)
104 WRITE(*,*)
'Generating test data for mp II...'
107 IF(ex3) CALL system(
'rm mp2tst.bin')
109 IF(.NOT.ex1)
OPEN(unit=7,access=
'SEQUENTIAL',form=
'FORMATTED', &
111 IF(.NOT.ex2)
OPEN(unit=9,access=
'SEQUENTIAL',form=
'FORMATTED', &
113 OPEN(unit=51,access=
'SEQUENTIAL',form=
'UNFORMATTED', file=
'mp2tst.bin')
140 WRITE(luns,101)
'* Default test steering file'
141 WRITE(luns,101)
'fortranfiles ! following bin files are fortran'
142 WRITE(luns,101)
'mp2con.txt ! constraints text file '
143 WRITE(luns,101)
'mp2tst.bin ! binary data file'
144 WRITE(luns,101)
'Cfiles ! following bin files are Cfiles'
148 WRITE(luns,101)
'*hugecut 50.0 !cut factor in iteration 0'
149 WRITE(luns,101)
'*chisqcut 1.0 1.0 ! cut factor in iterations 1 and 2'
150 WRITE(luns,101)
'*entries 10 ! lower limit on number of entries/parameter'
152 '*pairentries 10 ! lower limit on number of parameter pairs', &
154 WRITE(luns,101)
'*printrecord 1 2 ! debug printout for records'
156 '*printrecord -1 -1 ! debug printout for bad data records'
158 '*outlierdownweighting 2 ! number of internal iterations (> 1)'
159 WRITE(luns,101)
'*dwfractioncut 0.2 ! 0 < value < 0.5'
160 WRITE(luns,101)
'*presigma 0.01 ! default value for presigma'
161 WRITE(luns,101)
'*regularisation 1.0 ! regularisation factor'
162 WRITE(luns,101)
'*regularisation 1.0 0.01 ! regularisation factor, pre-sigma'
165 WRITE(luns,101)
'*bandwidth 0 ! width of precond. band matrix'
166 WRITE(luns,101)
'method diagonalization 3 0.001 ! diagonalization '
167 WRITE(luns,101)
'method fullMINRES 3 0.01 ! minimal residual '
168 WRITE(luns,101)
'method sparseMINRES 3 0.01 ! minimal residual '
169 WRITE(luns,101)
'*mrestol 1.0D-8 ! epsilon for MINRES'
170 WRITE(luns,101)
'method inversion 3 0.001 ! Gauss matrix inversion'
171 WRITE(luns,101)
'* last method is applied'
172 WRITE(luns,101)
'*matiter 3 ! recalculate matrix in iterations'
174 WRITE(luns,101)
'end ! optional for end-of-data'
179 IF(.NOT.ex2)
WRITE(lunt,*)
'Constraint 0.0'
182 x=detx+float(i-1)*disx+0.5*thck
183 IF(.NOT.ex2)
WRITE(lunt,103) labelt,one
190 IF(.NOT.ex2)
WRITE(lunt,*)
'Constraint 0.0'
191 dbar=0.5*float(nplan-1)*disx
192 xbar=detx+0.5*float(nplan-1)*disx
195 x=detx+float(i-1)*disx
197 IF(.NOT.ex2)
WRITE(lunt,103) labelt,ww
205 det=
REAL(float(nplan)*sv-sw*sw)
206 eps=
REAL(sv*s1-sw*s2)/det
207 eta=
REAL(float(nplan)*s2-sw*s1)/det
209 x=detx+float(i-1)*disx
211 del(i)=del(i)-eps-eta*ww
218 x=detx+float(i-1)*disx
232 IF(icount == 8759) ip=1
242 label(1)=10+ihits(i)*2
243 label(2)=500 + ihits(i)
244 CALL
mille(2,derlc,2,dergl,label,yhits(i),sigma(i))
272 WRITE(*,*) ncount,
' tracks generated with ',nthits,
' hits.'
273 WRITE(*,*) nrecds,
' records written.'
300 INTEGER,
INTENT(IN) :: ip
303 ynull=0.5*heit+0.1*heit*(
uran()-0.5)
304 slope=(
uran()-0.5)*heit/(float(nplan-1)*disx)
311 x=detx+float(i-1)*disx
312 IF(
uran() < eff(i))
THEN
315 nwire=int(1.0+ybias/4.0)
316 IF(nwire <= 0.OR.nwire > 25) exit
323 yhits(nhits)=ybias+ymeas+ydvds
324 ywire=float(nwire)*4.0-2.0
325 ydrft(nhits)=ybias-ywire
326 ydvds=ydrft(nhits)*dvd(i)
327 yhits(nhits)=ybias+ymeas-ydvds