test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
30  public:
31 
32  // ---------- Constructors ----------
33 
35  SiStripDetKey( const uint16_t& partition );
36 
38  SiStripDetKey( const DetId& det_id,
39  const uint16_t& apv_pair_number = 0,
40  const uint16_t& apv_within_pair = 0 );
41 
43  SiStripDetKey( const SiStripDetId& det_id );
44 
46  SiStripDetKey( const uint32_t& det_key );
47 
49  SiStripDetKey( const std::string& directory_path );
50 
52  SiStripDetKey( const SiStripDetKey& );
53 
55  SiStripDetKey( const SiStripKey& );
56 
58  SiStripDetKey( const SiStripKey&,
59  const sistrip::Granularity& );
60 
62  SiStripDetKey();
63 
64  // ---------- Public interface to member data ----------
65 
67  inline const uint16_t& partition() const;
68 
70  inline const uint16_t& apvPairNumber() const;
71 
73  inline const uint16_t& apvWithinPair() const;
74 
75  // ---------- Numbering schemes ----------
76 
77  //@@ nothing yet
78  //@@ switch b/w det_id and det_key
79  //@@ switch b/w strip, pair, apv, etc...
80 
81  // ---------- Utility methods ----------
82 
84  bool isEqual( const SiStripKey& ) const;
85 
87  bool isConsistent( const SiStripKey& ) const;
88 
90  bool isValid() const;
91 
94  bool isValid( const sistrip::Granularity& ) const;
95 
97  bool isInvalid() const;
98 
101  bool isInvalid( const sistrip::Granularity& ) const;
102 
103  // ---------- Print methods ----------
104 
106  virtual void print( std::stringstream& ss ) const;
107 
109  virtual void terse( std::stringstream& ss ) const;
110 
111  private:
112 
113  // ---------- Private methods ----------
114 
115  void initFromValue();
116  void initFromKey();
117  void initFromPath();
118  void initGranularity();
119 
120  // ---------- Private member data ----------
121 
123  uint16_t partition_;
124 
126  uint16_t apvPairNumber_;
127 
129  uint16_t apvWithinPair_;
130 
131  // Definition of bit field positions for 32-bit key
132  static const uint16_t partitionOffset_ = 29;
133 
134  // Definition of bit field masks for 32-bit key
135  static const uint16_t partitionMask_ = 0x07; // (3 bits)
136 
137 };
138 
139 // ---------- inline methods ----------
140 
141 const uint16_t& SiStripDetKey::partition() const { return partition_; }
142 const uint16_t& SiStripDetKey::apvPairNumber() const { return apvPairNumber_; }
143 const uint16_t& SiStripDetKey::apvWithinPair() const { return apvWithinPair_; }
144 
146 std::ostream& operator<< ( std::ostream&, const SiStripDetKey& );
147 
148 inline bool operator< ( const SiStripDetKey& a, const SiStripDetKey& b ) { return ( a.key() < b.key() ); }
149 
150 
151 #endif // DataFormats_SiStripCommon_SiStripDetKey_h
uint16_t apvPairNumber_
static const uint16_t partitionOffset_
virtual void print(std::stringstream &ss) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const uint32_t & key() const
Definition: SiStripKey.h:125
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
Constants and enumerated type for sistrip::Granularity.
void initFromValue()
const uint16_t & partition() const
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
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_
bool isEqual(const SiStripKey &) const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
bool isConsistent(const SiStripKey &) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
uint16_t apvWithinPair_
void initGranularity()
bool isValid() const
uint16_t partition_
virtual void terse(std::stringstream &ss) const