Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-21 00:19:31

0001 #ifndef Geometry_MTDGeometryBuilder_ProxyMTDTopology_H
0002 #define Geometry_MTDGeometryBuilder_ProxyMTDTopology_H
0003 
0004 /// ProxyMTDTopology
0005 ///
0006 /// Class derived from PixelTopology that serves as a proxy to the
0007 /// actual topology for a given PixelGeomDetType. In addition, the
0008 /// class holds a pointer to the surface deformation parameters.
0009 /// ProxyMTDTopology takes over ownership of the surface
0010 /// deformation parameters.
0011 ///
0012 /// All inherited virtual methods that take the predicted track
0013 /// state as a parameter are reimplemented in order to apply
0014 /// corrections due to the surface deformations.
0015 //
0016 /// The 'old' methods without the track predictions simply call
0017 /// the method of the actual topology.
0018 ///
0019 ///  \author    : Andreas Mussgiller
0020 ///  date       : December 2010
0021 
0022 #include "Geometry/CommonTopologies/interface/SurfaceDeformation.h"
0023 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0024 #include "Geometry/MTDGeometryBuilder/interface/MTDGeomDetType.h"
0025 
0026 class Plane;
0027 
0028 class ProxyMTDTopology final : public PixelTopology {
0029 public:
0030   ProxyMTDTopology(MTDGeomDetType const *type, Plane *bp);
0031 
0032   LocalPoint localPosition(const MeasurementPoint &) const override;
0033   /// conversion taking also the predicted track state
0034   LocalPoint localPosition(const MeasurementPoint &mp, const Topology::LocalTrackPred &trkPred) const override;
0035 
0036   LocalError localError(const MeasurementPoint &, const MeasurementError &) const override;
0037   /// conversion taking also the predicted track state
0038   LocalError localError(const MeasurementPoint &mp,
0039                         const MeasurementError &me,
0040                         const Topology::LocalTrackPred &trkPred) const override;
0041 
0042   MeasurementPoint measurementPosition(const LocalPoint &) const override;
0043   MeasurementPoint measurementPosition(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const override;
0044 
0045   MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override;
0046   MeasurementError measurementError(const LocalPoint &lp,
0047                                     const LocalError &le,
0048                                     const Topology::LocalTrackAngles &dir) const override;
0049 
0050   int channel(const LocalPoint &) const override;
0051   int channel(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const override;
0052 
0053   std::pair<float, float> pixel(const LocalPoint &p) const override;
0054   /// conversion taking also the angle from the track state
0055   std::pair<float, float> pixel(const LocalPoint &p, const Topology::LocalTrackAngles &ltp) const override;
0056 
0057   std::pair<float, float> pitch() const override { return specificTopology().pitch(); }
0058   int nrows() const override { return specificTopology().nrows(); }
0059   int ncolumns() const override { return specificTopology().ncolumns(); }
0060   int rocsY() const override { return specificTopology().rocsY(); }
0061   int rocsX() const override { return specificTopology().rocsX(); }
0062   int rowsperroc() const override { return specificTopology().rowsperroc(); }
0063   int colsperroc() const override { return specificTopology().colsperroc(); }
0064   float localX(const float mpX) const override;
0065   float localX(const float mpX, const Topology::LocalTrackPred &trkPred) const override;
0066   float localY(const float mpY) const override;
0067   float localY(const float mpY, const Topology::LocalTrackPred &trkPred) const override;
0068 
0069   bool isItBigPixelInX(const int ixbin) const override { return specificTopology().isItBigPixelInX(ixbin); }
0070   bool isItBigPixelInY(const int iybin) const override { return specificTopology().isItBigPixelInY(iybin); }
0071   bool containsBigPixelInX(int ixmin, int ixmax) const override {
0072     return specificTopology().containsBigPixelInX(ixmin, ixmax);
0073   }
0074   bool containsBigPixelInY(int iymin, int iymax) const override {
0075     return specificTopology().containsBigPixelInY(iymin, iymax);
0076   }
0077 
0078   bool isItEdgePixelInX(int ixbin) const override { return specificTopology().isItEdgePixelInX(ixbin); }
0079   bool isItEdgePixelInY(int iybin) const override { return specificTopology().isItEdgePixelInY(iybin); }
0080   bool isItEdgePixel(int ixbin, int iybin) const override { return specificTopology().isItEdgePixel(ixbin, iybin); }
0081 
0082   virtual const GeomDetType &type() const { return *theType; }
0083 
0084   virtual MTDGeomDetType const &specificType() const { return *theType; }
0085 
0086   const SurfaceDeformation *surfaceDeformation() const { return theSurfaceDeformation.operator->(); }
0087   virtual void setSurfaceDeformation(const SurfaceDeformation *deformation);
0088 
0089   virtual const PixelTopology &specificTopology() const { return specificType().specificTopology(); }
0090 
0091 private:
0092   /// Internal method to get correction of the position from SurfaceDeformation,
0093   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0094   SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos,
0095                                                        const Topology::LocalTrackAngles &dir) const;
0096   /// Internal method to get correction of the position from SurfaceDeformation,
0097   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0098   SurfaceDeformation::Local2DVector positionCorrection(const Topology::LocalTrackPred &trk) const;
0099 
0100   MTDGeomDetType const *theType;
0101   float theLength, theWidth;
0102   std::unique_ptr<const SurfaceDeformation> theSurfaceDeformation;
0103 };
0104 
0105 #endif