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
ecaldqm::kEBmHigh
Definition: EcalDQMCommonUtils.h:86
ecaldqm
Definition: DQWorker.h:24
EBDetId::ic
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
EBDetId
Definition: EBDetId.h:17
EcalPnDiodeDetId::iPnId
int iPnId() const
get the PnId
Definition: EcalPnDiodeDetId.h:46
EcalSubdetector
EcalSubdetector
Definition: EcalSubdetector.h:10
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
EcalElectronicsId::dccId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
Definition: EcalElectronicsId.h:31
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
EcalBarrel
Definition: EcalSubdetector.h:10
EcalElectronicsId::towerId
int towerId() const
get the tower id
Definition: EcalElectronicsId.h:33
DetId
Definition: DetId.h:17
EcalLogicID
Definition: EcalLogicID.h:7
EEDetId::zside
int zside() const
Definition: EEDetId.h:71
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
LogicIDTranslation.h
EEDetId
Definition: EEDetId.h:14
EcalEndcap
Definition: EcalSubdetector.h:10
EcalPnDiodeDetId::iDCCId
int iDCCId() const
get the DCCId
Definition: EcalPnDiodeDetId.h:44
ecaldqm::toDetId
DetId toDetId(EcalLogicID const &)
Definition: LogicIDTranslation.cc:82
ecaldqm::kEBmLow
Definition: EcalDQMCommonUtils.h:85
ecaldqm::memChannelID
EcalLogicID memChannelID(EcalPnDiodeDetId const &)
Definition: LogicIDTranslation.cc:48
ecaldqm::ecalID
EcalLogicID ecalID()
Definition: LogicIDTranslation.cc:8
EEDetId::iy
int iy() const
Definition: EEDetId.h:83
EEDetId::positiveZ
bool positiveZ() const
Definition: EEDetId.h:174
ecalpyutils::ism
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:51
ecaldqm::lmPNID
EcalLogicID lmPNID(EcalPnDiodeDetId const &)
Definition: LogicIDTranslation.cc:71
ecaldqm::memTowerID
EcalLogicID memTowerID(EcalElectronicsId const &)
Definition: LogicIDTranslation.cc:61
ecaldqm::crystalID
EcalLogicID crystalID(DetId const &)
Definition: LogicIDTranslation.cc:21
ecaldqm::kEEpLow
Definition: EcalDQMCommonUtils.h:83
Exception
Definition: hltDiff.cc:246
ecaldqm::towerID
EcalLogicID towerID(EcalElectronicsId const &)
Definition: LogicIDTranslation.cc:37
Exception.h
ecaldqm::kEBpLow
Definition: EcalDQMCommonUtils.h:87
ecaldqm::subdetID
EcalLogicID subdetID(EcalSubdetector)
Definition: LogicIDTranslation.cc:10
EcalDQMCommonUtils.h
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:16