26 unsigned short int pattern = ((theadd >> 8) & 0xf);
27 unsigned short int strip = (theadd & 0xff);
34 <<
"+++ Value of strip, " << strip
38 if(data.phi_local >= maxPhiL)
40 <<
"+++ Value of phi_local, " << data.phi_local
45 data.phi_bend_local = pattern & 0x3F;
51 unsigned short sector,
53 unsigned short subsector,
54 unsigned theadd,
const bool gangedME1a)
56 if(endcap < 1 || endcap > 2)
58 <<
"+++ Value of endcap, " << endcap
59 <<
", is out of bounds, [1, 2] +++\n";
60 if(sector < 1 || sector > 6)
62 <<
"+++ Value of sector, " << sector
63 <<
", is out of bounds, [1, 6] +++\n";
64 if(station < 1 || station > 4)
66 <<
"+++ Value of station, " << station
67 <<
", is out of bounds, [1, 4] +++\n";
72 unsigned short int tcscid = ((theadd >> 15) & 0xf);
73 unsigned short int lclPhi = ((theadd >> 6) & 0x3);
74 unsigned short int WG = ((theadd >> 8) & 0x7f);
75 unsigned short int bend = ((theadd) & 0x3f);
83 unsigned short int cscid = (tcscid>9) ? tcscid - 9 : tcscid;
86 unsigned short int lclPhip =0;
87 if (lclPhi == 1 || lclPhi == 3) lclPhip = 2;
90 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0] +
91 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1] *
92 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][2] + WG));
96 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][0] +
97 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][1] *
98 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhip][cscid-1][2] + WG));
105 if ( gangedME1a && (tcscid < 4)&&(lclPhi == 3) ) {
114 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0] +
115 gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1] *
124 <<
"+++ Value of cscid, " << tcscid
125 <<
", is out of bounds, [1, 9] -- or --" 126 <<
" Value of wire group, " << WG
133 data.global_eta = eta_temp;
141 data.global_bend = bend & 0x1F;
148 unsigned short sector,
150 unsigned short subsector,
151 unsigned theadd,
const bool gangedME1a)
153 if(endcap < 1 || endcap > 2)
155 <<
"+++ Value of endcap, " << endcap
156 <<
", is out of bounds, [1, 2] +++\n";
157 if(sector < 1 || sector > 6)
159 <<
"+++ Value of sector, " << sector
160 <<
", is out of bounds, [1, 6] +++\n";
161 if(station < 1 || station > 4)
163 <<
"+++ Value of station, " << station
164 <<
", is out of bounds, [1, 4] +++\n";
170 unsigned short int cscid = ((theadd >> 15)&0xf);
171 unsigned short int lclPhi = (theadd & 0x3ff);
172 if (!gangedME1a) lclPhi = lclPhi/0.625;
178 int strip =
static_cast<int>(lclPhi/binPhiL);
179 if (station == 1 && (cscid <= 3) && (strip >= 127 && strip < 224)){
184 gangedME1a? lclPhi = (strip-127+31)*(4*binPhiL/3) : lclPhi = (strip-127)*(4*binPhiL/3) ;
188 if(station == 1 && ((cscid <= 3) || (cscid >= 7))) {
192 maxPhiL = maxPhiL*(64./80);
196 if (station == 1 && (cscid >= 10)) {
197 lclPhi = strip*(4*binPhiL/3);
202 if((cscid > 0) && (cscid <= 9))
204 if((station == 1) && (lclPhi < maxPhiL))
205 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
206 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*lclPhi);
207 else if((station == 1) && (lclPhi >= maxPhiL))
208 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
209 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*(maxPhiL-1));
211 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][0] +
216 <<
"+++ Value of cscid, " << cscid
217 <<
", is out of bounds, [1, 9] +++\n";
219 if(data.global_phi >= maxPhiG)
221 <<
"+++ Value of global_phi, " << data.global_phi
222 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
228 unsigned short sector,
229 unsigned short subsector,
230 unsigned theadd,
const bool gangedME1a)
232 if(endcap < 1 || endcap > 2)
234 <<
"+++ Value of endcap, " << endcap
235 <<
", is out of bounds, [1, 2] +++\n";
236 if(sector < 1 || sector > 6)
238 <<
"+++ Value of sector, " << sector
239 <<
", is out of bounds, [1, 6] +++\n";
245 unsigned short int cscid = ((theadd >> 15)&0xf);
246 unsigned short int lclPhi = (theadd & 0x3ff);
247 if (!gangedME1a) lclPhi = lclPhi/0.625;
249 if((cscid <= 3) || (cscid >= 7))
250 maxPhiL = maxPhiL*(64./80);
252 if((cscid > 0) && (cscid <= 9))
255 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
258 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
263 <<
"+++ Value of cscid, " << cscid
264 <<
", is out of bounds, [1, 9] +++\n";
266 if(data.global_phi >= maxPhiG)
268 <<
"+++ Value of global_phi, " << data.global_phi
269 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
271 if(data.global_phi >= maxPhiG)
273 <<
"+++ Value of global_phi, " << data.global_phi
274 <<
", 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)