24 unsigned short int pattern = ((theadd >> 8) & 0xf);
25 unsigned short int strip = (theadd & 0xff);
35 edm::LogWarning(
"CSCSectorReceiverMiniLUT") <<
"+++ Value of strip, " << strip <<
", exceeds max allowed, "
38 if (data.phi_local >= maxPhiL)
40 <<
"+++ Value of phi_local, " << data.phi_local <<
", exceeds max allowed, "
45 data.phi_bend_local = pattern & 0x3F;
51 unsigned short sector,
53 unsigned short subsector,
55 const bool gangedME1a) {
56 if (endcap < 1 || endcap > 2)
58 <<
"+++ Value of endcap, " << endcap <<
", is out of bounds, [1, 2] +++\n";
59 if (sector < 1 || sector > 6)
61 <<
"+++ Value of sector, " << sector <<
", is out of bounds, [1, 6] +++\n";
62 if (station < 1 || station > 4)
64 <<
"+++ Value of station, " << station <<
", is out of bounds, [1, 4] +++\n";
68 unsigned short int tcscid = ((theadd >> 15) & 0xf);
69 unsigned short int lclPhi = ((theadd >> 6) & 0x3);
70 unsigned short int WG = ((theadd >> 8) & 0x7f);
71 unsigned short int bend = ((theadd)&0x3f);
73 int eta_temp = 999, eta_min = 999, eta_max = 999;
76 unsigned short int cscid = (tcscid > 9) ? tcscid - 9 : tcscid;
78 unsigned short int lclPhip = 0;
79 if (lclPhi == 1 || lclPhi == 3)
84 (
gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][0] +
85 gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][1] *
86 log(
gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][2] + WG));
87 eta_min =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][0];
88 eta_max =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][1];
91 (
gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][0] +
92 gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][1] *
93 log(
gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][2] + WG));
94 eta_min =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][0];
95 eta_max =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][1];
100 if (gangedME1a && (tcscid < 4) && (lclPhi == 3)) {
107 eta_temp = (
gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][0] +
108 gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][1] *
109 log(
gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][2] + WG));
110 eta_min =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][0];
111 eta_max =
gbl_eta_bounds[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][1];
115 <<
"+++ Value of cscid, " << tcscid <<
", is out of bounds, [1, 9] -- or --"
120 if ((eta_temp >= eta_min) && (eta_temp <= eta_max))
121 data.global_eta = eta_temp;
122 else if (eta_temp < eta_min)
123 data.global_eta = eta_min;
125 data.global_eta = eta_max;
129 data.global_bend = bend & 0x1F;
135 unsigned short sector,
137 unsigned short subsector,
139 const bool gangedME1a) {
140 if (endcap < 1 || endcap > 2)
142 <<
"+++ Value of endcap, " << endcap <<
", is out of bounds, [1, 2] +++\n";
143 if (sector < 1 || sector > 6)
145 <<
"+++ Value of sector, " << sector <<
", is out of bounds, [1, 6] +++\n";
146 if (station < 1 || station > 4)
148 <<
"+++ Value of station, " << station <<
", is out of bounds, [1, 4] +++\n";
154 unsigned short int cscid = ((theadd >> 15) & 0xf);
155 unsigned short int lclPhi = (theadd & 0x3ff);
157 lclPhi = lclPhi / 0.625;
163 int strip =
static_cast<int>(lclPhi / binPhiL);
164 if (station == 1 && (cscid <= 3) &&
165 (strip >= 127 && strip < 224)) {
171 ? lclPhi = (strip - 127 + 31) * (4 * binPhiL / 3)
179 if (station == 1 && ((cscid <= 3) || (cscid >= 7))) {
189 if (station == 1 && (cscid >= 10)) {
190 lclPhi = strip * (4 * binPhiL / 3);
195 if ((cscid > 0) && (cscid <= 9)) {
196 if ((station == 1) && (lclPhi < maxPhiL))
197 data.global_phi = (
gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][0] +
198 gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][1] * lclPhi);
199 else if ((station == 1) && (lclPhi >= maxPhiL))
201 (
gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][0] +
202 gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][1] * (maxPhiL - 1));
204 data.global_phi = (
gbl_phi_me_params[endcap - 1][sector - 1][station - 1][0][cscid - 1][0] +
205 gbl_phi_me_params[endcap - 1][sector - 1][station - 1][0][cscid - 1][1] * lclPhi);
208 <<
"+++ Value of cscid, " << cscid <<
", is out of bounds, [1, 9] +++\n";
210 if (data.global_phi >= maxPhiG)
212 <<
"+++ Value of global_phi, " << data.global_phi <<
", exceeds max allowed, " << maxPhiG - 1 <<
" +++\n";
218 unsigned short endcap,
unsigned short sector,
unsigned short subsector,
unsigned theadd,
const bool gangedME1a) {
219 if (endcap < 1 || endcap > 2)
221 <<
"+++ Value of endcap, " << endcap <<
", is out of bounds, [1, 2] +++\n";
222 if (sector < 1 || sector > 6)
224 <<
"+++ Value of sector, " << sector <<
", is out of bounds, [1, 6] +++\n";
230 unsigned short int cscid = ((theadd >> 15) & 0xf);
231 unsigned short int lclPhi = (theadd & 0x3ff);
233 lclPhi = lclPhi / 0.625;
235 if ((cscid <= 3) || (cscid >= 7))
240 if ((cscid > 0) && (cscid <= 9)) {
241 if (lclPhi < maxPhiL)
242 data.global_phi = (
gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][0] +
243 gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][1] * lclPhi);
245 data.global_phi = (
gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][0] +
246 gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][1] * (maxPhiL - 1));
249 <<
"+++ Value of cscid, " << cscid <<
", is out of bounds, [1, 9] +++\n";
251 if (data.global_phi >= maxPhiG)
253 <<
"+++ Value of global_phi, " << data.global_phi <<
", exceeds max allowed, " << maxPhiG - 1 <<
" +++\n";
255 if (data.global_phi >= maxPhiG)
257 <<
"+++ Value of global_phi, " << data.global_phi <<
", exceeds max allowed, " << maxPhiG - 1 <<
" +++\n";
static std::vector< std::string > checklist log
static global_phi_data calcGlobalPhiMEMini(unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd, const bool gangedME1a)
static const unsigned short int gbl_eta_bounds[2][6][4][2][4][9][2]
static const float gbl_eta_params[2][6][4][2][4][9][3]
static const float lcl_phi_param1
static const float lcl_phi_param0[1<< 4]
static lclphidat calcLocalPhiMini(unsigned theadd, const bool gangedME1a)
static global_phi_data calcGlobalPhiMBMini(unsigned short endcap, unsigned short sector, unsigned short subsector, unsigned theadd, const bool gangedME1a)
class global_phi_data gblphidat
class local_phi_data lclphidat
Data Types.
static const float gbl_phi_mb_params[2][6][2][9][2]
char data[epos_bytes_allocation]
static const float gbl_phi_me_params[2][6][4][2][9][2]
Log< level::Warning, false > LogWarning
class global_eta_data gbletadat
static global_eta_data calcGlobalEtaMEMini(unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd, const bool gangedME1a)