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 | |
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_ |
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.
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_=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_.
{ 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; }
int HcalElectronicsId::dccid | ( | ) | const [inline] |
get the (Hcal local) DCC id
Definition at line 55 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), and HcalCableMapper::process().
{ 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 39 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HcalQLPlotHistoMgr::GetAHistogram(), htrChanId(), HcalLuttoDB::openPerLut1(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HcalCableMapper::process(), HcalLedAnalysis::processLedEvent(), and HcalLuttoDB::writeoutlut1().
{ 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 41 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HcalQLPlotHistoMgr::GetAHistogram(), htrChanId(), HcalLuttoDB::openPerLut1(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), and HcalLuttoDB::writeoutlut1().
{ return ((hcalElectronicsId_>>2)&0x7)+1; }
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] |
get the htr slot
Definition at line 57 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().
{ return (hcalElectronicsId_>>14)&0x1F; }
int HcalElectronicsId::htrTopBottom | ( | ) | const [inline] |
get the htr top/bottom (1=top/0=bottom)
Definition at line 59 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), slbChannelCode(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().
{ return (hcalElectronicsId_>>19)&0x1; }
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] |
get a fast, compact, unique index for linear lookups (maximum value = 16384)
Definition at line 63 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HcalElectronicsMap::findPByElId(), HcalElectronicsMap::findTByElId(), HcalLogicalMap::getDetId(), ZDCLogicalMapEntry::getLinearIndex(), HBHEHFLogicalMapEntry::getLinearIndex(), HOHXLogicalMapEntry::getLinearIndex(), HTLogicalMapEntry::getLinearIndex(), CALIBLogicalMapEntry::getLinearIndex(), HcalElectronicsMap::lookup(), HcalElectronicsMap::mapEId2chId(), and HcalElectronicsMap::mapEId2tId().
{ return (hcalElectronicsId_)&0x3FFF; }
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] |
Definition at line 31 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by CALIBLogicalMapEntry::CALIBLogicalMapEntry(), HBHEHFLogicalMapEntry::HBHEHFLogicalMapEntry(), HOHXLogicalMapEntry::HOHXLogicalMapEntry(), HTLogicalMapEntry::HTLogicalMapEntry(), HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), HcalElectronicsMap::mapEId2chId(), HcalElectronicsMap::mapEId2tId(), and ZDCLogicalMapEntry::ZDCLogicalMapEntry().
{ return hcalElectronicsId_; }
int HcalElectronicsId::readoutVMECrateId | ( | ) | const [inline] |
get the readout VME crate number
Definition at line 61 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HcalLuttoDB::openPerLut1(), HcalLuttoDB::openPerLut2(), HcalPacker::pack(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), HcalCableMapper::process(), HcalLuttoDB::writeoutlut1(), and HcalLuttoDB::writeoutlut2().
{ 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 CALIBLogicalMapEntry::CALIBLogicalMapEntry(), HcalMonitorModule::CheckSubdetectorStatus(), ChannelPattern::Fill_by_hand(), HcalFiberPattern::getId(), HcalDbOnline::getObject(), HBHEHFLogicalMapEntry::HBHEHFLogicalMapEntry(), HOHXLogicalMapEntry::HOHXLogicalMapEntry(), HcalTriggerPrimitiveAlgo::runFEFormatError(), HcalUnpacker::unpack(), and ZDCLogicalMapEntry::ZDCLogicalMapEntry().
{ hcalElectronicsId_&=0x3FFF; // keep the readout chain info hcalElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20); }
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().
{ 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] |
get the spigot (input number on DCC)
Definition at line 53 of file HcalElectronicsId.h.
References hcalElectronicsId_.
Referenced by HtrXmlPatternTool::Fill(), HcalQLPlotHistoMgr::GetAHistogram(), HOHXLogicalMapEntry::printLMapLine(), ZDCLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HBHEHFLogicalMapEntry::printLMapLine(), HTLogicalMapEntry::printLMapLine(), printTableLine(), and HcalCableMapper::process().
{ return (hcalElectronicsId_>>5)&0xF; }
uint32_t HcalElectronicsId::hcalElectronicsId_ [private] |
Definition at line 76 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 66 of file HcalElectronicsId.h.
const int HcalElectronicsId::maxLinearIndex = 0x3FFF [static] |
Definition at line 65 of file HcalElectronicsId.h.
Referenced by HcalLogicalMapGenerator::createMap().