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
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
SiStripFedKey::fedIdMask_
static const uint16_t fedIdMask_
Definition: SiStripFedKey.h:180
SiStripFedKey::isEqual
bool isEqual(const SiStripKey &) const override
Definition: SiStripFedKey.cc:132
SiStripKey.h
SiStripFedKey::fedId_
uint16_t fedId_
Definition: SiStripFedKey.h:158
SiStripFedKey::feUnit_
uint16_t feUnit_
Definition: SiStripFedKey.h:161
SiStripFedKey::isValid
bool isValid() const override
Definition: SiStripFedKey.cc:157
SiStripFedKey::fedSlotMask_
static const uint16_t fedSlotMask_
Definition: SiStripFedKey.h:179
SiStripFedKey::fedCrateOffset_
static const uint16_t fedCrateOffset_
Definition: SiStripFedKey.h:170
SiStripFedKey::feChanMask_
static const uint16_t feChanMask_
Definition: SiStripFedKey.h:182
SiStripFedKey::feUnitMask_
static const uint16_t feUnitMask_
Definition: SiStripFedKey.h:181
SiStripFedKey::feChan_
uint16_t feChan_
Definition: SiStripFedKey.h:164
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
SiStripFedKey::fedIdOffset_
static const uint16_t fedIdOffset_
Definition: SiStripFedKey.h:172
SiStripFedKey::fedApvOffset_
static const uint16_t fedApvOffset_
Definition: SiStripFedKey.h:175
ConstantsForGranularity.h
Constants and enumerated type for sistrip::Granularity.
SiStripFedKey::fedCrateMask_
static const uint16_t fedCrateMask_
Definition: SiStripFedKey.h:178
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFedKey::SiStripFedKey
SiStripFedKey()
Definition: SiStripFedKey.cc:83
SiStripFedKey::initFromPath
void initFromPath() override
Definition: SiStripFedKey.cc:323
SiStripFedKey::isInvalid
bool isInvalid() const override
Definition: SiStripFedKey.cc:193
SiStripFedKey::initGranularity
void initGranularity() override
Definition: SiStripFedKey.cc:424
SiStripFedKey::terse
void terse(std::stringstream &ss) const override
Definition: SiStripFedKey.cc:459
SiStripFedKey::initFromKey
void initFromKey() override
Definition: SiStripFedKey.cc:249
SiStripFedKey::fedApv
const uint16_t & fedApv() const
Definition: SiStripFedKey.h:191
SiStripFedKey::feUnit
const uint16_t & feUnit() const
Definition: SiStripFedKey.h:189
SiStripFedKey::fedIndex
static uint32_t fedIndex(const uint16_t &fed_id, const uint16_t &fed_ch)
Definition: SiStripFedKey.cc:123
operator<<
std::ostream & operator<<(std::ostream &, const SiStripFedKey &)
Definition: SiStripFedKey.cc:499
SiStripFedKey::feUnitOffset_
static const uint16_t feUnitOffset_
Definition: SiStripFedKey.h:173
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripFedKey::isConsistent
bool isConsistent(const SiStripKey &) const override
Definition: SiStripFedKey.cc:143
SiStripFedKey::fedApvMask_
static const uint16_t fedApvMask_
Definition: SiStripFedKey.h:183
SiStripFedKey::fedApv_
uint16_t fedApv_
Definition: SiStripFedKey.h:167
SiStripFedKey::fedCh
static uint16_t fedCh(const uint16_t &fe_unit, const uint16_t &fe_chan)
Definition: SiStripFedKey.cc:94
SiStripFedKey::print
void print(std::stringstream &ss) const override
Definition: SiStripFedKey.cc:482
SiStripFedKey::fedChannel
uint16_t fedChannel() const
Definition: SiStripFedKey.h:192
SiStripFedKey::initFromValue
void initFromValue() override
Definition: SiStripFedKey.cc:229
SiStripFedKey::feChanOffset_
static const uint16_t feChanOffset_
Definition: SiStripFedKey.h:174
SiStripFedKey::fedSlotOffset_
static const uint16_t fedSlotOffset_
Definition: SiStripFedKey.h:171
SiStripKey
Base utility class that identifies a position within a logical structure of the strip tracker.
Definition: SiStripKey.h:23
SiStripFedKey::fedId
const uint16_t & fedId() const
Definition: SiStripFedKey.h:188
SiStripFedKey::feChan
const uint16_t & feChan() const
Definition: SiStripFedKey.h:190