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

#include <HcalElectronicsId.h>

Public Member Functions

int crateId () const
 get the readout VME crate number More...
 
int dccid () const
 get the (Hcal local) DCC id for VME, crate number for uTCA More...
 
int fiberChanId () const
 get the fiber channel id (which of channels on a fiber) More...
 
int fiberIndex () const
 get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zero-based 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)
 
 HcalElectronicsId (int crate, int slot, int fiber, int fiberchan, bool isTrigger)
 
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), valid for VME More...
 
bool isTriggerChainId () const
 
bool isUTCAid () const
 
bool isVMEid () const
 
int linearIndex () const
 get a fast, compact, unique index for linear lookups 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 VME trigger-chain ids) More...
 
int slbSiteNumber () const
 get the SLB site number (valid only for VME trigger-chain ids) More...
 
int slot () const
 get the htr or uHTR slot More...
 
int spigot () const
 get the spigot (input number on DCC, AMC card number for uTCA) More...
 
int subtype () const
 get subtype for this channel (valid for uTCA only) More...
 

Static Public Attributes

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

Private Attributes

uint32_t hcalElectronicsId_
 

Detailed Description

Readout chain identification for Hcal.

[31:27] Unused (so far) [26] VME (0), uTCA (1)

For VME Electronics: [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

For uTCA Electronics:

[25] Is Trigger Id [18:13] Readout Crate Id [12:9] Slot [8:4] Fiber [3:0] FiberChanId

Definition at line 32 of file HcalElectronicsId.h.

Constructor & Destructor Documentation

HcalElectronicsId::HcalElectronicsId ( )

Default constructor – invalid value

Definition at line 3 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

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

from raw

Definition at line 7 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

7  {
9 }
HcalElectronicsId::HcalElectronicsId ( int  fiberChan,
int  fiberIndex,
int  spigot,
int  dccid 
)

VME Constructor from fiberchan,fiber index,spigot,dccid

Definition at line 11 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

11  {
12  hcalElectronicsId_=(fiberChan&0x3) | (((fiberIndex-1)&0x7)<<2) |
13  ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
14 }
int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
HcalElectronicsId::HcalElectronicsId ( int  slbChan,
int  slbSite,
int  spigot,
int  dccid,
int  crate,
int  slot,
int  tb 
)

VME Constructor from slb channel,slb site,spigot,dccid

Definition at line 16 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

16  {
17  hcalElectronicsId_=(slbChan&0x3) | (((slbSite)&0x7)<<2) |
18  ((spigot&0xF)<<5) | ((dccid&0x1F)<<9);
19  hcalElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20);
20  hcalElectronicsId_|=0x02000000;
21 }
static int slbChan(const HcalTriggerPrimitiveSample &theSample)
int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
int slot() const
get the htr or uHTR slot
HcalElectronicsId::HcalElectronicsId ( int  crate,
int  slot,
int  fiber,
int  fiberchan,
bool  isTrigger 
)

uTCA constructor

Definition at line 23 of file HcalElectronicsId.cc.

References hcalElectronicsId_.

23  {
24  hcalElectronicsId_=(fc&0xF) | (((fiber)&0x1F)<<4) |
25  ((slot&0xF)<<9) | ((crate&0x3F)<<13);
26  if (isTrigger) hcalElectronicsId_|=0x02000000;
27  hcalElectronicsId_|=0x04000000;
28 }
int slot() const
get the htr or uHTR slot

Member Function Documentation

int HcalElectronicsId::crateId ( ) const
inline

get the readout VME crate number

Definition at line 86 of file HcalElectronicsId.h.

References hcalElectronicsId_, and isVMEid().

Referenced by dccid(), hcaldqm::quantity::getEid_FEDuTCASlot(), hcaldqm::quantity::getLabels_Crate(), hcaldqm::quantity::getLabels_CrateuTCA(), hcaldqm::quantity::getLabels_CrateVME(), hcaldqm::quantity::getLabels_FED(), hcaldqm::quantity::getLabels_FEDuTCA(), hcaldqm::quantity::getLabels_FEDuTCASlot(), hcaldqm::quantity::FEDQuantity::getValue(), hcaldqm::quantity::getValue_Crate(), hcaldqm::quantity::getValue_CrateuTCA(), hcaldqm::quantity::getValue_CrateVME(), hcaldqm::quantity::getValue_FED(), hcaldqm::quantity::getValue_FEDuTCA(), hcaldqm::hashfunctions::hash_Crate(), hcaldqm::hashfunctions::hash_CrateSlot(), hcaldqm::hashfunctions::hash_CrateSpigot(), hcaldqm::hashfunctions::hash_EChannel(), hcaldqm::hashfunctions::hash_FED(), hcaldqm::hashfunctions::hash_FEDSlot(), hcaldqm::hashfunctions::hash_FEDSpigot(), hcaldqm::utilities::isFEDHBHE(), hcaldqm::utilities::isFEDHF(), hcaldqm::hashfunctions::name_Crate(), hcaldqm::hashfunctions::name_CrateSlot(), hcaldqm::hashfunctions::name_CrateSpigot(), hcaldqm::hashfunctions::name_EChannel(), hcaldqm::hashfunctions::name_FED(), hcaldqm::hashfunctions::name_FEDSlot(), hcaldqm::hashfunctions::name_FEDSpigot(), and readoutVMECrateId().

86 { return (isVMEid())?((hcalElectronicsId_>>20)&0x1F):((hcalElectronicsId_>>13)&0x3F); }
bool isVMEid() const
int HcalElectronicsId::dccid ( ) const
inline

get the (Hcal local) DCC id for VME, crate number for uTCA

Definition at line 76 of file HcalElectronicsId.h.

References crateId(), hcalElectronicsId_, and isVMEid().

Referenced by ZDCTask::analyze(), HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), hcaldqm::quantity::getEid_FEDVMESpigot(), hcaldqm::quantity::getLabels_FED(), hcaldqm::quantity::getLabels_FEDVMESpigot(), hcaldqm::quantity::FEDQuantity::getValue(), hcaldqm::quantity::getValue_FED(), hcaldqm::quantity::getValue_FEDVME(), hcaldqm::hashfunctions::hash_Crate(), hcaldqm::hashfunctions::hash_CrateSlot(), hcaldqm::hashfunctions::hash_CrateSpigot(), hcaldqm::hashfunctions::hash_EChannel(), hcaldqm::hashfunctions::hash_FED(), hcaldqm::hashfunctions::hash_FEDSlot(), hcaldqm::hashfunctions::hash_FEDSpigot(), hcaldqm::utilities::isFEDHBHE(), hcaldqm::utilities::isFEDHO(), hcaldqm::hashfunctions::name_Crate(), hcaldqm::hashfunctions::name_CrateSlot(), hcaldqm::hashfunctions::name_CrateSpigot(), hcaldqm::hashfunctions::name_EChannel(), hcaldqm::hashfunctions::name_FED(), hcaldqm::hashfunctions::name_FEDSlot(), hcaldqm::hashfunctions::name_FEDSpigot(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), and SelectedElectronFEDListProducer< TEle, TCand >::produce().

76 { return (isVMEid())?((hcalElectronicsId_>>9)&0x1F):crateId(); }
int crateId() const
get the readout VME crate number
bool isVMEid() const
int HcalElectronicsId::fiberChanId ( ) const
inline
int HcalElectronicsId::fiberIndex ( ) const
inline

get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zero-based

Definition at line 61 of file HcalElectronicsId.h.

References hcalElectronicsId_, and isVMEid().

Referenced by ZDCTask::analyze(), HcalQLPlotHistoMgr::GetAHistogram(), hcaldqm::quantity::getEid_FiberuTCAFiberCh(), hcaldqm::quantity::getEid_FiberuTCATPFiberChuTCATP(), hcaldqm::quantity::getEid_FiberVMEFiberCh(), hcaldqm::quantity::getLabels_FiberuTCA(), hcaldqm::quantity::getLabels_FiberuTCAFiberCh(), hcaldqm::quantity::getLabels_FiberuTCATP(), hcaldqm::quantity::getLabels_FiberuTCATPFiberChuTCATP(), hcaldqm::quantity::getLabels_FiberVME(), hcaldqm::quantity::getLabels_FiberVMEFiberCh(), hcaldqm::quantity::getValue_FiberuTCA(), hcaldqm::quantity::getValue_FiberuTCATP(), hcaldqm::quantity::getValue_FiberVME(), hcaldqm::hashfunctions::hash_EChannel(), htrChanId(), hcaldqm::hashfunctions::name_EChannel(), HcalLuttoDB::openPerLut1(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), and HcalLuttoDB::writeoutlut1().

61 { return (isVMEid())?(((hcalElectronicsId_>>2)&0x7)+1):((hcalElectronicsId_>>4)&0x1F); }
bool isVMEid() const
int HcalElectronicsId::htrChanId ( ) const
inline

get the HTR channel id (1-24)

Definition at line 68 of file HcalElectronicsId.h.

References fiberChanId(), fiberIndex(), and isVMEid().

Referenced by HtrXmlPatternTool::Fill().

68 { return isVMEid()?((fiberChanId()+1)+((fiberIndex()-1)*3)):(0); }
int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
bool isVMEid() const
int HcalElectronicsId::htrSlot ( ) const
inline
int HcalElectronicsId::htrTopBottom ( ) const
inline
bool HcalElectronicsId::isTriggerChainId ( ) const
inline

Definition at line 51 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by slbChannelCode().

51 { return (hcalElectronicsId_&0x02000000)!=0; }
bool HcalElectronicsId::isUTCAid ( ) const
inline

Definition at line 50 of file HcalElectronicsId.h.

References hcalElectronicsId_.

Referenced by hcaldqm::quantity::getValue_Crate(), setHTR(), and subtype().

50 { return (hcalElectronicsId_&0x04000000)!=0; }
bool HcalElectronicsId::isVMEid ( ) const
inline
int HcalElectronicsId::linearIndex ( ) const
inline
int HcalElectronicsId::operator!= ( const HcalElectronicsId id) const
inline

Non-Equality operator

Definition at line 96 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

Definition at line 45 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

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

Definition at line 98 of file HcalElectronicsId.h.

References hcalElectronicsId_.

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

Equality operator

Definition at line 94 of file HcalElectronicsId.h.

References hcalElectronicsId_.

94 { 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 30 of file HcalElectronicsId.cc.

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

30  {
31  std::string retval;
32  if (isTriggerChainId() && isVMEid()) {
33  if (htrTopBottom()) { // top
34  switch (slbChannelIndex()) {
35  case (0): retval="A0"; break;
36  case (1): retval="A1"; break;
37  case (2): retval="C0"; break;
38  case (3): retval="C1"; break;
39  }
40  } else {
41  switch (slbChannelIndex()) {
42  case (0): retval="B0"; break;
43  case (1): retval="B1"; break;
44  case (2): retval="D0"; break;
45  case (3): retval="D1"; break;
46  }
47  }
48  }
49  return retval;
50 }
int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
int slbChannelIndex() const
get the SLB channel index (valid only for VME trigger-chain ids)
bool isVMEid() const
bool isTriggerChainId() const
int HcalElectronicsId::slbChannelIndex ( ) const
inline
int HcalElectronicsId::slbSiteNumber ( ) const
inline
int HcalElectronicsId::slot ( ) const
inline
int HcalElectronicsId::spigot ( ) const
inline
int HcalElectronicsId::subtype ( ) const
inline

get subtype for this channel (valid for uTCA only)

Definition at line 57 of file HcalElectronicsId.h.

References hcalElectronicsId_, and isUTCAid().

57 { return (isUTCAid())?((hcalElectronicsId_>>21)&0x1F):(-1); }
bool isUTCAid() const

Member Data Documentation

uint32_t HcalElectronicsId::hcalElectronicsId_
private
const int HcalElectronicsId::maxDCCId = 31
static

Definition at line 91 of file HcalElectronicsId.h.

const int HcalElectronicsId::maxLinearIndex = 0x7FFFF
static

Definition at line 90 of file HcalElectronicsId.h.

Referenced by HcalLogicalMapGenerator::createMap().