CMS 3D CMS Logo

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

#include <HcalFrontEndId.h>

Public Member Functions

int adc () const
 
int fiberChannel () const
 
 HcalFrontEndId ()
 
 HcalFrontEndId (uint32_t id)
 
 HcalFrontEndId (const std::string &rbx, int rm, int pixel, int rmfiber, int fiberchannel, int qiecard, int adc)
 
bool null () const
 
int operator!= (const HcalFrontEndId &id) const
 
int operator< (const HcalFrontEndId &id) const
 
int operator== (const HcalFrontEndId &id) const
 
int pixel () const
 
int qieCard () const
 
uint32_t rawId () const
 
std::string rbx () const
 
int rbxIndex () const
 
int rm () const
 
int rmFiber () const
 
int rmIndex () const
 
 ~HcalFrontEndId ()
 

Static Public Attributes

static const int maxRbxIndex = 0xFF
 
static const int maxRmIndex = 0x3FF
 

Private Attributes

uint32_t hcalFrontEndId_
 

Detailed Description

Definition at line 8 of file HcalFrontEndId.h.

Constructor & Destructor Documentation

◆ HcalFrontEndId() [1/3]

HcalFrontEndId::HcalFrontEndId ( )
inline

Definition at line 10 of file HcalFrontEndId.h.

10 : hcalFrontEndId_(0) {}
uint32_t hcalFrontEndId_

◆ HcalFrontEndId() [2/3]

HcalFrontEndId::HcalFrontEndId ( uint32_t  id)
inline

Definition at line 11 of file HcalFrontEndId.h.

References hcalFrontEndId_, and l1ctLayer2EG_cff::id.

◆ HcalFrontEndId() [3/3]

HcalFrontEndId::HcalFrontEndId ( const std::string &  rbx,
int  rm,
int  pixel,
int  rmfiber,
int  fiberchannel,
int  qiecard,
int  adc 
)

Definition at line 7 of file HcalFrontEndId.cc.

References adc(), hcalFrontEndId_, EgammaValidation_cff::num, pixel(), rbx(), and rm().

8  {
9  hcalFrontEndId_ = 0;
10 
11  if (rbx.size() < 5)
12  return;
13  if (rm < 1 || rm > 5)
14  return; //changed to 5 to incorporate CALIB channels which define RM = 5
15  if (pixel < 0 || pixel > 19)
16  return;
17  if (rmfiber < 1 || rmfiber > 8)
18  return;
19  if (fiberchannel < 0 || fiberchannel > 2)
20  return;
21  if (qie < 1 || qie > 4)
22  return;
23  if (adc < 0 || adc > 5)
24  return;
25 
26  int num = -1;
27  if (!rbx.compare(0, 3, "HBM")) {
28  num = 0 + atoi(rbx.substr(3, 2).c_str()) - 1;
29  } else if (!rbx.compare(0, 3, "HBP")) {
30  num = 18 + atoi(rbx.substr(3, 2).c_str()) - 1;
31  } else if (!rbx.compare(0, 3, "HEM")) {
32  num = 18 * 2 + atoi(rbx.substr(3, 2).c_str()) - 1;
33  } else if (!rbx.compare(0, 3, "HEP")) {
34  num = 18 * 3 + atoi(rbx.substr(3, 2).c_str()) - 1;
35  } else if (!rbx.compare(0, 4, "HO2M")) {
36  num = 18 * 4 + atoi(rbx.substr(4, 2).c_str()) - 1;
37  } else if (!rbx.compare(0, 4, "HO1M")) {
38  num = 18 * 4 + 12 + atoi(rbx.substr(4, 2).c_str()) - 1;
39  } else if (!rbx.compare(0, 3, "HO0")) {
40  num = 18 * 4 + 12 * 2 + atoi(rbx.substr(3, 2).c_str()) - 1;
41  } else if (!rbx.compare(0, 4, "HO1P")) {
42  num = 18 * 4 + 12 * 3 + atoi(rbx.substr(4, 2).c_str()) - 1;
43  } else if (!rbx.compare(0, 4, "HO2P")) {
44  num = 18 * 4 + 12 * 4 + atoi(rbx.substr(4, 2).c_str()) - 1;
45  } else if (!rbx.compare(0, 3, "HFM")) {
46  num = 18 * 4 + 12 * 5 + atoi(rbx.substr(3, 2).c_str()) - 1;
47  } else if (!rbx.compare(0, 3, "HFP")) {
48  num = 18 * 4 + 12 * 6 + atoi(rbx.substr(3, 2).c_str()) - 1;
49  } else
50  return;
51 
52  hcalFrontEndId_ |= ((adc + 1) & 0x7);
53  hcalFrontEndId_ |= ((qie - 1) & 0x3) << 3;
54  hcalFrontEndId_ |= (fiberchannel & 0x3) << 5;
55  hcalFrontEndId_ |= ((rmfiber - 1) & 0x7) << 7;
56  hcalFrontEndId_ |= (pixel & 0x1F) << 10;
57  hcalFrontEndId_ |= ((rm - 1) & 0x7) << 15;
58  hcalFrontEndId_ |= (num & 0xFF) << 18;
59 }
int rm() const
int pixel() const
std::string rbx() const
uint32_t hcalFrontEndId_
int adc() const

◆ ~HcalFrontEndId()

HcalFrontEndId::~HcalFrontEndId ( )

Definition at line 61 of file HcalFrontEndId.cc.

61 {}

Member Function Documentation

◆ adc()

int HcalFrontEndId::adc ( ) const
inline

◆ fiberChannel()

int HcalFrontEndId::fiberChannel ( ) const
inline

Definition at line 29 of file HcalFrontEndId.h.

References hcalFrontEndId_.

Referenced by CMTRawAnalyzer::fillMAP().

29 { return (hcalFrontEndId_ >> 5) & 0x3; }
uint32_t hcalFrontEndId_

◆ null()

bool HcalFrontEndId::null ( ) const
inline

Definition at line 23 of file HcalFrontEndId.h.

References hcalFrontEndId_.

23 { return hcalFrontEndId_ == 0; }
uint32_t hcalFrontEndId_

◆ operator!=()

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

Definition at line 34 of file HcalFrontEndId.h.

References hcalFrontEndId_.

34 { return id.hcalFrontEndId_ != hcalFrontEndId_; }
uint32_t hcalFrontEndId_

◆ operator<()

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

Definition at line 35 of file HcalFrontEndId.h.

References hcalFrontEndId_.

35 { return hcalFrontEndId_ < id.hcalFrontEndId_; }
uint32_t hcalFrontEndId_

◆ operator==()

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

Definition at line 33 of file HcalFrontEndId.h.

References hcalFrontEndId_.

33 { return id.hcalFrontEndId_ == hcalFrontEndId_; }
uint32_t hcalFrontEndId_

◆ pixel()

int HcalFrontEndId::pixel ( ) const
inline

◆ qieCard()

int HcalFrontEndId::qieCard ( ) const
inline

Definition at line 30 of file HcalFrontEndId.h.

References hcalFrontEndId_.

Referenced by CMTRawAnalyzer::fillMAP(), HBHEHFLogicalMapEntry::printLMapLine(), and HOHXLogicalMapEntry::printLMapLine().

30 { return ((hcalFrontEndId_ >> 3) & 0x3) + 1; }
uint32_t hcalFrontEndId_

◆ rawId()

uint32_t HcalFrontEndId::rawId ( ) const
inline

◆ rbx()

std::string HcalFrontEndId::rbx ( ) const

Definition at line 63 of file HcalFrontEndId.cc.

References hcalFrontEndId_, EgammaValidation_cff::num, AlCaHLTBitMon_QueryRunRegistry::string, and fireworks::subdets.

Referenced by CMTRawAnalyzer::fillMAP(), HcalFrontEndId(), HBHEHFLogicalMapEntry::printLMapLine(), HOHXLogicalMapEntry::printLMapLine(), and CALIBLogicalMapEntry::printLMapLine().

63  {
64  std::string subdets[11] = {"HBM", "HBP", "HEM", "HEP", "HO2M", "HO1M", "HO0", "HO1P", "HO2P", "HFM", "HFP"};
65 
66  int box = hcalFrontEndId_ >> 18;
67  int num = -1;
68  int subdet_index = -1;
69  if (box < 18 * 4) {
70  num = box % 18;
71  subdet_index = (box - num) / 18;
72  } else {
73  num = (box - 18 * 4) % 12;
74  subdet_index = 4 + (box - 18 * 4 - num) / 12;
75  }
76  std::stringstream tempss;
77  tempss << std::setw(2) << std::setfill('0') << num + 1;
78  return subdets[subdet_index] + tempss.str();
79 }
uint32_t hcalFrontEndId_
static const std::string subdets[7]
Definition: TrackUtils.cc:60

◆ rbxIndex()

int HcalFrontEndId::rbxIndex ( ) const
inline

Definition at line 17 of file HcalFrontEndId.h.

References hcalFrontEndId_.

Referenced by rmIndex().

17 { return (hcalFrontEndId_ >> 18); }
uint32_t hcalFrontEndId_

◆ rm()

int HcalFrontEndId::rm ( ) const
inline

◆ rmFiber()

int HcalFrontEndId::rmFiber ( ) const
inline

◆ rmIndex()

int HcalFrontEndId::rmIndex ( ) const
inline

Definition at line 20 of file HcalFrontEndId.h.

References rbxIndex(), and rm().

20 { return ((rm() - 1) & 0x3) + (rbxIndex() << 2); }
int rm() const
int rbxIndex() const

Member Data Documentation

◆ hcalFrontEndId_

uint32_t HcalFrontEndId::hcalFrontEndId_
private

◆ maxRbxIndex

const int HcalFrontEndId::maxRbxIndex = 0xFF
static

Definition at line 18 of file HcalFrontEndId.h.

◆ maxRmIndex

const int HcalFrontEndId::maxRmIndex = 0x3FF
static

Definition at line 21 of file HcalFrontEndId.h.

Referenced by HcalFrontEndMap::maxRMIndex().