File indexing completed on 2023-01-21 00:19:33
0001 #ifndef Geometry_TrackerGeometryBuilder_RectangularPixelTopology_H
0002 #define Geometry_TrackerGeometryBuilder_RectangularPixelTopology_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0036 #include "DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h"
0037 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0038
0039 class RectangularPixelTopology final : public PixelTopology {
0040 public:
0041
0042 RectangularPixelTopology(int nrows,
0043 int ncols,
0044 float pitchx,
0045 float pitchy,
0046 bool upgradeGeometry,
0047 int ROWS_PER_ROC,
0048 int COLS_PER_ROC,
0049 int BIG_PIX_PER_ROC_X,
0050 int BIG_PIX_PER_ROC_Y,
0051 int ROCS_X,
0052 int ROCS_Y)
0053 : m_pitchx(pitchx),
0054 m_pitchy(pitchy),
0055 m_nrows(nrows),
0056 m_ncols(ncols),
0057 m_ROWS_PER_ROC(ROWS_PER_ROC),
0058 m_COLS_PER_ROC(COLS_PER_ROC),
0059 m_ROCS_X(ROCS_X),
0060 m_ROCS_Y(ROCS_Y),
0061 m_upgradeGeometry(upgradeGeometry) {
0062
0063
0064
0065 m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X * m_nrows / ROWS_PER_ROC) / 2. * m_pitchx;
0066 m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y * m_ncols / COLS_PER_ROC) / 2. * m_pitchy;
0067
0068 LogDebug("RectangularPixelTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx " << m_pitchx
0069 << ", pitchy " << m_pitchy << ", xoffset " << m_xoffset << ", yoffset "
0070 << m_yoffset << ", BIG_PIX_PER_ROC_X " << BIG_PIX_PER_ROC_X
0071 << ", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y << ", ROWS_PER_ROC "
0072 << ROWS_PER_ROC << ", COLS_PER_ROC " << COLS_PER_ROC << ", ROCS_X " << ROCS_X
0073 << ", ROCS_Y " << ROCS_Y << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X
0074 << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y;
0075 }
0076
0077
0078
0079 LocalPoint localPosition(const MeasurementPoint& mp) const override;
0080
0081
0082 MeasurementPoint measurementPosition(const LocalPoint& lp) const override {
0083 std::pair<float, float> p = pixel(lp);
0084 return MeasurementPoint(p.first, p.second);
0085 }
0086
0087
0088
0089 std::pair<float, float> pixel(const LocalPoint& p) const override;
0090
0091
0092
0093 LocalError localError(const MeasurementPoint&, const MeasurementError&) const override;
0094
0095 MeasurementError measurementError(const LocalPoint&, const LocalError&) const override;
0096
0097
0098
0099
0100 int channel(const LocalPoint& lp) const override {
0101 std::pair<float, float> p = pixel(lp);
0102 return PixelChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
0103 }
0104
0105
0106
0107
0108 float localX(const float mpX) const override;
0109 float localY(const float mpY) const override;
0110
0111
0112
0113
0114 bool isItBigPixelInX(const int ixbin) const override {
0115 return ((m_upgradeGeometry) ? (false) : ((ixbin == 79) | (ixbin == 80)));
0116 }
0117
0118 bool isItBigPixelInY(const int iybin) const override {
0119 if UNLIKELY (m_upgradeGeometry)
0120 return false;
0121 else {
0122 int iybin0 = iybin % 52;
0123 return ((iybin0 == 0) | (iybin0 == 51));
0124
0125
0126 }
0127 }
0128
0129
0130
0131
0132 bool containsBigPixelInX(int ixmin, int ixmax) const override {
0133 return m_upgradeGeometry ? false : ((ixmin <= 80) & (ixmax >= 79));
0134 }
0135 bool containsBigPixelInY(int iymin, int iymax) const override {
0136 return m_upgradeGeometry ? false
0137 : (isItBigPixelInY(iymin) || isItBigPixelInY(iymax) || (iymin / 52) != (iymax / 52));
0138 }
0139
0140
0141
0142
0143 bool isItEdgePixelInX(int ixbin) const override { return ((ixbin == 0) | (ixbin == (m_nrows - 1))); }
0144 bool isItEdgePixelInY(int iybin) const override { return ((iybin == 0) | (iybin == (m_ncols - 1))); }
0145 bool isItEdgePixel(int ixbin, int iybin) const override {
0146 return (isItEdgePixelInX(ixbin) || isItEdgePixelInY(iybin));
0147 }
0148
0149
0150
0151 std::pair<float, float> pitch() const override { return std::pair<float, float>(float(m_pitchx), float(m_pitchy)); }
0152
0153 int nrows() const override { return (m_nrows); }
0154
0155 int ncolumns() const override { return (m_ncols); }
0156
0157 int rocsY() const override { return m_ROCS_Y; }
0158
0159 int rocsX() const override { return m_ROCS_X; }
0160
0161 int rowsperroc() const override { return m_ROWS_PER_ROC; }
0162
0163 int colsperroc() const override { return m_COLS_PER_ROC; }
0164 float xoffset() const { return m_xoffset; }
0165 float yoffset() const { return m_yoffset; }
0166
0167 private:
0168 float m_pitchx;
0169 float m_pitchy;
0170 float m_xoffset;
0171 float m_yoffset;
0172 int m_nrows;
0173 int m_ncols;
0174 int m_ROWS_PER_ROC;
0175 int m_COLS_PER_ROC;
0176 int m_ROCS_X;
0177 int m_ROCS_Y;
0178 bool m_upgradeGeometry;
0179 };
0180
0181 #endif