1 cdaq 1.2 subroutine H_FCNCHISQ(npar,grad,fval,ray,iflag,dumarg)
|
2 cdaq 1.1 * This subroutine calculates chi**2 for MINUIT for HMS. The
3 * arguments are determined by MINUIT
4 *
5 * d.f. geesaman 17 January 1994
|
6 cdaq 1.2 * $Log: h_fcnchisq.f,v $
|
7 cdaq 1.3 * Revision 1.2 1994/04/13 20:38:06 cdaq
8 * (SAW) Change name of dummy arg to dumarg
9 *
|
10 cdaq 1.2 * Revision 1.1 1994/02/19 06:14:15 cdaq
11 * Initial revision
|
12 cdaq 1.1 *
|
13 cdaq 1.2 *
|
14 cdaq 1.1 implicit none
15 external H_DPSIFUN
16 real*8 H_DPSIFUN
|
17 cdaq 1.3 include "hms_data_structures.cmn"
|
18 cdaq 1.1 include "hms_tracking.cmn"
19 include "hms_geometry.cmn"
20 *
21 * input
|
22 cdaq 1.2 real*8 ray(*),grad(*),dumarg
|
23 cdaq 1.1 integer*4 npar,iflag
24 * output
25 real*8 fval ! value of chi2
26 *
27 * local variables
28 real*8 diff
29 integer*4 ihit
30 integer*4 hitnum,planenum
31
32 fval=0.0d0
33 do ihit=1,HNTRACK_HITS(htrack_fit_num,1)
34 hitnum=HNTRACK_HITS(htrack_fit_num,ihit+1)
35 planenum=HDC_PLANE_NUM(hitnum)
36 diff=(dble(HDC_WIRE_COORD(hitnum))-H_DPSIFUN(ray,planenum))
37 & /dble(hdc_sigma(planenum))
38 fval=fval+diff*diff
39 enddo
40 return
41 end
|