C----------------------------------------------------------------------- C This is the content of the ring buffer for storing snapshots and C supporting longer integration periods in TRGMON C C NOTE: LV1_MPOOL.PARAMS must be included before this file in any source code C C Each snapshot takes 3020 bytes of memory C C Created : 7-JUN-1994 Philippe Laurens, Freddie Landry C- Updated 19-OCT-1995 Philippe Laurens - MSU L1 Trigger C- add scalers for 36x36 bunch test C----------------------------------------------------------------------- C C **** Variables used by INTEGRATE_NEW_DELTAS to work with the ring buffer C LOGICAL START, STEADY_STATE INTEGER OLD, CURRENT COMMON / RBUF_BOOKKEEPPING / START, STEADY_STATE, OLD, CURRENT C- CHARACTERISTICS AND SIZE LIMITS OF THE RING BUFFER C C define maximum length of the ring buffer INTEGER MAX_RBUF_LENGTH PARAMETER ( MAX_RBUF_LENGTH = 25 ) C C define the maximum factor of refresh time that the integration can be INTEGER MAX_REF_FACTOR PARAMETER( MAX_REF_FACTOR = MAX_RBUF_LENGTH-1 ) C- define the absolute maximum refresh time and therefore integration time C- in seconds INTEGER MAX_REF_TIME PARAMETER( MAX_REF_TIME = 7200 ) ! 2 hours C define handy parameters for index of gigas and units in stored variables INTEGER UNITS,GIGAS PARAMETER ( UNITS = 0, GIGAS = 1 ) C Following is the list of all variables contained in the ring buffer C ------------------------------------------------------------------- C C C C This is the number of beam crossings since the last time the system was C initialised. C This quantity is read from the data block: C item number: BEAM_CROSS_SCALER (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_BEAM_CROSS_COUNT ( UNITS:GIGAS, & 1:MAX_RBUF_LENGTH ) C C C This is the number of beam crossings since the last time the system was C initialised. C This quantity is read from the latched SBSC. C INTEGER RB_VETO_CROSS_COUNT ( 1:MAX_RBUF_LENGTH ) C C C This is the number of level 1 firings for all the specific triggers since C the system initialized. C This quantity is read from the data block: C item number: DBLOCK_NUM_SCALER (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_GLOBAL_FIRED_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C The number of events transferred to the level 2 trigger since C the system initialized. C item number: TRG_NUM_SCALER (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_EVENT_TRANSFER_COUNT ( UNITS:GIGAS, & 1:MAX_RBUF_LENGTH ) C C C The number of level 0 good readings since initialization. C item number: FASTZ_GOOD_SCALER (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_LEVEL_0_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times that the data block builder has been busy C since initialization. C item number: SCALER_DBBBUSY (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_DBBBUSY_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times the VME transfer program has been idle C since initialization. C item number: SCALER_68KSTATE_1 C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_68KSTATE_1_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times the VME transfer program has prepared C data since initialization. C item number: SCALER_68KSTATE_2 C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_68KSTATE_2_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C The number of times the VME transfer program has waited for C a free VBD buffer. C item number: SCALER_68KSTATE_3 C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_68KSTATE_3_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times the VME transfer program has waited for C the VBD to finish the previous DMA Read C item number: SCALER_68KSTATE_4 C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_68KSTATE_4_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C The number of times the VME transfer program is done with C Vertical and waiting for Slave Ready. C item number: SCALER_68KSTATE_5 (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_68KSTATE_5_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times that at least one specific trigger requiring C level 1.5 fired at level 1. C item number: LEVEL15_POTENTIAL_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_POTENTIAL_COUNT ( UNITS:GIGAS, & 1:MAX_RBUF_LENGTH ) C C C The number of events since initialization in which all specific triggers C fired required level 1.5 checking. C item number: LEVEL15_CYCLE_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_CYCLE_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of events since initialization which were confirmed at C the level 1.5 trigger. C item number: LEVEL15_PASS_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_ACCEPT_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of events since initialization which required level 1.5 C confirmation, but were rejected. C item number: LEVEL15_FAIL_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_REJECT_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of events since initialization in which at least one C specific trigger requiring level 1.5 fired and at least one pure C level 1 trigger fired. C item number: LEVEL15_SKIP_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_SKIP_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of times since initialization that an event required C level 1.5 confirmation, but the level 1.5 trigger timed-out, and C so the event was passed to level 2. C item number: LEVEL15_TIME_OUT_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_TIMEOUT_COUNT ( UNITS:GIGAS, 1:MAX_RBUF_LENGTH ) C C C The number of crossings unevaluated since initialization because C the level 1.5 was busy with another event. C item number: LEVEL15_DEAD_BEAMX_SCALER C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L15_DEAD_XING_COUNT ( UNITS:GIGAS, & 1:MAX_RBUF_LENGTH ) C C SPECIFIC TRIGGER COUNTS C C Counts of NUM_SPTRG_COUNTS different quantities for the 32 specific C triggers. Refer to SPTRG_COUNT in LV1_MPOOL_RAW.INC to see which C quantity corresponds to which element. C INTEGER RB_SPTRG_COUNT( 1:NUM_SPTRG_COUNTS, 0:31, & 1:MAX_RBUF_LENGTH) C C C C PER BUNCH SCALERS C C The number of level 1 firings since initialization for C bunch #b. C item number: BUNCH_LEVEL1 + 5*(b-1) C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L1_PER_BUNCH_COUNT( UNITS:GIGAS, 1:6, & 1:MAX_RBUF_LENGTH ) C C C The number of level 0 firings since initialization for C bunch #b. C item number: BUNCH_LEVEL0_GOOD + 5*(b-1) C (from:LEVEL1_TRIGGER_DATA_BLOCK.INC;18) C INTEGER RB_L0_PER_BUNCH_COUNT( UNITS:GIGAS, 1:6, & 1:MAX_RBUF_LENGTH ) C C C C FOREIGN SCALERS C C The total counts since initialization for the foreign scalers. C L1UTIL_GET_FOREIGN_SCALER routine is used to fill this C array. C INTEGER RB_FOREIGN_SCALER_COUNT( UNITS:GIGAS, 1:44, & 1:MAX_RBUF_LENGTH ) C C C GEOGRAPHIC SECTION COUNTS C C The number of geographic section (0:31) level 1 firings C since initialization. C item number: unknown C INTEGER RB_GEOSECT_STDGT_COUNT( 0:31, 1:MAX_RBUF_LENGTH ) C C C The number of geographic section (0:31) front end busy C signals since initialization. C item number: unknown C INTEGER RB_GEOSECT_BUSY_COUNT( 0:31, 1:MAX_RBUF_LENGTH ) C C C The 3 sets of scalers for the 36x36 bunch tests C INTEGER RB_FZLUM_36X36_COUNT ( 1:64, 1:MAX_RBUF_LENGTH ) INTEGER RB_PHALO_36X36_COUNT ( 1:64, 1:MAX_RBUF_LENGTH ) INTEGER RB_AHALO_36X36_COUNT ( 1:64, 1:MAX_RBUF_LENGTH ) C C C now collect all the variables in a common block COMMON / TRGMON_RBUF / RB_BEAM_CROSS_COUNT, & RB_VETO_CROSS_COUNT, & RB_GLOBAL_FIRED_COUNT, & RB_EVENT_TRANSFER_COUNT, & RB_LEVEL_0_COUNT, & RB_DBBBUSY_COUNT, & RB_68KSTATE_1_COUNT, & RB_68KSTATE_2_COUNT, & RB_68KSTATE_3_COUNT, & RB_68KSTATE_4_COUNT, & RB_68KSTATE_5_COUNT, & RB_L15_POTENTIAL_COUNT, & RB_L15_CYCLE_COUNT, & RB_L15_ACCEPT_COUNT, & RB_L15_REJECT_COUNT, & RB_L15_SKIP_COUNT, & RB_L15_TIMEOUT_COUNT, & RB_L15_DEAD_XING_COUNT, & RB_SPTRG_COUNT, & RB_L1_PER_BUNCH_COUNT, & RB_L0_PER_BUNCH_COUNT, & RB_FOREIGN_SCALER_COUNT, & RB_GEOSECT_STDGT_COUNT, & RB_GEOSECT_BUSY_COUNT, & RB_FZLUM_36X36_COUNT, & RB_PHALO_36X36_COUNT, & RB_AHALO_36X36_COUNT