CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalElectronicsId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALDETID_HCALELECTRONICSID_H
2 #define DATAFORMATS_HCALDETID_HCALELECTRONICSID_H 1
3 
4 #include <string>
5 #include <ostream>
6 #include <stdint.h>
7 
20 public:
24  HcalElectronicsId(uint32_t);
26  HcalElectronicsId(int fiberChan, int fiberIndex, int spigot, int dccid);
28  HcalElectronicsId(int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb);
29  uint32_t operator()() { return hcalElectronicsId_; }
30 
31  uint32_t rawId() const { return hcalElectronicsId_; }
32 
33  bool isTriggerChainId() const { return (hcalElectronicsId_&0x02000000)!=0; }
34 
36  void setHTR(int crate, int slot, int tb);
37 
39  int fiberChanId() const { return hcalElectronicsId_&0x3; }
41  int fiberIndex() const { return ((hcalElectronicsId_>>2)&0x7)+1; }
43  int slbChannelIndex() const { return hcalElectronicsId_&0x3; }
45  int slbSiteNumber() const { return ((hcalElectronicsId_>>2)&0x7); }
46 
49 
51  int htrChanId() const { return (fiberChanId()+1)+((fiberIndex()-1)*3); }
53  int spigot() const { return (hcalElectronicsId_>>5)&0xF; }
55  int dccid() const { return (hcalElectronicsId_>>9)&0x1F; }
57  int htrSlot() const { return (hcalElectronicsId_>>14)&0x1F; }
59  int htrTopBottom() const { return (hcalElectronicsId_>>19)&0x1; }
61  int readoutVMECrateId() const { return (hcalElectronicsId_>>20)&0x1F; }
63  int linearIndex() const { return (hcalElectronicsId_)&0x3FFF; }
64 
65  static const int maxLinearIndex = 0x3FFF;
66  static const int maxDCCId = 31;
67 
69  int operator==(const HcalElectronicsId& id) const { return id.hcalElectronicsId_==hcalElectronicsId_; }
71  int operator!=(const HcalElectronicsId& id) const { return id.hcalElectronicsId_!=hcalElectronicsId_; }
73  int operator<(const HcalElectronicsId& id) const { return hcalElectronicsId_<id.hcalElectronicsId_; }
74 
75 private:
77 };
78 
79 std::ostream& operator<<(std::ostream&,const HcalElectronicsId&);
80 
81 
82 #endif
int fiberIndex() const
get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-cha...
uint32_t rawId() const
int htrSlot() const
get the htr slot
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
int readoutVMECrateId() const
get the readout VME crate number
int operator<(const HcalElectronicsId &id) const
Compare the id to another id for use in a map.
int operator!=(const HcalElectronicsId &id) const
int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom)
std::string slbChannelCode() const
get the HTR-wide slb channel code (letter plus number)
int htrChanId() const
get the HTR channel id (1-24)
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-cha...
int spigot() const
get the spigot (input number on DCC)
int slbChannelIndex() const
get the SLB channel index (valid only for trigger-chain ids)
void setHTR(int crate, int slot, int tb)
bool isTriggerChainId() const
int operator==(const HcalElectronicsId &id) const
static const int maxDCCId
int linearIndex() const
get a fast, compact, unique index for linear lookups (maximum value = 16384)
int slbSiteNumber() const
get the SLB site number (valid only for trigger-chain ids)
static const int maxLinearIndex
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...