-- This file contains the history of some L1 and/or terms that were too long
-- to load using sql loader
-- E.Gallas June 2001
----------------------------------------------------------------------------
set echo on;
whenever sqlerror exit;

UPDATE L1_dialogs SET history=
'Special EM refset to trigger on electrons in instrumented region of CFT (July 2001). 
Requires ET > 5. GeV in all 8 currently available eta (-.8 to .8) and 3 phi (33 to 66 degrees CW from horizontal) TT.'
WHERE intent='detector' and neotype='emcount' and nty_version=1 and l1_key='em_refset' 
and name='em5eta8phi3' and version=1;

UPDATE L1_dialogs SET history=
'Special JET refset to trigger on jets in instrumented region of CFT (July 2001). 
Requires ET > 10. GeV in all 8 currently available eta (-.8 to .8) and 3 phi (33 to 66 degrees CW from horizontal) TT.'
WHERE intent='detector' and neotype='jetcount' and nty_version=1 and l1_key='jet_refset' 
and name='jt10eta8phi3' and version=1;

UPDATE l1_terms SET history='Copy of the Master Clock Generated L1 Sub-System Gap Signal.
 There are 3 gaps between superbunches, one called the ''Syncronization Gap''
 (which includes the ''beginning_of_turn'') and 2 called ''Cosmic Gaps''.'
WHERE t_name='Agap' and t_version=1
;

UPDATE l1_terms SET history='Cosmic Low Rate trigger based on cosmic cap top and bottom coincidence
 with a Muon Pulser signal with a higher threshold than ACosmicHi (source: LeCroy Lemo Input #1)'
WHERE t_name='ACosmicLow' and t_version=1
;
UPDATE l1_terms SET history='Cosmic High Rate trigger based on cosmic cap top and bottom coincidence
 with a Muon Pulser signal (source: LeCroy Lemo Input #3)'
WHERE t_name='ACosmicHi' and t_version=1
;
UPDATE l1_terms SET history='Cosmic ray trigger (for CFT cosmics) requires scint coincidence
 of Top East BorC and Bottom West BorC (source: LeCroy Lemo Input #9)'
WHERE t_name='AScintW1' and t_version=1
;
UPDATE l1_terms SET history='Muon Forward Pixel Scintillator test trigger (source: LeCroy Lemo Input #6)'
WHERE t_name='AMPixel' and t_version=1
;
UPDATE l1_terms SET history='Muon MDT_Fast_OR (source: LeCroy Lemo Input #8)'
WHERE t_name='AMDTFast' and t_version=1
;
UPDATE l1_terms SET history='Cosmic ray trigger intended for ICD (source: LeCroy Lemo Input #5)'
WHERE t_name='AICDTemp' and t_version=1
;

UPDATE l1_terms SET history='Dean''s calorimeter pulser trigger erroneously named after Jae'
WHERE t_name='AJae' and t_version=1
;
UPDATE l1_terms SET history='Dean''s 2nd cal pulser trigger used for timing studies'
WHERE t_name='ACalTest' and t_version=1
;

UPDATE l1_terms SET history='Permanently Tied HI (always true).
 This term is sent to Level 1 Framework if no other condition is required.'
WHERE t_name='AOn' and t_version=1
;

UPDATE l1_terms SET history='Luminosity Monitor trigger with name=''north_vertex''.'
WHERE t_name='Anorth_vertex' and t_version=1
;
UPDATE l1_terms SET history='Luminosity Monitor trigger.
 Also called the ''min_bias'' trigger, requiring hits above threshold in coincidence
 from Luminosity Monitors,
 which yields a ''good'' quick measure of the z vertex, commonly called the ''fastz''.'
WHERE t_name='Afastz' and t_version=1
;
UPDATE l1_terms SET history='Luminosity Monitor trigger with name=''pbar_halo''.
 Used during an antiproton only store to trigger on antiproton (pbar) halo in Luminosity Monitors.'
WHERE t_name='Apbar_halo' and t_version=1
;
UPDATE l1_terms SET history='Luminosity Monitor trigger with name=''proton_halo''.
 Used during an proton only store to trigger on proton halo in Luminosity Monitors.'
WHERE t_name='Aproton_halo' and t_version=1
;

UPDATE l1_terms SET history='L1 framework Outstanding L1s Limit #0.
 Disable L1 accept while the count difference between L1 accepts and L2 accepts,
 reflecting the number of events in the FIFO Buffer of events to be processed by L2,
 exceeds the Limit #0 (programmed into TCC). Buffer limit is 16 events (when full -> L1 busy).'
WHERE t_name='AOut0' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Outstanding L1s Limit #1.
 Disable L1 accept while the count difference between L1 accepts and L2 accepts,
 reflecting the number of events in the FIFO Buffer of events to be processed by L2,
 exceeds the Limit #1 (programmed into TCC). Buffer limit is 16 events (when full -> L1 busy).'
WHERE t_name='AOut1' and t_version=1
;

UPDATE l1_terms SET history='L1 framework Tevatron Beginning of Turn Marker.
 Occurs once per turn of the accelerator during the ''Syncronization Gap''.
 Does not coincide with any instantaneous luminosity.'
WHERE t_name='ABTurn' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron marker term.
 Live Accelerator BX (beam crossing)
 marks windows of time within which beam crossings (collisions) may occur.
 In Run 2a, there are a maximum of 36 crossings per turn of the accelerator.'
WHERE t_name='ALiveBX' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron Sync Gap Marker term.
 The Synchronization Gap is the name of one of the 3 gaps between superbunches in the accelerator.
 This gap always contains ''beginning of turn'', which occurs once per revolution.
 May be used to reset electronics, but no triggers should be taken.'
WHERE t_name='ASyncGap' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron Cosmic Gap Marker term.
 ''Cosmic Gap'' refers to two of the 3 gaps between superbunches in the accelerator.
 This 2.2 microsecond gap may be used to reset electronics, record cosmic ray or pedestal triggers.'
WHERE t_name='ACosGap' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Spare Marker.
 Now using 396 ns clock as the SVX chip time reference.'
WHERE t_name='ASpare' and t_version=1
;

UPDATE l1_terms SET history='L1 framework Skip Next N #0.
 Disable L1 accept after an L1 accept for a pre-programmed time
 to give L1 system time to make a decision.
 Time delay is fixed in TCC.
 This particular Skip #0 term is included in every L1 trigger
 and reflects the minimum L1 trigger inherent deadtime of the experiment.'
WHERE t_name='ASkip0' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Skip Next N #1.
 Disable L1 accept after an L1 accept for a pre-programmed time.
 Time delay is fixed in TCC.'
WHERE t_name='ASkip1' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Skip Next N #2.
 Disable L1 accept after an L1 accept for a pre-programmed time.
 Time delay is fixed in TCC.'
WHERE t_name='ASkip2' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Skip Next N #3.
 Disable L1 accept after an L1 accept for a pre-programmed time.
 Time delay is fixed in TCC.'
WHERE t_name='ASkip3' and t_version=1
;

UPDATE l1_terms SET history='L1 framework Tevatron Tick Select Comparator #0.
 Trigger for a specific one of 159 ticks which is known to coincide with a specific beam crossing 
(comparator #0 is generally the first bunch of a superbunch (tick 7)).
 Time delay (tick) is fixed in TCC.'
WHERE t_name='ATicSel0' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron Tick Select Comparator #1.
 Trigger for a specific one of 159 ticks which is known to coincide with a specific beam crossing.
 Time delay (tick) is fixed in TCC.'
WHERE t_name='ATicSel1' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron Tick Select Comparator #2.
 Trigger for a specific one of 159 ticks which is known to coincide with a specific beam crossing.
 Time delay (tick) is fixed in TCC.'
WHERE t_name='ATicSel2' and t_version=1
;
UPDATE l1_terms SET history='L1 framework Tevatron Tick Select Comparator #3.
 Trigger for a specific one of 159 ticks
 which is known to coincide with a specific beam crossing.
 Time delay (tick) is fixed in TCC.'
WHERE t_name='ATicSel3' and t_version=1
;

UPDATE l1_terms SET history='one muon with A and C layer SCINTILLATOR coincidence in CENTRAL region'
WHERE t_name='mu1cmsc' and t_version=1;
UPDATE l1_terms SET history='one muon with A and C layer PDT centroid coincidence in CENTRAL region'
WHERE t_name='mu1pdt' and t_version=1;
UPDATE l1_terms SET history='one muon with A and B layer SCINTILLATOR coincidence in NORTH region'
WHERE t_name='mu1pixn' and t_version=1;
UPDATE l1_terms SET history='one muon with A and B layer SCINTILLATOR coincidence in SOUTH region'
WHERE t_name='mu1pixs' and t_version=1;
UPDATE l1_terms SET history='one muon with TWO layer SCINTILLATOR coincidence in any region (C,N,or S)'
WHERE t_name='mu1scintw' and t_version=1;
UPDATE l1_terms SET history='one muon with TWO layer SCINTILLATOR and PDT centroid coincidence in CENTRAL region'
WHERE t_name='mu1tightc' and t_version=1;
UPDATE l1_terms SET history='two muons (AC SCINT coincidence in two different OCTANTS) in CENTRAL region'
WHERE t_name='mu2cmsc' and t_version=1;
UPDATE l1_terms SET history='two muons (any two SCINT layer coincidence in two different OCTANTS) in any region (C,N,or S)'
WHERE t_name='mu2scintw' and t_version=1;

commit;