CMS 3D CMS Logo

SiStripFedKey.h
Go to the documentation of this file.
1 
2 #ifndef DataFormats_SiStripCommon_SiStripFedKey_H
3 #define DataFormats_SiStripCommon_SiStripFedKey_H
4 
7 
8 class SiStripFedKey;
9 
11 std::ostream& operator<<(std::ostream&, const SiStripFedKey&);
12 
56 class SiStripFedKey : public SiStripKey {
57 public:
58  // ---------- Constructors ----------
59 
61  SiStripFedKey(const uint16_t& fed_id,
62  const uint16_t& fe_unit = 0,
63  const uint16_t& fe_chan = 0,
64  const uint16_t& fed_apv = 0);
65 
67  SiStripFedKey(const uint32_t& fed_key);
68 
70  SiStripFedKey(const std::string& directory_path);
71 
74 
76  SiStripFedKey(const SiStripKey&);
77 
79  SiStripFedKey();
80 
81  // ---------- Public interface to member data ----------
82 
84  inline const uint16_t& fedId() const;
85 
87  inline const uint16_t& feUnit() const;
88 
90  inline const uint16_t& feChan() const;
91 
93  inline const uint16_t& fedApv() const;
94 
96  inline uint16_t fedChannel() const;
97 
98  // ---------- Numbering schemes ----------
99 
102  static uint16_t fedCh(const uint16_t& fe_unit, const uint16_t& fe_chan);
103 
106  static uint16_t feUnit(const uint16_t& fed_ch);
107 
110  static uint16_t feChan(const uint16_t& fed_ch);
111 
115  static uint32_t fedIndex(const uint16_t& fed_id, const uint16_t& fed_ch);
116 
117  // ---------- Utility methods ----------
118 
120  bool isEqual(const SiStripKey&) const override;
121 
123  bool isConsistent(const SiStripKey&) const override;
124 
126  bool isValid() const override;
127 
130  bool isValid(const sistrip::Granularity&) const override;
131 
133  bool isInvalid() const override;
134 
137  bool isInvalid(const sistrip::Granularity&) const override;
138 
139  // ---------- Print methods ----------
140 
142  void print(std::stringstream& ss) const override;
143 
145  void terse(std::stringstream& ss) const override;
146 
147 private:
148  // ---------- Private methods ----------
149 
150  void initFromValue() override;
151  void initFromKey() override;
152  void initFromPath() override;
153  void initGranularity() override;
154 
155  // ---------- Private member data ----------
156 
158  uint16_t fedId_;
159 
161  uint16_t feUnit_;
162 
164  uint16_t feChan_;
165 
167  uint16_t fedApv_;
168 
169  // Definition of bit field positions for 32-bit key
170  static const uint16_t fedCrateOffset_ = 24;
171  static const uint16_t fedSlotOffset_ = 19;
172  static const uint16_t fedIdOffset_ = 10;
173  static const uint16_t feUnitOffset_ = 6;
174  static const uint16_t feChanOffset_ = 2;
175  static const uint16_t fedApvOffset_ = 0;
176 
177  // Definition of bit field masks for 32-bit key
178  static const uint16_t fedCrateMask_ = 0x03F; // (6 bits)
179  static const uint16_t fedSlotMask_ = 0x01F; // (5 bits)
180  static const uint16_t fedIdMask_ = 0x1FF; // (9 bits)
181  static const uint16_t feUnitMask_ = 0x00F; // (4 bits)
182  static const uint16_t feChanMask_ = 0x00F; // (4 bits)
183  static const uint16_t fedApvMask_ = 0x003; // (2 bits)
184 };
185 
186 // ---------- Inline methods ----------
187 
188 const uint16_t& SiStripFedKey::fedId() const { return fedId_; }
189 const uint16_t& SiStripFedKey::feUnit() const { return feUnit_; }
190 const uint16_t& SiStripFedKey::feChan() const { return feChan_; }
191 const uint16_t& SiStripFedKey::fedApv() const { return fedApv_; }
192 uint16_t SiStripFedKey::fedChannel() const { return fedCh(feUnit_, feChan_); }
193 
194 #endif // DataFormats_SiStripCommon_SiStripFedKey_H
static const uint16_t feChanMask_
void print(std::stringstream &ss) const override
void initFromValue() override
const uint16_t & fedApv() const
const uint16_t & feChan() const
static const uint16_t feUnitOffset_
void initFromPath() override
const uint16_t & feUnit() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
bool isInvalid() const override
void initFromKey() override
static const uint16_t fedSlotMask_
static uint32_t fedIndex(const uint16_t &fed_id, const uint16_t &fed_ch)
void terse(std::stringstream &ss) const override
bool isConsistent(const SiStripKey &) const override
uint16_t fedApv_
uint16_t fedChannel() const
Constants and enumerated type for sistrip::Granularity.
static const uint16_t fedCrateOffset_
bool isEqual(const SiStripKey &) const override
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:23
static const uint16_t feUnitMask_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t fedIdOffset_
void initGranularity() override
static const uint16_t feChanOffset_
const uint16_t & fedId() const
static const uint16_t fedCrateMask_
std::ostream & operator<<(std::ostream &, const SiStripFedKey &)
static const uint16_t fedSlotOffset_
static const uint16_t fedApvMask_
static uint16_t fedCh(const uint16_t &fe_unit, const uint16_t &fe_chan)
static const uint16_t fedIdMask_
static const uint16_t fedApvOffset_
bool isValid() const override