CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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):
9  retval = "A0";
10  break;
11  case (1):
12  retval = "A1";
13  break;
14  case (2):
15  retval = "C0";
16  break;
17  case (3):
18  retval = "C1";
19  break;
20  }
21  } else {
22  switch (slbChannelIndex()) {
23  case (0):
24  retval = "B0";
25  break;
26  case (1):
27  retval = "B1";
28  break;
29  case (2):
30  retval = "D0";
31  break;
32  case (3):
33  retval = "D1";
34  break;
35  }
36  }
37  }
38  return retval;
39 }
40 
41 std::ostream& operator<<(std::ostream& os, const HcalElectronicsId& id) {
42  if (id.isUTCAid()) {
43  if (id.isTriggerChainId())
44  os << "UTCA(trigger): ";
45  else
46  os << "UTCA: ";
47  return os << id.crateId() << ',' << id.slot() << ',' << id.fiberIndex() << ',' << id.fiberChanId();
48  } else {
49  if (id.isTriggerChainId()) {
50  return os << id.dccid() << ',' << id.spigot() << ",SLB" << id.slbSiteNumber() << ',' << id.slbChannelIndex()
51  << " (HTR " << id.readoutVMECrateId() << ":" << id.htrSlot()
52  << ((id.htrTopBottom() == 1) ? ('t') : ('b')) << ')';
53 
54  } else {
55  return os << id.dccid() << ',' << id.spigot() << ',' << id.fiberIndex() << ',' << id.fiberChanId() << " (HTR "
56  << id.readoutVMECrateId() << ":" << id.htrSlot() << ((id.htrTopBottom() == 1) ? ('t') : ('b')) << ')';
57  }
58  }
59 }
constexpr int slbChannelIndex() const
get the SLB channel index (valid only for VME trigger-chain ids)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
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.