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 
58  public:
59 
60  // ---------- Constructors ----------
61 
63  SiStripFedKey( const uint16_t& fed_id,
64  const uint16_t& fe_unit = 0,
65  const uint16_t& fe_chan = 0,
66  const uint16_t& fed_apv = 0 );
67 
69  SiStripFedKey( const uint32_t& fed_key );
70 
72  SiStripFedKey( const std::string& directory_path );
73 
75  SiStripFedKey( const SiStripFedKey& );
76 
78  SiStripFedKey( const SiStripKey& );
79 
81  SiStripFedKey();
82 
83  // ---------- Public interface to member data ----------
84 
86  inline const uint16_t& fedId() const;
87 
89  inline const uint16_t& feUnit() const;
90 
92  inline const uint16_t& feChan() const;
93 
95  inline const uint16_t& fedApv() const;
96 
98  inline uint16_t fedChannel() const;
99 
100  // ---------- Numbering schemes ----------
101 
104  static uint16_t fedCh( const uint16_t& fe_unit,
105  const uint16_t& fe_chan );
106 
109  static uint16_t feUnit( const uint16_t& fed_ch );
110 
113  static uint16_t feChan( const uint16_t& fed_ch );
114 
118  static uint32_t fedIndex( const uint16_t& fed_id,
119  const uint16_t& fed_ch );
120 
121  // ---------- Utility methods ----------
122 
124  bool isEqual( const SiStripKey& ) const;
125 
127  bool isConsistent( const SiStripKey& ) const;
128 
130  bool isValid() const;
131 
134  bool isValid( const sistrip::Granularity& ) const;
135 
137  bool isInvalid() const;
138 
141  bool isInvalid( const sistrip::Granularity& ) const;
142 
143  // ---------- Print methods ----------
144 
146  virtual void print( std::stringstream& ss ) const;
147 
149  virtual void terse( std::stringstream& ss ) const;
150 
151  private:
152 
153  // ---------- Private methods ----------
154 
155  void initFromValue();
156  void initFromKey();
157  void initFromPath();
158  void initGranularity();
159 
160  // ---------- Private member data ----------
161 
163  uint16_t fedId_;
164 
166  uint16_t feUnit_;
167 
169  uint16_t feChan_;
170 
172  uint16_t fedApv_;
173 
174  // Definition of bit field positions for 32-bit key
175  static const uint16_t fedCrateOffset_ = 24;
176  static const uint16_t fedSlotOffset_ = 19;
177  static const uint16_t fedIdOffset_ = 10;
178  static const uint16_t feUnitOffset_ = 6;
179  static const uint16_t feChanOffset_ = 2;
180  static const uint16_t fedApvOffset_ = 0;
181 
182  // Definition of bit field masks for 32-bit key
183  static const uint16_t fedCrateMask_ = 0x03F; // (6 bits)
184  static const uint16_t fedSlotMask_ = 0x01F; // (5 bits)
185  static const uint16_t fedIdMask_ = 0x1FF; // (9 bits)
186  static const uint16_t feUnitMask_ = 0x00F; // (4 bits)
187  static const uint16_t feChanMask_ = 0x00F; // (4 bits)
188  static const uint16_t fedApvMask_ = 0x003; // (2 bits)
189 
190 };
191 
192 // ---------- Inline methods ----------
193 
194 const uint16_t& SiStripFedKey::fedId() const { return fedId_; }
195 const uint16_t& SiStripFedKey::feUnit() const { return feUnit_; }
196 const uint16_t& SiStripFedKey::feChan() const { return feChan_; }
197 const uint16_t& SiStripFedKey::fedApv() const { return fedApv_; }
198 uint16_t SiStripFedKey::fedChannel() const { return fedCh( feUnit_, feChan_ ); }
199 
200 #endif // DataFormats_SiStripCommon_SiStripFedKey_H
201 
202 
203 
static const uint16_t feChanMask_
bool isConsistent(const SiStripKey &) const
virtual void print(std::stringstream &ss) const
static const uint16_t feUnitOffset_
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
bool isInvalid() const
static const uint16_t fedSlotMask_
static uint32_t fedIndex(const uint16_t &fed_id, const uint16_t &fed_ch)
virtual void terse(std::stringstream &ss) const
uint16_t fedApv_
Constants and enumerated type for sistrip::Granularity.
bool isEqual(const SiStripKey &) const
bool isValid() const
static const uint16_t fedCrateOffset_
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_
void initFromValue()
uint16_t fedChannel() const
uint16_t fedId_
uint16_t feUnit_
static const uint16_t fedIdOffset_
void initGranularity()
static const uint16_t feChanOffset_
static const uint16_t fedCrateMask_
const uint16_t & fedApv() const
std::ostream & operator<<(std::ostream &, const SiStripFedKey &)
const uint16_t & feUnit() const
static const uint16_t fedSlotOffset_
const uint16_t & feChan() const
static const uint16_t fedApvMask_
const uint16_t & fedId() const
static uint16_t fedCh(const uint16_t &fe_unit, const uint16_t &fe_chan)
static const uint16_t fedIdMask_
static const uint16_t fedApvOffset_