28 unsigned short int pattern = ((theadd >> 8) & 0xf);
29 unsigned short int strip = (theadd & 0xff);
36 <<
"+++ Value of strip, " << strip
40 if(data.phi_local >= maxPhiL)
42 <<
"+++ Value of phi_local, " << data.phi_local
47 data.phi_bend_local = pattern & 0x3F;
53 unsigned short sector,
55 unsigned short subsector,
56 unsigned theadd,
const bool gangedME1a)
58 if(endcap < 1 || endcap > 2)
60 <<
"+++ Value of endcap, " << endcap
61 <<
", is out of bounds, [1, 2] +++\n";
62 if(sector < 1 || sector > 6)
64 <<
"+++ Value of sector, " << sector
65 <<
", is out of bounds, [1, 6] +++\n";
66 if(station < 1 || station > 4)
68 <<
"+++ Value of station, " << station
69 <<
", is out of bounds, [1, 4] +++\n";
74 unsigned short int tcscid = ((theadd >> 15) & 0xf);
75 unsigned short int lclPhi = ((theadd >> 6) & 0x3);
76 unsigned short int WG = ((theadd >> 8) & 0x7f);
77 unsigned short int bend = ((theadd) & 0x3f);
85 unsigned short int cscid = (tcscid>9) ? tcscid - 9 : tcscid;
88 unsigned short int lclPhip =0;
89 if (lclPhi == 1 || lclPhi == 3) lclPhip = 2;
92 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0] +
93 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1] *
94 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][2] + WG));
98 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][0] +
99 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][1] *
100 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][2] + WG));
107 if ( gangedME1a && (tcscid < 4)&&(lclPhi == 3) ) {
116 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0] +
117 gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1] *
126 <<
"+++ Value of cscid, " << tcscid
127 <<
", is out of bounds, [1, 9] -- or --" 128 <<
" Value of wire group, " << WG
135 data.global_eta = eta_temp;
143 data.global_bend = bend & 0x1F;
150 unsigned short sector,
152 unsigned short subsector,
153 unsigned theadd,
const bool gangedME1a)
155 if(endcap < 1 || endcap > 2)
157 <<
"+++ Value of endcap, " << endcap
158 <<
", is out of bounds, [1, 2] +++\n";
159 if(sector < 1 || sector > 6)
161 <<
"+++ Value of sector, " << sector
162 <<
", is out of bounds, [1, 6] +++\n";
163 if(station < 1 || station > 4)
165 <<
"+++ Value of station, " << station
166 <<
", is out of bounds, [1, 4] +++\n";
172 unsigned short int cscid = ((theadd >> 15)&0xf);
173 unsigned short int lclPhi = (theadd & 0x3ff);
174 if (!gangedME1a) lclPhi = lclPhi/0.625;
180 int strip =
static_cast<int>(lclPhi/binPhiL);
181 if (station == 1 && (cscid <= 3) && (strip >= 127 && strip < 224)){
186 gangedME1a? lclPhi = (strip-127+31)*(4*binPhiL/3) : lclPhi = (strip-127)*(4*binPhiL/3) ;
190 if(station == 1 && ((cscid <= 3) || (cscid >= 7))) {
194 maxPhiL = maxPhiL*(64./80);
198 if (station == 1 && (cscid >= 10)) {
199 lclPhi = strip*(4*binPhiL/3);
204 if((cscid > 0) && (cscid <= 9))
206 if((station == 1) && (lclPhi < maxPhiL))
207 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
208 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*lclPhi);
209 else if((station == 1) && (lclPhi >= maxPhiL))
210 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
211 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*(maxPhiL-1));
213 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][0] +
218 <<
"+++ Value of cscid, " << cscid
219 <<
", is out of bounds, [1, 9] +++\n";
221 if(data.global_phi >= maxPhiG)
223 <<
"+++ Value of global_phi, " << data.global_phi
224 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
230 unsigned short sector,
231 unsigned short subsector,
232 unsigned theadd,
const bool gangedME1a)
234 if(endcap < 1 || endcap > 2)
236 <<
"+++ Value of endcap, " << endcap
237 <<
", is out of bounds, [1, 2] +++\n";
238 if(sector < 1 || sector > 6)
240 <<
"+++ Value of sector, " << sector
241 <<
", is out of bounds, [1, 6] +++\n";
247 unsigned short int cscid = ((theadd >> 15)&0xf);
248 unsigned short int lclPhi = (theadd & 0x3ff);
249 if (!gangedME1a) lclPhi = lclPhi/0.625;
251 if((cscid <= 3) || (cscid >= 7))
252 maxPhiL = maxPhiL*(64./80);
254 if((cscid > 0) && (cscid <= 9))
257 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
260 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
265 <<
"+++ Value of cscid, " << cscid
266 <<
", is out of bounds, [1, 9] +++\n";
268 if(data.global_phi >= maxPhiG)
270 <<
"+++ Value of global_phi, " << data.global_phi
271 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
273 if(data.global_phi >= maxPhiG)
275 <<
"+++ Value of global_phi, " << data.global_phi
276 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
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]
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)