CMS 3D CMS Logo

HcalElectronicsId.cc
Go to the documentation of this file.
2 
4  std::string retval;
5  if (isTriggerChainId() && isVMEid()) {
6  if (htrTopBottom()) { // top
7  switch (slbChannelIndex()) {
8  case (0): retval="A0"; break;
9  case (1): retval="A1"; break;
10  case (2): retval="C0"; break;
11  case (3): retval="C1"; break;
12  }
13  } else {
14  switch (slbChannelIndex()) {
15  case (0): retval="B0"; break;
16  case (1): retval="B1"; break;
17  case (2): retval="D0"; break;
18  case (3): retval="D1"; break;
19  }
20  }
21  }
22  return retval;
23 }
24 
25 std::ostream& operator<<(std::ostream& os,const HcalElectronicsId& id) {
26  if (id.isUTCAid()) {
27  if (id.isTriggerChainId()) os << "UTCA(trigger): ";
28  else os << "UTCA: ";
29  return os << id.crateId() << ',' << id.slot() << ',' << id.fiberIndex() << ',' << id.fiberChanId();
30  } else {
31  if (id.isTriggerChainId()) {
32  return os << id.dccid() << ',' << id.spigot() << ",SLB" << id.slbSiteNumber() << ',' << id.slbChannelIndex() << " (HTR "
33  << id.readoutVMECrateId() << ":" << id.htrSlot() << ((id.htrTopBottom()==1)?('t'):('b')) << ')';
34 
35  } else {
36  return os << id.dccid() << ',' << id.spigot() << ',' << id.fiberIndex() << ',' << id.fiberChanId() << " (HTR "
37  << id.readoutVMECrateId() << ":" << id.htrSlot() << ((id.htrTopBottom()==1)?('t'):('b')) << ')';
38  }
39  }
40 }
constexpr int slbChannelIndex() const
get the SLB channel index (valid only for VME trigger-chain ids)
std::ostream & operator<<(std::ostream &os, const HcalElectronicsId &id)
constexpr bool isUTCAid() const
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
constexpr bool isVMEid() const
std::string slbChannelCode() const
get the HTR-wide slb channel code (letter plus number)
constexpr bool isTriggerChainId() const
Readout chain identification for Hcal.