CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
CastorElectronicsId Class Reference

Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] not used [25]
[24:20] [19] [18:14] [13:9]
[8:5]
[4:2]
[1:0]
More...

#include <CastorElectronicsId.h>

Public Member Functions

 CastorElectronicsId ()
 
 CastorElectronicsId (int fiberChan, int fiberIndex, int spigot, int dccid)
 
 CastorElectronicsId (int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb)
 
 CastorElectronicsId (uint32_t)
 
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. More...
 
int operator== (const CastorElectronicsId &id) const
 
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 = 15
 
static const int maxLinearIndex = 0x3FFF
 

Private Attributes

uint32_t castorElectronicsId_
 

Detailed Description

Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] not used [25]
[24:20] [19] [18:14] [13:9]
[8:5]
[4:2]
[1:0]

Definition at line 20 of file CastorElectronicsId.h.

Constructor & Destructor Documentation

◆ CastorElectronicsId() [1/4]

CastorElectronicsId::CastorElectronicsId ( )

Constructors

Definition at line 3 of file CastorElectronicsId.cc.

3 { castorElectronicsId_ = 0xffffffffu; }

References castorElectronicsId_.

◆ CastorElectronicsId() [2/4]

CastorElectronicsId::CastorElectronicsId ( uint32_t  id)

Definition at line 5 of file CastorElectronicsId.cc.

References castorElectronicsId_, and triggerObjects_cff::id.

◆ CastorElectronicsId() [3/4]

CastorElectronicsId::CastorElectronicsId ( int  fiberChan,
int  fiberIndex,
int  spigot,
int  dccid 
)

Definition at line 7 of file CastorElectronicsId.cc.

7  {
9  (fiberChan & 0x3) | (((fiberIndex - 1) & 0xf) << 2) | ((spigot & 0xF) << 6) | ((dccid & 0xF) << 10);
10 }

References castorElectronicsId_, dccid(), fiberIndex(), and spigot().

◆ CastorElectronicsId() [4/4]

CastorElectronicsId::CastorElectronicsId ( int  slbChan,
int  slbSite,
int  spigot,
int  dccid,
int  crate,
int  slot,
int  tb 
)

Definition at line 12 of file CastorElectronicsId.cc.

12  {
13  castorElectronicsId_ = (slbChan & 0x3) | (((slbSite - 1) & 0xf) << 2) | ((spigot & 0xF) << 6) | ((dccid & 0xF) << 10);
14  castorElectronicsId_ |= ((tb & 0x1) << 19) | ((slot & 0x1f) << 14) | ((crate & 0x3f) << 20);
15  castorElectronicsId_ |= 0x02000000;
16 }

References castorElectronicsId_, dccid(), slbChan(), and spigot().

Member Function Documentation

◆ dccid()

int CastorElectronicsId::dccid ( ) const
inline

Definition at line 43 of file CastorElectronicsId.h.

43 { return (castorElectronicsId_ >> 10) & 0xF; }

References castorElectronicsId_.

Referenced by CastorElectronicsId().

◆ fiberChanId()

int CastorElectronicsId::fiberChanId ( ) const
inline

Definition at line 34 of file CastorElectronicsId.h.

34 { return castorElectronicsId_ & 0x3; }

References castorElectronicsId_.

Referenced by htrChanId().

◆ fiberIndex()

int CastorElectronicsId::fiberIndex ( ) const
inline

Definition at line 35 of file CastorElectronicsId.h.

35 { return ((castorElectronicsId_ >> 2) & 0xf) + 1; }

References castorElectronicsId_.

Referenced by CastorElectronicsId(), and htrChanId().

◆ htrChanId()

int CastorElectronicsId::htrChanId ( ) const
inline

Definition at line 41 of file CastorElectronicsId.h.

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

References fiberChanId(), and fiberIndex().

◆ htrSlot()

int CastorElectronicsId::htrSlot ( ) const
inline

Definition at line 44 of file CastorElectronicsId.h.

44 { return (castorElectronicsId_ >> 14) & 0x1F; }

References castorElectronicsId_.

Referenced by CastorCtdcPacker::pack(), and CastorPacker::pack().

◆ htrTopBottom()

int CastorElectronicsId::htrTopBottom ( ) const
inline

Definition at line 45 of file CastorElectronicsId.h.

45 { return (castorElectronicsId_ >> 19) & 0x1; }

References castorElectronicsId_.

Referenced by CastorCtdcPacker::pack(), CastorPacker::pack(), and slbChannelCode().

◆ isTriggerChainId()

bool CastorElectronicsId::isTriggerChainId ( ) const
inline

Definition at line 31 of file CastorElectronicsId.h.

31 { return (castorElectronicsId_ & 0x02000000) != 0; }

References castorElectronicsId_.

Referenced by slbChannelCode().

◆ linearIndex()

int CastorElectronicsId::linearIndex ( ) const
inline

◆ operator!=()

int CastorElectronicsId::operator!= ( const CastorElectronicsId id) const
inline

Definition at line 54 of file CastorElectronicsId.h.

54 { return id.castorElectronicsId_ != castorElectronicsId_; }

References castorElectronicsId_.

◆ operator()()

uint32_t CastorElectronicsId::operator() ( )
inline

Definition at line 27 of file CastorElectronicsId.h.

27 { return castorElectronicsId_; }

References castorElectronicsId_.

◆ operator<()

int CastorElectronicsId::operator< ( const CastorElectronicsId id) const
inline

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

Definition at line 56 of file CastorElectronicsId.h.

56 { return castorElectronicsId_ < id.castorElectronicsId_; }

References castorElectronicsId_.

◆ operator==()

int CastorElectronicsId::operator== ( const CastorElectronicsId id) const
inline

operators

Definition at line 53 of file CastorElectronicsId.h.

53 { return id.castorElectronicsId_ == castorElectronicsId_; }

References castorElectronicsId_.

◆ rawId()

uint32_t CastorElectronicsId::rawId ( ) const
inline

◆ readoutVMECrateId()

int CastorElectronicsId::readoutVMECrateId ( ) const
inline

Definition at line 46 of file CastorElectronicsId.h.

46 { return (castorElectronicsId_ >> 20) & 0x1F; }

References castorElectronicsId_.

Referenced by CastorCtdcPacker::pack(), and CastorPacker::pack().

◆ setHTR()

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

Definition at line 56 of file CastorElectronicsId.cc.

56  {
57  castorElectronicsId_ &= 0x3FFF; // keep the readout chain info
58  castorElectronicsId_ |= ((tb & 0x1) << 19) | ((slot & 0x1f) << 14) | ((crate & 0x3f) << 20);
59 }

References castorElectronicsId_.

Referenced by CastorDbASCIIIO::getObject(), and CastorDbHardcode::makeHardcodeMap().

◆ slbChannelCode()

std::string CastorElectronicsId::slbChannelCode ( ) const

Definition at line 18 of file CastorElectronicsId.cc.

18  {
19  std::string retval;
20  if (isTriggerChainId()) {
21  if (htrTopBottom()) { // top
22  switch (slbChannelIndex()) {
23  case (0):
24  retval = "A0";
25  break;
26  case (1):
27  retval = "A1";
28  break;
29  case (2):
30  retval = "C0";
31  break;
32  case (3):
33  retval = "C1";
34  break;
35  }
36  } else {
37  switch (slbChannelIndex()) {
38  case (0):
39  retval = "B0";
40  break;
41  case (1):
42  retval = "B1";
43  break;
44  case (2):
45  retval = "D0";
46  break;
47  case (3):
48  retval = "D1";
49  break;
50  }
51  }
52  }
53  return retval;
54 }

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

◆ slbChannelIndex()

int CastorElectronicsId::slbChannelIndex ( ) const
inline

Definition at line 36 of file CastorElectronicsId.h.

36 { return castorElectronicsId_ & 0x3; }

References castorElectronicsId_.

Referenced by slbChannelCode().

◆ slbSiteNumber()

int CastorElectronicsId::slbSiteNumber ( ) const
inline

Definition at line 37 of file CastorElectronicsId.h.

37 { return ((castorElectronicsId_ >> 2) & 0xf) + 1; }

References castorElectronicsId_.

◆ spigot()

int CastorElectronicsId::spigot ( ) const
inline

Definition at line 42 of file CastorElectronicsId.h.

42 { return (castorElectronicsId_ >> 6) & 0xF; }

References castorElectronicsId_.

Referenced by CastorElectronicsId().

Member Data Documentation

◆ castorElectronicsId_

uint32_t CastorElectronicsId::castorElectronicsId_
private

◆ maxDCCId

const int CastorElectronicsId::maxDCCId = 15
static

Definition at line 50 of file CastorElectronicsId.h.

◆ maxLinearIndex

const int CastorElectronicsId::maxLinearIndex = 0x3FFF
static

Definition at line 49 of file CastorElectronicsId.h.

CastorElectronicsId::slbChannelIndex
int slbChannelIndex() const
Definition: CastorElectronicsId.h:36
CastorElectronicsId::fiberIndex
int fiberIndex() const
Definition: CastorElectronicsId.h:35
CastorElectronicsId::fiberChanId
int fiberChanId() const
Definition: CastorElectronicsId.h:34
CastorElectronicsId::castorElectronicsId_
uint32_t castorElectronicsId_
Definition: CastorElectronicsId.h:59
slbChan
static int slbChan(const HcalTriggerPrimitiveSample &theSample)
Definition: CastorUnpacker.cc:72
CastorElectronicsId::htrTopBottom
int htrTopBottom() const
Definition: CastorElectronicsId.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CastorElectronicsId::spigot
int spigot() const
Definition: CastorElectronicsId.h:42
CastorElectronicsId::isTriggerChainId
bool isTriggerChainId() const
Definition: CastorElectronicsId.h:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CastorElectronicsId::dccid
int dccid() const
Definition: CastorElectronicsId.h:43