CMS 3D CMS Logo

OmniClusterRef.h
Go to the documentation of this file.
1 #ifndef TrackerRecHit2D_OmniClusterRef_H
2 #define TrackerRecHit2D_OmniClusterRef_H
3 
5 
10 
12 
13  static const unsigned int kInvalid = 0x80000000; // bit 31 on
14  static const unsigned int kIsStrip = 0x20000000; // bit 29 on
15  // FIXME:: need to check when introducing phase2 pixel
16  static const unsigned int kIsPhase2 = 0x40000000; // bit 30 on
17  static const unsigned int kIsRegional = 0x60000000; // bit 30 and 29 on (will become fastsim???)
18 
19  static const unsigned int indexMask = 0xFFFFFF;
20  static const unsigned int subClusMask = 0xF000000;
21  static const unsigned int subClusShift = 24;
22 
23 public:
27 
28  OmniClusterRef() : me(edm::RefCore(),kInvalid) {}
29  explicit OmniClusterRef(ClusterPixelRef const & ref, unsigned int subClus=0) : me(ref.refCore(), (ref.isNonnull() ? ref.key() | (subClus<<subClusShift) : kInvalid) ){ }
30  explicit OmniClusterRef(ClusterStripRef const & ref, unsigned int subClus=0) : me(ref.refCore(), (ref.isNonnull() ? (ref.key() | kIsStrip ) | (subClus<<subClusShift) : kInvalid) ){ }
31  explicit OmniClusterRef(Phase2Cluster1DRef const & ref, unsigned int subClus=0) : me(ref.refCore(), (ref.isNonnull() ? (ref.key() | kIsPhase2) | (subClus<<subClusShift) : kInvalid) ){ }
32 
33  ClusterPixelRef cluster_pixel() const {
34  return (isPixel() && isValid()) ? ClusterPixelRef(me.toRefCore(),index()) : ClusterPixelRef();
35  }
36 
37  ClusterStripRef cluster_strip() const {
39  }
40 
41  Phase2Cluster1DRef cluster_phase2OT() const {
43  }
44 
45  SiPixelCluster const & pixelCluster() const {
46  return *ClusterPixelRef(me.toRefCore(),index());
47  }
48  SiStripCluster const & stripCluster() const {
49  return *ClusterStripRef(me.toRefCore(),index());
50  }
52  return *Phase2Cluster1DRef(me.toRefCore(),index());
53  }
54 
55  bool operator==(OmniClusterRef const & lh) const {
56  return rawIndex() == lh.rawIndex(); // in principle this is enough!
57  }
58 
59  bool operator<(OmniClusterRef const & lh) const {
60  return rawIndex() < lh.rawIndex(); // in principle this is enough!
61  }
62 
63 public:
64  // edm Ref interface
65  /* auto */ edm::ProductID id() const { return me.id();}
66  unsigned int key() const { return index();}
67 
68 
69  unsigned int rawIndex() const { return me.index();}
70 
71  unsigned int index() const { return rawIndex() & indexMask;}
72 
73  unsigned int subCluster() const { return (rawIndex() & subClusMask)>>subClusShift; }
74 
75  bool isValid() const { return !(rawIndex() & kInvalid); }
76  bool isPixel() const { return !isStrip() && !isPhase2(); } //NOTE: non-valid will also show up as a pixel
77  bool isStrip() const { return rawIndex() & kIsStrip; }
78  bool isPhase2() const { return rawIndex() & kIsPhase2; }
79  // bool isRegional() const { return (rawIndex() & kIsRegional)==kIsRegional; }
80  // bool isNonRegionalStrip() const {return (rawIndex() & kIsRegional)==kIsStrip;}
81 
82 private:
84 };
85 
86 #endif // TrackerRecHit2D_OmniClusterRef_H
unsigned int rawIndex() const
Phase2Cluster1DRef cluster_phase2OT() const
bool isStrip() const
Phase2TrackerCluster1D const & phase2OTCluster() const
SiPixelCluster const & pixelCluster() const
OmniClusterRef(ClusterPixelRef const &ref, unsigned int subClus=0)
unsigned int subCluster() const
static const unsigned int kIsPhase2
unsigned int index() const
bool int lh
Definition: SIMDVec.h:21
ProductID id() const
ClusterPixelRef cluster_pixel() const
bool operator==(OmniClusterRef const &lh) const
bool isValid() const
OmniClusterRef(Phase2Cluster1DRef const &ref, unsigned int subClus=0)
SiStripCluster const & stripCluster() const
RefCore const & toRefCore() const
bool operator<(OmniClusterRef const &lh) const
edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1D > Phase2Cluster1DRef
edm::RefCoreWithIndex me
OmniClusterRef(ClusterStripRef const &ref, unsigned int subClus=0)
ClusterStripRef cluster_strip() const
edm::Ref< edmNew::DetSetVector< SiPixelCluster >, SiPixelCluster > ClusterPixelRef
static const unsigned int kIsStrip
bool isPixel() const
static const unsigned int indexMask
unsigned int index() const
Pixel cluster – collection of neighboring pixels above threshold.
edm::ProductID id() const
HLT enums.
static const unsigned int subClusMask
edm::Ref< edmNew::DetSetVector< SiStripCluster >, SiStripCluster > ClusterStripRef
static const unsigned int subClusShift
bool isPhase2() const
static const unsigned int kIsRegional
unsigned int key() const
static const unsigned int kInvalid