CMS 3D CMS Logo

SiStripDetKey.h
Go to the documentation of this file.
1 
2 #ifndef DataFormats_SiStripCommon_SiStripDetKey_h
3 #define DataFormats_SiStripCommon_SiStripDetKey_h
4 
8 
28 class SiStripDetKey : public SiStripKey {
29 public:
30  // ---------- Constructors ----------
31 
33  SiStripDetKey(const uint16_t& partition);
34 
36  SiStripDetKey(const DetId& det_id, const uint16_t& apv_pair_number = 0, const uint16_t& apv_within_pair = 0);
37 
39  SiStripDetKey(const SiStripDetId& det_id);
40 
42  SiStripDetKey(const uint32_t& det_key);
43 
45  SiStripDetKey(const std::string& directory_path);
46 
49 
51  SiStripDetKey(const SiStripKey&);
52 
55 
57  SiStripDetKey();
58 
59  // ---------- Public interface to member data ----------
60 
62  inline const uint16_t& partition() const;
63 
65  inline const uint16_t& apvPairNumber() const;
66 
68  inline const uint16_t& apvWithinPair() const;
69 
70  // ---------- Numbering schemes ----------
71 
72  //@@ nothing yet
73  //@@ switch b/w det_id and det_key
74  //@@ switch b/w strip, pair, apv, etc...
75 
76  // ---------- Utility methods ----------
77 
79  bool isEqual(const SiStripKey&) const override;
80 
82  bool isConsistent(const SiStripKey&) const override;
83 
85  bool isValid() const override;
86 
89  bool isValid(const sistrip::Granularity&) const override;
90 
92  bool isInvalid() const override;
93 
96  bool isInvalid(const sistrip::Granularity&) const override;
97 
98  // ---------- Print methods ----------
99 
101  void print(std::stringstream& ss) const override;
102 
104  void terse(std::stringstream& ss) const override;
105 
106 private:
107  // ---------- Private methods ----------
108 
109  void initFromValue() override;
110  void initFromKey() override;
111  void initFromPath() override;
112  void initGranularity() override;
113 
114  // ---------- Private member data ----------
115 
117  uint16_t partition_;
118 
120  uint16_t apvPairNumber_;
121 
123  uint16_t apvWithinPair_;
124 
125  // Definition of bit field positions for 32-bit key
126  static const uint16_t partitionOffset_ = 29;
127 
128  // Definition of bit field masks for 32-bit key
129  static const uint16_t partitionMask_ = 0x07; // (3 bits)
130 };
131 
132 // ---------- inline methods ----------
133 
134 const uint16_t& SiStripDetKey::partition() const { return partition_; }
135 const uint16_t& SiStripDetKey::apvPairNumber() const { return apvPairNumber_; }
136 const uint16_t& SiStripDetKey::apvWithinPair() const { return apvWithinPair_; }
137 
139 std::ostream& operator<<(std::ostream&, const SiStripDetKey&);
140 
141 inline bool operator<(const SiStripDetKey& a, const SiStripDetKey& b) { return (a.key() < b.key()); }
142 
143 #endif // DataFormats_SiStripCommon_SiStripDetKey_h
sistrip::Granularity
Granularity
Definition: ConstantsForGranularity.h:60
SiStripDetKey::print
void print(std::stringstream &ss) const override
Definition: SiStripDetKey.cc:309
SiStripKey.h
SiStripDetKey::initFromKey
void initFromKey() override
Definition: SiStripDetKey.cc:203
SiStripDetId.h
ConstantsForGranularity.h
Constants and enumerated type for sistrip::Granularity.
SiStripDetKey::isEqual
bool isEqual(const SiStripKey &) const override
Definition: SiStripDetKey.cc:126
SiStripDetKey::apvPairNumber
const uint16_t & apvPairNumber() const
Definition: SiStripDetKey.h:135
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
SiStripDetKey::apvWithinPair_
uint16_t apvWithinPair_
Definition: SiStripDetKey.h:123
SiStripDetKey::partition_
uint16_t partition_
Definition: SiStripDetKey.h:117
b
double b
Definition: hdecay.h:118
SiStripDetKey::initFromValue
void initFromValue() override
Definition: SiStripDetKey.cc:194
a
double a
Definition: hdecay.h:119
operator<<
std::ostream & operator<<(std::ostream &, const SiStripDetKey &)
Definition: SiStripDetKey.cc:321
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripDetKey
Utility class that identifies a position within the strip tracker geometrical structure,...
Definition: SiStripDetKey.h:28
SiStripDetKey::partitionMask_
static const uint16_t partitionMask_
Definition: SiStripDetKey.h:129
SiStripDetKey::partitionOffset_
static const uint16_t partitionOffset_
Definition: SiStripDetKey.h:126
SiStripDetKey::apvPairNumber_
uint16_t apvPairNumber_
Definition: SiStripDetKey.h:120
SiStripDetKey::isConsistent
bool isConsistent(const SiStripKey &) const override
Definition: SiStripDetKey.cc:138
SiStripDetKey::partition
const uint16_t & partition() const
Definition: SiStripDetKey.h:134
SiStripDetKey::initFromPath
void initFromPath() override
Definition: SiStripDetKey.cc:233
SiStripDetKey::isValid
bool isValid() const override
Definition: SiStripDetKey.cc:152
SiStripDetKey::SiStripDetKey
SiStripDetKey()
Definition: SiStripDetKey.cc:116
operator<
bool operator<(const SiStripDetKey &a, const SiStripDetKey &b)
Definition: SiStripDetKey.h:141
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
SiStripDetKey::initGranularity
void initGranularity() override
Definition: SiStripDetKey.cc:291
SiStripDetKey::isInvalid
bool isInvalid() const override
Definition: SiStripDetKey.cc:173
SiStripKey
Base utility class that identifies a position within a logical structure of the strip tracker.
Definition: SiStripKey.h:23
SiStripDetKey::terse
void terse(std::stringstream &ss) const override
Definition: SiStripDetKey.cc:305
SiStripDetKey::apvWithinPair
const uint16_t & apvWithinPair() const
Definition: SiStripDetKey.h:136