CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripFedKey.h
Go to the documentation of this file.
1 // Last commit: $Id: SiStripFedKey.h,v 1.14 2008/02/22 09:53:14 bainbrid Exp $
2 
3 #ifndef DataFormats_SiStripCommon_SiStripFedKey_H
4 #define DataFormats_SiStripCommon_SiStripFedKey_H
5 
8 
9 class SiStripFedKey;
10 
12 std::ostream& operator<< ( std::ostream&, const SiStripFedKey& );
13 
57 class SiStripFedKey : public SiStripKey {
58 
59  public:
60 
61  // ---------- Constructors ----------
62 
64  SiStripFedKey( const uint16_t& fed_id,
65  const uint16_t& fe_unit = 0,
66  const uint16_t& fe_chan = 0,
67  const uint16_t& fed_apv = 0 );
68 
70  SiStripFedKey( const uint32_t& fed_key );
71 
73  SiStripFedKey( const std::string& directory_path );
74 
76  SiStripFedKey( const SiStripFedKey& );
77 
79  SiStripFedKey( const SiStripKey& );
80 
82  SiStripFedKey();
83 
84  // ---------- Public interface to member data ----------
85 
87  inline const uint16_t& fedId() const;
88 
90  inline const uint16_t& feUnit() const;
91 
93  inline const uint16_t& feChan() const;
94 
96  inline const uint16_t& fedApv() const;
97 
99  inline uint16_t fedChannel() const;
100 
101  // ---------- Numbering schemes ----------
102 
105  static uint16_t fedCh( const uint16_t& fe_unit,
106  const uint16_t& fe_chan );
107 
110  static uint16_t feUnit( const uint16_t& fed_ch );
111 
114  static uint16_t feChan( const uint16_t& fed_ch );
115 
119  static uint32_t fedIndex( const uint16_t& fed_id,
120  const uint16_t& fed_ch );
121 
122  // ---------- Utility methods ----------
123 
125  bool isEqual( const SiStripKey& ) const;
126 
128  bool isConsistent( const SiStripKey& ) const;
129 
131  bool isValid() const;
132 
135  bool isValid( const sistrip::Granularity& ) const;
136 
138  bool isInvalid() const;
139 
142  bool isInvalid( const sistrip::Granularity& ) const;
143 
144  // ---------- Print methods ----------
145 
147  virtual void print( std::stringstream& ss ) const;
148 
150  virtual void terse( std::stringstream& ss ) const;
151 
152  private:
153 
154  // ---------- Private methods ----------
155 
156  void initFromValue();
157  void initFromKey();
158  void initFromPath();
159  void initGranularity();
160 
161  // ---------- Private member data ----------
162 
164  uint16_t fedId_;
165 
167  uint16_t feUnit_;
168 
170  uint16_t feChan_;
171 
173  uint16_t fedApv_;
174 
175  // Definition of bit field positions for 32-bit key
176  static const uint16_t fedCrateOffset_ = 24;
177  static const uint16_t fedSlotOffset_ = 19;
178  static const uint16_t fedIdOffset_ = 10;
179  static const uint16_t feUnitOffset_ = 6;
180  static const uint16_t feChanOffset_ = 2;
181  static const uint16_t fedApvOffset_ = 0;
182 
183  // Definition of bit field masks for 32-bit key
184  static const uint16_t fedCrateMask_ = 0x03F; // (6 bits)
185  static const uint16_t fedSlotMask_ = 0x01F; // (5 bits)
186  static const uint16_t fedIdMask_ = 0x1FF; // (9 bits)
187  static const uint16_t feUnitMask_ = 0x00F; // (4 bits)
188  static const uint16_t feChanMask_ = 0x00F; // (4 bits)
189  static const uint16_t fedApvMask_ = 0x003; // (2 bits)
190 
191 };
192 
193 // ---------- Inline methods ----------
194 
195 const uint16_t& SiStripFedKey::fedId() const { return fedId_; }
196 const uint16_t& SiStripFedKey::feUnit() const { return feUnit_; }
197 const uint16_t& SiStripFedKey::feChan() const { return feChan_; }
198 const uint16_t& SiStripFedKey::fedApv() const { return fedApv_; }
199 uint16_t SiStripFedKey::fedChannel() const { return fedCh( feUnit_, feChan_ ); }
200 
201 #endif // DataFormats_SiStripCommon_SiStripFedKey_H
202 
203 
204 
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:57
bool isInvalid() const
static const uint16_t fedSlotMask_
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
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:24
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
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_