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 
2 #ifndef DataFormats_SiStripCommon_SiStripKey_H
3 #define DataFormats_SiStripCommon_SiStripKey_H
4 
6 #include <boost/cstdint.hpp>
7 #include <ostream>
8 #include <sstream>
9 #include <string>
10 
11 class SiStripKey;
12 
14 std::ostream& operator<< ( std::ostream&, const SiStripKey& );
15 
23 class SiStripKey {
24 
25  public:
26 
27  // ---------- Constructors ----------
28 
30  SiStripKey( const uint32_t& key );
31 
33  SiStripKey( const std::string& directory_path );
34 
36  SiStripKey( const SiStripKey& );
37 
39  const SiStripKey& operator=( const SiStripKey& );
40 
42  SiStripKey();
43 
45  virtual ~SiStripKey() {;}
46 
47  // ---------- Public interface to member data ----------
48 
50  inline const uint32_t& key() const;
51 
53  inline const std::string& path() const;
54 
56  inline const sistrip::Granularity& granularity() const;
57 
59  inline const uint16_t& channel() const;
60 
61  // ---------- Virtual utility methods ----------
62 
64  virtual bool isEqual( const SiStripKey& ) const;
65 
67  virtual bool isConsistent( const SiStripKey& ) const;
68 
70  virtual bool isValid() const;
71 
74  virtual bool isValid( const sistrip::Granularity& ) const;
75 
77  virtual bool isInvalid() const;
78 
81  virtual bool isInvalid( const sistrip::Granularity& ) const;
82 
83  // ---------- Print methods ----------
84 
86  virtual void print( std::stringstream& ss ) const;
87 
89  virtual void terse( std::stringstream& ss ) const {;}
90 
91  protected:
92 
93  // ---------- Protected methods ----------
94 
95  virtual void initFromValue() {;}
96  virtual void initFromKey() {;}
97  virtual void initFromPath() {;}
98  virtual void initGranularity() {;}
99 
100  inline void key( const uint32_t& );
101  inline void path( const std::string& );
102  inline void granularity( const sistrip::Granularity& );
103  inline void channel( const uint16_t& );
104 
105  private:
106 
107  // ---------- Private member data ----------
108 
110  uint32_t key_;
111 
114 
117 
119  uint16_t channel_;
120 
121 };
122 
123 // ---------- Inline methods ----------
124 
125 const uint32_t& SiStripKey::key() const { return key_; }
126 const std::string& SiStripKey::path() const { return path_; }
128 const uint16_t& SiStripKey::channel() const { return channel_; }
129 
130 void SiStripKey::key( const uint32_t& key ) { key_ = key; }
133 void SiStripKey::channel( const uint16_t& chan ) { channel_ = chan; }
134 
135 #endif // DataFormats_SiStripCommon_SiStripKey_H
136 
137 
virtual void terse(std::stringstream &ss) const
Definition: SiStripKey.h:89
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:56
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
virtual void initFromPath()
Definition: SiStripKey.h:97
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:104
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:36
const uint32_t & key() const
Definition: SiStripKey.h:125
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
std::string path_
Definition: SiStripKey.h:113
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:23
const std::string & path() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:110
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
virtual void initGranularity()
Definition: SiStripKey.h:98
virtual bool isValid() const
Definition: SiStripKey.cc:74
const uint16_t & channel() const
Definition: SiStripKey.h:128
virtual void initFromValue()
Definition: SiStripKey.h:95
virtual bool isInvalid() const
Definition: SiStripKey.cc:89
virtual void initFromKey()
Definition: SiStripKey.h:96
uint16_t channel_
Definition: SiStripKey.h:119
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:68
virtual ~SiStripKey()
Definition: SiStripKey.h:45