File indexing completed on 2024-04-06 12:05:20
0001 #ifndef DataFormats_SiPixelRecHit_h
0002 #define DataFormats_SiPixelRecHit_h 1
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "DataFormats/TrackerRecHit2D/interface/TrackerSingleRecHit.h"
0018
0019 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitQuality.h"
0020
0021 #include "TkCloner.h"
0022
0023 class SiPixelRecHit final : public TrackerSingleRecHit {
0024 public:
0025 typedef edm::Ref<edmNew::DetSetVector<SiPixelCluster>, SiPixelCluster> ClusterRef;
0026
0027 SiPixelRecHit() {}
0028
0029 ~SiPixelRecHit() override {}
0030
0031 SiPixelRecHit(const LocalPoint& pos,
0032 const LocalError& err,
0033 SiPixelRecHitQuality::QualWordType qual,
0034 GeomDet const& idet,
0035 ClusterRef const& clus)
0036 : TrackerSingleRecHit(pos, err, idet, clus) {
0037 qualWord_ = qual;
0038 }
0039
0040 bool isPixel() const override { return true; }
0041
0042 SiPixelRecHit* clone() const override { return new SiPixelRecHit(*this); }
0043 #ifndef __GCCXML__
0044 RecHitPointer cloneSH() const override { return std::make_shared<SiPixelRecHit>(*this); }
0045 #endif
0046
0047 ClusterRef cluster() const { return cluster_pixel(); }
0048
0049 void setClusterRef(ClusterRef const& ref) { setClusterPixelRef(ref); }
0050
0051 int dimension() const override { return 2; }
0052 void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents2D(holder); }
0053
0054 bool canImproveWithTrack() const override { return true; }
0055
0056 private:
0057
0058 SiPixelRecHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
0059 return cloner(*this, tsos).release();
0060 }
0061 #ifndef __GCCXML__
0062 RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
0063 return cloner.makeShared(*this, tsos);
0064 }
0065 #endif
0066
0067 public:
0068
0069
0070
0071
0072
0073
0074 using BaseTrackerRecHit::clusterProbability;
0075 float clusterProbability(unsigned int flags = 0) const;
0076
0077
0078 inline SiPixelRecHitQuality::QualWordType rawQualityWord() const { return qualWord_; }
0079
0080
0081
0082 inline float probabilityX() const { return SiPixelRecHitQuality::thePacking.probabilityX(qualWord_); }
0083 inline float probabilityY() const { return SiPixelRecHitQuality::thePacking.probabilityY(qualWord_); }
0084
0085
0086 inline float probabilityXY() const { return SiPixelRecHitQuality::thePacking.probabilityXY(qualWord_); }
0087 inline float probabilityQ() const { return SiPixelRecHitQuality::thePacking.probabilityQ(qualWord_); }
0088
0089
0090
0091
0092 inline int qBin() const { return SiPixelRecHitQuality::thePacking.qBin(qualWord_); }
0093
0094
0095
0096
0097 inline bool isOnEdge() const { return SiPixelRecHitQuality::thePacking.isOnEdge(qualWord_); }
0098
0099 inline bool hasBadPixels() const { return SiPixelRecHitQuality::thePacking.hasBadPixels(qualWord_); }
0100
0101 inline bool spansTwoROCs() const { return SiPixelRecHitQuality::thePacking.spansTwoROCs(qualWord_); }
0102
0103
0104 inline bool hasFilledProb() const { return SiPixelRecHitQuality::thePacking.hasFilledProb(qualWord_); }
0105 };
0106
0107 #endif