CMS 3D CMS Logo

LogicIDTranslation.cc
Go to the documentation of this file.
2 
4 
6 
7 namespace ecaldqm {
8  EcalLogicID ecalID() { return EcalLogicID("ECAL", 1); }
9 
11  switch (_subdet) {
12  case EcalBarrel:
13  return EcalLogicID("EB", 1000000000UL);
14  case EcalEndcap:
15  return EcalLogicID("EE", 2000000000UL);
16  default:
17  throw cms::Exception("UndefinedLogicID");
18  }
19  }
20 
21  EcalLogicID crystalID(DetId const &_id) {
22  unsigned iDCC(dccId(_id) - 1);
23  if (iDCC <= kEEmHigh || iDCC >= kEEpLow) {
24  EEDetId eeid(_id);
25  return EcalLogicID("EE_crystal_number",
26  2010000000UL + 1000000 * (eeid.positiveZ() ? 2 : 0) + 1000 * eeid.ix() + eeid.iy(),
27  eeid.zside(),
28  eeid.ix(),
29  eeid.iy());
30  } else {
31  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
32  EBDetId ebid(_id);
33  return EcalLogicID("EB_crystal_number", 1011000000UL + 10000 * ism + ebid.ic(), ism, ebid.ic());
34  }
35  }
36 
38  unsigned iDCC(_id.dccId() - 1);
39  if (iDCC <= kEEmHigh || iDCC >= kEEpLow) {
40  return EcalLogicID(
41  "EE_readout_tower", 2110000000UL + 100 * (601 + iDCC) + _id.towerId(), 601 + iDCC, _id.towerId());
42  } else {
43  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
44  return EcalLogicID("EB_trigger_tower", 1021000000UL + 10000 * ism + _id.towerId(), ism, _id.towerId());
45  }
46  }
47 
49  // using the PN ID degenerates the logic ID - 50 time samples are actually
50  // split into 5 channels each
51  unsigned iDCC(_id.iDCCId() - 1);
52  int memId((_id.iPnId() - 1) % 5 + ((_id.iPnId() - 1) / 5) * 25 + 1);
53  if (iDCC <= kEEmHigh || iDCC >= kEEpLow) {
54  return EcalLogicID("EE_mem_channel", 100 * (601 + iDCC) + memId, 601 + iDCC, memId);
55  } else {
56  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
57  return EcalLogicID("EB_mem_channel", 1191000000UL + 10000 * ism + memId, ism, memId);
58  }
59  }
60 
62  unsigned iDCC(_id.dccId() - 1);
63  if (iDCC <= kEEmHigh || iDCC >= kEEpLow) {
64  return EcalLogicID("EE_mem_TT", 100 * (601 + iDCC) + _id.towerId(), 601 + iDCC, _id.towerId());
65  } else {
66  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
67  return EcalLogicID("EB_mem_TT", 1181000000UL + 10000 * ism + _id.towerId(), ism, _id.towerId());
68  }
69  }
70 
72  unsigned iDCC(_id.iDCCId() - 1);
73  int pnid(_id.iPnId());
74  if (iDCC <= kEEmHigh || iDCC >= kEEpLow) {
75  return EcalLogicID("EE_LM_PN", 100 * (601 + iDCC) + pnid, 601 + iDCC, pnid);
76  } else {
77  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
78  return EcalLogicID("EB_LM_PN", 1131000000UL + 10000 * ism + pnid, ism, pnid);
79  }
80  }
81 
82  DetId toDetId(EcalLogicID const &_id) { return DetId(); }
83 } // namespace ecaldqm
int ix() const
Definition: EEDetId.h:77
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
bool positiveZ() const
Definition: EEDetId.h:174
int towerId() const
get the tower id
int iPnId() const
get the PnId
int zside() const
Definition: EEDetId.h:71
int iy() const
Definition: EEDetId.h:83
EcalLogicID memChannelID(EcalPnDiodeDetId const &)
DetId toDetId(EcalLogicID const &)
int iDCCId() const
get the DCCId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
EcalLogicID ecalID()
Definition: DetId.h:18
EcalLogicID lmPNID(EcalPnDiodeDetId const &)
EcalLogicID subdetID(EcalSubdetector)
EcalLogicID towerID(EcalElectronicsId const &)
EcalLogicID memTowerID(EcalElectronicsId const &)
EcalSubdetector
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
unsigned dccId(DetId const &)
EcalLogicID crystalID(DetId const &)