SUBROUTINE GLOBAL_THRESHOLD_TRANSLATION ( & THRSH_TYPE, & DESIRED_THRSH, & HARDWARE_THRSH ) C---------------------------------------------------------------------- C- C- Purpose and Methods : Translates the specified global energy threshold to C- the appropriate reference number to load into a C- comparator of one of the last summing CAT card of C- the specified Energy tree. C- The threshold translation is inclusive, meaning that C- an energy deposit of the amount specified or greater C- will clear the threshold. C- C- Inputs : C- THRSH_TYPE specifies the quantity type for which the threshold C- translation is requested. C- It is recommended to use one of the compilation C- constants defined along with the common block. C- See GL_..._THRTYP in common block. C- C- DESIRED_THRSH is the desired energy threshold to be applied to the C- specified tower. C- Units: GeV. C- C- Outputs : C- HARDWARE_THRSH is the byte of quantified threshold to be loaded in C- the appropriate Tier #3 (or final stage) CAT Card C- to achieve the specified threshold comparison. C- C- Controls: None C- C- Comments : C- A call to INIT_LOOKUP_ROUTINES must have been made C- before this routine can be called. C- C- This translation will take into account the global C- sum of any offset present at the output of the C- lookup PROMs for the specified quantity. C- C- The threshold comparator in the hardware of the CAT C- card will perform an inclusive comparison. This C- means that a quantified global energy sum must be C- greater than or equal to the reference number C- programmed for that quantity to be considered as C- passing the threshold. C- C- Defined 6-FEB-1990 MICHIGAN STATE UNIVERSTITY, TRIGGER CONTROL SOFTWARE C- Updated 2-AUG-1990 MICHIGAN STATE UNIVERSTITY, TRIGGER CONTROL SOFTWARE C---------------------------------------------------------------------- IMPLICIT NONE C INCLUDE 'D0$LEVEL1:LEVEL1_LOOKUP.PARAMS' INCLUDE 'D0$LEVEL1:LEVEL1_LOOKUP.INC' C INTEGER THRSH_TYPE REAL DESIRED_THRSH INTEGER HARDWARE_THRSH C C---------------------------------------------------------------------- C IF (GLOBAL_ENERGY_SCALE(THRSH_TYPE) .EQ. 0) THEN HARDWARE_THRSH = 0 ELSE HARDWARE_THRSH = NINT ( DESIRED_THRSH & / GLOBAL_ENERGY_SCALE(THRSH_TYPE) ) & + TREE_OFFSET(THRSH_TYPE) ENDIF C C---------------------------------------------------------------------- 999 RETURN END