12-Dec-1990 12:13:17 VAX FORTRAN V5.4-79 Page 1 19-Sep-1990 16:32:19 TOWER_THRESHOLD_TRANSLATION.FOR;7 0001 SUBROUTINE TOWER_THRESHOLD_TRANSLATION ( 0002 & SIGN_ETA, MAGN_ETA, PHI, 0003 & THRSH_TYPE, 0004 & DESIRED_THRSH, 0005 & HARDWARE_THRSH ) 0006 C---------------------------------------------------------------------- 0007 C- 0008 C- Purpose and Methods : Calculates the appropriate reference byte to load 0009 C- into the CTFE card cluster threshold comparator 0010 C- for the specified Trigger Tower and the specified 0011 C- quantity type in order to achieve the specified 0012 C- energy threshold comparison. 0013 C- The threshold translation is inclusive, meaning that 0014 C- an energy deposit of the amount specified or greater 0015 C- will clear the threshold. 0016 C- In the case of the Hadronic Veto, an hadronic 0017 C- energy deposit of the amount specified or greater 0018 C- will prevent an EM tower to clear its threshold. 0019 C- 0020 C- Inputs : 0021 C- THRSH_TYPE specifies the quantity type for which the threshold 0022 C- translation is requested. 0023 C- It is recommended to use one of the compilation 0024 C- constants defined along with the common block. 0025 C- See TT_..._THRTYP in common block. 0026 C- 0027 C- SIGN_ETA is the sign of the eta index of the trigger 0028 C- tower for which the threshold is requested. 0029 C- Use 0 to specify a negative eta index, 1 to 0030 C- specify a positive eta index. 0031 C- It is recommended to use one of the compilation 0032 C- constants defined along with the common block. 0033 C- POS_ETA=0 or NEG_ETA=1. 0034 C- 0035 C- MAGN_ETA is the magnitutde of the eta index of the 0036 C- trigger tower for which the threshold is 0037 C- requested. 0038 C- Range : 1 to 24 0039 C- 0040 C- PHI is the phi index of the trigger tower for 0041 C- which the threshold is requested. 0042 C- Range : 1 to 32 0043 C- 0044 C- DESIRED_THRSH is the desired energy threshold to be applied to the 0045 C- specified tower. 0046 C- Units: GeV. 0047 C- 0048 C- Outputs : 0049 C- HARDWARE_THRSH is the byte of quantified threshold to be loaded in 0050 C- the CTFE cluster threshold comparator of the 0051 C- specified Trigger Tower to achieve the specified 0052 C- threshold comparison. 0053 C- 0054 C- Controls: None 0055 C- 0056 C- Comments : 0057 C- A call to INIT_LOOKUP_ROUTINES must have been made 12-Dec-1990 12:13:17 VAX FORTRAN V5.4-79 Page 2 19-Sep-1990 16:32:19 TOWER_THRESHOLD_TRANSLATION.FOR;7 0058 C- before this routine can be called. 0059 C- 0060 C- No verification is made of the integrity of the 0061 C- arguments specifying the indices of the Trigger 0062 C- Tower. 0063 C- 0064 C- This translation will take into account any 0065 C- offset present at the output of the lookup PROMs. 0066 C- 0067 C- The Threshold comparator (in the hardware) will 0068 C- perform a strict comparison. This means that a 0069 C- Trigger Tower must have a quantified transverse 0070 C- energy at the output from the Lookup PROMS strictly 0071 C- greater than the reference byte programmed for that 0072 C- Trigger Tower to contribute to the global count 0073 C- carried over the whole detector. 0074 C- 0075 C- When the desired threshold exactly falls on an 0076 C- allowed quantified value, the byte will be chosen to 0077 C- implement an inclusve comparison by returning the 0078 C- next smaller byte when necessary. 0079 C- 0080 C- Defined 6-FEB-1990 MICHIGAN STATE UNIVERSTITY, TRIGGER CONTROL SOFTWARE 0081 C- Updated 2-AUG-1990 MICHIGAN STATE UNIVERSTITY, TRIGGER CONTROL SOFTWARE 0082 C---------------------------------------------------------------------- 0083 IMPLICIT NONE 0084 C 0085 INCLUDE 'D0$LEVEL1:LEVEL1_LOOKUP.PARAMS' 0226 INCLUDE 'D0$LEVEL1:LEVEL1_LOOKUP.INC' 0602 C 0603 INTEGER THRSH_TYPE 0604 INTEGER SIGN_ETA, MAGN_ETA, PHI 0605 REAL DESIRED_THRSH 0606 INTEGER HARDWARE_THRSH 0607 C 0608 C---------------------------------------------------------------------- 0609 C 0610 C 0611 IF ( THRSH_TYPE .EQ. TT_EMET_THRTYP ) THEN 0612 IF (GLOBAL_ENERGY_SCALE(EM_ET_QUANT) .EQ. 0) THEN 0613 HARDWARE_THRSH = 0 0614 ELSE 0615 HARDWARE_THRSH = NINT ( DESIRED_THRSH 0616 & / ( GLOBAL_ENERGY_SCALE ( EM_ET_QUANT ) 0617 & * 2.0 ** LUQ_LOCAL_RESCALING 0618 & (SIGN_ETA,MAGN_ETA,EM_ET_QUANT) ) ) 0619 & + LOOKUP_ZERESP(SIGN_ETA,MAGN_ETA,PHI, 0620 & EM_ET_QUANT) 0621 & - 1 0622 ENDIF 0623 C 0624 ELSE IF ( THRSH_TYPE .EQ. TT_HDVETO_THRTYP ) THEN 0625 IF (GLOBAL_ENERGY_SCALE( HD_ET_QUANT ) .EQ. 0) THEN 0626 HARDWARE_THRSH = 0 0627 ELSE 0628 HARDWARE_THRSH = NINT ( DESIRED_THRSH 0629 & / ( GLOBAL_ENERGY_SCALE ( HD_ET_QUANT ) TOWER_THRESHOLD_TRANSLATION 12-Dec-1990 12:13:17 VAX FORTRAN V5.4-79 Page 3 19-Sep-1990 16:32:19 TOWER_THRESHOLD_TRANSLATION.FOR;7 0630 & * 2.0 ** LUQ_LOCAL_RESCALING 0631 & (SIGN_ETA,MAGN_ETA,HD_ET_QUANT) ) ) 0632 & + LOOKUP_ZERESP(SIGN_ETA,MAGN_ETA,PHI, 0633 & HD_ET_QUANT) 0634 & - 1 0635 ENDIF 0636 C 0637 ELSE IF ( THRSH_TYPE .EQ. TT_TOTET_THRTYP ) THEN 0638 IF (GLOBAL_ENERGY_SCALE( TOT_ET_QUANT) .EQ. 0) THEN 0639 HARDWARE_THRSH = 0 0640 ELSE 0641 HARDWARE_THRSH = NINT ( DESIRED_THRSH 0642 & / ( GLOBAL_ENERGY_SCALE ( TOT_ET_QUANT ) 0643 & * 2.0 ** LUQ_LOCAL_RESCALING 0644 & (SIGN_ETA,MAGN_ETA,EM_ET_QUANT) ) ) 0645 & + LOOKUP_ZERESP(SIGN_ETA,MAGN_ETA,PHI, 0646 & EM_ET_QUANT) 0647 & + LOOKUP_ZERESP(SIGN_ETA,MAGN_ETA,PHI, 0648 & HD_ET_QUANT) 0649 & - 1 0650 ENDIF 0651 C 0652 ELSE !ERROR 0653 ENDIF 0654 C 0655 IF ( HARDWARE_THRSH .LT. 0 ) HARDWARE_THRSH = 0 0656 IF ( HARDWARE_THRSH .GT. 255 ) HARDWARE_THRSH = 255 0657 C---------------------------------------------------------------------- 0658 999 RETURN 0659 END TOWER_THRESHOLD_TRANSLATION 12-Dec-1990 12:13:17 VAX FORTRAN V5.4-79 Page 4 01 19-Sep-1990 16:32:19 TOWER_THRESHOLD_TRANSLATION.FOR;7 PROGRAM SECTIONS Name Bytes Attributes 0 $CODE 324 PIC CON REL LCL SHR EXE RD NOWRT LONG 3 LEVEL1_LOOKUP 512340 PIC OVR REL GBL SHR NOEXE RD WRT LONG 4 LEVEL1_LOOKUP_EXPANSION 302400 PIC OVR REL GBL SHR NOEXE RD WRT LONG Total Space Allocated 815064 ENTRY POINTS Address Type Name 0-00000000 TOWER_THRESHOLD_TRANSLATION VARIABLES Address Type Name Address Type Name AP-00000014@ R*4 DESIRED_THRSH 3-000000F8 I*4 FIRST_LOOKUP_TYPE 3-00000490 R*4 GLOBAL_ADC_SCALE AP-00000018@ I*4 HARDWARE_THRSH AP-00000008@ I*4 MAGN_ETA AP-0000000C@ I*4 PHI 3-000000FC I*4 SECOND_LOOKUP_TYPE AP-00000004@ I*4 SIGN_ETA AP-00000010@ I*4 THRSH_TYPE ARRAYS Address Type Name Bytes Dimensions 3-000064B4 R*4 ADC_CNT_VS_RAW_E 18432 (0:1, 24, 32, 3) 3-0000ACB4 I*4 ADC_ZERESP 12288 (0:1, 24, 32, 2) 3-000034B4 R*4 ANALOG_INPUT_SCALING 12288 (0:1, 24, 32, 2) 3-0000DCB4 I*4 DAC_BYTE 12288 (0:1, 24, 32, 2) 4-000000A8 R*4 ELEC_NOISE_CUT_FACT 24 (6) 3-00010CB4 R*4 ELEC_NOISE_SIGMA 12288 (0:1, 24, 32, 2) 4-0000A8C0 R*4 FINAL_FITTING 258048 (0:1, 24, 32, 6, -3:3) 3-00000494 R*4 GLOBAL_ENERGY_SCALE 32 (8) 3-000004B4 R*4 INPUT_ENERGY_ERROR 12288 (0:1, 24, 32, 2) 3-00000000 R*4 L0_BIN_COVERAGE 248 (-15:15, 0:1) 3-00014134 I*4 LOOKUP_ZERESP 36864 (0:1, 24, 32, 6) 3-00013CB4 I*4 LUQ_LOCAL_RESCALING 1152 (0:1, 24, 6) 3-000003E8 I*4 LUQ_PAGE_INDEX 168 (6, -3:3) 3-00000100 I*4 LUQ_PAGE_NUMBER 744 (6, -15:15) 4-00000000 R*4 PAGE_Z_NOM 168 (6, -3:3) 3-0001D134 I*4 PROM_CUT 196608 (0:1, 24, 32, 4, 8) 3-0004D134 R*4 PROM_SLOPE 196608 (0:1, 24, 32, 4, 8) 4-000090C0 R*4 TOWER_PHI_COORD 6144 (0:1, 24, 32) 4-000000C0 R*4 TOWER_RZ_COORD 36864 (0:1, 24, 32, 3, 0:1) 4-000498C0 R*4 TRANSV_ENERGY_CUT 1152 (0:1, 24, 6) 3-0007D134 I*4 TREE_OFFSET 32 (8) TOWER_THRESHOLD_TRANSLATION 12-Dec-1990 12:13:17 VAX FORTRAN V5.4-79 Page 5 01 19-Sep-1990 16:32:19 TOWER_THRESHOLD_TRANSLATION.FOR;7 LABELS Address Label 0-00000143 999 COMMAND QUALIFIERS FORTRAN/LIST/DEBUG=ALL/NOOP TOWER_THRESHOLD_TRANSLATION /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW) /DEBUG=(SYMBOLS,TRACEBACK) /DESIGN=(NOCOMMENTS,NOPLACEHOLDERS) /SHOW=(NODICTIONARY,NOINCLUDE,MAP,NOPREPROCESSOR,SINGLE) /STANDARD=(NOSEMANTIC,NOSOURCE_FORM,NOSYNTAX) /WARNINGS=(NODECLARATIONS,GENERAL,NOULTRIX,NOVAXELN) /CONTINUATIONS=19 /NOCROSS_REFERENCE /NOD_LINES /NOEXTEND_SOURCE /F77 /NOG_FLOATING /I4 /NOMACHINE_CODE /NOOPTIMIZE /NOPARALLEL /NOANALYSIS_DATA /NODIAGNOSTICS /LIST=MSUTRGROOT:[000000.TRG_LIB.LSMLIB]TOWER_THRESHOLD_TRANSLATION.LIS;1 /OBJECT=MSUTRGROOT:[000000.TRG_LIB.LSMLIB]TOWER_THRESHOLD_TRANSLATION.OBJ;1 COMPILATION STATISTICS Run Time: 0.65 seconds Elapsed Time: 2.29 seconds Page Faults: 302 Dynamic Memory: 384 pages