SUBROUTINE L15C_FILL_TOOL_PARAM_BLOCK() C---------------------------------------------------------------------- C- C- Purpose and Methods : Get the tool parameter information for the C- L1.5 calorimeter trigger simulation. C- C- Inputs : C- Outputs : C- Controls: C- C- Created 10-MAY-1994 sFahey C- Updated 29-DEC-1995 Dan Owen modified to handle both real and int C- parameters for both Glabal and Local tool. C- Also modified such that real params are C- not output in machine format rather than C- being converted to integer. This is what C- the hardware does. But note that the C- hardware floating pt format is different C- than that of the VAX C- C- *NOTE* -- NOT FULLY FILLED (unused terms do not have default values C- *written to output block.) C- C---------------------------------------------------------------------- IMPLICIT NONE C INCLUDE 'D0$PARAMS:L15CALDBB_DATA_BLOCK.PARAMS' INCLUDE 'D0$INC:L15CALDBB_DATA_BLOCK.INC' INCLUDE 'D0$PARAMS:L1COOR_PARSER.PARAMS' INCLUDE 'D0$PARAMS:L15COOR_PARSER.PARAMS' INCLUDE 'D0$INC:L15C_TERM_INIT.INC' INCLUDE 'D0$INC:L15C_TOOL_INIT.INC' INCLUDE 'D0$INC:L15C_TERM_INFO.INC' C C c INTEGER INDEX,NUM_WORDS,I c INTEGER NTERMS c INTEGER LIST_LNGTH,HEADER INTEGER nterms, TERM_NUM INTEGER refset_type INTEGER num_tool_param, tool_num INTEGER param_data, p_type , p INTEGER param_i REAL param_r EQUIVALENCE (PARAM_I, PARAM_R) INTEGER LDSP_info(L15TM_NUM_MIN:L15TM_NUM_MAX, 2) INTEGER GDSP_info(L15TM_NUM_MIN:L15TM_NUM_MAX, 2) REAL LDSP_param(L15TM_NUM_MIN:L15TM_NUM_MAX, 14) INTEGER GDSP_param(L15TM_NUM_MIN:L15TM_NUM_MAX, 14) INTEGER i,j INTEGER list_length INTEGER ptr INTEGER param_num C---------------------------------------------------------------------- C nterms = 0 c DO TERM_NUM = L15TM_NUM_MIN, L15TM_NUM_MAX C **** Check if term is alocated c IF ( L15C_TERM_INFO(0, TERM_NUM, 1) .eq. -1 ) THEN DO TERM_NUM = 0, L15CAL_NUM_TERMS_HARDWARE-1 nterms = nterms + 1 C ***** Fill Local DSP info CALL BYTE_COPYTO_LW(TERM_NUM, 1, param_data) CALL BYTE_COPYTO_LW(1 , 2, param_data) refset_type = L15C_TERM_INFO(0, TERM_NUM, 3) IF ( refset_type .EQ. KEY_EM) THEN CALL BYTE_COPYTO_LW(0 , 3, param_data) ELSE CALL BYTE_COPYTO_LW(255 , 3, param_data) ENDIF CALL BYTE_COPYTO_LW(0 , 4, param_data) LDSP_info(nterms, 1) = param_data tool_num = L15C_TERM_INFO(0, TERM_NUM, 5) LDSP_info(nterms, 2) = tool_num C ***** Fill parameter section num_tool_param = 0 DO P = L15PM_NUM_MIN,L15PM_NUM_MAX p_type = L15_TYPE_PARAMS(0, term_num, L15TL_LOC_DSP, & tool_num, P) IF ( p_type .NE. L15TL_PARAM_UNUSED ) THEN num_tool_param = num_tool_param + 1 IF (P_TYPE.EQ.L15TL_PARAM_FLT) PARAM_R = & L15_FLOAT_PARAMS(0, term_num, L15TL_LOC_DSP,tool_num, P) IF (P_TYPE.EQ.L15TL_PARAM_INT) PARAM_I = & L15_INTG_PARAMS(0, term_num, L15TL_LOC_DSP,tool_num, P) LDSP_param(nterms, num_tool_param+1) = param_i ENDIF ENDDO LDSP_param(nterms, 1) = num_tool_param C ***** Fill Global DSP info CALL BYTE_COPYTO_LW(TERM_NUM, 1, param_data) CALL BYTE_COPYTO_LW(2 , 2, param_data) GDSP_info(nterms, 1) = param_data tool_num =L15C_TERM_INFO(0, TERM_NUM, 4) GDSP_info(nterms, 2) = tool_num C ***** Fill parameter section num_tool_param = 0 DO P = L15PM_NUM_MIN,L15PM_NUM_MAX p_type = L15_TYPE_PARAMS(0, term_num, L15TL_GLB_DSP, & tool_num, P) IF ( p_type .NE. L15TL_PARAM_UNUSED ) THEN num_tool_param = num_tool_param + 1 IF (P_TYPE.EQ.L15TL_PARAM_FLT) PARAM_R = & L15_FLOAT_PARAMS(0, term_num, L15TL_GLB_DSP,tool_num, P) IF (P_TYPE.EQ.L15TL_PARAM_INT) PARAM_I = & L15_INTG_PARAMS(0, term_num, L15TL_GLB_DSP,tool_num, P) GDSP_param(nterms, num_tool_param+1) = param_i ENDIF ENDDO GDSP_param(nterms, 1) = num_tool_param c ENDIF ENDDO C ***** Output info c type *, '*****L15C_FILL_TOOL_PARAM_BLOCK.FOR info' c DO i = 1, nterms c type *, 'LOCAL' c write(5,100) LDSP_info(i, 1) c write(5,*) LDSP_info(i, 2) c DO j = 1,14 c write(5,*) LDSP_param(i, j) c ENDDO c type *, 'GLOBAL' c write(5,100) GDSP_info(i, 1) c write(5,*) GDSP_info(i, 2) c DO j = 1,14 c write(5,*) GDSP_param(i, j) c ENDDO c ENDDO 100 FORMAT(z10.8) C ***** Fill block L15CAL_TOOL_PARAM_BLOCK(1) = & L15CAL_NUM_TERMS_HARDWARE*(LOC_NLW+GLB_NLW) + 1 CALL BYTE_COPYTO_LW(L15CAL_NUM_TERMS_HARDWARE , 1, list_length) CALL BYTE_COPYTO_LW(LOC_NLW , 2, list_length) CALL BYTE_COPYTO_LW(L15CAL_NUM_TERMS_HARDWARE , 3, list_length) CALL BYTE_COPYTO_LW(GLB_NLW , 4, list_length) L15CAL_TOOL_PARAM_BLOCK(2) = list_length C ***** Fill Local DSP section ptr = 3 DO term_num = 1,nterms L15CAL_TOOL_PARAM_BLOCK(ptr) = LDSP_info(term_num,1) L15CAL_TOOL_PARAM_BLOCK(ptr+1) = LDSP_info(term_num,2) DO param_num = 1, 14 L15CAL_TOOL_PARAM_BLOCK(ptr+1 + param_num) = & LDSP_param(term_num, param_num) ENDDO ptr = ptr + LOC_NLW ENDDO C ***** Fill Global DSP section DO term_num = 1,nterms L15CAL_TOOL_PARAM_BLOCK(ptr) = GDSP_info(term_num,1) L15CAL_TOOL_PARAM_BLOCK(ptr+1) = GDSP_info(term_num,2) DO param_num = 1, 14 L15CAL_TOOL_PARAM_BLOCK(ptr+1 + param_num) = & GDSP_param(term_num, param_num) ENDDO ptr = ptr + GLB_NLW ENDDO C ***** type out the block c write(5,*) L15CAL_TOOL_PARAM_BLOCK(1) c DO i =2,L15CAL_TOOL_PARAM_BLOCK(1)+1 c write(5,100) L15CAL_TOOL_PARAM_BLOCK(i) c ENDDO 999 RETURN END