63 INTEGER(mpi),
PARAMETER ::
nlyr=10
64 INTEGER(mpi),
PARAMETER ::
nmlyr=14
65 INTEGER(mpi),
PARAMETER ::
nmx=10
66 INTEGER(mpi),
PARAMETER ::
nmy=5
79 INTEGER(mpi),
DIMENSION(nmlyr) ::
islyr
80 INTEGER(mpi),
DIMENSION(nmlyr) ::
ihits
129 INTEGER(mpi) :: icount
136 INTEGER(mpi) :: labelt
137 INTEGER(mpi) :: layer
145 INTEGER(mpi) :: ncount
148 INTEGER(mpi) :: nrecds
149 INTEGER(mpi) :: nthits
151 INTEGER(mpi),
INTENT(IN) :: imodel
153 REAL(mps) :: derlc(nmlyr*2+3)
154 REAL(mps) :: dergl(nmlyr*2+3)
155 INTEGER(mpi) :: label(2)
160 dimension nbrl(2),lbrl(nmlyr,2),sbrl(nmlyr,2),wbrl(nmlyr,2), cmbbrl(2)
161 DATA cmbbrl / 0.0, 1.0 /
164 INQUIRE(file=
'mp2str.txt',iostat=ios,exist=ex1)
165 INQUIRE(file=
'mp2con.txt',iostat=ios,exist=ex2)
167 INQUIRE(file=
'mp2tst.bin',iostat=ios,exist=ex3)
170 WRITE(*,*)
'Generating test data for mp II...'
173 IF(ex3)
CALL system(
'rm mp2tst.bin')
175 IF(.NOT.ex1)
OPEN(unit=7,access=
'SEQUENTIAL',form=
'FORMATTED', &
177 IF(.NOT.ex2)
OPEN(unit=9,access=
'SEQUENTIAL',form=
'FORMATTED', &
179 OPEN(unit=51,access=
'SEQUENTIAL',form=
'UNFORMATTED', file=
'mp2tst.bin')
191 IF (mod(layer,3) == 1)
THEN
209 IF (abs(
sarc(i)-sold) > cmbbrl(k)) nbrl(k)=nbrl(k)+1
212 sbrl(lb,k)=sbrl(lb,k)+
sarc(i)
213 wbrl(lb,k)=wbrl(lb,k)+1.0
217 sbrl(i,k)=sbrl(i,k)/wbrl(i,k)
218 wbrl(i,k)=sqrt(wbrl(i,k))
240 WRITE(luns,101)
'* Default test steering file'
241 WRITE(luns,101)
'fortranfiles ! following bin files are fortran'
242 WRITE(luns,101)
'mp2con.txt ! constraints text file '
243 WRITE(luns,101)
'mp2tst.bin ! binary data file'
244 WRITE(luns,101)
'Cfiles ! following bin files are Cfiles'
248 WRITE(luns,101)
'*hugecut 50.0 !cut factor in iteration 0'
249 WRITE(luns,101)
'*chisqcut 1.0 1.0 ! cut factor in iterations 1 and 2'
250 WRITE(luns,101)
'*entries 10 ! lower limit on number of entries/parameter'
252 '*pairentries 10 ! lower limit on number of parameter pairs', &
254 WRITE(luns,101)
'*printrecord 1 2 ! debug printout for records'
256 '*printrecord -1 -1 ! debug printout for bad data records'
258 '*outlierdownweighting 2 ! number of internal iterations (> 1)'
259 WRITE(luns,101)
'*dwfractioncut 0.2 ! 0 < value < 0.5'
260 WRITE(luns,101)
'*presigma 0.01 ! default value for presigma'
261 WRITE(luns,101)
'*regularisation 1.0 ! regularisation factor'
262 WRITE(luns,101)
'*regularisation 1.0 0.01 ! regularisation factor, pre-sigma'
265 WRITE(luns,101)
'*bandwidth 0 ! width of precond. band matrix'
266 WRITE(luns,101)
'method diagonalization 3 0.001 ! diagonalization '
267 WRITE(luns,101)
'method fullMINRES 3 0.01 ! minimal residual '
268 WRITE(luns,101)
'method sparseMINRES 3 0.01 ! minimal residual '
269 WRITE(luns,101)
'*mrestol 1.0D-8 ! epsilon for MINRES'
270 WRITE(luns,101)
'method inversion 3 0.001 ! Gauss matrix inversion'
271 WRITE(luns,101)
'* last method is applied'
272 WRITE(luns,101)
'*matiter 3 ! recalculate matrix in iterations'
274 WRITE(luns,101)
'end ! optional for end-of-data'
284 IF(.NOT.ex2)
WRITE(lunt,*)
'Constraint 0.0'
286 labelt=(i*
nmy+k)*
nmx+ncx-1
287 IF(.NOT.ex2)
WRITE(lunt,103) labelt,one
290 IF(.NOT.ex2)
WRITE(lunt,*)
'Constraint 0.0'
292 labelt=(i*
nmy+k)*
nmx+ncx+1000-1
293 IF(.NOT.ex2)
WRITE(lunt,103) labelt,one
316 im =mod(
ihits(i),nmxy)
324 label(1)=im+nmxy*
islyr(lyr)
325 label(2)=im+nmxy*
islyr(lyr)+1000
327 IF (imodel == 1)
THEN
333 IF (imodel == 2.AND.i > 1)
THEN
343 IF (imodel >= 3)
THEN
350 derlc(lb*2-1)=
spro(1,lyr)
351 derlc(lb*2 )=
spro(2,lyr)
358 IF (imodel == 2)
THEN
365 CALL mille(nalc,derlc,0,dergl,label,0.0,
the0)
369 IF (imodel >= 3)
THEN
371 dp=1.0/(sbrl(i,ibrl)-sbrl(i-1,ibrl))
372 dn=1.0/(sbrl(i+1,ibrl)-sbrl(i,ibrl))
379 derlc(2* i +l)=-dp-dn
381 CALL mille(nalc,derlc,0,dergl,label,0.0,
the0*wbrl(i,ibrl))
411 WRITE(*,*) ncount,
' tracks generated with ',nthits,
' hits.'
412 WRITE(*,*) nrecds,
' records written.'
452 INTEGER(mpi),
INTENT(IN) :: ip
455 xnull=
sizel*(uran()-0.5)
456 ynull=
sizel*(uran()-0.5)
457 xexit=
sizel*(uran()-0.5)
458 yexit=
sizel*(uran()-0.5)
463 WRITE(*,*)
' Track ', xnull, ynull, xslop, yslop
477 xs=xnull+
sarc(i)*xslop
478 ys=ynull+
sarc(i)*yslop
487 IF (imx < 0.OR.imx >=
nmx) cycle
489 IF (imy < 0.OR.imy >=
nmy) cycle
491 ihit=((i-1)*
nmy+imy)*
nmx+imx
subroutine mille(nlc, derlc, ngl, dergl, label, rmeas, sigma)
Add data block to record. Called from user code.
subroutine mptst2(imodel)
Generate test files.
subroutine genln2(ip)
Generate line and measurements.
real(mps), dimension(nmlyr) ssig
resolution
integer(mpi), parameter nmx
number of modules in x direction
real(mps), parameter sizel
size of layers
real(mps), dimension(ntot) sdevx
shift in x (alignment parameter)
real(mps), dimension(ntot) sdevy
shift in y (alignment parameter)
integer(mpi) nhits
number of hits
integer(mpi), dimension(nmlyr) ihits
module number
integer(mpi), parameter nmlyr
number of measurement layers
real(mps), parameter stereo
stereo angle
integer(mpi), parameter nmy
number of modules in y direction
real(mps) the0
multiple scattering error
real(mps), dimension(nmlyr) sarc
arc length
integer(mpi), dimension(nmlyr) islyr
(detector) layer
integer(mpi), parameter nlyr
number of detector layers
real(mps), parameter sigl
real(mps), parameter offs
offset of stereo modules
integer(mpi), parameter ntot
total number of modules
real(mps), parameter thck
thickness of plane (X0)
real(mps), dimension(2, nmlyr) spro
projection of measurent direction in (XY)
real(mps), dimension(nmlyr) yhits
measured position in plane (hit)
real(mps), dimension(nmlyr) sigma
measurement sigma (hit)
real(mps), dimension(nmlyr) xhits
position perp. to plane (hit)
real(mps), parameter dets
arclength of first plane
real(mps), parameter diss
distance between planes