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::HcalFrontEndId ( )
inline

Definition at line 10 of file HcalFrontEndId.h.

Referenced by HcalFrontEndId().

10 : hcalFrontEndId_(0) {}
uint32_t hcalFrontEndId_
HcalFrontEndId::HcalFrontEndId ( uint32_t  id)
inline
HcalFrontEndId::HcalFrontEndId ( const std::string &  rbx,
int  rm,
int  pixel,
int  rmfiber,
int  fiberchannel,
int  qiecard,
int  adc 
)

Definition at line 8 of file HcalFrontEndId.cc.

References hcalFrontEndId_, and pileupDistInMC::num.

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

Definition at line 43 of file HcalFrontEndId.cc.

Referenced by HcalFrontEndId().

44 {
45 }

Member Function Documentation

int HcalFrontEndId::adc ( ) const
inline

Definition at line 31 of file HcalFrontEndId.h.

References hcalFrontEndId_.

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

31 {return (hcalFrontEndId_&0x7)-1;}
uint32_t hcalFrontEndId_
int HcalFrontEndId::fiberChannel ( ) const
inline

Definition at line 29 of file HcalFrontEndId.h.

References hcalFrontEndId_.

29 {return (hcalFrontEndId_>>5)&0x3;}
uint32_t hcalFrontEndId_
bool HcalFrontEndId::null ( ) const
inline

Definition at line 23 of file HcalFrontEndId.h.

References hcalFrontEndId_, rbx(), and AlCaHLTBitMon_QueryRunRegistry::string.

23 { return hcalFrontEndId_==0; }
uint32_t hcalFrontEndId_
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_
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_
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_
int HcalFrontEndId::pixel ( ) const
inline

Definition at line 27 of file HcalFrontEndId.h.

References hcalFrontEndId_.

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

27 {return (hcalFrontEndId_>>10)&0x1F;}
uint32_t hcalFrontEndId_
int HcalFrontEndId::qieCard ( ) const
inline

Definition at line 30 of file HcalFrontEndId.h.

References hcalFrontEndId_.

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

30 {return ((hcalFrontEndId_>>3)&0x3)+1;}
uint32_t hcalFrontEndId_
uint32_t HcalFrontEndId::rawId ( ) const
inline
std::string HcalFrontEndId::rbx ( ) const

Definition at line 47 of file HcalFrontEndId.cc.

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

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

48 {
49  std::string subdets[11]={"HBM","HBP","HEM","HEP","HO2M","HO1M","HO0","HO1P","HO2P","HFM","HFP"};
50 
51  int box=hcalFrontEndId_>>18;
52  int num=-1;
53  int subdet_index=-1;
54  if (box<18*4) {
55  num=box%18;
56  subdet_index=(box-num)/18;
57  }
58  else {
59  num=(box-18*4)%12;
60  subdet_index=4+(box-18*4-num)/12;
61  }
62  std::stringstream tempss;
63  tempss << std::setw(2) << std::setfill('0') << num+1;
64  return subdets[subdet_index]+tempss.str();
65 }
uint32_t hcalFrontEndId_
static const std::string subdets[7]
Definition: TrackUtils.cc:66
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_
int HcalFrontEndId::rm ( ) const
inline
int HcalFrontEndId::rmFiber ( ) const
inline
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

uint32_t HcalFrontEndId::hcalFrontEndId_
private
const int HcalFrontEndId::maxRbxIndex =0xFF
static

Definition at line 18 of file HcalFrontEndId.h.

const int HcalFrontEndId::maxRmIndex =0x3FF
static

Definition at line 21 of file HcalFrontEndId.h.

Referenced by HcalFrontEndMap::maxRMIndex().