Параметризация делается полиномами Чебышева с помощью CHEB.FOR
Значения управляющих параметров error,ipunch,itry
error - точность,
ниже которой коэффициенты разложения
отбрасываются
ipunch - 1 - полиномы Чебышева, 2 -
обыкновенные полиномы
itry -
количество испытаний функции в произвольно
взятых точках после фита
Обычная параметризация магнитного поля выглядит:
После магнита ( в области больших дрейфовых камер) параметризуется
Ax(ax0,ay0,ay0,by0,1/p)
Bx(ax0,ay0,ay0,by0,1/p)
Ay(ax0,ay0,ay0,by0,1/p)
Py(ax0,ay0,ay0,by0,1/p)
Ниже приведен код для использования данной параметризации
call fldax(ax0,bx0,ay0,by0,p, dax )
call fldbx(ax0,bx0,ay0,by0,p, dbx )
call flday(ax0,bx0,ay0,by0,p, day )
call fldby(ax0,bx0,ay0,by0,p, dby )
pxz = p * dsqrt( (1.d0+ax02) / (1.d0+ax02+ay02))
sin1 = ax0/sqrt( 1. + ax02 )
sin2 = sin1 + dax/pxz ! may be >1
if(abs(sin2).ge.1.)sin2=0.99999
axf = sin2/sqrt(1.-sin2*sin2)
ayf = ay0 + day/p
bxf = bx0 + dbx
byf = by0 + dby
Перед магнитом и внутри него параметризуется величина
( X - ax*(Z-Z0)-Vx)*pxz , где ax-наклон трека в
X-плоскости, pxz - его XZ компонента импульса,
Vx - x-координата вершины, Z0 - константа (=-213), Z-
положение плоскости.
Пример кода для получения X-координаты трека на плоскости ZJ
call flddx(ax,bx,ay,by,p,daj,zj)
xk =ax*zj+bx+daj/pxz
CHEB.FOR
PROGRAM CHEB5
C - - - - - - - - - - - - - - - -
C. CHEB5 IS A COMPLETE PROGRAM COMPUTING A POLYNOMIAL
C. OR CHEBYSHEV EXPANSION TO EXPRESS A FUNCTION
C. EXPLICITLY IN TERMS OF FIVE VARIABLES. NO INVERSE
C. INTERPOLATION IS PERFORMED UNLIKE THE SIMILAR
C. ALGORITHM GENC ( X1019).
C. THE USER SHOULD SUPPLY SUBROUTINE FUNZ(X) IN WHICH
C. X MUST BE DIMENSIONED X(5).
C. DOCUMENTATION = METHOD AND PROGRAM ARE DESCRIBED
C. IN CERN INTERNAL REPORT EP/81-12, H.WIND.
C. ORIGIN = H. WIND '81, STATUS = USED.
C
C ON 32-BIT MACHINES THIS PROGRAM MAY NEED DOUBLE PRECISION.
C INPUT IS IN STATEMENTS WITH LABEL "INPUT" IN COLLUMNS 73-80.
C OUTPUT IS IN PRINTED FORM .
C TO GET THE OUTPUT OF THE FUNCTION REPRESENTATION
C ON CARDS OR OTHERWISE , THE PRINT STATEMENTS WITH
C " PUN CRDS " IN COLLUMNS 73-80 ARE TO BE MODIFIED.
C TO CHANGE THE DIMENSIONS IN THE COMMON STATEMENTS ONE HAS TO LOOK FOR CHA DIM
C IN COLLUMNS 73-80
C USER SUPPLIES ROUTINE FUNZ
C EXAMPLES FOR SHORTCUTTING GENERATION OF FUNCTION VALUES
C AND FOR STORING COEFFICIENTS ON FILE FOR LATER TESTING CAN
C BE FOUND BELOW (USING TAPE1 AND TAPE2)
C THE LIMITS OF THE RELEVANT INTERVAL FOR X(I) MUST BE SPECIFIED
C BY RANGE SUCH THAT RANGE(1,I).LE.X(I).LE.RANGE(2,I)
C IM1(I) IS THE NUMBER OF DIFFERENT VALUES OF X(I) TO BE TAKEN.
C IM2(I) MINUS ONE WILL BE THE HIGHEST POWER OF X(I) . 1.LE.IM2(I).LE.IM1(I) .
C TO MAKE A FIT TO A FUNCTION OF LESS THAN 5 VARIABLES
C IM1(I) AND IM2(I) SHOULD BE PUT =1 FOR THE DUMMY VARIABLES
C THE RANGE OF THESE VARIABLES CAN BE CHOSEN ARBITRARY E.G (-1,+1)
C NXF ,THE MINIMUM DIMENSION OF F, IS THE PRODUCT OF ALL IM1(I) .
C ITRY IS THE NUMBER OF TIMES THE RESULTING FUNCTION
C WILL BE TRIED WITH RANDOMLY CHOSEN X.
C IPUNCH=1 GIVES A CHEBYSHEV REPRESENTATION
C AND IPUNCH=2 GIVES ONE WHICH IS TRANSFORMED INTO
C A REGULAR POWER EXPANSION .
C THE FIRST IS MORE RELIABLE ( FOR MACHINE ROUNDING ERRORS)
C THE SECOND IS MARGINALY FASTER IN LATER USE.
C IF IPUNCH=1 ,I.E. PURE CHEBYSHEV FIT THEN COFPOL IS NOT NEEDED
C AND NEITHER
C SUBROUTINE GENP ,
C FUNCTION POLYN ,
C FUNCTION PC1 ,
C SUBROUTINE PCPOL AND
C SUBROUTINE PUN .
C IF MORE THAN 40 DIFFERENT VALUES OF ONE VARIABLE ARE TAKEN LINES WITH CHA IHP
C IN COLLUMNS 73-80 ARE TO BE CHANGED.
C
C ERROR CAN BE EITHER THE ERROR OF MEASUREMENT OR THE PRECISION
C (IN ABSOLUTE TERMS) REQUIRED. WE WILL DELETE A COEFFICIENT
C C(I,J,K,L,M) IF
C ABS OF C(I,J,K,L,M) LE ERROR
C AND ABS OF C(I+1,J,K,L,M) LE ERROR
C AND ABS OF C(I,J+1,K,L,M) LE ERROR
C AND ABS OF C(I,J,K+1,L,M) LE ERROR
C AND ABS OF C(I,J,K,L+1,M) LE ERROR
C AND ABS OF C(I,J,K,L,M+1) LE ERROR
C UNLESS ONE INDEX (IN THE PROGRAM THE FIVE INDICES
C ARE PACKED INTO ONE) HAS ALREADY REACHED ITS MAXIMUM IN WHICH
C CASE THE CORRESPONDING TEST IS BYPASSED.
C