Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:17

0001 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
0002 
0003 std::string HcalElectronicsId::slbChannelCode() const {
0004   std::string retval;
0005   if (isTriggerChainId() && isVMEid()) {
0006     if (htrTopBottom()) {  // top
0007       switch (slbChannelIndex()) {
0008         case (0):
0009           retval = "A0";
0010           break;
0011         case (1):
0012           retval = "A1";
0013           break;
0014         case (2):
0015           retval = "C0";
0016           break;
0017         case (3):
0018           retval = "C1";
0019           break;
0020       }
0021     } else {
0022       switch (slbChannelIndex()) {
0023         case (0):
0024           retval = "B0";
0025           break;
0026         case (1):
0027           retval = "B1";
0028           break;
0029         case (2):
0030           retval = "D0";
0031           break;
0032         case (3):
0033           retval = "D1";
0034           break;
0035       }
0036     }
0037   }
0038   return retval;
0039 }
0040 
0041 std::ostream& operator<<(std::ostream& os, const HcalElectronicsId& id) {
0042   if (id.isUTCAid()) {
0043     if (id.isTriggerChainId())
0044       os << "UTCA(trigger): ";
0045     else
0046       os << "UTCA: ";
0047     return os << id.crateId() << ',' << id.slot() << ',' << id.fiberIndex() << ',' << id.fiberChanId();
0048   } else {
0049     if (id.isTriggerChainId()) {
0050       return os << id.dccid() << ',' << id.spigot() << ",SLB" << id.slbSiteNumber() << ',' << id.slbChannelIndex()
0051                 << " (HTR " << id.readoutVMECrateId() << ":" << id.htrSlot()
0052                 << ((id.htrTopBottom() == 1) ? ('t') : ('b')) << ')';
0053 
0054     } else {
0055       return os << id.dccid() << ',' << id.spigot() << ',' << id.fiberIndex() << ',' << id.fiberChanId() << " (HTR "
0056                 << id.readoutVMECrateId() << ":" << id.htrSlot() << ((id.htrTopBottom() == 1) ? ('t') : ('b')) << ')';
0057     }
0058   }
0059 }