CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripKey.h
Go to the documentation of this file.
1 // Last commit: $Id: SiStripKey.h,v 1.6 2008/02/06 14:32:48 bainbrid Exp $
2 
3 #ifndef DataFormats_SiStripCommon_SiStripKey_H
4 #define DataFormats_SiStripCommon_SiStripKey_H
5 
7 #include <boost/cstdint.hpp>
8 #include <ostream>
9 #include <sstream>
10 #include <string>
11 
12 class SiStripKey;
13 
15 std::ostream& operator<< ( std::ostream&, const SiStripKey& );
16 
24 class SiStripKey {
25 
26  public:
27 
28  // ---------- Constructors ----------
29 
31  SiStripKey( const uint32_t& key );
32 
34  SiStripKey( const std::string& directory_path );
35 
37  SiStripKey( const SiStripKey& );
38 
40  const SiStripKey& operator=( const SiStripKey& );
41 
43  SiStripKey();
44 
46  virtual ~SiStripKey() {;}
47 
48  // ---------- Public interface to member data ----------
49 
51  inline const uint32_t& key() const;
52 
54  inline const std::string& path() const;
55 
57  inline const sistrip::Granularity& granularity() const;
58 
60  inline const uint16_t& channel() const;
61 
62  // ---------- Virtual utility methods ----------
63 
65  virtual bool isEqual( const SiStripKey& ) const;
66 
68  virtual bool isConsistent( const SiStripKey& ) const;
69 
71  virtual bool isValid() const;
72 
75  virtual bool isValid( const sistrip::Granularity& ) const;
76 
78  virtual bool isInvalid() const;
79 
82  virtual bool isInvalid( const sistrip::Granularity& ) const;
83 
84  // ---------- Print methods ----------
85 
87  virtual void print( std::stringstream& ss ) const;
88 
90  virtual void terse( std::stringstream& ss ) const {;}
91 
92  protected:
93 
94  // ---------- Protected methods ----------
95 
96  virtual void initFromValue() {;}
97  virtual void initFromKey() {;}
98  virtual void initFromPath() {;}
99  virtual void initGranularity() {;}
100 
101  inline void key( const uint32_t& );
102  inline void path( const std::string& );
103  inline void granularity( const sistrip::Granularity& );
104  inline void channel( const uint16_t& );
105 
106  private:
107 
108  // ---------- Private member data ----------
109 
111  uint32_t key_;
112 
115 
118 
120  uint16_t channel_;
121 
122 };
123 
124 // ---------- Inline methods ----------
125 
126 const uint32_t& SiStripKey::key() const { return key_; }
127 const std::string& SiStripKey::path() const { return path_; }
129 const uint16_t& SiStripKey::channel() const { return channel_; }
130 
131 void SiStripKey::key( const uint32_t& key ) { key_ = key; }
134 void SiStripKey::channel( const uint16_t& chan ) { channel_ = chan; }
135 
136 #endif // DataFormats_SiStripCommon_SiStripKey_H
137 
138 
virtual void terse(std::stringstream &ss) const
Definition: SiStripKey.h:90
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:57
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void initFromPath()
Definition: SiStripKey.h:98
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:105
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:37
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
std::string path_
Definition: SiStripKey.h:114
Constants and enumerated type for sistrip::Granularity.
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:24
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
virtual void initGranularity()
Definition: SiStripKey.h:99
virtual bool isValid() const
Definition: SiStripKey.cc:75
const uint16_t & channel() const
Definition: SiStripKey.h:129
virtual void initFromValue()
Definition: SiStripKey.h:96
virtual bool isInvalid() const
Definition: SiStripKey.cc:90
virtual void initFromKey()
Definition: SiStripKey.h:97
list key
Definition: combine.py:13
uint16_t channel_
Definition: SiStripKey.h:120
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:69
virtual ~SiStripKey()
Definition: SiStripKey.h:46