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 * Revision 1.1 1994/02/19 06:14:15 cdaq
8 * Initial revision
|
9 cdaq 1.1 *
|
10 cdaq 1.2 *
|
11 cdaq 1.1 implicit none
12 external H_DPSIFUN
13 real*8 H_DPSIFUN
14 include "gen_data_structures.cmn"
15 include "hms_tracking.cmn"
16 include "hms_geometry.cmn"
17 *
18 * input
|
19 cdaq 1.2 real*8 ray(*),grad(*),dumarg
|
20 cdaq 1.1 integer*4 npar,iflag
21 * output
22 real*8 fval ! value of chi2
23 *
24 * local variables
25 real*8 diff
26 integer*4 ihit
27 integer*4 hitnum,planenum
28
29 fval=0.0d0
30 do ihit=1,HNTRACK_HITS(htrack_fit_num,1)
31 hitnum=HNTRACK_HITS(htrack_fit_num,ihit+1)
32 planenum=HDC_PLANE_NUM(hitnum)
33 diff=(dble(HDC_WIRE_COORD(hitnum))-H_DPSIFUN(ray,planenum))
34 & /dble(hdc_sigma(planenum))
35 fval=fval+diff*diff
36 enddo
37 return
38 end
|