CMS 3D CMS Logo

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 <DataFormats/HcalDetId/interface/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 (int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb)
 Constructor from slb channel,slb site,spigot,dccid.
 HcalElectronicsId (int fiberChan, int fiberIndex, int spigot, int dccid)
 Constructor from fiberchan,fiber index,spigot,dccid.
 HcalElectronicsId (uint32_t)
 from raw
 HcalElectronicsId ()
 Default constructor -- invalid value.
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
 Non-Equality operator.
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
 Equality operator.
uint32_t rawId () const
int readoutVMECrateId () const
 get the readout VME crate number
void setHTR (int crate, int slot, int tb)
 Set the htr-related information 1=top, 0=bottom.
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 18 of file HcalElectronicsId.h.


Constructor & Destructor Documentation

HcalElectronicsId::HcalElectronicsId (  ) 

Default constructor -- invalid value.

Definition at line 4 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

00004                                      {
00005   hcalElectronicsId_=0xffffffffu;
00006 }

HcalElectronicsId::HcalElectronicsId ( uint32_t  id  ) 

from raw

Definition at line 8 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

00008                                                 {
00009   hcalElectronicsId_=id;
00010 }

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_.

00012                                                                                          {
00013   hcalElectronicsId_=(fiberChan&0x3) | (((fiberIndex-1)&0x7)<<2) |
00014     ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
00015 }

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_.

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


Member Function Documentation

int HcalElectronicsId::dccid (  )  const [inline]

get the (Hcal local) DCC id

Definition at line 54 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLEDClient::getHistograms(), HcalCableMapper::process(), HcalDigiMonitor::processEvent(), and HcalTrigPrimMonitor::processEvent().

00054 { return (hcalElectronicsId_>>9)&0x1F; }

int HcalElectronicsId::fiberChanId (  )  const [inline]

get the fiber channel id (which of three channels on a readout fiber) (valid only for non-trigger-chain ids)

Definition at line 38 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalQLPlotHistoMgr::GetAHistogram(), htrChanId(), HcalLuttoDB::openPerLut1(), HcalCableMapper::process(), HcalLedAnalysis::processLedEvent(), and HcalLuttoDB::writeoutlut1().

00038 { return hcalElectronicsId_&0x3; }

int HcalElectronicsId::fiberIndex (  )  const [inline]

get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-chain ids)

Definition at line 40 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalQLPlotHistoMgr::GetAHistogram(), htrChanId(), HcalLuttoDB::openPerLut1(), HcalCableMapper::process(), and HcalLuttoDB::writeoutlut1().

00040 { return ((hcalElectronicsId_>>2)&0x7)+1; }

int HcalElectronicsId::htrChanId (  )  const [inline]

get the HTR channel id (1-24)

Definition at line 50 of file HcalElectronicsId.h.

References fiberChanId(), and fiberIndex().

Referenced by HtrXmlPatternTool::Fill(), and HcalLEDClient::getHistograms().

00050 { return (fiberChanId()+1)+((fiberIndex()-1)*3); }

int HcalElectronicsId::htrSlot (  )  const [inline]

get the htr slot

Definition at line 56 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLEDClient::getHistograms(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HcalCableMapper::process(), HcalDigiMonitor::processEvent(), HcalTrigPrimMonitor::processEvent(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().

00056 { return (hcalElectronicsId_>>14)&0x1F; }

int HcalElectronicsId::htrTopBottom (  )  const [inline]

get the htr top/bottom (1=top/0=bottom)

Definition at line 58 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HcalCableMapper::process(), HcalDigiMonitor::processEvent(), HcalTrigPrimMonitor::processEvent(), slbChannelCode(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().

00058 { return (hcalElectronicsId_>>19)&0x1; }

bool HcalElectronicsId::isTriggerChainId (  )  const [inline]

Definition at line 32 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by operator<<(), and slbChannelCode().

00032 { return (hcalElectronicsId_&0x02000000)!=0; }

int HcalElectronicsId::linearIndex (  )  const [inline]

get a fast, compact, unique index for linear lookups (maximum value = 16384)

Definition at line 62 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalElectronicsMap::findPByElId(), HcalElectronicsMap::findTByElId(), HcalElectronicsMap::lookup(), HcalElectronicsMap::mapEId2chId(), and HcalElectronicsMap::mapEId2tId().

00062 { return (hcalElectronicsId_)&0x3FFF; }

int HcalElectronicsId::operator!= ( const HcalElectronicsId id  )  const [inline]

Non-Equality operator.

Definition at line 70 of file HcalElectronicsId.h.

References hcalElectronicsId_.

00070 { return id.hcalElectronicsId_!=hcalElectronicsId_; }

uint32_t HcalElectronicsId::operator() (  )  [inline]

Definition at line 28 of file HcalElectronicsId.h.

References hcalElectronicsId_.

00028 { return hcalElectronicsId_; }

int HcalElectronicsId::operator< ( const HcalElectronicsId id  )  const [inline]

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

Definition at line 72 of file HcalElectronicsId.h.

References hcalElectronicsId_.

00072 { return hcalElectronicsId_<id.hcalElectronicsId_; }

int HcalElectronicsId::operator== ( const HcalElectronicsId id  )  const [inline]

Equality operator.

Definition at line 68 of file HcalElectronicsId.h.

References hcalElectronicsId_.

00068 { return id.hcalElectronicsId_==hcalElectronicsId_; }

uint32_t HcalElectronicsId::rawId (  )  const [inline]

Definition at line 30 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), HcalElectronicsMap::mapEId2chId(), and HcalElectronicsMap::mapEId2tId().

00030 { return hcalElectronicsId_; }

int HcalElectronicsId::readoutVMECrateId (  )  const [inline]

get the readout VME crate number

Definition at line 60 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLEDClient::getHistograms(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HcalCableMapper::process(), HcalDigiMonitor::processEvent(), HcalTrigPrimMonitor::processEvent(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().

00060 { return (hcalElectronicsId_>>20)&0x1F; }

void HcalElectronicsId::setHTR ( int  crate,
int  slot,
int  tb 
)

Set the htr-related information 1=top, 0=bottom.

Definition at line 46 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

Referenced by HcalMonitorModule::CheckSubdetectorStatus(), HcalFiberPattern::getId(), HcalDbOnline::getObject(), HcalDataFormatMonitor::unpack(), and HcalUnpacker::unpack().

00046                                                           {
00047   hcalElectronicsId_&=0x3FFF; // keep the readout chain info
00048   hcalElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20);
00049 }

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(), and slbChannelIndex().

00024                                                   {
00025   std::string retval;
00026   if (isTriggerChainId()) {
00027     if (htrTopBottom()) { // top
00028       switch (slbChannelIndex()) {
00029       case (0): retval="A0"; break;
00030       case (1): retval="A1"; break;
00031       case (2): retval="C0"; break;
00032       case (3): retval="C1"; break;
00033       }
00034     } else {
00035       switch (slbChannelIndex()) {
00036       case (0): retval="B0"; break;
00037       case (1): retval="B1"; break;
00038       case (2): retval="D0"; break;
00039       case (3): retval="D1"; break;
00040       }
00041     }
00042   }
00043   return retval;
00044 }

int HcalElectronicsId::slbChannelIndex (  )  const [inline]

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

Definition at line 42 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

00042 { return hcalElectronicsId_&0x3; }

int HcalElectronicsId::slbSiteNumber (  )  const [inline]

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

Definition at line 44 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

00044 { return ((hcalElectronicsId_>>2)&0x7); }

int HcalElectronicsId::spigot (  )  const [inline]

get the spigot (input number on DCC)

Definition at line 52 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLEDClient::getHistograms(), HcalCableMapper::process(), HcalDigiMonitor::processEvent(), and HcalTrigPrimMonitor::processEvent().

00052 { return (hcalElectronicsId_>>5)&0xF; }


Member Data Documentation

uint32_t HcalElectronicsId::hcalElectronicsId_ [private]

Definition at line 75 of file HcalElectronicsId.h.

Referenced by dccid(), fiberChanId(), fiberIndex(), HcalElectronicsId(), htrSlot(), htrTopBottom(), isTriggerChainId(), linearIndex(), operator!=(), operator()(), operator<(), operator==(), rawId(), readoutVMECrateId(), setHTR(), slbChannelIndex(), slbSiteNumber(), and spigot().

const int HcalElectronicsId::maxDCCId = 31 [static]

Definition at line 65 of file HcalElectronicsId.h.

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

Definition at line 64 of file HcalElectronicsId.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:40 2009 for CMSSW by  doxygen 1.5.4