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
44 data.phi_bend_local = 0;
50 unsigned short sector,
52 unsigned short subsector,
55 if(endcap < 1 || endcap > 2)
57 <<
"+++ Value of endcap, " << endcap
58 <<
", is out of bounds, [1, 2] +++\n";
59 if(sector < 1 || sector > 6)
61 <<
"+++ Value of sector, " << sector
62 <<
", is out of bounds, [1, 6] +++\n";
63 if(station < 1 || station > 4)
65 <<
"+++ Value of station, " << station
66 <<
", is out of bounds, [1, 4] +++\n";
70 unsigned short int cscid = ((theadd >> 15) & 0xf);
71 unsigned short int lclPhi = ((theadd >> 6) & 0x3);
72 unsigned short int WG = ((theadd >> 8) & 0x7f);
74 int eta_temp=999, eta_min=999, eta_max=999;
80 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0] +
81 gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1] *
82 log(
gbl_eta_params[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][2] + WG));
83 eta_min =
gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][0];
84 eta_max =
gbl_eta_bounds[endcap-1][sector-1][station-1][subsector-1][lclPhi][cscid-1][1];
88 eta_temp = (
gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0] +
89 gbl_eta_params[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1] *
91 eta_min =
gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][0];
92 eta_max =
gbl_eta_bounds[endcap-1][sector-1][station-1][0][lclPhi][cscid-1][1];
98 <<
"+++ Value of cscid, " << cscid
99 <<
", is out of bounds, [1, 9] -- or --"
100 <<
" Value of wire group, " << WG
105 if((eta_temp >= eta_min) &&
106 (eta_temp <= eta_max))
107 data.global_eta = eta_temp;
108 else if(eta_temp < eta_min)
109 data.global_eta = eta_min;
111 data.global_eta = eta_max;
113 data.global_bend = 0;
119 unsigned short sector,
121 unsigned short subsector,
124 if(endcap < 1 || endcap > 2)
126 <<
"+++ Value of endcap, " << endcap
127 <<
", is out of bounds, [1, 2] +++\n";
128 if(sector < 1 || sector > 6)
130 <<
"+++ Value of sector, " << sector
131 <<
", is out of bounds, [1, 6] +++\n";
132 if(station < 1 || station > 4)
134 <<
"+++ Value of station, " << station
135 <<
", is out of bounds, [1, 4] +++\n";
141 unsigned short int cscid = ((theadd >> 15)&0xf);
142 unsigned short int lclPhi = (theadd & 0x3ff);
148 int strip =
static_cast<int>(lclPhi/binPhiL);
150 if (station == 1 && (cscid <= 3) && (strip >= 127 && strip < 160)){
156 lclPhi = (strip-127+31)*(4*binPhiL/3);
160 if(station == 1 && ((cscid <= 3) || (cscid >= 7))) {
164 maxPhiL = maxPhiL*(64./80);
168 if (station == 1 && (cscid >= 10)) {
169 lclPhi = strip*(4*binPhiL/3);
174 if((cscid > 0) && (cscid <= 9))
176 if((station == 1) && (lclPhi < maxPhiL))
177 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
178 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*lclPhi);
179 else if((station == 1) && (lclPhi >= maxPhiL))
180 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][0] +
181 gbl_phi_me_params[endcap-1][sector-1][station-1][subsector-1][cscid-1][1]*(maxPhiL-1));
183 data.global_phi = (
gbl_phi_me_params[endcap-1][sector-1][station-1][0][cscid-1][0] +
188 <<
"+++ Value of cscid, " << cscid
189 <<
", is out of bounds, [1, 9] +++\n";
191 if(data.global_phi >= maxPhiG)
193 <<
"+++ Value of global_phi, " << data.global_phi
194 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
200 unsigned short sector,
201 unsigned short subsector,
204 if(endcap < 1 || endcap > 2)
206 <<
"+++ Value of endcap, " << endcap
207 <<
", is out of bounds, [1, 2] +++\n";
208 if(sector < 1 || sector > 6)
210 <<
"+++ Value of sector, " << sector
211 <<
", is out of bounds, [1, 6] +++\n";
217 unsigned short int cscid = ((theadd >> 15)&0xf);
218 unsigned short int lclPhi = (theadd & 0x3ff);
220 if((cscid <= 3) || (cscid >= 7))
221 maxPhiL = maxPhiL*(64./80);
223 if((cscid > 0) && (cscid <= 9))
226 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
229 data.global_phi = (
gbl_phi_mb_params[endcap-1][sector-1][subsector-1][cscid-1][0] +
234 <<
"+++ Value of cscid, " << cscid
235 <<
", is out of bounds, [1, 9] +++\n";
237 if(data.global_phi >= maxPhiG)
239 <<
"+++ Value of global_phi, " << data.global_phi
240 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
242 if(data.global_phi >= maxPhiG)
244 <<
"+++ Value of global_phi, " << data.global_phi
245 <<
", exceeds max allowed, " << maxPhiG-1 <<
" +++\n";
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)
Log< T >::type log(const T &t)
class global_phi_data gblphidat
class local_phi_data lclphidat
Data Types.
static const float gbl_phi_mb_params[2][6][2][9][2]
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)