CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OmniClusterRef.h
Go to the documentation of this file.
1 #ifndef TrackerRecHit2D_OmniClusterRef_H
2 #define TrackerRecHit2D_OmniClusterRef_H
3 
5 
11 
13 
14  static const unsigned int kInvalid = 0x80000000; // bit 31 on
15  static const unsigned int kIsStrip = 0x20000000; // bit 29 on
16  static const unsigned int kIsRegional = 0x60000000; // bit 30 and 29 on
17 
18 public:
22 
23  OmniClusterRef() : me(edm::RefCore(),kInvalid) {}
24  explicit OmniClusterRef(ClusterPixelRef const & ref) : me(ref.refCore(), (ref.isNonnull() ? ref.key() : kInvalid) ){}
25  explicit OmniClusterRef(ClusterStripRef const & ref) : me(ref.refCore(), (ref.isNonnull() ? ref.key() | kIsStrip : kInvalid) ){}
26  explicit OmniClusterRef(ClusterRegionalRef const & ref) : me(ref.refCore(), (ref.isNonnull() ? ref.key() | kIsRegional : kInvalid)){}
27 
29  return (isPixel() && isValid()) ? ClusterPixelRef(me.toRefCore(),index()) : ClusterPixelRef();
30  }
31 
34  }
35 
38  }
39 
40 
41  SiStripCluster const & stripCluster() const {
43  }
44 
45  bool operator==(OmniClusterRef const & lh) const {
46  return rawIndex() == lh.rawIndex(); // in principle this is enough!
47  }
48 
49  bool operator<(OmniClusterRef const & lh) const {
50  return rawIndex() < lh.rawIndex(); // in principle this is enough!
51  }
52 
53 public:
54  // edm Ref interface
55  /* auto */ edm::ProductID id() const { return me.id();}
56  unsigned int key() const { return index();}
57 
58 
59  unsigned int rawIndex() const { return me.index();}
60 
61  unsigned int index() const { return rawIndex() & (~kIsRegional);}
62 
63 
64  bool isValid() const { return !(rawIndex() & kInvalid); }
65  bool isPixel() const { return !isStrip(); } //NOTE: non-valid will also show up as a pixel
66  bool isStrip() const { return rawIndex() & kIsStrip; }
67  bool isRegional() const { return (rawIndex() & kIsRegional)==kIsRegional; }
68  bool isNonRegionalStrip() const {return (rawIndex() & kIsRegional)==kIsStrip;}
69 
71 
72 
73 };
74 
75 #endif // TrackerRecHit2D_OmniClusterRef_H
76 
unsigned int rawIndex() const
bool isStrip() const
OmniClusterRef(ClusterPixelRef const &ref)
unsigned int index() const
bool int lh
Definition: SIMDVec.h:19
ProductID id() const
ClusterRegionalRef cluster_regional() const
ClusterPixelRef cluster_pixel() const
bool operator==(OmniClusterRef const &lh) const
bool isValid() const
OmniClusterRef(ClusterStripRef const &ref)
SiStripCluster const & stripCluster() const
edm::Ref< edm::LazyGetter< SiStripCluster >, SiStripCluster, edm::FindValue< SiStripCluster > > ClusterRegionalRef
RefCore const & toRefCore() const
bool operator<(OmniClusterRef const &lh) const
bool isNonRegionalStrip() const
edm::RefCoreWithIndex me
OmniClusterRef(ClusterRegionalRef const &ref)
ClusterStripRef cluster_strip() const
edm::Ref< edmNew::DetSetVector< SiPixelCluster >, SiPixelCluster > ClusterPixelRef
static const unsigned int kIsStrip
bool isPixel() const
bool isRegional() const
unsigned int index() const
Pixel cluster – collection of neighboring pixels above threshold.
edm::ProductID id() const
edm::Ref< edmNew::DetSetVector< SiStripCluster >, SiStripCluster > ClusterStripRef
static const unsigned int kIsRegional
unsigned int key() const
static const unsigned int kInvalid