CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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>

Public Member Functions

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

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

4  {
5  hcalElectronicsId_=0xffffffffu;
6 }
HcalElectronicsId::HcalElectronicsId ( uint32_t  id)
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_.

12  {
13  hcalElectronicsId_=(fiberChan&0x3) | (((fiberIndex-1)&0x7)<<2) |
14  ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
15 }
int fiberIndex() const
get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-cha...
int dccid() const
get the (Hcal local) DCC id
int spigot() const
get the spigot (input number on DCC)
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_.

17  {
18  hcalElectronicsId_=(slbChan&0x3) | (((slbSite)&0x7)<<2) |
19  ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
20  hcalElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20);
21  hcalElectronicsId_|=0x02000000;
22 }
int dccid() const
get the (Hcal local) DCC id
int spigot() const
get the spigot (input number on DCC)

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().

51 { return (fiberChanId()+1)+((fiberIndex()-1)*3); }
int fiberIndex() const
get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-cha...
int fiberChanId() const
get the fiber channel id (which of three channels on a readout fiber) (valid only for non-trigger-cha...
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().

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

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

Definition at line 29 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

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

Equality operator

Definition at line 69 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

24  {
25  std::string retval;
26  if (isTriggerChainId()) {
27  if (htrTopBottom()) { // top
28  switch (slbChannelIndex()) {
29  case (0): retval="A0"; break;
30  case (1): retval="A1"; break;
31  case (2): retval="C0"; break;
32  case (3): retval="C1"; break;
33  }
34  } else {
35  switch (slbChannelIndex()) {
36  case (0): retval="B0"; break;
37  case (1): retval="B1"; break;
38  case (2): retval="D0"; break;
39  case (3): retval="D1"; break;
40  }
41  }
42  }
43  return retval;
44 }
int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom)
int slbChannelIndex() const
get the SLB channel index (valid only for trigger-chain ids)
bool isTriggerChainId() const
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().

43 { 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().

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

Member Data Documentation

uint32_t HcalElectronicsId::hcalElectronicsId_
private
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().