CMS 3D CMS Logo

CastorElectronicsId.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALDETID_CASTORELECTRONICSID_H
2 #define DATAFORMATS_HCALDETID_CASTORELECTRONICSID_H 1
3 
4 #include <string>
5 #include <ostream>
6 #include <cstdint>
7 
21 public:
24  CastorElectronicsId(uint32_t);
25  CastorElectronicsId(int fiberChan, int fiberIndex, int spigot, int dccid);
26  CastorElectronicsId(int slbChan, int slbSite, int spigot, int dccid, int crate, int slot, int tb);
27  uint32_t operator()() { return castorElectronicsId_; }
28 
29  uint32_t rawId() const { return castorElectronicsId_; }
30 
31  bool isTriggerChainId() const { return (castorElectronicsId_ & 0x02000000) != 0; }
32 
33  void setHTR(int crate, int slot, int tb);
34  int fiberChanId() const { return castorElectronicsId_ & 0x3; }
35  int fiberIndex() const { return ((castorElectronicsId_ >> 2) & 0xf) + 1; }
36  int slbChannelIndex() const { return castorElectronicsId_ & 0x3; }
37  int slbSiteNumber() const { return ((castorElectronicsId_ >> 2) & 0xf) + 1; }
38 
40 
41  int htrChanId() const { return (fiberChanId() + 1) + ((fiberIndex() - 1) * 3); }
42  int spigot() const { return (castorElectronicsId_ >> 6) & 0xF; }
43  int dccid() const { return (castorElectronicsId_ >> 10) & 0xF; }
44  int htrSlot() const { return (castorElectronicsId_ >> 14) & 0x1F; }
45  int htrTopBottom() const { return (castorElectronicsId_ >> 19) & 0x1; }
46  int readoutVMECrateId() const { return (castorElectronicsId_ >> 20) & 0x1F; }
47  int linearIndex() const { return (castorElectronicsId_)&0x3FFF; }
48 
49  static const int maxLinearIndex = 0x3FFF;
50  static const int maxDCCId = 15;
51 
53  int operator==(const CastorElectronicsId& id) const { return id.castorElectronicsId_ == castorElectronicsId_; }
54  int operator!=(const CastorElectronicsId& id) const { return id.castorElectronicsId_ != castorElectronicsId_; }
56  int operator<(const CastorElectronicsId& id) const { return castorElectronicsId_ < id.castorElectronicsId_; }
57 
58 private:
60 };
61 
62 std::ostream& operator<<(std::ostream&, const CastorElectronicsId&);
63 
64 #endif
CastorElectronicsId::slbChannelIndex
int slbChannelIndex() const
Definition: CastorElectronicsId.h:36
CastorElectronicsId::readoutVMECrateId
int readoutVMECrateId() const
Definition: CastorElectronicsId.h:46
CastorElectronicsId::linearIndex
int linearIndex() const
Definition: CastorElectronicsId.h:47
CastorElectronicsId::fiberIndex
int fiberIndex() const
Definition: CastorElectronicsId.h:35
CastorElectronicsId::fiberChanId
int fiberChanId() const
Definition: CastorElectronicsId.h:34
CastorElectronicsId::operator!=
int operator!=(const CastorElectronicsId &id) const
Definition: CastorElectronicsId.h:54
CastorElectronicsId::operator==
int operator==(const CastorElectronicsId &id) const
Definition: CastorElectronicsId.h:53
CastorElectronicsId::castorElectronicsId_
uint32_t castorElectronicsId_
Definition: CastorElectronicsId.h:59
CastorElectronicsId::maxLinearIndex
static const int maxLinearIndex
Definition: CastorElectronicsId.h:49
CastorElectronicsId
Readout chain identification for Castor Bits for the readout chain : some names need change!...
Definition: CastorElectronicsId.h:20
CastorElectronicsId::CastorElectronicsId
CastorElectronicsId()
Definition: CastorElectronicsId.cc:3
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::rawId
uint32_t rawId() const
Definition: CastorElectronicsId.h:29
CastorElectronicsId::setHTR
void setHTR(int crate, int slot, int tb)
Definition: CastorElectronicsId.cc:56
CastorElectronicsId::spigot
int spigot() const
Definition: CastorElectronicsId.h:42
CastorElectronicsId::maxDCCId
static const int maxDCCId
Definition: CastorElectronicsId.h:50
CastorElectronicsId::htrChanId
int htrChanId() const
Definition: CastorElectronicsId.h:41
CastorElectronicsId::operator()
uint32_t operator()()
Definition: CastorElectronicsId.h:27
CastorElectronicsId::htrSlot
int htrSlot() const
Definition: CastorElectronicsId.h:44
CastorElectronicsId::isTriggerChainId
bool isTriggerChainId() const
Definition: CastorElectronicsId.h:31
CastorElectronicsId::operator<
int operator<(const CastorElectronicsId &id) const
Compare the id to another one for use in a map.
Definition: CastorElectronicsId.h:56
CastorElectronicsId::slbSiteNumber
int slbSiteNumber() const
Definition: CastorElectronicsId.h:37
CastorElectronicsId::dccid
int dccid() const
Definition: CastorElectronicsId.h:43
CastorElectronicsId::slbChannelCode
std::string slbChannelCode() const
Definition: CastorElectronicsId.cc:18
operator<<
std::ostream & operator<<(std::ostream &, const CastorElectronicsId &)
Definition: CastorElectronicsId.cc:61