CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripDetKey.h
Go to the documentation of this file.
1 // Last commit: $Id: SiStripDetKey.h,v 1.8 2009/07/31 09:53:47 lowette Exp $
2 
3 #ifndef DataFormats_SiStripCommon_SiStripDetKey_h
4 #define DataFormats_SiStripCommon_SiStripDetKey_h
5 
9 
29 class SiStripDetKey : public SiStripKey {
30 
31  public:
32 
33  // ---------- Constructors ----------
34 
36  SiStripDetKey( const uint16_t& partition );
37 
39  SiStripDetKey( const DetId& det_id,
40  const uint16_t& apv_pair_number = 0,
41  const uint16_t& apv_within_pair = 0 );
42 
44  SiStripDetKey( const SiStripDetId& det_id );
45 
47  SiStripDetKey( const uint32_t& det_key );
48 
50  SiStripDetKey( const std::string& directory_path );
51 
53  SiStripDetKey( const SiStripDetKey& );
54 
56  SiStripDetKey( const SiStripKey& );
57 
59  SiStripDetKey( const SiStripKey&,
60  const sistrip::Granularity& );
61 
63  SiStripDetKey();
64 
65  // ---------- Public interface to member data ----------
66 
68  inline const uint16_t& partition() const;
69 
71  inline const uint16_t& apvPairNumber() const;
72 
74  inline const uint16_t& apvWithinPair() const;
75 
76  // ---------- Numbering schemes ----------
77 
78  //@@ nothing yet
79  //@@ switch b/w det_id and det_key
80  //@@ switch b/w strip, pair, apv, etc...
81 
82  // ---------- Utility methods ----------
83 
85  bool isEqual( const SiStripKey& ) const;
86 
88  bool isConsistent( const SiStripKey& ) const;
89 
91  bool isValid() const;
92 
95  bool isValid( const sistrip::Granularity& ) const;
96 
98  bool isInvalid() const;
99 
102  bool isInvalid( const sistrip::Granularity& ) const;
103 
104  // ---------- Print methods ----------
105 
107  virtual void print( std::stringstream& ss ) const;
108 
110  virtual void terse( std::stringstream& ss ) const;
111 
112  private:
113 
114  // ---------- Private methods ----------
115 
116  void initFromValue();
117  void initFromKey();
118  void initFromPath();
119  void initGranularity();
120 
121  // ---------- Private member data ----------
122 
124  uint16_t partition_;
125 
127  uint16_t apvPairNumber_;
128 
130  uint16_t apvWithinPair_;
131 
132  // Definition of bit field positions for 32-bit key
133  static const uint16_t partitionOffset_ = 29;
134 
135  // Definition of bit field masks for 32-bit key
136  static const uint16_t partitionMask_ = 0x07; // (3 bits)
137 
138 };
139 
140 // ---------- inline methods ----------
141 
142 const uint16_t& SiStripDetKey::partition() const { return partition_; }
143 const uint16_t& SiStripDetKey::apvPairNumber() const { return apvPairNumber_; }
144 const uint16_t& SiStripDetKey::apvWithinPair() const { return apvWithinPair_; }
145 
147 std::ostream& operator<< ( std::ostream&, const SiStripDetKey& );
148 
149 inline bool operator< ( const SiStripDetKey& a, const SiStripDetKey& b ) { return ( a.key() < b.key() ); }
150 
151 
152 #endif // DataFormats_SiStripCommon_SiStripDetKey_h
uint16_t apvPairNumber_
static const uint16_t partitionOffset_
virtual void print(std::stringstream &ss) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const uint32_t & key() const
Definition: SiStripKey.h:126
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
Constants and enumerated type for sistrip::Granularity.
void initFromValue()
const uint16_t & partition() const
const uint16_t & apvWithinPair() const
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:24
const uint16_t & apvPairNumber() const
bool isInvalid() const
Utility class that identifies a position within the strip tracker geometrical structure, down to the level of an APV25 chip.
Definition: SiStripDetKey.h:29
static const uint16_t partitionMask_
bool isEqual(const SiStripKey &) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:20
bool isConsistent(const SiStripKey &) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
uint16_t apvWithinPair_
void initGranularity()
bool isValid() const
uint16_t partition_
virtual void terse(std::stringstream &ss) const