CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
bool isEqual(const SiStripKey &) const override
uint16_t apvPairNumber_
void initFromPath() override
bool isValid() const override
void initGranularity() override
static const uint16_t partitionOffset_
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
const uint32_t & key() const
Definition: SiStripKey.h:120
Constants and enumerated type for sistrip::Granularity.
const uint16_t & partition() const
void initFromKey() override
void terse(std::stringstream &ss) const override
const uint16_t & apvWithinPair() const
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:23
const uint16_t & apvPairNumber() const
bool isInvalid() const override
Utility class that identifies a position within the strip tracker geometrical structure, down to the level of an APV25 chip.
Definition: SiStripDetKey.h:28
static const uint16_t partitionMask_
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
Definition: DetId.h:17
void initFromValue() override
double b
Definition: hdecay.h:118
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
Definition: DTCELinkId.h:70
double a
Definition: hdecay.h:119
uint16_t apvWithinPair_
void print(std::stringstream &ss) const override
bool isConsistent(const SiStripKey &) const override
uint16_t partition_