CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LogicIDTranslation.cc
Go to the documentation of this file.
1 #include "../interface/LogicIDTranslation.h"
2 
4 
6 
7 namespace ecaldqm
8 {
11  {
12  return EcalLogicID("ECAL", 1);
13  }
14 
17  {
18  switch(_subdet){
19  case EcalBarrel:
20  return EcalLogicID("EB", 1000000000UL);
21  case EcalEndcap:
22  return EcalLogicID("EE", 2000000000UL);
23  default:
24  throw cms::Exception("UndefinedLogicID");
25  }
26  }
27 
29  crystalID(DetId const& _id)
30  {
31  unsigned iDCC(dccId(_id) - 1);
32  if(iDCC <= kEEmHigh || iDCC >= kEEpLow){
33  EEDetId eeid(_id);
34  return EcalLogicID("EE_crystal_number",
35  2010000000UL + 1000000 * (eeid.positiveZ() ? 2 : 0) + 1000 * eeid.ix() + eeid.iy(),
36  eeid.zside(), eeid.ix(), eeid.iy());
37  }
38  else{
39  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
40  EBDetId ebid(_id);
41  return EcalLogicID("EB_crystal_number",
42  1011000000UL + 10000 * ism + ebid.ic(),
43  ism, ebid.ic());
44  }
45  }
46 
49  {
50  unsigned iDCC(_id.dccId() - 1);
51  if(iDCC <= kEEmHigh || iDCC >= kEEpLow){
52  return EcalLogicID("EE_readout_tower",
53  2110000000UL + 100 * (601 + iDCC) + _id.towerId(),
54  601 + iDCC, _id.towerId());
55  }
56  else{
57  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
58  return EcalLogicID("EB_trigger_tower",
59  1021000000UL + 10000 * ism + _id.towerId(),
60  ism, _id.towerId());
61  }
62  }
63 
66  {
67  // using the PN ID degenerates the logic ID - 50 time samples are actually split into 5 channels each
68  unsigned iDCC(_id.iDCCId() - 1);
69  int memId((_id.iPnId() - 1) % 5 + ((_id.iPnId() - 1) / 5) * 25 + 1);
70  if(iDCC <= kEEmHigh || iDCC >= kEEpLow){
71  return EcalLogicID("EE_mem_channel",
72  100 * (601 + iDCC) + memId,
73  601 + iDCC, memId);
74  }
75  else{
76  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
77  return EcalLogicID("EB_mem_channel",
78  1191000000UL + 10000 * ism + memId,
79  ism, memId);
80  }
81  }
82 
85  {
86  unsigned iDCC(_id.dccId() - 1);
87  if(iDCC <= kEEmHigh || iDCC >= kEEpLow){
88  return EcalLogicID("EE_mem_TT",
89  100 * (601 + iDCC) + _id.towerId(),
90  601 + iDCC, _id.towerId());
91  }
92  else{
93  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
94  return EcalLogicID("EB_mem_TT",
95  1181000000UL + 10000 * ism + _id.towerId(),
96  ism, _id.towerId());
97  }
98  }
99 
102  {
103  unsigned iDCC(_id.iDCCId() - 1);
104  int pnid(_id.iPnId());
105  if(iDCC <= kEEmHigh || iDCC >= kEEpLow){
106  return EcalLogicID("EE_LM_PN",
107  100 * (601 + iDCC) + pnid,
108  601 + iDCC, pnid);
109  }
110  else{
111  int ism(iDCC <= kEBmHigh ? 19 + iDCC - kEBmLow : 1 + iDCC - kEBpLow);
112  return EcalLogicID("EB_LM_PN",
113  1131000000UL + 10000 * ism + pnid,
114  ism, pnid);
115  }
116  }
117 
118  DetId
119  toDetId(EcalLogicID const& _id)
120  {
121  return DetId();
122  }
123 }
124 
int ix() const
Definition: EEDetId.h:76
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:173
int towerId() const
get the tower id
int iPnId() const
get the PnId
int zside() const
Definition: EEDetId.h:70
int iy() const
Definition: EEDetId.h:82
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:46
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 &)