Trigger Board 2 (slot 14) Line Definitions

 
A1(082900)-------------------------------------------------------------------------------------
0
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = cc_time[0] # tr_time[1];
	out = 1cblow & 3tracks & evtime;
1
	2cblow  = (cb_n_low[] > 1)#(cb_n_med[] > 0);
	3tracks = (tr_n_ax[]>2);
	evtime = cc_time[0] # tr_time[1];
	out = 2cblow & 3tracks & evtime;
2
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 3tracks & evtime;
3
	1cbmed  = cb_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cbmed & 1track & evtime;
4
	1cblow  = cb_n_low[] > 0;
	2track = (tr_n_lo[]>1) # (tr_n_hi[]>1) # ( (tr_n_lo[]>0) & (tr_n_hi[]>0) ); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cblow & 2track & evtime;
5
	2cblow  = (cb_n_low[] > 1)#(cb_n_med[] > 0);
	2track = (tr_n_lo[]>1) # (tr_n_hi[]>1) # ( (tr_n_lo[]>0) & (tr_n_hi[]>0) ); 
	evtime = cc_time[0] # tr_time[1];
	out = 2cblow & 2track & evtime;
6
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0];
	out = 1cehigh & 1track & evtime;
7
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cehigh & 1track & evtime;
8
	1cemed  = ce_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0] # tr_time[1];
	out = 1cemed & 1track & evtime;
9
	2cclow  = cb_n_low[] > 1;
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
10
	2cclow  = (cb_n_low[] > 1) #
			 ((cb_n_low[] > 0)&(ce_n_low[] > 0)) #
			  (ce_n_low[] > 1);
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # ce_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
11
	ored = 	GND;
	out = ored;
A1(080100)-------------------------------------------------------------------------------------
0
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = cc_time[0] # tr_time[1];
	out = 1cblow & 3tracks & evtime;
1
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 1cblow & 3tracks & evtime;
2
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 3tracks & evtime;
3
	1cbmed  = cb_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cbmed & 1track & evtime;
4
	1cblow  = cb_n_low[] > 0;
	2track = (tr_n_lo[]>1) # (tr_n_hi[]>1) # ( (tr_n_lo[]>0) & (tr_n_hi[]>0) ); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cblow & 2track & evtime;
5
	1cbhigh  = cb_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cbhigh & 1track & evtime;
6
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0];
	out = 1cehigh & 1track & evtime;
7
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cehigh & 1track & evtime;
8
	1cemed  = ce_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0] # tr_time[1];
	out = 1cemed & 1track & evtime;
9
	2cclow  = cb_n_low[] > 1;
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
10
	2cclow  = (cb_n_low[] > 1) #
			 ((cb_n_low[] > 0)&(ce_n_low[] > 0)) #
			  (ce_n_low[] > 1);
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # ce_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
11
	ored = 	GND;
	out = ored;
A1(060200)-------------------------------------------------------------------------------------
0
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = cc_time[0] # tr_time[1];
	out = 1cblow & 3tracks & evtime;
1
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 1cblow & 3tracks & evtime;
2
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 3tracks & evtime;
3
	1cbmed  = cb_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cbmed & 1track & evtime;
4
	1cbhigh  = cb_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0];
	out = 1cbhigh & 1track & evtime;
5
	1cbhigh  = cb_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cbhigh & 1track & evtime;
6
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0];
	out = 1cehigh & 1track & evtime;
7
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cehigh & 1track & evtime;
8
	1cemed  = ce_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0] # tr_time[1];
	out = 1cemed & 1track & evtime;
9
	2cclow  = cb_n_low[] > 1;
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
10
	2cclow  = (cb_n_low[] > 1) #
			 ((cb_n_low[] > 0)&(ce_n_low[] > 0)) #
			  (ce_n_low[] > 1);
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # ce_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
11
	ored = 	GND;
	out = ored;
A1(051200)-------------------------------------------------------------------------------------
0
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = cc_time[0];
	out = 1cblow & 3tracks & evtime;
1
	1cblow  = cb_n_low[] > 0;
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 1cblow & 3tracks & evtime;
2
	3tracks = (tr_n_ax[]>2);
	evtime = tr_time[1];
	out = 3tracks & evtime;
3
	1cbmed  = cb_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0] # tr_time[1];
	out = 1cbmed & 1track & evtime;
4
	1cbhigh  = cb_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = cc_time[0];
	out = 1cbhigh & 1track & evtime;
5
	1cbhigh  = cb_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cbhigh & 1track & evtime;
6
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0];
	out = 1cehigh & 1track & evtime;
7
	1cehigh  = ce_n_high[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = tr_time[1];
	out = 1cehigh & 1track & evtime;
8
	1cemed  = ce_n_med[] > 0;
	1track = (tr_n_ax[]>0); 
	evtime = ce_time[0] # tr_time[1];
	out = 1cemed & 1track & evtime;
9
	2cclow  = cb_n_low[] > 1;
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
10
	2cclow  = (cb_n_low[] > 1) #
			 ((cb_n_low[] > 0)&(ce_n_low[] > 0)) #
			  (ce_n_low[] > 1);
	2track = tr_n_ax[] > 1; 
	evtime = cc_time[0] # ce_time[0] # tr_time[1];
	out = 2cclow & 2track & evtime;
11
	ored = 	in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
			in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
			in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
			in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
			in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
			in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
			in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
			in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
			in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
			in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
			in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
			in[9]&in[8]&in[7]&in[6]&in[5]&in[3]&in[1];
	out = ored#in[0]#in[2]#in[4];
A2(103003)-------------------------------------------------------------------------------------
0
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>1);
	ored = gamgam & evtime;
	out = ored;
1
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(ce_n_med[]>0);
	ored = gamgam & evtime;
	out = ored;
2
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>2);
	ored = gamgam & evtime;
	out = ored;
3
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>1)&(ce_n_low[]>0);
	ored = gamgam & evtime;
	out = ored;
4
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>1);
	ored = gamgam & evtime;
	out = ored;
5
	evtime = cc_time[0];
	gamgam = (cb_n_med[]>1)&(cb_n_high[]>0);
	ored = gamgam & evtime;
	out = ored;
6
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_high[]>0)&(cb_n_med[]>2);
	ored = gamgam & evtime;
	out = ored;
7
	evtime = cc_time[0]#tr_time[1];
	gamgam = cb_n_high[]>1;
	ored = gamgam & evtime;
	out = ored;
8
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>2);
	ored = 2phot & evtime;
	out = ored;
9
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>3);
	ored = 2phot & evtime;
	out = ored;
10
	evtime = cc_time[0]#tr_time[1];
	2photon= (cb_n_high[]>1)&(ce_n_med[]>1);
	ored = 2photon & evtime;
	out = ored;
11
	ored = 	in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
			in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
			in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
			in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
			in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
			in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
			in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
			in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
			in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
			in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
			in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
			in[9]&in[8]&in[7]&in[6]&in[5]&in[3]&in[1];
	out = ored#in[0]#in[2]#in[4];
A2(102503)-------------------------------------------------------------------------------------
0
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>1);
	ored = gamgam & evtime;
	out = ored;
1
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(ce_n_med[]>0);
	ored = gamgam & evtime;
	out = ored;
2
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>2);
	ored = gamgam & evtime;
	out = ored;
3
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>1)&(ce_n_low[]>0);
	ored = gamgam & evtime;
	out = ored;
4
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_med[]>0)&(cb_n_low[]>1);
	ored = gamgam & evtime;
	out = ored;
5
	evtime = cc_time[0];
	gamgam = (cb_n_med[]>0)&(tr_n_ax[]==0);
	ored = gamgam & evtime;
	out = ored;
6
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_high[]>0)&(cb_n_med[]>2);
	ored = gamgam & evtime;
	out = ored;
7
	evtime = cc_time[0]#tr_time[1];
	gamgam = cb_n_high[]>1;
	ored = gamgam & evtime;
	out = ored;
8
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>2);
	ored = 2phot & evtime;
	out = ored;
9
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>3);
	ored = 2phot & evtime;
	out = ored;
10
	evtime = cc_time[0]#tr_time[1];
	2photon= (cb_n_high[]>1)&(ce_n_med[]>1);
	ored = 2photon & evtime;
	out = ored;
11
	ored = 	in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
			in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
			in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
			in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
			in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
			in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
			in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
			in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
			in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
			in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
			in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
			in[9]&in[8]&in[7]&in[6]&in[5]&in[3]&in[1];
	out = ored#in[0]#in[2]#in[4];
A2(062202)-------------------------------------------------------------------------------------
0-5
% 6/20/02: Digital Energy Sum trigger line

Let h = exclusive high count, 
m = exclusive medium count, 
l = exclusive low count
(i.e. h + m + l = total number of all clusters)

Digital Energy Sum E = a*h +b*m + c*l

if high threshold = 1.50 GeV
medium threshold = 0.70 GeV
low threshold = 0.15 GeV

then, taking c=1 and rounding we get a=10 and b=5

However, since setting a high also sets medium and low, the counts are NOT
exclusive. So, the counts we measure are:

H = actual inclusive high count,
M = actual inclusive medium count,
L = actual inclusive low count

Now relate the exclusive and inclusive counts:
h = H
m = M-h = M-H
l = L-m-h = L-(M-H)-H = L-M

so E = a*H + b*(M-H) + c(L-M)
= a*H + b*M - b*H + c*L - c*M
= (a-b)*H + (b-c)*M + c*L 
= A*H + B*M + C*L

Since we found above that a=10, b=5, and c=1
we get A = 5, B = 4, C = 1 in the above equation, which is 
implemented in the code below.

Note: we dont actually ask this chip to multiply, but rather we shift and add.

-------- code ------
esum[] = cb_n_hi_4x[] + cb_n_hi_1x[]  -- HI x A (5)
		      + cb_n_md_4x[]  -- MED x B (4)
		      + cb_n_lo_1x[]; -- LO x C (1)

evtime = cc_time[0]#tr_time[1];

out[] = esum[]&evtime;
===========================================================================
6
	evtime = cc_time[0]#tr_time[1];
	gamgam = (cb_n_high[]>0)&(cb_n_med[]>2);
	ored = gamgam & evtime;

7
	evtime = cc_time[0]#tr_time[1];
	gamgam = cb_n_high>1;
	ored = gamgam & evtime;
8
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>2);
	ored = 2phot & evtime;
9
	evtime = cc_time[0]#tr_time[1];
	2phot = (cb_n_high[]>1) & (cb_n_med[]>3);
	ored = 2phot & evtime;
10
	evtime = cc_time[0]#tr_time[1];
	2photon= (cb_n_high[]>1)&(ce_n_med[]>1);
	ored = 2photon & evtime;
11
	ored = in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
	in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
	in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
	in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
	in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
	in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
	in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
	in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
	in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
	in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
	in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
	in[9]&in[8]&in[7]&in[6]&in[5]&in[3]&in[1];
	out = ored#in[0]#in[2]#in[4];
A2(051200)-------------------------------------------------------------------------------------
0
	evtime = ce_time[0];
	bhabha = bha_theta[0];
	ored = 	bhabha & evtime;
	out = ored;
1
	evtime = ce_time[0];
	bhabha = bha_theta[1];
	ored = 	bhabha & evtime;
	out = ored;
2
	evtime = ce_time[0];
	bhabha = bha_theta[2] # bha_theta[3];
	ored = 	bhabha & evtime;
	out = ored;
3
	evtime = cc_time[0];
	bhabha = bha_theta[2] # bha_theta[3];
	ored = 	bhabha & evtime;
	out = ored;
4
	evtime = cc_time[0];
	bhabha = bha_theta[4];
	ored = 	bhabha & evtime;
	out = ored;
5
	evtime = cc_time[0];
	bhabha = bha_theta[5];
	ored = 	bhabha & evtime;
	out = ored;
6
	evtime = cc_time[0];
	gamgam = bha_theta[5] # bha_theta[4] # bha_theta[3] # bha_theta[2];
	notrack = tr_n_ax[]==0;
	ored = 	gamgam & notrack & evtime;
	out = ored;
7
	evtime = ce_time[0];
	gamgam = bha_theta[0] # bha_theta[1] # bha_theta[2] # bha_theta[3];
	notrack = tr_n_ax[]==0;
	ored = 	gamgam & notrack & evtime;
	out = ored;
8
	evtime = cc_time[0];
	2phot = (cb_n_low[]>0) & (ce_n_med[]>0);
	ored = 	2phot & evtime;
	out = ored;
9
	evtime = ce_time[0];
	2phot = (cb_n_low[]>0) & (ce_n_med[]>0);
	ored = 	2phot & evtime;
	out = ored;
10
	evtime = cc_time[0];
	2phot = (cb_n_low[]>0) & (ce_n_low[]>1);
	ored = 	2phot & evtime;
	out = ored;
11
	ored = 	in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
			in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
			in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
			in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
			in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
			in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
			in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
			in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
			in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
			in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
			in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
			in[9]&in[8]&in[7]&in[6]&in[5]&in[3]&in[1];
	out = ored#in[0]#in[2]#in[4];
A3(080300)---------------------------------------------------------------------------------------
0
	tr_time[1]#cc_time[0];
1
	(tr_time[1]#cc_time[0]) & (n_tr_ax[]>0);
2
	(tr_time[1]#cc_time[0]) & (n_tr_ax[]>1);
3
	(tr_time[1]#cc_time[0]) & (n_tr_ax[]>2);
4
	(tr_time[1]#cc_time[0]) & (n_tr_lo[]>0);
5
	(tr_time[1]#cc_time[0]) & (n_tr_lo[]>1);
6
	(tr_time[1]#cc_time[0]) & (n_tr_lo[]>2);
7
	(tr_time[1]#cc_time[0]) & (n_tr_hi[]>0);
8
	(tr_time[1]#cc_time[0]) & (n_tr_hi[]>1);
9
	(tr_time[1]#cc_time[0]) & (n_tr_hi[]>2);
10
	(tr_time[1]#cc_time[0]) & (n_tr_hi[]==2);
11
	(tr_time[1]#cc_time[0]) & (n_tr_hi[]==2) & (n_tr_lo[]==0);
A3(070900)---------------------------------------------------------------------------------------
0
	tr_time[1]
1
	tr_time[1] & (n_tr_ax[]>0);
2
	tr_time[1] & (n_tr_ax[]>1);
3
	tr_time[1] & (n_tr_ax[]>2);
4
	tr_time[1] & (n_tr_lo[]>0);
5
	tr_time[1] & (n_tr_lo[]>1);
6
	tr_time[1] & (n_tr_lo[]>2);
7
	tr_time[1] & (n_tr_hi[]>0);
8
	tr_time[1] & (n_tr_hi[]>1);
9
	tr_time[1] & (n_tr_hi[]>2);
10
	tr_time[1] & (n_tr_hi[]==2);
11
	tr_time[1] & (n_tr_hi[]==2) & (n_tr_lo[]==0);
A3(111999)---------------------------------------------------------------------------------------
0
	tr_time[1]
1
	tr_time[1] & (n_tr_ax[]>0);
2
	tr_time[1] & (n_tr_ax[]>1);
3
	tr_time[1] & (n_tr_ax[]>2);
4
	tr_time[1] & (n_tr_ax[]>3);
5
	tr_time[1] & (n_tr_ax[]>4);
6
	n_tr_ax[] > 0;
7
	n_tr_ax[] > 1;
8
	n_tr_ax[] > 2;
9
	n_tr_ax[] > 3;
10
	n_tr_ax[] > 4;
11
	n_tr_ax[] > 5;
A4(051200)------------------------------------------------------------------------------------------
0
	evtrig = (cb_high_old[] == 3);
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
1
	evtrig = (cb_low_old[] == 3);
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
2
	evtrig = (ce_high_old[] == 3);
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
3
	evtrig = (ce_low_old[] == 3);
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
4
	evtrig = (cb_high_old[] > 1) & !cpu_trig[0];
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
5
	evtrig = (cb_low_old[] > 1) & !cpu_trig[0];
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
6
	evtrig = (ce_high_old[] > 1) & !cpu_trig[0];
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
7
	evtrig = (ce_low_old[] > 1) & !cpu_trig[0];
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
8
	evtrig = (cb_high_old[] > 0) & !cpu_trig[1];
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
9
	evtrig = (cb_low_old[] > 0) & !cpu_trig[1];
	evtime = (cc_time[0] # tr_time[1]);
	ored = evtrig & evtime;
10
	evtrig = (ce_high_old[] > 0) & !cpu_trig[1];
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
11
	evtrig = (ce_low_old[] > 0) & !cpu_trig[1];
	evtime = (ce_time[0] # tr_time[1]);
	ored = evtrig & evtime;
B1(080300) -------------------------------------------------------------------------------
line0:	back to back tracks with (track OR CB) timing (1 versus 3 cells)
line1:	back to back tracks with (track OR CB) timing (1 versus 5 cells)
line2:	back to back tracks with (track OR CB) timing (1 versus 7 cells)
line3:	back to back tracks with (track OR CB) timing (1 versus 9 cells)
line4:	back to back tracks with (track OR CB) timing (1 versus 11 cells)
line5:	back to back tracks with (track OR CB) timing (1 versus 13 cells)
line6:	back to back tracks (1 versus 3 cells)
line7:	back to back tracks (1 versus 5 cells)
line8:	back to back tracks (1 versus 7 cells)
line9:	back to back tracks (1 versus 9 cells)
line10:	back to back tracks (1 versus 11 cells)
line11:	back to back tracks (1 versus 13 cells)
B1(051700) -------------------------------------------------------------------------------
line0:	back to back tracks with (track OR CB) timing (1 versus 3 cells)
line1:	back to back tracks with (track OR CB) timing (1 versus 5 cells)
line2:	back to back tracks with (track OR CB) timing (1 versus 7 cells)
line3:	back to back tracks with (track OR CB) timing (1 versus 9 cells)
line4:	back to back tracks with (track OR CB) timing (1 versus 11 cells)
line5:	back to back tracks with (track OR CB) timing (1 versus 13 cells)
lines 6 through 11 are GND;
B2(030100)--------------------------------------------------------------------------------
0
	ored = 	cpu_trig[0] & !ext_trig[0];
1
	ored = 	cpu_trig[1] & !ext_trig[2];
2
	ored = 	GND;
3
	ored = 	GND;
4
	ored = 	GND;
5
	ored = 	GND;
6
	ored = 	GND;
7
	ored = 	GND;
8
	ored = 	GND;
9
	ored = 	GND;
10
	ored = 	GND;
11
	ored = 	in[117]&in[116]&in[115]&in[114]&in[113]&in[112]&in[111]&in[110]&in[109]&in[108]&
			in[107]&in[106]&in[105]&in[104]&in[103]&in[102]&in[101]&in[100]&
			in[99]&in[98]&in[97]&in[96]&in[95]&in[94]&in[93]&in[92]&in[91]&in[90]&
			in[89]&in[88]&in[87]&in[86]&in[85]&in[84]&in[83]&in[82]&in[81]&in[80]&
			in[79]&in[78]&in[77]&in[76]&in[75]&in[74]&in[73]&in[72]&in[71]&in[70]&
			in[69]&in[68]&in[67]&in[66]&in[65]&in[64]&in[63]&in[62]&in[61]&in[60]&
			in[59]&in[58]&in[57]&in[56]&in[55]&in[54]&in[53]&in[52]&in[51]&in[50]&
			in[49]&in[48]&in[47]&in[46]&in[45]&in[44]&in[43]&in[42]&in[41]&in[40]&
			in[39]&in[38]&in[37]&in[36]&in[35]&in[34]&in[33]&in[32]&in[31]&in[30]&
			in[29]&in[28]&in[27]&in[26]&in[25]&in[24]&in[23]&in[22]&in[21]&in[20]&
			in[19]&in[18]&in[17]&in[16]&in[15]&in[14]&in[13]&in[12]&in[11]&in[10]&
			in[9]&in[8]&in[7]&in[6]&in[5]&in[4]&in[3]&in[2]&in[1]&in[0];
C1(120400)-----------------------------------------------------------------------------------
	o[0] = a1[0]; -- hadronic (using 1cblow)
	o[1] = b1[1]; -- mupair
	o[2] = a4[0]; -- barrel bhabha
	o[3] = a4[6]; -- endcap bhabha
	o[4] = a1[3]; -- el-track
	o[5] = a3[2]; -- 2-track
	o[6] = a1[4]; -- rad/tau (using 1cblow)
	o[7] = a3[8]&b1[6]; -- b-to-b high stereo (tr_n_hi > 1)

	o[8] = a1[1]; -- hadronic (using 2cblow#1cbmed)
	o[9] = a1[5]; -- rad/tau (using 2cblow#1cbmed)

	o[21..10] = gnd;

-- the following lines are for debugging
	o[22] = a3[8]; -- debug b-to-b high stereo
	o[23] = b1[6]; -- debug b-to-b high stereo

	out[23..0]		= o[23..0];

	xout = 	gnd;
C1(090500)-----------------------------------------------------------------------------------
	o[0] = a1[0]; -- hadronic (using 1cblow)
	o[1] = b1[1]; -- mupair
	o[2] = a4[0]; -- barrel bhabha
	o[3] = a4[6]; -- endcap bhabha
	o[4] = a1[3]; -- el-track
	o[5] = a3[2]; -- 2-track
	o[6] = a1[4]; -- rad/tau (using 1cblow)
	o[7] = a3[8]&b1[6]; -- b-to-b high stereo(tr_n_hi > 1)

	o[8] = a1[1]; -- hadronic (using 2cblow#1cbmed)
	o[9] = a1[5]; -- rad/tau (using 2cblow#1cbmed)

	o[23..10] = gnd;

	out[23..0]		= o[23..0];
C1(082900)-----------------------------------------------------------------------------------
	o[0] = a1[0]; -- hadronic (using 1cblow)
	o[1] = b1[1]; -- mupair
	o[2] = a4[0]; -- barrel bhabha
	o[3] = a4[6]; -- endcap bhabha
	o[4] = a1[3]; -- el-track
	o[5] = a3[2]; -- 2-track
	o[6] = a1[4]; -- rad/tau (using 1cblow)
	o[7] = a3[10]&b1[6]; -- b-to-b high stereo(tr_n_hi == 2)

	o[8] = a1[1]; -- hadronic (using 2cblow#1cbmed)
	o[9] = a1[5]; -- rad/tau (using 2cblow#1cbmed)

	o[23..10] = gnd;

	out[23..0]		= o[23..0];
C1(080200)-----------------------------------------------------------------------------------
	o[0] = a1[0]; -- hadronic
	o[1] = b1[1]; -- mupair A
	o[2] = a4[0]; -- barrel bhabha
	o[3] = a4[6]; -- endcap bhabha
	o[4] = a1[3]; -- el-track
	o[5] = a3[2]; -- 2-track
	o[6] = a1[4]; -- mupair B
	o[7] = a3[10]&b1[6]; -- b-to-b high stereo

	o[23..8] = gnd;
	out[23..0] = o[23..0];
C1(060199)-----------------------------------------------------------------------------------
    If (ctl[3..0]==1) Then 
       o[11..0] = a1[];
    ElsIf (ctl[3..0]==2) Then
       o[11..0] = a2[];
    ElsIf (ctl[3..0]==3) Then
       o[11..0] = a3[];
    ElsIf (ctl[3..0]==4) Then
       o[11..0] = a4[];
    ElsIf (ctl[3..0]==5) Then
       o[11..0] = b1[];
    ElsIf (ctl[3..0]==6) Then
       o[11..0] = b2[];
	else
       o[11..0] = a1[];
	End If;
    If (ctl[7..4]==1) Then 
       o[23..12] = a1[];
    ElsIf (ctl[7..4]==2) Then
       o[23..12] = a2[];
    ElsIf (ctl[7..4]==3) Then
       o[23..12] = a3[];
    ElsIf (ctl[7..4]==4) Then
       o[23..12] = a4[];
    ElsIf (ctl[7..4]==5) Then
       o[23..12] = b1[];
    ElsIf (ctl[7..4]==6) Then
       o[23..12] = b2[];
	else
       o[23..12] = a2[];
	End If;
	out[23..0] = o[23..0];
C2(062402)-----------------------------------------------------------------------------------
%
This version of C2 is designed to work with A2 chip version 062202.
Specifically, it compares the 6-bit digital energy count from the A2 chip
(see A2 documentation) to the 6-bit threshold specified by bits [13..8] of
the 24 bit serial control register in this chip. 

In order for the threshold for line 0 on this chip to function properly,
the lines ctl[13..8] need to be set to the proper value (see A2(062202) above).

These 6 bits are set with the L1Lookup constant. 

Since this board (board 2) is in the lowest slot number containing an 
L1D board (slot 14) the ctl[23..0] bits for the 8 trigger 
chips on this board will be the first 8 L1Lookup constants. Since this chip, C2,
is the 8'th chip on this board that has these kinds of L1Lookup ctl[23..0] bits, 
the ctl[23..0] bits for this chip will be the 8th in the list of constants.
This word should be set to 0x00nm00, where the lowers 6 bits of "nm" represent
the threshold.  For example, if you want the digital threshold to be 14 decimal
(= 0E hex) the constant word should be set to 0x000E00(hex) = 3584(dec).
 
For a more complete explanation of trigger constants in general, please
have a look here.
%
o[0] = a2[5..0] > ctl[13..8]; 	-- digital energy sum over threshold?
o[1] = a2[6]; 			-- other 
o[2] = a2[7]; 			-- lines
o[3] = a2[8]; 			-- from 
o[4] = a2[9]; 			-- the
o[5] = a2[10]; 			-- A2 chip

o[23..6] = GND;

out[23..0] = o[23..0];

C2(060199)-----------------------------------------------------------------------------------
    If (ctl[3..0]==1) Then 
       o[11..0] = a1[];
    ElsIf (ctl[3..0]==2) Then
       o[11..0] = a2[];
    ElsIf (ctl[3..0]==3) Then
       o[11..0] = a3[];
    ElsIf (ctl[3..0]==4) Then
       o[11..0] = a4[];
    ElsIf (ctl[3..0]==5) Then
       o[11..0] = b1[];
    ElsIf (ctl[3..0]==6) Then
       o[11..0] = b2[];
	else
       o[11..0] = a1[];
	End If;
    If (ctl[7..4]==1) Then 
       o[23..12] = a1[];
    ElsIf (ctl[7..4]==2) Then
       o[23..12] = a2[];
    ElsIf (ctl[7..4]==3) Then
       o[23..12] = a3[];
    ElsIf (ctl[7..4]==4) Then
       o[23..12] = a4[];
    ElsIf (ctl[7..4]==5) Then
       o[23..12] = b1[];
    ElsIf (ctl[7..4]==6) Then
       o[23..12] = b2[];
	else
       o[23..12] = a2[];
	End If;
	out[23..0] = o[23..0];