File indexing completed on 2025-06-12 23:29:42
0001 #ifndef DataFormats_CTPPSReco_interface_CTPPSPixelRecHit_h
0002 #define DataFormats_CTPPSReco_interface_CTPPSPixelRecHit_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <cassert>
0013
0014 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0015 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0016 #include "FWCore/Utilities/interface/isFinite.h"
0017
0018
0019
0020 class CTPPSPixelRecHit {
0021 public:
0022 CTPPSPixelRecHit(LocalPoint lp = LocalPoint(0., 0., 0.),
0023 LocalError le = LocalError(0., 0., 0.),
0024 bool edge = false,
0025 bool bad = false,
0026 bool rocs = false,
0027 int minrow = 0,
0028 int mincol = 0,
0029 int size = 0,
0030 int rowsize = 0,
0031 int colsize = 0)
0032 : thePoint_(lp),
0033 theError_(le),
0034 isOnEdge_(edge),
0035 hasBadPixels_(bad),
0036 spanTwoRocs_(rocs),
0037 minPixelRow_(minrow),
0038 minPixelCol_(mincol),
0039 clusterSize_(size),
0040 clusterSizeRow_(rowsize),
0041 clusterSizeCol_(colsize) {}
0042
0043 LocalPoint point() const { return thePoint_; }
0044 LocalError error() const { return theError_; }
0045
0046 bool isOnEdge() const { return isOnEdge_; }
0047 bool hasBadPixels() const { return hasBadPixels_; }
0048 bool spanTwoRocs() const { return spanTwoRocs_; }
0049
0050 unsigned int minPixelRow() const { return minPixelRow_; }
0051 unsigned int minPixelCol() const { return minPixelCol_; }
0052
0053 unsigned int clusterSize() const { return clusterSize_; }
0054 unsigned int clusterSizeRow() const { return clusterSizeRow_; }
0055 unsigned int clusterSizeCol() const { return clusterSizeCol_; }
0056
0057 float sort_key() const { return thePoint_.mag2(); }
0058
0059 private:
0060 LocalPoint thePoint_;
0061 LocalError theError_;
0062
0063 bool isOnEdge_;
0064 bool hasBadPixels_;
0065 bool spanTwoRocs_;
0066
0067 unsigned int minPixelRow_;
0068 unsigned int minPixelCol_;
0069
0070 unsigned int clusterSize_;
0071 unsigned int clusterSizeRow_;
0072 unsigned int clusterSizeCol_;
0073 };
0074
0075 inline bool operator<(CTPPSPixelRecHit const& a, CTPPSPixelRecHit const& b) {
0076 float a_key = a.sort_key();
0077 float b_key = b.sort_key();
0078 assert(edm::isFinite(a_key));
0079 assert(edm::isFinite(b_key));
0080 return a_key < b_key;
0081 }
0082
0083 #endif