CMS 3D CMS Logo

RectangularMTDTopology.cc
Go to the documentation of this file.
2 
3 //--------------------------------------------------------------------
4 // PixelTopology interface.
5 // Transform LocalPoint in cm to measurement in pitch units.
6 std::pair<float, float> RectangularMTDTopology::pixel(const LocalPoint& p) const {
7  // check limits
8  float py = p.y();
9  float px = p.x();
10 
11  // In Y
12  float newybin = (py - m_yoffset) / m_pitchy;
13  // In X
14  float newxbin = (px - m_xoffset) / m_pitchx;
15 
16  return std::pair<float, float>(newxbin, newybin);
17 }
18 
19 //The following lines check whether the point is actually out of the active pixel area.
21  bool isInside = true;
22  const auto& thepixel = pixel(p);
23  const int ixbin = static_cast<int>(thepixel.first);
24  const int iybin = static_cast<int>(thepixel.second);
25  const float fractionX = thepixel.first - ixbin;
26  const float fractionY = thepixel.second - iybin;
27  if ((fractionX > 1.0 - m_GAPxInterpadFrac || fractionX < m_GAPxInterpadFrac) ||
28  (ixbin == 0 && fractionX < m_GAPxBorderFrac) || (ixbin == m_nrows - 1 && fractionX > 1.0 - m_GAPxBorderFrac)) {
29  isInside = false;
30  }
31  if ((fractionY > 1.0 - m_GAPyInterpadFrac || fractionY < m_GAPyInterpadFrac) ||
32  (iybin == 0 && fractionY < m_GAPyBorderFrac) || (iybin == m_ncols - 1 && fractionY > 1.0 - m_GAPyBorderFrac)) {
33  isInside = false;
34  }
35  return isInside;
36 }
37 
38 //----------------------------------------------------------------------
39 // Topology interface, go from Measurement to Local corrdinates
40 // pixel coordinates (mp) -> cm (LocalPoint)
42  float mpy = mp.y(); // measurements
43  float mpx = mp.x();
44 
45  float lpY = localY(mpy);
46  float lpX = localX(mpx);
47 
48  // Return it as a LocalPoint
49  return LocalPoint(lpX, lpY);
50 }
51 
52 //--------------------------------------------------------------------
53 //
54 // measuremet to local transformation for X coordinate
55 float RectangularMTDTopology::localX(const float mpx) const {
56  // The final position in local coordinates
57  float lpX = mpx * m_pitchx + m_xoffset;
58 
59  return lpX;
60 }
61 
62 float RectangularMTDTopology::localY(const float mpy) const {
63  // The final position in local coordinates
64  float lpY = mpy * m_pitchy + m_yoffset;
65 
66  return lpY;
67 }
68 
70 // Get hit errors in LocalPoint coordinates (cm)
72  return LocalError(me.uu() * float(m_pitchx * m_pitchx), 0, me.vv() * float(m_pitchy * m_pitchy));
73 }
74 
76 // Get errors in pixel pitch units.
78  return MeasurementError(le.xx() / float(m_pitchx * m_pitchx), 0, le.yy() / float(m_pitchy * m_pitchy));
79 }
Point2DBase
Definition: Point2DBase.h:9
RectangularMTDTopology::m_pitchy
float m_pitchy
Definition: RectangularMTDTopology.h:177
RectangularMTDTopology::m_ncols
int m_ncols
Definition: RectangularMTDTopology.h:181
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
RectangularMTDTopology::pixel
std::pair< float, float > pixel(const LocalPoint &p) const override
Definition: RectangularMTDTopology.cc:6
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::localPosition
LocalPoint localPosition(const MeasurementPoint &mp) const override
Definition: RectangularMTDTopology.cc:41
LocalError::xx
float xx() const
Definition: LocalError.h:22
RectangularMTDTopology::m_xoffset
float m_xoffset
Definition: RectangularMTDTopology.h:178
MeasurementError
Definition: MeasurementError.h:8
RectangularMTDTopology.h
Point3DBase< float, LocalTag >
RectangularMTDTopology::localError
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
Definition: RectangularMTDTopology.cc:71
RectangularMTDTopology::m_pitchx
float m_pitchx
Definition: RectangularMTDTopology.h:176
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
LocalError
Definition: LocalError.h:12
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
RectangularMTDTopology::m_GAPyInterpadFrac
float m_GAPyInterpadFrac
Definition: RectangularMTDTopology.h:192
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
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
RectangularMTDTopology::m_nrows
int m_nrows
Definition: RectangularMTDTopology.h:180
RectangularMTDTopology::m_yoffset
float m_yoffset
Definition: RectangularMTDTopology.h:179
RectangularMTDTopology::m_GAPyBorderFrac
float m_GAPyBorderFrac
Definition: RectangularMTDTopology.h:193
RectangularMTDTopology::m_GAPxBorderFrac
float m_GAPxBorderFrac
Definition: RectangularMTDTopology.h:191
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
LocalError::yy
float yy() const
Definition: LocalError.h:24