33 {
34
35
36 SG::ReadHandle<TrigConf::L1Menu> l1Menu (
m_l1MenuKey, ctx);
37
38
39 const auto & thr_gXE_altMet = l1Menu->thrExtraInfo().gXE();
40 int noiseCutThrA = thr_gXE_altMet.noiseCutThr('A');
41 int noiseCutThrB = thr_gXE_altMet.noiseCutThr('B');
42 int noiseCutThrC = thr_gXE_altMet.noiseCutThr('C');
43
44 std::vector<int> thr_A(12, noiseCutThrA);
45 std::vector<int> thr_B(12, noiseCutThrB);
46 std::vector<int> thr_C(16, noiseCutThrC);
47
48 std::array<std::vector<int>, 3> etaThr;
49 etaThr[0] = std::move(thr_A);
50 etaThr[1] = std::move(thr_B);
51 etaThr[2] = std::move(thr_C);
52
53
54 int A_MET_x_nc = 0x0;
55 int A_MET_y_nc = 0x0;
56 int A_MET_x_rms = 0x0;
57 int A_MET_y_rms = 0x0;
58
59 int A_sumEt_nc = 0x0;
60 int A_sumEt_rms = 0x0;
61
62
63 int B_MET_x_nc = 0x0;
64 int B_MET_y_nc = 0x0;
65 int B_MET_x_rms = 0x0;
66 int B_MET_y_rms = 0x0;
67
68 int B_sumEt_nc = 0x0;
69 int B_sumEt_rms = 0x0;
70
71
72 int C_MET_x_nc = 0x0;
73 int C_MET_y_nc = 0x0;
74 int C_MET_x_rms = 0x0;
75 int C_MET_y_rms = 0x0;
76
77 int C_sumEt_nc = 0x0;
78 int C_sumEt_rms = 0x0;
79
80
81 int MET_x_nc = 0x0;
82 int MET_y_nc = 0x0;
83 int MET_nc = 0x0;
84 int MET_x_rms = 0x0;
85 int MET_y_rms = 0x0;
86 int MET_rms = 0x0;
87
88
89 int total_sumEt_nc = 0x0;
90 int total_sumEt_rms = 0x0;
91
92 metFPGA(Atwr, A_MET_x_nc, A_MET_y_nc, 0, etaThr);
93 metFPGA(Btwr, B_MET_x_nc, B_MET_y_nc, 1, etaThr);
94 metFPGA(Ctwr, C_MET_x_nc, C_MET_y_nc, 2, etaThr);
95
96 metTotal(A_MET_x_nc, A_MET_y_nc, B_MET_x_nc, B_MET_y_nc, C_MET_x_nc, C_MET_y_nc, MET_x_nc, MET_y_nc, MET_nc);
97
104
105 rho_MET(Atwr, A_MET_x_rms, A_MET_y_rms, A_rho, A_sigma);
106 rho_MET(Btwr, B_MET_x_rms, B_MET_y_rms, B_rho, B_sigma);
107 rho_MET(Ctwr, C_MET_x_rms, C_MET_y_rms, C_rho, C_sigma);
108
109 metTotal(A_MET_x_rms, A_MET_y_rms, B_MET_x_rms, B_MET_y_rms, C_MET_x_rms, C_MET_y_rms, MET_x_rms, MET_y_rms, MET_rms);
110
114 total_sumEt_nc =
sumEt(A_sumEt_nc, B_sumEt_nc, C_sumEt_nc);
115 total_sumEt_nc = total_sumEt_nc/4;
116
120 total_sumEt_rms =
sumEt(A_sumEt_rms, B_sumEt_rms, C_sumEt_rms);
121 total_sumEt_rms = total_sumEt_rms/4;
122
123
124
125
126
127
128
129
130
131
132
133
134 outTOB[0] = (MET_y_nc& 0x00000FFF) << 0;
135 outTOB[0] = outTOB[0] | (MET_x_nc & 0x00000FFF) << 12;
136 if (MET_y_nc != 0) outTOB[0] = outTOB[0] | 0x00000001 << 24;
137 if (MET_x_nc != 0) outTOB[0] = outTOB[0] | 0x00000001 << 25;
138 outTOB[0] = outTOB[0] | (2 & 0x0000001F) << 26;
139
140
141 outTOB[1] = (MET_y_rms& 0x00000FFF) << 0;
142 outTOB[1] = outTOB[1] | (MET_x_rms & 0x00000FFF) << 12;
143 if (MET_y_rms != 0) outTOB[1] = outTOB[1] | 0x00000001 << 24;
144 if (MET_x_rms != 0) outTOB[1] = outTOB[1] | 0x00000001 << 25;
145 outTOB[1] = outTOB[1] | (2 & 0x0000001F) << 26;
146
147
148 outTOB[2] = (total_sumEt_nc& 0x00000FFF) << 0;
149 outTOB[2] = outTOB[2] | (MET_nc & 0x00000FFF) << 12;
150 if (total_sumEt_nc != 0) outTOB[2] = outTOB[2] | 0x00000001 << 24;
151 if (MET_nc != 0) outTOB[2] = outTOB[2] | 0x00000001 << 25;
152 outTOB[2] = outTOB[2] | (1 & 0x0000001F) << 26;
153
154
155 outTOB[3] = (total_sumEt_rms& 0x00000FFF) << 0;
156 outTOB[3] = outTOB[3] | (MET_rms & 0x00000FFF) << 12;
157 if (total_sumEt_rms != 0) outTOB[3] = outTOB[3] | 0x00000001 << 24;
158 if (MET_rms != 0) outTOB[3] = outTOB[3] | 0x00000001 << 25;
159 outTOB[3] = outTOB[3] | (1 & 0x0000001F) << 26;
160
161
162}