Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:49:59

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 #include <memory>
0027 
0028 class Plane;
0029 
0030 class ProxyMTDTopology final : public PixelTopology {
0031 public:
0032   ProxyMTDTopology(MTDGeomDetType const *type, Plane *bp);
0033 
0034   LocalPoint localPosition(const MeasurementPoint &) const override;
0035   /// conversion taking also the predicted track state
0036   LocalPoint localPosition(const MeasurementPoint &mp, const Topology::LocalTrackPred &trkPred) const override;
0037 
0038   LocalError localError(const MeasurementPoint &, const MeasurementError &) const override;
0039   /// conversion taking also the predicted track state
0040   LocalError localError(const MeasurementPoint &mp,
0041                         const MeasurementError &me,
0042                         const Topology::LocalTrackPred &trkPred) const override;
0043 
0044   MeasurementPoint measurementPosition(const LocalPoint &) const override;
0045   MeasurementPoint measurementPosition(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const override;
0046 
0047   MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override;
0048   MeasurementError measurementError(const LocalPoint &lp,
0049                                     const LocalError &le,
0050                                     const Topology::LocalTrackAngles &dir) const override;
0051 
0052   int channel(const LocalPoint &) const override;
0053   int channel(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const override;
0054 
0055   std::pair<float, float> pixel(const LocalPoint &p) const override;
0056   /// conversion taking also the angle from the track state
0057   std::pair<float, float> pixel(const LocalPoint &p, const Topology::LocalTrackAngles &ltp) const override;
0058 
0059   std::pair<float, float> pitch() const override { return specificTopology().pitch(); }
0060   int nrows() const override { return specificTopology().nrows(); }
0061   int ncolumns() const override { return specificTopology().ncolumns(); }
0062   int rocsY() const override { return specificTopology().rocsY(); }
0063   int rocsX() const override { return specificTopology().rocsX(); }
0064   int rowsperroc() const override { return specificTopology().rowsperroc(); }
0065   int colsperroc() const override { return specificTopology().colsperroc(); }
0066   float localX(const float mpX) const override;
0067   float localX(const float mpX, const Topology::LocalTrackPred &trkPred) const override;
0068   float localY(const float mpY) const override;
0069   float localY(const float mpY, const Topology::LocalTrackPred &trkPred) const override;
0070 
0071   bool isItBigPixelInX(const int ixbin) const override { return specificTopology().isItBigPixelInX(ixbin); }
0072   bool isItBigPixelInY(const int iybin) const override { return specificTopology().isItBigPixelInY(iybin); }
0073   bool containsBigPixelInX(int ixmin, int ixmax) const override {
0074     return specificTopology().containsBigPixelInX(ixmin, ixmax);
0075   }
0076   bool containsBigPixelInY(int iymin, int iymax) const override {
0077     return specificTopology().containsBigPixelInY(iymin, iymax);
0078   }
0079 
0080   bool isItEdgePixelInX(int ixbin) const override { return specificTopology().isItEdgePixelInX(ixbin); }
0081   bool isItEdgePixelInY(int iybin) const override { return specificTopology().isItEdgePixelInY(iybin); }
0082   bool isItEdgePixel(int ixbin, int iybin) const override { return specificTopology().isItEdgePixel(ixbin, iybin); }
0083 
0084   virtual const GeomDetType &type() const { return *theType; }
0085 
0086   virtual MTDGeomDetType const &specificType() const { return *theType; }
0087 
0088   const SurfaceDeformation *surfaceDeformation() const { return theSurfaceDeformation.operator->(); }
0089   virtual void setSurfaceDeformation(const SurfaceDeformation *deformation);
0090 
0091   virtual const PixelTopology &specificTopology() const { return specificType().specificTopology(); }
0092 
0093 private:
0094   /// Internal method to get correction of the position from SurfaceDeformation,
0095   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0096   SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos,
0097                                                        const Topology::LocalTrackAngles &dir) const;
0098   /// Internal method to get correction of the position from SurfaceDeformation,
0099   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0100   SurfaceDeformation::Local2DVector positionCorrection(const Topology::LocalTrackPred &trk) const;
0101 
0102   MTDGeomDetType const *theType;
0103   float theLength, theWidth;
0104   std::unique_ptr<const SurfaceDeformation> theSurfaceDeformation;
0105 };
0106 
0107 #endif