Go to the documentation of this file.00001 #ifndef DataFormats_SiPixelRecHit_h
00002 #define DataFormats_SiPixelRecHit_h 1
00003
00004
00014
00015
00017 #include "DataFormats/TrackerRecHit2D/interface/BaseSiTrackerRecHit2DLocalPos.h"
00019 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitQuality.h"
00020
00021 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
00022 #include "DataFormats/Common/interface/DetSetVector.h"
00023 #include "DataFormats/Common/interface/Ref.h"
00024
00025
00026
00027 class SiPixelRecHit : public BaseSiTrackerRecHit2DLocalPos {
00028 public:
00029
00030 typedef edm::Ref<edmNew::DetSetVector<SiPixelCluster>, SiPixelCluster > ClusterRef;
00031
00032 SiPixelRecHit(): BaseSiTrackerRecHit2DLocalPos(), qualWord_(0), cluster_() {}
00033
00034 ~SiPixelRecHit() {}
00035
00036 SiPixelRecHit( const LocalPoint&, const LocalError&,
00037 const DetId&,
00038 ClusterRef const& cluster);
00039
00040 virtual SiPixelRecHit * clone() const {return new SiPixelRecHit( * this); }
00041
00042 ClusterRef const& cluster() const { return cluster_;}
00043 void setClusterRef(const ClusterRef &ref) { cluster_ = ref; }
00044
00045 virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const;
00046
00047
00048
00049
00050
00051 private:
00052
00053
00054 SiPixelRecHitQuality::QualWordType qualWord_ ;
00055
00056
00057
00058 public:
00059
00060
00061
00062
00063
00064
00065 float clusterProbability(unsigned int flags = 0) const;
00066
00067
00068
00069 inline SiPixelRecHitQuality::QualWordType rawQualityWord() const {
00070 return qualWord_ ;
00071 }
00072 inline void setRawQualityWord( SiPixelRecHitQuality::QualWordType w ) {
00073 qualWord_ = w;
00074 }
00075
00076
00077
00078
00079 inline float probabilityX() const {
00080 return SiPixelRecHitQuality::thePacking.probabilityX( qualWord_ );
00081 }
00082 inline float probabilityY() const {
00083 return SiPixelRecHitQuality::thePacking.probabilityY( qualWord_ );
00084 }
00085
00086
00087 inline float probabilityXY() const {
00088 return SiPixelRecHitQuality::thePacking.probabilityXY( qualWord_ );
00089 }
00090 inline float probabilityQ() const {
00091 return SiPixelRecHitQuality::thePacking.probabilityQ( qualWord_ );
00092 }
00093
00094
00095
00096
00097 inline int qBin() const {
00098 return SiPixelRecHitQuality::thePacking.qBin( qualWord_ );
00099 }
00100
00101
00102
00103
00104 inline bool isOnEdge() const {
00105 return SiPixelRecHitQuality::thePacking.isOnEdge( qualWord_ );
00106 }
00107
00108 inline bool hasBadPixels() const {
00109 return SiPixelRecHitQuality::thePacking.hasBadPixels( qualWord_ );
00110 }
00111
00112 inline bool spansTwoROCs() const {
00113 return SiPixelRecHitQuality::thePacking.spansTwoROCs( qualWord_ );
00114 }
00115
00116
00117 inline bool hasFilledProb() const {
00118 return SiPixelRecHitQuality::thePacking.hasFilledProb( qualWord_ );
00119 }
00120
00121
00122 inline void setProbabilityXY( float prob ) {
00123 SiPixelRecHitQuality::thePacking.setProbabilityXY( prob, qualWord_ );
00124 }
00125 inline void setProbabilityQ( float prob ) {
00126 SiPixelRecHitQuality::thePacking.setProbabilityQ( prob, qualWord_ );
00127 }
00128 inline void setQBin( int qbin ) {
00129 SiPixelRecHitQuality::thePacking.setQBin( qbin, qualWord_ );
00130 }
00131 inline void setIsOnEdge( bool flag ) {
00132 SiPixelRecHitQuality::thePacking.setIsOnEdge( flag, qualWord_ );
00133 }
00134 inline void setHasBadPixels( bool flag ) {
00135 SiPixelRecHitQuality::thePacking.setHasBadPixels( flag, qualWord_ );
00136 }
00137 inline void setSpansTwoROCs( bool flag ) {
00138 SiPixelRecHitQuality::thePacking.setSpansTwoROCs( flag, qualWord_ );
00139 }
00140 inline void setHasFilledProb( bool flag ) {
00141 SiPixelRecHitQuality::thePacking.setHasFilledProb( flag, qualWord_ );
00142 }
00143
00144 private:
00145
00146 SiPixelClusterRefNew cluster_;
00147
00148 };
00149
00150
00151 inline bool operator<( const SiPixelRecHit& one, const SiPixelRecHit& other) {
00152 if ( one.geographicalId() < other.geographicalId() ) {
00153 return true;
00154 } else {
00155 return false;
00156 }
00157 }
00158
00159 #endif