28 unsigned short int pattern = ((theadd >> 8) & 0xf);
29 unsigned short int strip = (theadd & 0xff);
35 <<
"+++ Value of strip, " << strip
39 if(data.phi_local >= maxPhiL)
41 <<
"+++ Value of phi_local, " << data.phi_local
46 data.phi_bend_local = pattern & 0x3F;
52 unsigned short sector,
54 unsigned short subsector,
57 if(endcap < 1 || endcap > 2)
59 <<
"+++ Value of endcap, " << endcap
60 <<
", is out of bounds, [1, 2] +++\n";
61 if(sector < 1 || sector > 6)
63 <<
"+++ Value of sector, " << sector
64 <<
", is out of bounds, [1, 6] +++\n";
65 if(station < 1 || station > 4)
67 <<
"+++ Value of station, " << station
68 <<
", is out of bounds, [1, 4] +++\n";
72 unsigned short int cscid = ((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);
77 int eta_temp=999, eta_min=999, eta_max=999;
83 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0] +
84 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1] *
85 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][2] + WG));
86 eta_min =
gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0];
87 eta_max =
gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1];
90 if ( (cscid < 4)&&(lclPhi == 3) ) {
99 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0] +
100 gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1] *
102 eta_min =
gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0];
103 eta_max =
gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1];
109 <<
"+++ Value of cscid, " << cscid
110 <<
", is out of bounds, [1, 9] -- or --"
111 <<
" Value of wire group, " << WG
116 if((eta_temp >= eta_min) &&
117 (eta_temp <= eta_max))
118 data.global_eta = eta_temp;
119 else if(eta_temp < eta_min)
120 data.global_eta = eta_min;
122 data.global_eta = eta_max;
126 data.global_bend = bend & 0x1F;
132 unsigned short sector,
134 unsigned short subsector,
137 if(endcap < 1 || endcap > 2)
139 <<
"+++ Value of endcap, " << endcap
140 <<
", is out of bounds, [1, 2] +++\n";
141 if(sector < 1 || sector > 6)
143 <<
"+++ Value of sector, " << sector
144 <<
", is out of bounds, [1, 6] +++\n";
145 if(station < 1 || station > 4)
147 <<
"+++ Value of station, " << station
148 <<
", is out of bounds, [1, 4] +++\n";
154 unsigned short int cscid = ((theadd >> 15)&0xf);
155 unsigned short int lclPhi = (theadd & 0x3ff);
161 int strip =
static_cast<int>(lclPhi/binPhiL);
163 if (station == 1 && (cscid <= 3) && (strip >= 127 && strip < 160)){
169 lclPhi = (strip-127+31)*(4*binPhiL/3);
173 if(station == 1 && ((cscid <= 3) || (cscid >= 7))) {
177 maxPhiL = maxPhiL*(64./80);
181 if (station == 1 && (cscid >= 10)) {
182 lclPhi = strip*(4*binPhiL/3);
187 if((cscid > 0) && (cscid <= 9))
189 if((station == 1) && (lclPhi < maxPhiL))
190 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
191 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*lclPhi);
192 else if((station == 1) && (lclPhi >= maxPhiL))
193 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
194 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*(maxPhiL-1));
196 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][0] +
201 <<
"+++ Value of cscid, " << cscid
202 <<
", is out of bounds, [1, 9] +++\n";
204 if(data.global_phi >= maxPhiG)
206 <<
"+++ Value of global_phi, " << data.global_phi
207 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
213 unsigned short sector,
214 unsigned short subsector,
217 if(endcap < 1 || endcap > 2)
219 <<
"+++ Value of endcap, " << endcap
220 <<
", is out of bounds, [1, 2] +++\n";
221 if(sector < 1 || sector > 6)
223 <<
"+++ Value of sector, " << sector
224 <<
", is out of bounds, [1, 6] +++\n";
230 unsigned short int cscid = ((theadd >> 15)&0xf);
231 unsigned short int lclPhi = (theadd & 0x3ff);
233 if((cscid <= 3) || (cscid >= 7))
234 maxPhiL = maxPhiL*(64./80);
236 if((cscid > 0) && (cscid <= 9))
239 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
242 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
247 <<
"+++ Value of cscid, " << cscid
248 <<
", is out of bounds, [1, 9] +++\n";
250 if(data.global_phi >= maxPhiG)
252 <<
"+++ Value of global_phi, " << data.global_phi
253 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
255 if(data.global_phi >= maxPhiG)
257 <<
"+++ Value of global_phi, " << data.global_phi
258 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
static std::vector< std::string > checklist log
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 global_phi_data calcGlobalPhiMEMini(unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd)
static global_phi_data calcGlobalPhiMBMini(unsigned short endcap, unsigned short sector, unsigned short subsector, unsigned theadd)
static const float lcl_phi_param0[1<< 4]
static lclphidat calcLocalPhiMini(unsigned theadd)
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)