CMS 3D CMS Logo

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 <ostream>
7 #include <sstream>
8 #include <string>
9 #include <cstdint>
10 
11 class SiStripKey;
12 
14 std::ostream& operator<<(std::ostream&, const SiStripKey&);
15 
23 class SiStripKey {
24 public:
25  // ---------- Constructors ----------
26 
28  SiStripKey(const uint32_t& key);
29 
31  SiStripKey(const std::string& directory_path);
32 
34  SiStripKey(const SiStripKey&);
35 
37  const SiStripKey& operator=(const SiStripKey&);
38 
40  SiStripKey();
41 
43  virtual ~SiStripKey() { ; }
44 
45  // ---------- Public interface to member data ----------
46 
48  inline const uint32_t& key() const;
49 
51  inline const std::string& path() const;
52 
54  inline const sistrip::Granularity& granularity() const;
55 
57  inline const uint16_t& channel() const;
58 
59  // ---------- Virtual utility methods ----------
60 
62  virtual bool isEqual(const SiStripKey&) const;
63 
65  virtual bool isConsistent(const SiStripKey&) const;
66 
68  virtual bool isValid() const;
69 
72  virtual bool isValid(const sistrip::Granularity&) const;
73 
75  virtual bool isInvalid() const;
76 
79  virtual bool isInvalid(const sistrip::Granularity&) const;
80 
81  // ---------- Print methods ----------
82 
84  virtual void print(std::stringstream& ss) const;
85 
87  virtual void terse(std::stringstream& ss) const { ; }
88 
89 protected:
90  // ---------- Protected methods ----------
91 
92  virtual void initFromValue() { ; }
93  virtual void initFromKey() { ; }
94  virtual void initFromPath() { ; }
95  virtual void initGranularity() { ; }
96 
97  inline void key(const uint32_t&);
98  inline void path(const std::string&);
99  inline void granularity(const sistrip::Granularity&);
100  inline void channel(const uint16_t&);
101 
102 private:
103  // ---------- Private member data ----------
104 
106  uint32_t key_;
107 
110 
113 
115  uint16_t channel_;
116 };
117 
118 // ---------- Inline methods ----------
119 
120 const uint32_t& SiStripKey::key() const { return key_; }
121 const std::string& SiStripKey::path() const { return path_; }
123 const uint16_t& SiStripKey::channel() const { return channel_; }
124 
125 void SiStripKey::key(const uint32_t& key) { key_ = key; }
128 void SiStripKey::channel(const uint16_t& chan) { channel_ = chan; }
129 
130 #endif // DataFormats_SiStripCommon_SiStripKey_H
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
SiStripKey::granularity_
sistrip::Granularity granularity_
Definition: SiStripKey.h:112
SiStripKey::operator=
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:30
SiStripKey::path_
std::string path_
Definition: SiStripKey.h:109
SiStripKey::initFromKey
virtual void initFromKey()
Definition: SiStripKey.h:93
SiStripKey::key
const uint32_t & key() const
Definition: SiStripKey.h:120
SiStripKey::SiStripKey
SiStripKey()
Definition: SiStripKey.cc:43
SiStripKey::isValid
virtual bool isValid() const
Definition: SiStripKey.cc:68
SiStripKey::key_
uint32_t key_
Definition: SiStripKey.h:106
ConstantsForGranularity.h
Constants and enumerated type for sistrip::Granularity.
SiStripKey::granularity
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:122
SiStripKey::~SiStripKey
virtual ~SiStripKey()
Definition: SiStripKey.h:43
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripKey::initGranularity
virtual void initGranularity()
Definition: SiStripKey.h:95
SiStripKey::print
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:90
SiStripKey::channel
const uint16_t & channel() const
Definition: SiStripKey.h:123
operator<<
std::ostream & operator<<(std::ostream &, const SiStripKey &)
Definition: SiStripKey.cc:100
SiStripKey::initFromValue
virtual void initFromValue()
Definition: SiStripKey.h:92
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripKey::terse
virtual void terse(std::stringstream &ss) const
Definition: SiStripKey.h:87
SiStripKey::channel_
uint16_t channel_
Definition: SiStripKey.h:115
SiStripKey::isConsistent
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:64
SiStripKey::path
const std::string & path() const
Definition: SiStripKey.h:121
SiStripKey::isEqual
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:53
officialStyle.chan
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi....
Definition: officialStyle.py:106
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
crabWrapper.key
key
Definition: crabWrapper.py:19
SiStripKey
Base utility class that identifies a position within a logical structure of the strip tracker.
Definition: SiStripKey.h:23
SiStripKey::initFromPath
virtual void initFromPath()
Definition: SiStripKey.h:94
SiStripKey::isInvalid
virtual bool isInvalid() const
Definition: SiStripKey.cc:79