CMS 3D CMS Logo

MESetBinningUtils2.cc
Go to the documentation of this file.
2 
4 
6 
7 #include <algorithm>
8 
9 #include "TMath.h"
10 
11 namespace ecaldqm {
12  namespace binning {
13  int xlow_(int _iSM) {
14  switch (_iSM) {
15  case kEEm01:
16  case kEEp01:
17  return 20;
18  case kEEm02:
19  case kEEp02:
20  return 0;
21  case kEEm03:
22  case kEEp03:
23  return 0;
24  case kEEm04:
25  case kEEp04:
26  return 5;
27  case kEEm05:
28  case kEEp05:
29  return 35;
30  case kEEm06:
31  case kEEp06:
32  return 55;
33  case kEEm07:
34  case kEEp07:
35  return 60;
36  case kEEm08:
37  case kEEp08:
38  return 55;
39  case kEEm09:
40  case kEEp09:
41  return 50;
42  default:
43  break;
44  }
45 
46  if (_iSM >= kEBmLow && _iSM <= kEBpHigh)
47  return 0;
48 
49  return 0;
50  }
51 
52  int ylow_(int _iSM) {
53  switch (_iSM) {
54  case kEEm01:
55  case kEEp01:
56  case kEEm09:
57  case kEEp09:
58  return 60;
59  case kEEm02:
60  case kEEp02:
61  case kEEm08:
62  case kEEp08:
63  return 50;
64  case kEEm03:
65  case kEEp03:
66  case kEEm07:
67  case kEEp07:
68  return 25;
69  case kEEm04:
70  case kEEp04:
71  case kEEm06:
72  case kEEp06:
73  return 5;
74  case kEEm05:
75  case kEEp05:
76  return 0;
77  default:
78  break;
79  }
80 
81  if (_iSM >= kEBmLow && _iSM <= kEBmHigh)
82  return ((_iSM - kEBmLow) % 18) * 20;
83  if (_iSM >= kEBpLow && _iSM <= kEBpHigh)
84  return (-1 - ((_iSM - kEBpLow) % 18)) * 20;
85 
86  return 0;
87  }
88 
89  AxisSpecs getBinningEB_(BinningType _btype, bool _isMap, int _axis) {
91 
92  if (!_isMap) {
93  switch (_btype) {
94  case kTCC:
95  specs.nbins = 36;
96  specs.low = 9.;
97  specs.high = 45.;
98  specs.title = "iTCC";
99  break;
100  case kDCC:
101  specs.nbins = 36;
102  specs.low = 9.;
103  specs.high = 45.;
104  break;
105  case kProjEta:
106  specs.nbins = nEBEtaBins;
107  specs.low = -etaBound;
108  specs.high = etaBound;
109  specs.title = "eta";
110  break;
111  case kProjPhi:
112  specs.nbins = nPhiBins;
113  specs.low = -TMath::Pi() / 18.;
114  specs.high = TMath::Pi() * 35. / 18.;
115  specs.title = "phi";
116  break;
117  default:
118  break;
119  }
120  } else {
121  switch (_btype) {
122  case kCrystal:
123  if (_axis == 1)
124  specs.nbins = 360;
125  else if (_axis == 2)
126  specs.nbins = 170;
127  break;
128  case kSuperCrystal:
129  case kTriggerTower:
130  case kPseudoStrip:
131  if (_axis == 1)
132  specs.nbins = 72;
133  else if (_axis == 2)
134  specs.nbins = 34;
135  break;
136  default:
137  return specs;
138  }
139 
140  if (_axis == 1) {
141  specs.low = 0.;
142  specs.high = 360.;
143  specs.title = "iphi";
144  } else if (_axis == 2) {
145  specs.low = -85.;
146  specs.high = 85.;
147  specs.title = "ieta";
148  }
149  }
150 
151  return specs;
152  }
153 
154  AxisSpecs getBinningEE_(BinningType _btype, bool _isMap, int _zside, int _axis) {
156 
157  if (!_isMap) {
158  switch (_btype) {
159  case kTCC:
160  specs.nbins = _zside ? 36 : 72;
161  specs.low = 0.;
162  specs.high = _zside ? 36. : 72.;
163  specs.title = "iTCC";
164  break;
165  case kDCC:
166  specs.nbins = _zside ? 9 : 18;
167  specs.low = 0.;
168  specs.high = _zside ? 9. : 18.;
169  break;
170  case kProjEta:
171  if (_zside == 0) {
172  specs.nbins = nEEEtaBins / (3. - etaBound) * 6.;
173  specs.low = -3.;
174  specs.high = 3.;
175  } else {
176  specs.nbins = nEEEtaBins;
177  specs.low = _zside < 0 ? -3. : etaBound;
178  specs.high = _zside < 0 ? -etaBound : 3.;
179  }
180  specs.title = "eta";
181  break;
182  case kProjPhi:
183  specs.nbins = nPhiBins;
184  specs.low = -TMath::Pi() / 18.;
185  specs.high = TMath::Pi() * 35. / 18.;
186  specs.title = "phi";
187  break;
188  default:
189  break;
190  }
191  } else {
192  switch (_btype) {
193  case kCrystal:
194  case kTriggerTower:
195  case kPseudoStrip:
196  if (_axis == 1)
197  specs.nbins = _zside ? 100 : 200;
198  if (_axis == 2)
199  specs.nbins = 100;
200  break;
201  case kSuperCrystal:
202  if (_axis == 1)
203  specs.nbins = _zside ? 20 : 40;
204  if (_axis == 2)
205  specs.nbins = 20;
206  break;
207  default:
208  return specs;
209  }
210 
211  if (_axis == 1) {
212  specs.low = 0.;
213  specs.high = _zside ? 100. : 200.;
214  specs.title = "ix";
215  } else if (_axis == 2) {
216  specs.low = 0.;
217  specs.high = 100.;
218  specs.title = "iy";
219  }
220  }
221 
222  return specs;
223  }
224 
226  BinningType _btype, bool _isMap, unsigned _iObj, int _axis, const EcalElectronicsMapping *electronicsMap) {
228 
229  unsigned iSM(_iObj);
230 
231  const bool isBarrel(iSM >= kEBmLow && iSM <= kEBpHigh);
232 
233  if (!_isMap) {
234  switch (_btype) {
235  case kCrystal:
236  specs.nbins = isBarrel ? 1700 : electronicsMap->dccConstituents(iSM + 1).size();
237  specs.low = 0.;
238  specs.high = specs.nbins;
239  specs.title = "crystal";
240  break;
241  case kTriggerTower:
242  case kPseudoStrip:
243  specs.nbins = isBarrel ? 68 : (2 * nTTOuter + 2 * nTTInner); // For EE: numbering of bins
244  // is in the order (inner1, inner2, outer1, outer2). ("inner"" := closer
245  // to the beam)
246  specs.low = 1.;
247  specs.high = specs.nbins + specs.low;
248  specs.title = "tower";
249  break;
250  case kSuperCrystal:
251  specs.nbins = isBarrel ? 68 : nSuperCrystals(iSM + 1);
252  specs.low = 1.;
253  specs.high = specs.nbins + specs.low;
254  specs.title = "tower";
255  break;
256  default:
257  break;
258  }
259  } else {
260  int nEEX(nEESMX);
261  int nEEY(nEESMY);
262  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
263  nEEX = nEESMXExt;
264  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
265  nEEX = nEESMXRed;
266  if (iSM == kEEm03 || iSM == kEEm07 || iSM == kEEp03 || iSM == kEEp07)
267  nEEY = nEESMYRed;
268 
269  switch (_btype) {
270  case kCrystal:
271  if (_axis == 1)
272  specs.nbins = isBarrel ? nEBSMEta : nEEX;
273  else if (_axis == 2)
274  specs.nbins = isBarrel ? nEBSMPhi : nEEY;
275  break;
276  case kTriggerTower:
277  case kPseudoStrip:
278  if (_axis == 1)
279  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX;
280  else if (_axis == 2)
281  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY;
282  break;
283  case kSuperCrystal:
284  if (_axis == 1)
285  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX / 5;
286  else if (_axis == 2)
287  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY / 5;
288  break;
289  default:
290  return specs;
291  }
292 
293  if (_axis == 1) {
294  specs.low = xlow_(iSM);
295  specs.high = specs.low + (isBarrel ? nEBSMEta : nEEX);
296  specs.title = isBarrel ? (iSM < kEBpLow ? "-ieta" : "ieta") : "ix";
297  } else if (_axis == 2) {
298  specs.low = ylow_(iSM);
299  specs.high = specs.low + (isBarrel ? nEBSMPhi : nEEY);
300  specs.title = isBarrel ? "iphi" : "iy";
301  }
302  }
303 
304  return specs;
305  }
306 
307  AxisSpecs getBinningSMMEM_(BinningType _btype, bool _isMap, unsigned _iObj, int _axis) {
309 
310  unsigned iSM(memDCCId(_iObj) - 1);
311 
312  if (iSM == unsigned(-1) || _btype != kCrystal)
313  return specs;
314 
315  if (_axis == 1) {
316  specs.nbins = 10;
317  specs.low = 0.;
318  specs.high = 10.;
319  if (_isMap)
320  specs.title = "pseudo-strip";
321  else
322  specs.title = "iPN";
323  } else if (_axis == 2) {
324  specs.nbins = 1;
325  specs.low = 0.;
326  specs.high = 5.;
327  specs.title = "channel";
328  }
329 
330  return specs;
331  }
332 
333  AxisSpecs getBinningEcal_(BinningType _btype, bool _isMap, int _axis) {
335 
336  if (!_isMap) {
337  switch (_btype) {
338  case kTCC:
339  specs.nbins = 108;
340  specs.low = 0.;
341  specs.high = 108.;
342  specs.title = "iTCC";
343  break;
344  case kDCC:
345  specs.nbins = 54;
346  specs.low = 0.;
347  specs.high = 54.;
348  specs.title = "iDCC";
349  break;
350  case kProjEta:
351  specs.nbins = nEBEtaBins + 2 * nEEEtaBins;
352  specs.edges = std::vector(specs.nbins + 1, 0.f);
353  for (int i(0); i <= nEEEtaBins; i++)
354  specs.edges[i] = -3. + (3. - etaBound) / nEEEtaBins * i;
355  for (int i(1); i <= nEBEtaBins; i++)
356  specs.edges[i + nEEEtaBins] = -etaBound + 2. * etaBound / nEBEtaBins * i;
357  for (int i(1); i <= nEEEtaBins; i++)
358  specs.edges[i + nEEEtaBins + nEBEtaBins] = etaBound + (3. - etaBound) / nEEEtaBins * i;
359  specs.title = "eta";
360  break;
361  case kProjPhi:
362  specs.nbins = nPhiBins;
363  specs.low = -TMath::Pi() / 18.;
364  specs.high = TMath::Pi() * 35. / 18.;
365  specs.title = "phi";
366  break;
367  default:
368  break;
369  }
370  } else {
371  switch (_btype) {
372  case kDCC:
373  if (_axis == 1) {
374  specs.nbins = 9;
375  specs.low = 0.;
376  specs.high = 9.;
377  } else if (_axis == 2) {
378  specs.nbins = 6;
379  specs.low = 0.;
380  specs.high = 6.;
381  }
382  break;
383  case kRCT:
384  if (_axis == 1) {
385  specs.nbins = 64;
386  specs.low = -32.;
387  specs.high = 32.;
388  specs.title = "RCT iEta";
389  } else if (_axis == 2) {
390  specs.nbins = 72;
391  specs.low = 0.;
392  specs.high = 72.;
393  specs.title = "RCT Phi";
394  }
395  break;
396  default:
397  break;
398  }
399  }
400 
401  return specs;
402  }
403 
404  AxisSpecs getBinningMEM_(BinningType _btype, bool _isMap, int _subdet, int _axis) {
406 
407  if (_btype != kCrystal)
408  return specs;
409 
410  int nbins(44);
411  if (_subdet == EcalBarrel)
412  nbins = 36;
413  else if (_subdet == EcalEndcap)
414  nbins = 8;
415 
416  if (_axis == 1) {
417  specs.nbins = nbins;
418  specs.low = 0.;
419  specs.high = nbins;
420  } else if (_axis == 2) {
421  specs.nbins = 10;
422  specs.low = 0.;
423  specs.high = 10.;
424  specs.title = "iPN";
425  }
426 
427  return specs;
428  }
429 
430  int findBinCrystal_(const EcalElectronicsMapping *electronicsMap,
431  ObjectType _otype,
432  const DetId &_id,
433  int _iSM /* = -1*/) {
434  int xbin(0), ybin(0);
435  int nbinsX(0);
436  int subdet(_id.subdetId());
437 
438  if (subdet == EcalBarrel) {
439  EBDetId ebid(_id);
440  int iphi(ebid.iphi());
441  int ieta(ebid.ieta());
442  switch (_otype) {
443  case kEB:
444  xbin = iphi;
445  ybin = ieta < 0 ? ieta + 86 : ieta + 85;
446  nbinsX = 360;
447  break;
448  case kSM:
449  case kEBSM:
450  xbin = ieta < 0 ? -ieta : ieta;
451  ybin = ieta < 0 ? (iphi - 1) % 20 + 1 : 20 - (iphi - 1) % 20;
452  nbinsX = nEBSMEta;
453  break;
454  default:
455  break;
456  }
457  } else if (subdet == EcalEndcap) {
458  EEDetId eeid(_id);
459  int ix(eeid.ix());
460  int iy(eeid.iy());
461  switch (_otype) {
462  case kEE:
463  xbin = eeid.zside() < 0 ? ix : ix + 100;
464  ybin = iy;
465  nbinsX = 200;
466  break;
467  case kEEm:
468  case kEEp:
469  xbin = ix;
470  ybin = iy;
471  nbinsX = 100;
472  break;
473  case kSM:
474  case kEESM: {
475  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
476  xbin = ix - xlow_(iSM);
477  ybin = iy - ylow_(iSM);
478  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
479  nbinsX = nEESMXExt;
480  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
481  nbinsX = nEESMXRed;
482  else
483  nbinsX = nEESMX;
484  } break;
485  default:
486  break;
487  }
488  } else if (subdet == EcalLaserPnDiode) {
489  EcalPnDiodeDetId pnid(_id);
490  switch (_otype) {
491  case kSMMEM:
492  case kEBSMMEM:
493  case kEESMMEM:
494  xbin = pnid.iPnId();
495  ybin = 1;
496  nbinsX = 10;
497  break;
498  case kMEM:
499  xbin = memDCCIndex(dccId(_id, electronicsMap)) + 1;
500  ybin = pnid.iPnId();
501  nbinsX = 44;
502  break;
503  case kEBMEM:
504  xbin = memDCCIndex(dccId(_id, electronicsMap)) - 3;
505  ybin = pnid.iPnId();
506  nbinsX = 36;
507  break;
508  case kEEMEM:
509  xbin = memDCCIndex(dccId(_id, electronicsMap)) + 1;
510  if (xbin > kEEmHigh + 1)
511  xbin -= 36;
512  ybin = pnid.iPnId();
513  nbinsX = 8;
514  break;
515  default:
516  break;
517  }
518  }
519 
520  return (nbinsX + 2) * ybin + xbin;
521  }
522 
523  int findBinCrystal_(const EcalElectronicsMapping *electronicsMap, ObjectType _otype, EcalElectronicsId const &_id) {
524  return findBinCrystal_(electronicsMap, _otype, electronicsMap->getDetId(_id));
525  }
526 
527  int findBinRCT_(ObjectType _otype, DetId const &_id) {
528  int xbin(0);
529  int ybin(0);
530  int nbinsX(0);
531 
532  EcalTrigTowerDetId ttid(_id);
533  int ieta(ttid.ieta());
534  int iphi((ttid.iphi() + 1) % 72 + 1);
535 
536  xbin = ieta < 0 ? ieta + 33 : ieta + 32;
537  ybin = iphi;
538  nbinsX = 64;
539 
540  return (nbinsX + 2) * ybin + xbin;
541  }
542 
543  int findBinTriggerTower_(const EcalElectronicsMapping *electronicsMap, ObjectType _otype, DetId const &_id) {
544  int xbin(0);
545  int ybin(0);
546  int nbinsX(0);
547  int subdet(_id.subdetId());
548 
549  if ((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel) {
550  EcalTrigTowerDetId ttid;
551  if (subdet == EcalBarrel)
552  ttid = EBDetId(_id).tower();
553  else
554  ttid = _id;
555 
556  int ieta(ttid.ieta());
557  int iphi((ttid.iphi() + 1) % 72 + 1);
558  switch (_otype) {
559  case kEB:
560  xbin = iphi;
561  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
562  nbinsX = 72;
563  break;
564  case kSM:
565  case kEBSM:
566  xbin = ieta < 0 ? -ieta : ieta;
567  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
568  nbinsX = 17;
569  break;
570  case kEcal:
571  xbin = ieta < 0 ? ieta + 33 : ieta + 32;
572  ybin = iphi > 70 ? iphi - 70 : iphi + 2;
573  nbinsX = 64;
574  default:
575  break;
576  }
577  } else if (subdet == EcalEndcap) {
578  unsigned tccid(tccId(_id, electronicsMap));
579  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
580  return findBinCrystal_(electronicsMap, _otype, _id, iSM);
581  }
582 
583  return (nbinsX + 2) * ybin + xbin;
584  }
585 
586  int findBinPseudoStrip_(const EcalElectronicsMapping *electronicsMap, ObjectType _otype, DetId const &_id) {
587  int xbin(0);
588  int ybin(0);
589  int nbinsX(0);
590  int subdet(_id.subdetId());
591 
592  if ((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel) {
593  return findBinTriggerTower_(electronicsMap, _otype, _id);
594  } else if (subdet == EcalEndcap) {
595  unsigned tccid(tccId(_id, electronicsMap));
596  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
597  return findBinCrystal_(electronicsMap, _otype, _id, iSM);
598  }
599 
600  return (nbinsX + 2) * ybin + xbin;
601  }
602 
603  int findBinSuperCrystal_(const EcalElectronicsMapping *electronicsMap,
604  ObjectType _otype,
605  const DetId &_id,
606  int _iSM /* -1*/) {
607  int xbin(0);
608  int ybin(0);
609  int nbinsX(0);
610  int subdet(_id.subdetId());
611 
612  if (subdet == EcalBarrel) {
613  EBDetId ebid(_id);
614  int iphi(ebid.iphi());
615  int ieta(ebid.ieta());
616  switch (_otype) {
617  case kEB:
618  xbin = (iphi - 1) / 5 + 1;
619  ybin = (ieta < 0 ? ieta + 85 : ieta + 84) / 5 + 1;
620  nbinsX = 72;
621  break;
622  case kSM:
623  case kEBSM:
624  xbin = (ieta < 0 ? -ieta - 1 : ieta - 1) / 5 + 1;
625  ybin = (ieta < 0 ? (iphi - 1) % 20 : 19 - (iphi - 1) % 20) / 5 + 1;
626  nbinsX = nEBSMEta / 5;
627  break;
628  default:
629  break;
630  }
631  } else if (subdet == EcalEndcap) {
632  if (isEcalScDetId(_id)) {
633  EcalScDetId scid(_id);
634  int ix(scid.ix());
635  int iy(scid.iy());
636  switch (_otype) {
637  case kEE: {
638  int zside(scid.zside());
639  xbin = zside < 0 ? ix : ix + 20;
640  ybin = iy;
641  nbinsX = 40;
642  } break;
643  case kEEm:
644  case kEEp:
645  xbin = ix;
646  ybin = iy;
647  nbinsX = 20;
648  break;
649  case kSM:
650  case kEESM: {
651  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
652  xbin = ix - xlow_(iSM) / 5;
653  ybin = iy - ylow_(iSM) / 5;
654  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
655  nbinsX = nEESMXExt / 5;
656  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 ||
657  iSM == kEEp09)
658  nbinsX = nEESMXRed / 5;
659  else
660  nbinsX = nEESMX / 5;
661  } break;
662  default:
663  break;
664  }
665  } else {
666  EEDetId eeid(_id);
667  int ix(eeid.ix());
668  int iy(eeid.iy());
669  switch (_otype) {
670  case kEE:
671  xbin = (eeid.zside() < 0 ? ix - 1 : ix + 99) / 5 + 1;
672  ybin = (iy - 1) / 5 + 1;
673  nbinsX = 40;
674  break;
675  case kEEm:
676  case kEEp:
677  xbin = (ix - 1) / 5 + 1;
678  ybin = (iy - 1) / 5 + 1;
679  nbinsX = 20;
680  break;
681  case kSM:
682  case kEESM: {
683  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
684  xbin = (ix - xlow_(iSM) - 1) / 5 + 1;
685  ybin = (iy - ylow_(iSM) - 1) / 5 + 1;
686  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
687  nbinsX = nEESMXExt / 5;
688  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 ||
689  iSM == kEEp09)
690  nbinsX = nEESMXRed / 5;
691  else
692  nbinsX = nEESMX / 5;
693  } break;
694  default:
695  break;
696  }
697  }
698  } else if (subdet == EcalTriggerTower && !isEndcapTTId(_id)) {
699  EcalTrigTowerDetId ttid(_id);
700  int ieta(ttid.ieta());
701  int iphi((ttid.iphi() + 1) % 72 + 1);
702  switch (_otype) {
703  case kEB:
704  xbin = iphi;
705  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
706  nbinsX = 72;
707  break;
708  case kSM:
709  case kEBSM:
710  xbin = ieta < 0 ? -ieta : ieta;
711  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
712  nbinsX = nEBSMEta / 5;
713  break;
714  default:
715  break;
716  }
717  }
718 
719  return (nbinsX + 2) * ybin + xbin;
720  }
721 
722  int findBinSuperCrystal_(const EcalElectronicsMapping *electronicsMap,
723  ObjectType _otype,
724  const EcalElectronicsId &_id) {
725  int xbin(0);
726  int ybin(0);
727  int nbinsX(0);
728  int iDCC(_id.dccId() - 1);
729 
730  if (iDCC >= kEBmLow && iDCC <= kEBpHigh) {
731  unsigned towerid(_id.towerId());
732  bool isEBm(iDCC <= kEBmHigh);
733  switch (_otype) {
734  case kEB:
735  xbin = 4 * ((iDCC - 9) % 18) + (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
736  ybin = (towerid - 1) / 4 * (isEBm ? -1 : 1) + (isEBm ? 18 : 17);
737  nbinsX = 72;
738  break;
739  case kSM:
740  case kEBSM:
741  xbin = (towerid - 1) / 4 + 1;
742  //In by SM plots, using towerid, the ybinning always increases from 1 to 4,
743  //whereas using iphi it flips for EB- and EB+
744  ybin = (towerid - 1) % 4 + 1;
745  nbinsX = 17;
746  break;
747  default:
748  break;
749  }
750  } else {
751  return findBinSuperCrystal_(electronicsMap, _otype, EEDetId(electronicsMap->getDetId(_id)).sc());
752  }
753 
754  return (nbinsX + 2) * ybin + xbin;
755  }
756  } // namespace binning
757 } // namespace ecaldqm
static constexpr int nEBSMEta
const double Pi
unsigned memDCCIndex(unsigned)
int findBinRCT_(ObjectType, DetId const &)
static constexpr int nEESMXExt
int zside() const
Definition: EcalScDetId.h:64
int ieta() const
get the tower ieta
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
int findBinPseudoStrip_(EcalElectronicsMapping const *, ObjectType, DetId const &)
double const etaBound
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
int ix() const
Definition: EEDetId.h:77
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
static constexpr int nEESMYRed
int zside(DetId const &)
static constexpr int nEBSMPhi
std::vector< DetId > dccConstituents(int dccId) const
Get the constituent detids for this dccId.
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
static constexpr int nTTOuter
unsigned nSuperCrystals(unsigned)
static constexpr int nEESMX
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
bool isEndcapTTId(DetId const &)
int towerId() const
get the tower id
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
static constexpr int nEEEtaBins
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
AxisSpecs getBinningEB_(BinningType, bool, int)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int iy() const
Definition: EcalScDetId.h:76
int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &)
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
Definition: DetId.h:17
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
int zside() const
Definition: EEDetId.h:71
static constexpr int nEBEtaBins
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
AxisSpecs getBinningEE_(BinningType, bool, int, int)
int iPnId() const
get the PnId
static constexpr int nEESMXRed
static constexpr int nTTInner
static constexpr int nPhiBins
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.h:57
int iphi() const
get the tower iphi
AxisSpecs getBinningMEM_(BinningType, bool, int, int)
AxisSpecs getBinningEcal_(BinningType, bool, int)
static constexpr int nEESMY
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.
int iy() const
Definition: EEDetId.h:83
int ix() const
Definition: EcalScDetId.h:70