#include <DataFormats/HcalDetId/interface/CastorElectronicsId.h>
Public Member Functions | |
CastorElectronicsId (int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb) | |
CastorElectronicsId (int fiberChan, int fiberIndex, int spigot, int dccid) | |
CastorElectronicsId (uint32_t) | |
CastorElectronicsId () | |
Constructors. | |
int | dccid () const |
int | fiberChanId () const |
int | fiberIndex () const |
int | htrChanId () const |
int | htrSlot () const |
int | htrTopBottom () const |
bool | isTriggerChainId () const |
int | linearIndex () const |
int | operator!= (const CastorElectronicsId &id) const |
uint32_t | operator() () |
int | operator< (const CastorElectronicsId &id) const |
Compare the id to another one for use in a map. | |
int | operator== (const CastorElectronicsId &id) const |
operators | |
uint32_t | rawId () const |
int | readoutVMECrateId () const |
void | setHTR (int crate, int slot, int tb) |
std::string | slbChannelCode () const |
int | slbChannelIndex () const |
int | slbSiteNumber () const |
int | spigot () const |
Static Public Attributes | |
static const int | maxDCCId = 31 |
static const int | maxLinearIndex = 0x3FFF |
Private Attributes | |
uint32_t | castorElectronicsId_ |
Definition at line 19 of file CastorElectronicsId.h.
CastorElectronicsId::CastorElectronicsId | ( | ) |
Constructors.
Definition at line 4 of file CastorElectronicsId.cc.
References castorElectronicsId_.
00004 { 00005 castorElectronicsId_=0xffffffffu; 00006 }
CastorElectronicsId::CastorElectronicsId | ( | uint32_t | id | ) |
Definition at line 8 of file CastorElectronicsId.cc.
References castorElectronicsId_.
00008 { 00009 castorElectronicsId_=id; 00010 }
Definition at line 12 of file CastorElectronicsId.cc.
References castorElectronicsId_.
00012 { 00013 castorElectronicsId_=(fiberChan&0x3) | (((fiberIndex-1)&0x7)<<2) | 00014 ((spigot&0xF)<<5) | ((dccid&0x1F)<<9); 00015 }
CastorElectronicsId::CastorElectronicsId | ( | int | slbChan, | |
int | slbSite, | |||
int | spigot, | |||
int | dccid, | |||
int | crate, | |||
int | slot, | |||
int | tb | |||
) |
Definition at line 17 of file CastorElectronicsId.cc.
References castorElectronicsId_.
00017 { 00018 castorElectronicsId_=(slbChan&0x3) | (((slbSite-1)&0x7)<<2) | 00019 ((spigot&0xF)<<5) | ((dccid&0x1F)<<9); 00020 castorElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20); 00021 castorElectronicsId_|=0x02000000; 00022 }
int CastorElectronicsId::dccid | ( | ) | const [inline] |
Definition at line 42 of file CastorElectronicsId.h.
References castorElectronicsId_.
00042 { return (castorElectronicsId_>>9)&0x1F; }
int CastorElectronicsId::fiberChanId | ( | ) | const [inline] |
Definition at line 33 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by htrChanId().
00033 { return castorElectronicsId_&0x3; }
int CastorElectronicsId::fiberIndex | ( | ) | const [inline] |
Definition at line 34 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by htrChanId().
00034 { return ((castorElectronicsId_>>2)&0x7)+1; }
int CastorElectronicsId::htrChanId | ( | ) | const [inline] |
Definition at line 40 of file CastorElectronicsId.h.
References fiberChanId(), and fiberIndex().
00040 { return (fiberChanId()+1)+((fiberIndex()-1)*3); }
int CastorElectronicsId::htrSlot | ( | ) | const [inline] |
Definition at line 43 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by CastorPacker::pack().
00043 { return (castorElectronicsId_>>14)&0x1F; }
int CastorElectronicsId::htrTopBottom | ( | ) | const [inline] |
Definition at line 44 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by CastorPacker::pack(), and slbChannelCode().
00044 { return (castorElectronicsId_>>19)&0x1; }
bool CastorElectronicsId::isTriggerChainId | ( | ) | const [inline] |
Definition at line 30 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by operator<<(), and slbChannelCode().
00030 { return (castorElectronicsId_&0x02000000)!=0; }
int CastorElectronicsId::linearIndex | ( | ) | const [inline] |
Definition at line 46 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by CastorElectronicsMap::findPByElId(), CastorElectronicsMap::findTByElId(), CastorElectronicsMap::lookup(), CastorElectronicsMap::mapEId2chId(), and CastorElectronicsMap::mapEId2tId().
00046 { return (castorElectronicsId_)&0x3FFF; }
int CastorElectronicsId::operator!= | ( | const CastorElectronicsId & | id | ) | const [inline] |
Definition at line 53 of file CastorElectronicsId.h.
References castorElectronicsId_.
00053 { return id.castorElectronicsId_!=castorElectronicsId_; }
uint32_t CastorElectronicsId::operator() | ( | ) | [inline] |
Definition at line 26 of file CastorElectronicsId.h.
References castorElectronicsId_.
00026 { return castorElectronicsId_; }
int CastorElectronicsId::operator< | ( | const CastorElectronicsId & | id | ) | const [inline] |
Compare the id to another one for use in a map.
Definition at line 55 of file CastorElectronicsId.h.
References castorElectronicsId_.
00055 { return castorElectronicsId_<id.castorElectronicsId_; }
int CastorElectronicsId::operator== | ( | const CastorElectronicsId & | id | ) | const [inline] |
operators
Definition at line 52 of file CastorElectronicsId.h.
References castorElectronicsId_.
00052 { return id.castorElectronicsId_==castorElectronicsId_; }
uint32_t CastorElectronicsId::rawId | ( | ) | const [inline] |
Definition at line 28 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by CastorElectronicsMap::lookup(), CastorElectronicsMap::lookupTrigger(), CastorElectronicsMap::mapEId2chId(), and CastorElectronicsMap::mapEId2tId().
00028 { return castorElectronicsId_; }
int CastorElectronicsId::readoutVMECrateId | ( | ) | const [inline] |
Definition at line 45 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by CastorPacker::pack().
00045 { return (castorElectronicsId_>>20)&0x1F; }
Definition at line 46 of file CastorElectronicsId.cc.
References castorElectronicsId_.
Referenced by CastorDbHardcode::makeHardcodeMap().
00046 { 00047 castorElectronicsId_&=0x3FFF; // keep the readout chain info 00048 castorElectronicsId_|=((tb&0x1)<<19) | ((slot&0x1f)<<14) | ((crate&0x3f)<<20); 00049 }
std::string CastorElectronicsId::slbChannelCode | ( | ) | const |
Definition at line 24 of file CastorElectronicsId.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 CastorElectronicsId::slbChannelIndex | ( | ) | const [inline] |
Definition at line 35 of file CastorElectronicsId.h.
References castorElectronicsId_.
Referenced by slbChannelCode().
00035 { return castorElectronicsId_&0x3; }
int CastorElectronicsId::slbSiteNumber | ( | ) | const [inline] |
Definition at line 36 of file CastorElectronicsId.h.
References castorElectronicsId_.
00036 { return ((castorElectronicsId_>>2)&0x7)+1; }
int CastorElectronicsId::spigot | ( | ) | const [inline] |
Definition at line 41 of file CastorElectronicsId.h.
References castorElectronicsId_.
00041 { return (castorElectronicsId_>>5)&0xF; }
uint32_t CastorElectronicsId::castorElectronicsId_ [private] |
Definition at line 58 of file CastorElectronicsId.h.
Referenced by CastorElectronicsId(), dccid(), fiberChanId(), fiberIndex(), htrSlot(), htrTopBottom(), isTriggerChainId(), linearIndex(), operator!=(), operator()(), operator<(), operator==(), rawId(), readoutVMECrateId(), setHTR(), slbChannelIndex(), slbSiteNumber(), and spigot().
const int CastorElectronicsId::maxDCCId = 31 [static] |
Definition at line 49 of file CastorElectronicsId.h.
const int CastorElectronicsId::maxLinearIndex = 0x3FFF [static] |
Definition at line 48 of file CastorElectronicsId.h.