CMS 3D CMS Logo

List of all members | Static Public Member Functions | Static Private Attributes
CSCSectorReceiverMiniLUT Class Reference

#include <CSCSectorReceiverMiniLUT.h>

Static Public Member Functions

static global_eta_data calcGlobalEtaMEMini (unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd, const bool gangedME1a)
 
static global_phi_data calcGlobalPhiMBMini (unsigned short endcap, unsigned short sector, unsigned short subsector, unsigned theadd, const bool gangedME1a)
 
static global_phi_data calcGlobalPhiMEMini (unsigned short endcap, unsigned short sector, unsigned short station, unsigned short subsector, unsigned theadd, const bool gangedME1a)
 
static lclphidat calcLocalPhiMini (unsigned theadd, const bool gangedME1a)
 

Static Private Attributes

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 gbl_phi_mb_params [2][6][2][9][2]
 
static const float gbl_phi_me_params [2][6][4][2][9][2]
 
static const float lcl_phi_param0 [1<< 4]
 
static const float lcl_phi_param1 = 6.4
 

Detailed Description

Author
Brett Jackson

Provides a new way of defining the Lookup tables used by the core. Defines the lookup tables as parameterized functions in order to save on memory usage when compared to the current standard definitions of LUTs

Definition at line 15 of file CSCSectorReceiverMiniLUT.h.

Member Function Documentation

◆ calcGlobalEtaMEMini()

global_eta_data CSCSectorReceiverMiniLUT::calcGlobalEtaMEMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  station,
unsigned short  subsector,
unsigned  theadd,
const bool  gangedME1a 
)
static

Definition at line 51 of file CSCSectorReceiverMiniLUT.cc.

56  {
57  if (endcap < 1 || endcap > 2)
58  edm::LogWarning("CSCSectorReceiverMiniLUT")
59  << "+++ Value of endcap, " << endcap << ", is out of bounds, [1, 2] +++\n";
60  if (sector < 1 || sector > 6)
61  edm::LogWarning("CSCSectorReceiverMiniLUT")
62  << "+++ Value of sector, " << sector << ", is out of bounds, [1, 6] +++\n";
63  if (station < 1 || station > 4)
64  edm::LogWarning("CSCSectorReceiverMiniLUT")
65  << "+++ Value of station, " << station << ", is out of bounds, [1, 4] +++\n";
66 
67  gbletadat data(0);
68 
69  unsigned short int tcscid = ((theadd >> 15) & 0xf);
70  unsigned short int lclPhi = ((theadd >> 6) & 0x3);
71  unsigned short int WG = ((theadd >> 8) & 0x7f);
72  unsigned short int bend = ((theadd)&0x3f);
73 
74  int eta_temp = 999, eta_min = 999, eta_max = 999;
75 
76  if ((tcscid > 0) && (tcscid <= 12) && (WG < CSCConstants::MAX_NUM_WIRES)) {
77  unsigned short int cscid = (tcscid > 9) ? tcscid - 9 : tcscid;
78  if (station == 1) {
79  unsigned short int lclPhip = 0;
80  if (lclPhi == 1 || lclPhi == 3)
81  lclPhip = 2;
82  // use only eta correction for first and last third of ME1/1 chamber since local phi scaling changed
83  if (gangedME1a) {
84  eta_temp =
85  (gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][0] +
86  gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][1] *
87  log(gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][2] + WG));
88  eta_min = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][0];
89  eta_max = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhi][cscid - 1][1];
90  } else { // DA and MDG, if unganged replace "lclPhi" index with "lclPhip"
91  eta_temp =
92  (gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][0] +
93  gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][1] *
94  log(gbl_eta_params[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][2] + WG));
95  eta_min = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][0];
96  eta_max = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][subsector - 1][lclPhip][cscid - 1][1];
97  }
98 
99  // add offset to ME+11a, subtract for ME-11a (wire tilt and strip direction)1
100  // only is ganged
101  if (gangedME1a && (tcscid < 4) && (lclPhi == 3)) {
102  if (endcap == 1)
103  eta_temp += 3;
104  else
105  eta_temp -= 3;
106  }
107  } else {
108  eta_temp = (gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][0] +
109  gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][1] *
110  log(gbl_eta_params[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][2] + WG));
111  eta_min = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][0];
112  eta_max = gbl_eta_bounds[endcap - 1][sector - 1][station - 1][0][lclPhi][cscid - 1][1];
113  }
114  } else {
115  edm::LogWarning("CSCSectorReceiverMiniLUT")
116  << "+++ Value of cscid, " << tcscid << ", is out of bounds, [1, 9] -- or --"
117  << " Value of wire group, " << WG << ", exceeds max allowed, " << CSCConstants::MAX_NUM_WIRES << " +++\n";
118  }
119 
120  // protect from negative numbers. If the value of eta_temp is <0, set global eta to the minimum value
121  if ((eta_temp >= eta_min) && (eta_temp <= eta_max))
122  data.global_eta = eta_temp;
123  else if (eta_temp < eta_min)
124  data.global_eta = eta_min;
125  else
126  data.global_eta = eta_max;
127 
128  // data.global_bend = 0;
129  // Just pass through lowest 5 bits of local bend (drop 1 MSB)
130  data.global_bend = bend & 0x1F;
131 
132  return data;
133 }

References trklet::bend(), data, makeMuonMisalignmentScenario::endcap, distMuonTCMETValueMapProducer_cff::eta_max, egammaIdentification::eta_min, l1temulator_dqm_sourceclient-live_cfg::gangedME1a, gbl_eta_bounds, gbl_eta_params, dqm-mbProfile::log, CSCConstants::MAX_NUM_WIRES, and relativeConstraints::station.

Referenced by CSCSectorReceiverLUT::globalEtaME().

◆ calcGlobalPhiMBMini()

global_phi_data CSCSectorReceiverMiniLUT::calcGlobalPhiMBMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  subsector,
unsigned  theadd,
const bool  gangedME1a 
)
static

Definition at line 218 of file CSCSectorReceiverMiniLUT.cc.

219  {
220  if (endcap < 1 || endcap > 2)
221  edm::LogWarning("CSCSectorReceiverMiniLUT")
222  << "+++ Value of endcap, " << endcap << ", is out of bounds, [1, 2] +++\n";
223  if (sector < 1 || sector > 6)
224  edm::LogWarning("CSCSectorReceiverMiniLUT")
225  << "+++ Value of sector, " << sector << ", is out of bounds, [1, 6] +++\n";
226 
227  gblphidat data(0);
228 
229  unsigned short int maxPhiL = 1 << CSCBitWidths::kLocalPhiDataBitWidth;
230  unsigned short int maxPhiG = 1 << CSCBitWidths::kGlobalPhiDataBitWidth;
231  unsigned short int cscid = ((theadd >> 15) & 0xf);
232  unsigned short int lclPhi = (theadd & 0x3ff);
233  if (!gangedME1a)
234  lclPhi = lclPhi / 0.625; // DA and MDG, recover old scaling of local phi
235 
236  if ((cscid <= 3) || (cscid >= 7))
237  maxPhiL =
238  maxPhiL *
239  (64. / 80); // currently a hack that is in place to handle the different number of strips in ME1/1 and ME1/3
240 
241  if ((cscid > 0) && (cscid <= 9)) {
242  if (lclPhi < maxPhiL)
243  data.global_phi = (gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][0] +
244  gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][1] * lclPhi);
245  else
246  data.global_phi = (gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][0] +
247  gbl_phi_mb_params[endcap - 1][sector - 1][subsector - 1][cscid - 1][1] * (maxPhiL - 1));
248  } else
249  edm::LogWarning("CSCSectorReceiverMiniLUT")
250  << "+++ Value of cscid, " << cscid << ", is out of bounds, [1, 9] +++\n";
251 
252  if (data.global_phi >= maxPhiG)
253  edm::LogWarning("CSCSectorReceiverMiniLUT")
254  << "+++ Value of global_phi, " << data.global_phi << ", exceeds max allowed, " << maxPhiG - 1 << " +++\n";
255 
256  if (data.global_phi >= maxPhiG)
257  edm::LogWarning("CSCSectorReceiverMiniLUT")
258  << "+++ Value of global_phi, " << data.global_phi << ", exceeds max allowed, " << maxPhiG - 1 << " +++\n";
259 
260  return data;
261 }

References data, makeMuonMisalignmentScenario::endcap, l1temulator_dqm_sourceclient-live_cfg::gangedME1a, gbl_phi_mb_params, CSCBitWidths::kGlobalPhiDataBitWidth, and CSCBitWidths::kLocalPhiDataBitWidth.

◆ calcGlobalPhiMEMini()

global_phi_data CSCSectorReceiverMiniLUT::calcGlobalPhiMEMini ( unsigned short  endcap,
unsigned short  sector,
unsigned short  station,
unsigned short  subsector,
unsigned  theadd,
const bool  gangedME1a 
)
static

Definition at line 135 of file CSCSectorReceiverMiniLUT.cc.

140  {
141  if (endcap < 1 || endcap > 2)
142  edm::LogWarning("CSCSectorReceiverMiniLUT")
143  << "+++ Value of endcap, " << endcap << ", is out of bounds, [1, 2] +++\n";
144  if (sector < 1 || sector > 6)
145  edm::LogWarning("CSCSectorReceiverMiniLUT")
146  << "+++ Value of sector, " << sector << ", is out of bounds, [1, 6] +++\n";
147  if (station < 1 || station > 4)
148  edm::LogWarning("CSCSectorReceiverMiniLUT")
149  << "+++ Value of station, " << station << ", is out of bounds, [1, 4] +++\n";
150 
151  gblphidat data(0);
152 
153  unsigned short int maxPhiL = 1 << CSCBitWidths::kLocalPhiDataBitWidth;
154  unsigned short int maxPhiG = 1 << CSCBitWidths::kGlobalPhiDataBitWidth;
155  unsigned short int cscid = ((theadd >> 15) & 0xf);
156  unsigned short int lclPhi = (theadd & 0x3ff);
157  if (!gangedME1a)
158  lclPhi = lclPhi / 0.625; // DA and MDG recover old scaling of local phi
159 
160  // 12/11/09
161  // GP et DA: how to identify the strip number and isolate and shift the localPhi value
162  const double binPhiL = static_cast<double>(maxPhiL) / (2 * CSCConstants::MAX_NUM_STRIPS);
163 
164  int strip = static_cast<int>(lclPhi / binPhiL);
165  if (station == 1 && (cscid <= 3) &&
166  (strip >= 127 && strip < 224)) { // 160 --> 224, change range for ME1/1a acceptance, DA and MDG
167  // in this case need to redefine lclPhi in order to
168  // place local phi in the middle of the 5th CFEB
169  // and not on the first third of the CFEB as default
170 
171  gangedME1a
172  ? lclPhi = (strip - 127 + 31) * (4 * binPhiL / 3)
173  : lclPhi =
174  (strip - 127) *
175  (4 * binPhiL /
176  3); //DA and MDG remove offset to center of ME1/1a (no ganging), and reset ME1/1a strip number to start from 0, and scale 48 strips to match ME1/1b 64 strips
177  }
178  // end GP et DA
179 
180  if (station == 1 && ((cscid <= 3) || (cscid >= 7))) {
181  //if ( (strip >= 127 && strip < 160) || (cscid >= 10) ) // VK: the || (cscid >= 10) for unganged ME1a
182  // maxPhiL = maxPhiL*(48./80); // GP et DA: currently a hack that is in place to handle the different number of strips in ME1/1a and ME1/3
183  //else
184  maxPhiL =
185  maxPhiL *
186  (64. / 80); // currently a hack that is in place to handle the different number of strips in ME1/1 and ME1/3
187  }
188 
189  // VK: The the unganged ME1a hack
190  if (station == 1 && (cscid >= 10)) {
191  lclPhi = strip * (4 * binPhiL / 3);
192  cscid = cscid - 9; // back to normal 1-9 range
193  }
194  // end VK
195 
196  if ((cscid > 0) && (cscid <= 9)) {
197  if ((station == 1) && (lclPhi < maxPhiL))
198  data.global_phi = (gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][0] +
199  gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][1] * lclPhi);
200  else if ((station == 1) && (lclPhi >= maxPhiL))
201  data.global_phi =
202  (gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][0] +
203  gbl_phi_me_params[endcap - 1][sector - 1][station - 1][subsector - 1][cscid - 1][1] * (maxPhiL - 1));
204  else
205  data.global_phi = (gbl_phi_me_params[endcap - 1][sector - 1][station - 1][0][cscid - 1][0] +
206  gbl_phi_me_params[endcap - 1][sector - 1][station - 1][0][cscid - 1][1] * lclPhi);
207  } else
208  edm::LogWarning("CSCSectorReceiverMiniLUT")
209  << "+++ Value of cscid, " << cscid << ", is out of bounds, [1, 9] +++\n";
210 
211  if (data.global_phi >= maxPhiG)
212  edm::LogWarning("CSCSectorReceiverMiniLUT")
213  << "+++ Value of global_phi, " << data.global_phi << ", exceeds max allowed, " << maxPhiG - 1 << " +++\n";
214 
215  return data;
216 }

References data, makeMuonMisalignmentScenario::endcap, l1temulator_dqm_sourceclient-live_cfg::gangedME1a, gbl_phi_me_params, CSCBitWidths::kGlobalPhiDataBitWidth, CSCBitWidths::kLocalPhiDataBitWidth, CSCConstants::MAX_NUM_STRIPS, relativeConstraints::station, and digitizers_cfi::strip.

Referenced by CSCSectorReceiverLUT::globalPhiME().

◆ calcLocalPhiMini()

lclphidat CSCSectorReceiverMiniLUT::calcLocalPhiMini ( unsigned  theadd,
const bool  gangedME1a 
)
static

Definition at line 19 of file CSCSectorReceiverMiniLUT.cc.

19  {
20  // This method is ripped from CSCSectorReceverLUT.cc with minor changes
21 
23 
24  constexpr int maxPhiL = 1 << CSCBitWidths::kLocalPhiDataBitWidth;
25  unsigned short int pattern = ((theadd >> 8) & 0xf);
26  unsigned short int strip = (theadd & 0xff);
27 
28  if (strip < 2 * (CSCConstants::MAX_NUM_STRIPS * 7 / 5) &&
29  pattern <
31  NUM_CLCT_PATTERNS) { // MDG, DA and RW, for ME1 we have 7CFEBs and not just 5, so the num_strips can go up to 16 * 7 but only for ME1
32  data.phi_local = gangedME1a ? static_cast<unsigned>((lcl_phi_param0[pattern] + strip) * lcl_phi_param1)
33  : static_cast<unsigned>((lcl_phi_param0[pattern] + strip) * 0.625 * lcl_phi_param1);
34  //DA and MDG, rescale range of local phi so ME1/1b fits in 0-511
35  } else
36  edm::LogWarning("CSCSectorReceiverMiniLUT") << "+++ Value of strip, " << strip << ", exceeds max allowed, "
37  << 2 * CSCConstants::MAX_NUM_STRIPS - 1 << " +++\n";
38 
39  if (data.phi_local >= maxPhiL)
40  edm::LogWarning("CSCSectorReceiverMiniLUT")
41  << "+++ Value of phi_local, " << data.phi_local << ", exceeds max allowed, "
42  << CSCConstants::NUM_CLCT_PATTERNS - 1 << " +++\n";
43 
44  // data.phi_bend_local = 0;
45  // Just pass through all bits of pattern as bend angle (so 2 MSB unfilled)
46  data.phi_bend_local = pattern & 0x3F;
47 
48  return data;
49 }

References data, l1temulator_dqm_sourceclient-live_cfg::gangedME1a, CSCBitWidths::kLocalPhiDataBitWidth, lcl_phi_param0, lcl_phi_param1, CSCConstants::MAX_NUM_STRIPS, CSCConstants::NUM_CLCT_PATTERNS, topSingleLeptonDQM_PU_cfi::pattern, and digitizers_cfi::strip.

Referenced by CSCSectorReceiverLUT::localPhi().

Member Data Documentation

◆ gbl_eta_bounds

const unsigned short int CSCSectorReceiverMiniLUT::gbl_eta_bounds
staticprivate

Definition at line 40 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalEtaMEMini().

◆ gbl_eta_params

const float CSCSectorReceiverMiniLUT::gbl_eta_params
staticprivate

Definition at line 38 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalEtaMEMini().

◆ gbl_phi_mb_params

const float CSCSectorReceiverMiniLUT::gbl_phi_mb_params
staticprivate

Definition at line 44 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalPhiMBMini().

◆ gbl_phi_me_params

const float CSCSectorReceiverMiniLUT::gbl_phi_me_params
staticprivate

Definition at line 42 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcGlobalPhiMEMini().

◆ lcl_phi_param0

const float CSCSectorReceiverMiniLUT::lcl_phi_param0
staticprivate
Initial value:
= {
0.50, 0.50, -0.10, 1.10, -0.14, 1.14, 0.27, 0.73, 0.29, 0.71, 0.50, 0, 0, 0, 0, 0}

Definition at line 34 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcLocalPhiMini().

◆ lcl_phi_param1

const float CSCSectorReceiverMiniLUT::lcl_phi_param1 = 6.4
staticprivate

Definition at line 35 of file CSCSectorReceiverMiniLUT.h.

Referenced by calcLocalPhiMini().

CSCConstants::MAX_NUM_WIRES
Definition: CSCConstants.h:22
lclphidat
class local_phi_data lclphidat
Data Types.
relativeConstraints.station
station
Definition: relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
egammaIdentification.eta_min
eta_min
Definition: egammaIdentification.py:20
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCSectorReceiverMiniLUT::gbl_eta_bounds
static const unsigned short int gbl_eta_bounds[2][6][4][2][4][9][2]
Definition: CSCSectorReceiverMiniLUT.h:40
CSCSectorReceiverMiniLUT::lcl_phi_param0
static const float lcl_phi_param0[1<< 4]
Definition: CSCSectorReceiverMiniLUT.h:34
CSCConstants::MAX_NUM_STRIPS
Definition: CSCConstants.h:24
CSCSectorReceiverMiniLUT::gbl_phi_me_params
static const float gbl_phi_me_params[2][6][4][2][9][2]
Definition: CSCSectorReceiverMiniLUT.h:42
edm::LogWarning
Definition: MessageLogger.h:141
l1temulator_dqm_sourceclient-live_cfg.gangedME1a
gangedME1a
Definition: l1temulator_dqm_sourceclient-live_cfg.py:99
CSCSectorReceiverMiniLUT::lcl_phi_param1
static const float lcl_phi_param1
Definition: CSCSectorReceiverMiniLUT.h:35
distMuonTCMETValueMapProducer_cff.eta_max
eta_max
Definition: distMuonTCMETValueMapProducer_cff.py:9
CSCBitWidths::kGlobalPhiDataBitWidth
Definition: CSCBitWidths.h:28
CSCSectorReceiverMiniLUT::gbl_phi_mb_params
static const float gbl_phi_mb_params[2][6][2][9][2]
Definition: CSCSectorReceiverMiniLUT.h:44
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCBitWidths::kLocalPhiDataBitWidth
Definition: CSCBitWidths.h:25
gbletadat
class global_eta_data gbletadat
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
gblphidat
class global_phi_data gblphidat
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CSCConstants::NUM_CLCT_PATTERNS
Definition: CSCConstants.h:51
CSCSectorReceiverMiniLUT::gbl_eta_params
static const float gbl_eta_params[2][6][4][2][4][9][3]
Definition: CSCSectorReceiverMiniLUT.h:38