CMS 3D CMS Logo

RectangularMTDTopology.h
Go to the documentation of this file.
1 #ifndef Geometry_MTDGeometryBuilder_RectangularMTDTopology_H
2 #define Geometry_MTDGeometryBuilder_RectangularMTDTopology_H
3 
7 // Modified for the large pixels. Should work for barrel and forward.
8 // Danek Kotlinski & Michele Pioppi, 3/06.
9 // The bigger pixels are on the ROC boundries.
10 // For columns (Y direction, longer direction):
11 // the normal pixel are 150um long, big pixels are 300um long,
12 // the pixel index goes from 0 to 416 (or less for smaller modules)
13 // the big pixel are in 0, 52,104,156,208,260,312,363
14 // 51,103,155,207,259,311,363,415 .
15 // For rows (X direction, shorter direction):
16 // the normal pixel are 100um wide, big pixels are 200um wide,
17 // the pixel index goes from 0 to 159 (or less for smaller modules)
18 // the big pixel are in 79,80.
19 // The ROC has rows=80, cols=52.
20 // There are a lot of hardwired constants, sorry but this is a very
21 // specific class. For any other sensor design it has to be rewritten.
22 
23 // G. Giurgiu 11/27/06 ---------------------------------------------
24 // Check whether the pixel is at the edge of the module by adding the
25 // following functions (ixbin and iybin are the pixel row and column
26 // inside the module):
27 // bool isItEdgePixelInX (int ixbin)
28 // bool isItEdgePixelInY (int iybin)
29 // bool isItEdgePixel (int ixbin, int iybin)
30 // ------------------------------------------------------------------
31 // Add the individual measurement to local trasformations classes 01/07 d.k.
32 // ------------------------------------------------------------------
33 // Add big pixel flags for cluster range 15/3/07 V.Chiochia
34 
38 
39 class RectangularMTDTopology final : public PixelTopology {
40 public:
41  // Constructor, initilize
43  int ncols,
44  float pitchx,
45  float pitchy,
46  int ROWS_PER_ROC, // Num of Rows per ROC
47  int COLS_PER_ROC, // Num of Cols per ROC
48  int ROCS_X,
49  int ROCS_Y,
50  float GAPxInterpad, // Value given in cm
51  float GAPxBorder, // Value given in cm
52  float GAPyInterpad, // Value given in cm
53  float GAPyBorder) // Value given in cm
54  : m_pitchx(pitchx),
55  m_pitchy(pitchy),
56  m_nrows(nrows),
57  m_ncols(ncols),
58  m_ROWS_PER_ROC(ROWS_PER_ROC), // Num of Rows per ROC
59  m_COLS_PER_ROC(COLS_PER_ROC), // Num of Cols per ROC
60  m_ROCS_X(ROCS_X), // 2 for SLHC
61  m_ROCS_Y(ROCS_Y), // 8 for SLHC
62  m_GAPxInterpad(GAPxInterpad),
63  m_GAPxBorder(GAPxBorder),
64  m_GAPyInterpad(GAPyInterpad),
65  m_GAPyBorder(GAPyBorder) {
66  m_xoffset = -(m_nrows / 2.) * m_pitchx;
67  m_yoffset = -(m_ncols / 2.) * m_pitchy;
72  }
73 
74  // Topology interface, go from Masurement to Local module corrdinates
75  // pixel coordinates (mp) -> cm (LocalPoint)
76  LocalPoint localPosition(const MeasurementPoint& mp) const override;
77 
78  // Transform LocalPoint to Measurement. Call pixel().
79  MeasurementPoint measurementPosition(const LocalPoint& lp) const override {
80  std::pair<float, float> p = pixel(lp);
81  return MeasurementPoint(p.first, p.second);
82  }
83 
84  // PixelTopology interface.
85  std::pair<float, float> pixel(const LocalPoint& p) const override;
86 
87  //check whether LocalPoint is inside the pixel active area
88  bool isInPixel(const LocalPoint& p) const;
89 
90  // Errors
91  // Error in local (cm) from the masurement errors
92  LocalError localError(const MeasurementPoint&, const MeasurementError&) const override;
93  // Errors in pitch units from localpoint error (in cm)
94  MeasurementError measurementError(const LocalPoint&, const LocalError&) const override;
95 
96  //-------------------------------------------------------------
97  // Transform LocalPoint to channel. Call pixel()
98  int channel(const LocalPoint& lp) const override {
99  std::pair<float, float> p = pixel(lp);
100  return MTDChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
101  }
102 
103  //----
104  // Transforms between module-local coordinates and pixel-local coordinates
105  // don't need a transform for errors, same units
107  std::pair<float, float> p = pixel(mlp);
108  return LocalPoint(mlp.x() - (m_xoffset + (int(p.first) + 0.5f) * m_pitchx),
109  mlp.y() - (m_yoffset + (int(p.second) + 0.5f) * m_pitchy),
110  mlp.z());
111  }
112  LocalPoint pixelToModuleLocalPoint(const LocalPoint& plp, int row, int col) const {
113  return LocalPoint(
114  plp.x() + (m_xoffset + (row + 0.5f) * m_pitchx), plp.y() + (m_yoffset + (col + 0.5f) * m_pitchy), plp.z());
115  }
117  std::pair<int, int> p = MTDChannelIdentifier::channelToPixel(channel);
118  return pixelToModuleLocalPoint(plp, p.first, p.second);
119  }
120 
121  //-------------------------------------------------------------
122  // Return the BIG pixel information for a given pixel
123  bool isItBigPixelInX(const int ixbin) const override { return false; }
124 
125  bool isItBigPixelInY(const int iybin) const override { return false; }
126 
127  //-------------------------------------------------------------
128  // Return BIG pixel flag in a given pixel range
129  bool containsBigPixelInX(int ixmin, int ixmax) const override { return false; }
130 
131  bool containsBigPixelInY(int iymin, int iymax) const override { return false; }
132 
133  // Check whether the pixel is at the edge of the module
134  bool isItEdgePixelInX(int ixbin) const override { return ((ixbin == 0) | (ixbin == (m_nrows - 1))); }
135 
136  bool isItEdgePixelInY(int iybin) const override { return ((iybin == 0) | (iybin == (m_ncols - 1))); }
137 
138  bool isItEdgePixel(int ixbin, int iybin) const override {
139  return (isItEdgePixelInX(ixbin) | isItEdgePixelInY(iybin));
140  }
141 
142  //-------------------------------------------------------------
143  // Transform measurement to local coordinates individually in each dimension
144  //
145  float localX(const float mpX) const override;
146  float localY(const float mpY) const override;
147 
148  //------------------------------------------------------------------
149  // Return pitch
150  std::pair<float, float> pitch() const override { return std::pair<float, float>(float(m_pitchx), float(m_pitchy)); }
151  // Return number of rows
152  int nrows() const override { return (m_nrows); }
153  // Return number of cols
154  int ncolumns() const override { return (m_ncols); }
155  // mlw Return number of ROCS Y
156  int rocsY() const override { return m_ROCS_Y; }
157  // mlw Return number of ROCS X
158  int rocsX() const override { return m_ROCS_X; }
159  // mlw Return number of rows per roc
160  int rowsperroc() const override { return m_ROWS_PER_ROC; }
161  // mlw Return number of cols per roc
162  int colsperroc() const override { return m_COLS_PER_ROC; }
163  float xoffset() const { return m_xoffset; }
164  float yoffset() const { return m_yoffset; }
165  float gapxInterpad() const { return m_GAPxInterpad; } // Value returned in cm
166  float gapyInterpad() const { return m_GAPyInterpad; } // Value returned in cm
167  float gapxBorder() const { return m_GAPxBorder; } // Value returned in cm
168  float gapyBorder() const { return m_GAPyBorder; } // Value returned in cm
169  float gapxInterpadFrac() const { return m_GAPxInterpadFrac; }
170  float gapyInterpadFrac() const { return m_GAPyInterpadFrac; }
171  float gapxBorderFrac() const { return m_GAPxBorderFrac; }
172  float gapyBorderFrac() const { return m_GAPyBorderFrac; }
173  bool isBricked() const override { return false; }
174 
175 private:
176  float m_pitchx;
177  float m_pitchy;
178  float m_xoffset;
179  float m_yoffset;
180  int m_nrows;
181  int m_ncols;
184  int m_ROCS_X;
185  int m_ROCS_Y;
194 };
195 
196 #endif
Point2DBase
Definition: Point2DBase.h:9
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:104
RectangularMTDTopology::m_ROCS_Y
int m_ROCS_Y
Definition: RectangularMTDTopology.h:185
RectangularMTDTopology::m_pitchy
float m_pitchy
Definition: RectangularMTDTopology.h:177
RectangularMTDTopology::m_ncols
int m_ncols
Definition: RectangularMTDTopology.h:181
MessageLogger.h
PixelTopology.h
RectangularMTDTopology::ncolumns
int ncolumns() const override
Definition: RectangularMTDTopology.h:154
RectangularMTDTopology::m_GAPxBorder
float m_GAPxBorder
Definition: RectangularMTDTopology.h:187
RectangularMTDTopology::isItBigPixelInX
bool isItBigPixelInX(const int ixbin) const override
Definition: RectangularMTDTopology.h:123
RectangularMTDTopology::pitch
std::pair< float, float > pitch() const override
Definition: RectangularMTDTopology.h:150
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
cuy.col
col
Definition: cuy.py:1009
RectangularMTDTopology::pixel
std::pair< float, float > pixel(const LocalPoint &p) const override
Definition: RectangularMTDTopology.cc:6
RectangularMTDTopology::gapyInterpad
float gapyInterpad() const
Definition: RectangularMTDTopology.h:166
RectangularMTDTopology::nrows
int nrows() const override
Definition: RectangularMTDTopology.h:152
RectangularMTDTopology::gapyBorderFrac
float gapyBorderFrac() const
Definition: RectangularMTDTopology.h:172
RectangularMTDTopology::m_GAPxInterpadFrac
float m_GAPxInterpadFrac
Definition: RectangularMTDTopology.h:190
RectangularMTDTopology::localY
float localY(const float mpY) const override
Definition: RectangularMTDTopology.cc:62
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
RectangularMTDTopology::pixelToModuleLocalPoint
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int channel) const
Definition: RectangularMTDTopology.h:116
RectangularMTDTopology::localPosition
LocalPoint localPosition(const MeasurementPoint &mp) const override
Definition: RectangularMTDTopology.cc:41
RectangularMTDTopology::gapyInterpadFrac
float gapyInterpadFrac() const
Definition: RectangularMTDTopology.h:170
RectangularMTDTopology::m_GAPxInterpad
float m_GAPxInterpad
Definition: RectangularMTDTopology.h:186
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
RectangularMTDTopology::gapxBorderFrac
float gapxBorderFrac() const
Definition: RectangularMTDTopology.h:171
RectangularMTDTopology::isItEdgePixelInY
bool isItEdgePixelInY(int iybin) const override
Definition: RectangularMTDTopology.h:136
MTDChannelIdentifier::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: MTDChannelIdentifier.h:22
RectangularMTDTopology::m_xoffset
float m_xoffset
Definition: RectangularMTDTopology.h:178
MeasurementError
Definition: MeasurementError.h:8
RectangularMTDTopology::rocsX
int rocsX() const override
Definition: RectangularMTDTopology.h:158
RectangularMTDTopology::m_GAPyBorder
float m_GAPyBorder
Definition: RectangularMTDTopology.h:189
RectangularMTDTopology::isBricked
bool isBricked() const override
Definition: RectangularMTDTopology.h:173
RectangularMTDTopology::gapxInterpadFrac
float gapxInterpadFrac() const
Definition: RectangularMTDTopology.h:169
Point3DBase< float, LocalTag >
PixelTopology
Definition: PixelTopology.h:10
RectangularMTDTopology::gapxInterpad
float gapxInterpad() const
Definition: RectangularMTDTopology.h:165
RectangularMTDTopology::rowsperroc
int rowsperroc() const override
Definition: RectangularMTDTopology.h:160
RectangularMTDTopology::yoffset
float yoffset() const
Definition: RectangularMTDTopology.h:164
RectangularMTDTopology::localError
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
Definition: RectangularMTDTopology.cc:71
RectangularMTDTopology::m_pitchx
float m_pitchx
Definition: RectangularMTDTopology.h:176
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
RectangularMTDTopology::containsBigPixelInX
bool containsBigPixelInX(int ixmin, int ixmax) const override
Definition: RectangularMTDTopology.h:129
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
RectangularMTDTopology::gapyBorder
float gapyBorder() const
Definition: RectangularMTDTopology.h:168
LocalError
Definition: LocalError.h:12
RectangularMTDTopology::m_GAPyInterpadFrac
float m_GAPyInterpadFrac
Definition: RectangularMTDTopology.h:192
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
RectangularMTDTopology::m_ROCS_X
int m_ROCS_X
Definition: RectangularMTDTopology.h:184
RectangularMTDTopology::colsperroc
int colsperroc() const override
Definition: RectangularMTDTopology.h:162
RectangularMTDTopology::isItEdgePixel
bool isItEdgePixel(int ixbin, int iybin) const override
Definition: RectangularMTDTopology.h:138
RectangularMTDTopology::isItBigPixelInY
bool isItBigPixelInY(const int iybin) const override
Definition: RectangularMTDTopology.h:125
RectangularMTDTopology::isItEdgePixelInX
bool isItEdgePixelInX(int ixbin) const override
Definition: RectangularMTDTopology.h:134
RectangularMTDTopology::measurementError
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
Definition: RectangularMTDTopology.cc:77
RectangularMTDTopology::localX
float localX(const float mpX) const override
Definition: RectangularMTDTopology.cc:55
RectangularMTDTopology::isInPixel
bool isInPixel(const LocalPoint &p) const
Definition: RectangularMTDTopology.cc:20
RectangularMTDTopology
Definition: RectangularMTDTopology.h:39
RectangularMTDTopology::measurementPosition
MeasurementPoint measurementPosition(const LocalPoint &lp) const override
Definition: RectangularMTDTopology.h:79
RectangularMTDTopology::m_nrows
int m_nrows
Definition: RectangularMTDTopology.h:180
RectangularMTDTopology::RectangularMTDTopology
RectangularMTDTopology(int nrows, int ncols, float pitchx, float pitchy, int ROWS_PER_ROC, int COLS_PER_ROC, int ROCS_X, int ROCS_Y, float GAPxInterpad, float GAPxBorder, float GAPyInterpad, float GAPyBorder)
Definition: RectangularMTDTopology.h:42
RectangularMTDTopology::m_yoffset
float m_yoffset
Definition: RectangularMTDTopology.h:179
RectangularMTDTopology::xoffset
float xoffset() const
Definition: RectangularMTDTopology.h:163
RectangularMTDTopology::gapxBorder
float gapxBorder() const
Definition: RectangularMTDTopology.h:167
RectangularMTDTopology::moduleToPixelLocalPoint
LocalPoint moduleToPixelLocalPoint(const LocalPoint &mlp) const
Definition: RectangularMTDTopology.h:106
RectangularMTDTopology::m_ROWS_PER_ROC
int m_ROWS_PER_ROC
Definition: RectangularMTDTopology.h:182
RectangularMTDTopology::rocsY
int rocsY() const override
Definition: RectangularMTDTopology.h:156
RectangularMTDTopology::channel
int channel(const LocalPoint &lp) const override
Definition: RectangularMTDTopology.h:98
RectangularMTDTopology::m_GAPyBorderFrac
float m_GAPyBorderFrac
Definition: RectangularMTDTopology.h:193
RectangularMTDTopology::containsBigPixelInY
bool containsBigPixelInY(int iymin, int iymax) const override
Definition: RectangularMTDTopology.h:131
MTDChannelIdentifier.h
RectangularMTDTopology::m_GAPxBorderFrac
float m_GAPxBorderFrac
Definition: RectangularMTDTopology.h:191
MTDChannelIdentifier::channelToPixel
static std::pair< int, int > channelToPixel(int ch)
Definition: MTDChannelIdentifier.h:16
RectangularMTDTopology::pixelToModuleLocalPoint
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
Definition: RectangularMTDTopology.h:112
RectangularMTDTopology::m_COLS_PER_ROC
int m_COLS_PER_ROC
Definition: RectangularMTDTopology.h:183
RectangularMTDTopology::m_GAPyInterpad
float m_GAPyInterpad
Definition: RectangularMTDTopology.h:188