Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-22 04:03:02

0001 #ifndef Geometry_CommonTopologies_ProxyPixelTopology_H
0002 #define Geometry_CommonTopologies_ProxyPixelTopology_H
0003 
0004 /// ProxyStripTopology
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 /// ProxyPixelTopology 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/CommonTopologies/interface/PixelGeomDetType.h"
0025 
0026 #include <memory>
0027 
0028 class Plane;
0029 
0030 class ProxyPixelTopology final : public PixelTopology {
0031 public:
0032   ProxyPixelTopology(PixelGeomDetType 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   bool bigpixelsX() const override { return specificTopology().bigpixelsX(); }
0067   bool bigpixelsY() const override { return specificTopology().bigpixelsY(); }
0068   float localX(const float mpX) const override;
0069   float localX(const float mpX, const Topology::LocalTrackPred &trkPred) const override;
0070   float localY(const float mpY) const override;
0071   float localY(const float mpY, const Topology::LocalTrackPred &trkPred) const override;
0072 
0073   bool isItBigPixelInX(const int ixbin) const override { return specificTopology().isItBigPixelInX(ixbin); }
0074   bool isItBigPixelInY(const int iybin) const override { return specificTopology().isItBigPixelInY(iybin); }
0075   float pixelFractionInX(int ixbin) const override { return specificTopology().pixelFractionInX(ixbin); }
0076   float pixelFractionInY(int iybin) const override { return specificTopology().pixelFractionInY(iybin); }
0077   bool containsBigPixelInX(int ixmin, int ixmax) const override {
0078     return specificTopology().containsBigPixelInX(ixmin, ixmax);
0079   }
0080   bool containsBigPixelInY(int iymin, int iymax) const override {
0081     return specificTopology().containsBigPixelInY(iymin, iymax);
0082   }
0083 
0084   bool isItEdgePixelInX(int ixbin) const override { return specificTopology().isItEdgePixelInX(ixbin); }
0085   bool isItEdgePixelInY(int iybin) const override { return specificTopology().isItEdgePixelInY(iybin); }
0086   bool isItEdgePixel(int ixbin, int iybin) const override { return specificTopology().isItEdgePixel(ixbin, iybin); }
0087 
0088   virtual const GeomDetType &type() const { return *theType; }
0089 
0090   virtual PixelGeomDetType const &specificType() const { return *theType; }
0091 
0092   const SurfaceDeformation *surfaceDeformation() const { return theSurfaceDeformation.operator->(); }
0093   virtual void setSurfaceDeformation(const SurfaceDeformation *deformation);
0094 
0095   virtual const PixelTopology &specificTopology() const { return specificType().specificTopology(); }
0096 
0097 private:
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 LocalPoint &pos,
0101                                                        const Topology::LocalTrackAngles &dir) const;
0102   /// Internal method to get correction of the position from SurfaceDeformation,
0103   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0104   SurfaceDeformation::Local2DVector positionCorrection(const Topology::LocalTrackPred &trk) const;
0105 
0106   PixelGeomDetType const *theType;
0107   float theLength, theWidth;
0108   std::unique_ptr<const SurfaceDeformation> theSurfaceDeformation;
0109 };
0110 
0111 #endif