CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

HcalElectronicsId Class Reference

Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Readout Crate Id [19] HTR FPGA selector [t/b] [18:14] HTR Slot [13:9] DCC id [8:5] Spigot [4:2] FiberIndex or SLB site [1:0] FiberChanId or SLB channel. More...

#include <HcalElectronicsId.h>

List of all members.

Public Member Functions

int dccid () const
 get the (Hcal local) DCC id
int fiberChanId () const
 get the fiber channel id (which of three channels on a readout fiber) (valid only for non-trigger-chain ids)
int fiberIndex () const
 get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-chain ids)
 HcalElectronicsId (uint32_t)
 HcalElectronicsId (int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb)
 HcalElectronicsId ()
 HcalElectronicsId (int fiberChan, int fiberIndex, int spigot, int dccid)
int htrChanId () const
 get the HTR channel id (1-24)
int htrSlot () const
 get the htr slot
int htrTopBottom () const
 get the htr top/bottom (1=top/0=bottom)
bool isTriggerChainId () const
int linearIndex () const
 get a fast, compact, unique index for linear lookups (maximum value = 16384)
int operator!= (const HcalElectronicsId &id) const
uint32_t operator() ()
int operator< (const HcalElectronicsId &id) const
 Compare the id to another id for use in a map.
int operator== (const HcalElectronicsId &id) const
uint32_t rawId () const
int readoutVMECrateId () const
 get the readout VME crate number
void setHTR (int crate, int slot, int tb)
std::string slbChannelCode () const
 get the HTR-wide slb channel code (letter plus number)
int slbChannelIndex () const
 get the SLB channel index (valid only for trigger-chain ids)
int slbSiteNumber () const
 get the SLB site number (valid only for trigger-chain ids)
int spigot () const
 get the spigot (input number on DCC)

Static Public Attributes

static const int maxDCCId = 31
static const int maxLinearIndex = 0x3FFF

Private Attributes

uint32_t hcalElectronicsId_

Detailed Description

Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Readout Crate Id [19] HTR FPGA selector [t/b] [18:14] HTR Slot [13:9] DCC id [8:5] Spigot [4:2] FiberIndex or SLB site [1:0] FiberChanId or SLB channel.

Definition at line 19 of file HcalElectronicsId.h.


Constructor & Destructor Documentation

HcalElectronicsId::HcalElectronicsId ( )

Default constructor -- invalid value

Definition at line 4 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

                                     {
  hcalElectronicsId_=0xffffffffu;
}
HcalElectronicsId::HcalElectronicsId ( uint32_t  id)

from raw

Definition at line 8 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

HcalElectronicsId::HcalElectronicsId ( int  fiberChan,
int  fiberIndex,
int  spigot,
int  dccid 
)

Constructor from fiberchan,fiber index,spigot,dccid

Definition at line 12 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

                                                                                         {
  hcalElectronicsId_=(fiberChan&0x3) | (((fiberIndex-1)&0x7)<<2) |
    ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
}
HcalElectronicsId::HcalElectronicsId ( int  slbChan,
int  slbSite,
int  spigot,
int  dccid,
int  crate,
int  slot,
int  tb 
)

Constructor from slb channel,slb site,spigot,dccid

Definition at line 17 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

                                                                                                                 {
  hcalElectronicsId_=(slbChan&0x3) | (((slbSite)&0x7)<<2) |
    ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
  hcalElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20);
  hcalElectronicsId_|=0x02000000;
}

Member Function Documentation

int HcalElectronicsId::dccid ( ) const [inline]
int HcalElectronicsId::fiberChanId ( ) const [inline]
int HcalElectronicsId::fiberIndex ( ) const [inline]
int HcalElectronicsId::htrChanId ( ) const [inline]

get the HTR channel id (1-24)

Definition at line 51 of file HcalElectronicsId.h.

References fiberChanId(), and fiberIndex().

Referenced by HtrXmlPatternTool::Fill().

{ return (fiberChanId()+1)+((fiberIndex()-1)*3); }
int HcalElectronicsId::htrSlot ( ) const [inline]
int HcalElectronicsId::htrTopBottom ( ) const [inline]
bool HcalElectronicsId::isTriggerChainId ( ) const [inline]

Definition at line 33 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by slbChannelCode().

{ return (hcalElectronicsId_&0x02000000)!=0; }
int HcalElectronicsId::linearIndex ( ) const [inline]
int HcalElectronicsId::operator!= ( const HcalElectronicsId id) const [inline]

Non-Equality operator

Definition at line 71 of file HcalElectronicsId.h.

References hcalElectronicsId_.

{ return id.hcalElectronicsId_!=hcalElectronicsId_; }
uint32_t HcalElectronicsId::operator() ( ) [inline]

Definition at line 29 of file HcalElectronicsId.h.

References hcalElectronicsId_.

{ return hcalElectronicsId_; }
int HcalElectronicsId::operator< ( const HcalElectronicsId id) const [inline]

Compare the id to another id for use in a map.

Definition at line 73 of file HcalElectronicsId.h.

References hcalElectronicsId_.

{ return hcalElectronicsId_<id.hcalElectronicsId_; }
int HcalElectronicsId::operator== ( const HcalElectronicsId id) const [inline]

Equality operator

Definition at line 69 of file HcalElectronicsId.h.

References hcalElectronicsId_.

{ return id.hcalElectronicsId_==hcalElectronicsId_; }
uint32_t HcalElectronicsId::rawId ( ) const [inline]
int HcalElectronicsId::readoutVMECrateId ( ) const [inline]
void HcalElectronicsId::setHTR ( int  crate,
int  slot,
int  tb 
)
std::string HcalElectronicsId::slbChannelCode ( ) const

get the HTR-wide slb channel code (letter plus number)

Definition at line 24 of file HcalElectronicsId.cc.

References htrTopBottom(), isTriggerChainId(), slbChannelIndex(), and AlCaHLTBitMon_QueryRunRegistry::string.

                                                  {
  std::string retval;
  if (isTriggerChainId()) {
    if (htrTopBottom()) { // top
      switch (slbChannelIndex()) {
      case (0): retval="A0"; break;
      case (1): retval="A1"; break;
      case (2): retval="C0"; break;
      case (3): retval="C1"; break;
      }
    } else {
      switch (slbChannelIndex()) {
      case (0): retval="B0"; break;
      case (1): retval="B1"; break;
      case (2): retval="D0"; break;
      case (3): retval="D1"; break;
      }
    }
  }
  return retval;
}
int HcalElectronicsId::slbChannelIndex ( ) const [inline]

get the SLB channel index (valid only for trigger-chain ids)

Definition at line 43 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalLuttoDB::openPerLut2(), HTLogicalMapEntry::printLMapLine(), slbChannelCode(), and HcalLuttoDB::writeoutlut2().

{ return hcalElectronicsId_&0x3; }
int HcalElectronicsId::slbSiteNumber ( ) const [inline]

get the SLB site number (valid only for trigger-chain ids)

Definition at line 45 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalLuttoDB::openPerLut2(), HTLogicalMapEntry::printLMapLine(), and HcalLuttoDB::writeoutlut2().

{ return ((hcalElectronicsId_>>2)&0x7); }
int HcalElectronicsId::spigot ( ) const [inline]

Member Data Documentation

const int HcalElectronicsId::maxDCCId = 31 [static]

Definition at line 66 of file HcalElectronicsId.h.

const int HcalElectronicsId::maxLinearIndex = 0x3FFF [static]

Definition at line 65 of file HcalElectronicsId.h.

Referenced by HcalLogicalMapGenerator::createMap().