Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:26

0001 #ifndef Geometry_TrackerTopology_ProxyStripTopology_H
0002 #define Geometry_TrackerTopology_ProxyStripTopology_H
0003 
0004 /// ProxyStripTopology
0005 ///
0006 /// Class derived from StripTopology that serves as a proxy to the
0007 /// actual topology for a given StripGeomDetType. In addition, the
0008 /// class holds a pointer to the surface deformation parameters.
0009 /// ProxyStripTopology takes over ownership of the surface
0010 /// deformation parameters.
0011 ///
0012 /// All inherited virtual methods that take the
0013 /// predicted track state as a parameter are reimplemented in order
0014 /// to apply corrections due to the surface deformations.
0015 //
0016 /// The 'old' methods without the track predictions simply call
0017 /// the method of the actual StripTopology.
0018 /// While one could easily deduce corrections from the given
0019 /// LocalPosition (and track angles 0) when converting from local frame
0020 /// to measurement frame, this is not done to be consistent with the
0021 /// methods converting the other way round where the essential y-coordinate
0022 /// is basically missing (it is a 1D strip detector...)
0023 ///
0024 ///  \author    : Andreas Mussgiller
0025 ///  date       : November 2010
0026 
0027 #include "Geometry/CommonTopologies/interface/SurfaceDeformation.h"
0028 #include "Geometry/CommonTopologies/interface/StripTopology.h"
0029 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
0030 #include <memory>
0031 
0032 class Plane;
0033 
0034 class ProxyStripTopology final : public StripTopology {
0035 public:
0036   ProxyStripTopology(StripGeomDetType const* type, Plane* bp);
0037 
0038   LocalPoint localPosition(const MeasurementPoint& mp) const override { return specificTopology().localPosition(mp); }
0039   /// conversion taking also the predicted track state
0040   LocalPoint localPosition(const MeasurementPoint& mp, const Topology::LocalTrackPred& trkPred) const override;
0041 
0042   LocalPoint localPosition(float strip) const override { return specificTopology().localPosition(strip); }
0043   /// conversion taking also the predicted track state
0044   LocalPoint localPosition(float strip, const Topology::LocalTrackPred& trkPred) const override;
0045 
0046   LocalError localError(float strip, float stripErr2) const override {
0047     return specificTopology().localError(strip, stripErr2);
0048   }
0049   /// conversion taking also the predicted track state
0050   LocalError localError(float strip, float stripErr2, const Topology::LocalTrackPred& trkPred) const override;
0051 
0052   LocalError localError(const MeasurementPoint& mp, const MeasurementError& me) const override {
0053     return specificTopology().localError(mp, me);
0054   }
0055   /// conversion taking also the predicted track state
0056   LocalError localError(const MeasurementPoint& mp,
0057                         const MeasurementError& me,
0058                         const Topology::LocalTrackPred& trkPred) const override;
0059 
0060   MeasurementPoint measurementPosition(const LocalPoint& lp) const override {
0061     return specificTopology().measurementPosition(lp);
0062   }
0063   MeasurementPoint measurementPosition(const LocalPoint& lp, const Topology::LocalTrackAngles& dir) const override;
0064 
0065   MeasurementError measurementError(const LocalPoint& lp, const LocalError& le) const override {
0066     return specificTopology().measurementError(lp, le);
0067   }
0068   MeasurementError measurementError(const LocalPoint& lp,
0069                                     const LocalError& le,
0070                                     const Topology::LocalTrackAngles& dir) const override;
0071 
0072   int channel(const LocalPoint& lp) const override { return specificTopology().channel(lp); }
0073   int channel(const LocalPoint& lp, const Topology::LocalTrackAngles& dir) const override;
0074 
0075   float strip(const LocalPoint& lp) const override { return specificTopology().strip(lp); }
0076   /// conversion taking also the track state (LocalTrajectoryParameters)
0077   float strip(const LocalPoint& lp, const Topology::LocalTrackAngles& dir) const override;
0078 
0079   float coveredStrips(const LocalPoint& lp1, const LocalPoint& lp2) const override {
0080     return specificTopology().coveredStrips(lp1, lp2);
0081   }
0082 
0083   float pitch() const override { return specificTopology().pitch(); }
0084   float localPitch(const LocalPoint& lp) const override { return specificTopology().localPitch(lp); }
0085   /// conversion taking also the angle from the track state (LocalTrajectoryParameters)
0086   float localPitch(const LocalPoint& lp, const Topology::LocalTrackAngles& dir) const override;
0087 
0088   float stripAngle(float strip) const override { return specificTopology().stripAngle(strip); }
0089 
0090   int nstrips() const override { return specificTopology().nstrips(); }
0091 
0092   float stripLength() const override { return specificTopology().stripLength(); }
0093   float localStripLength(const LocalPoint& lp) const override { return specificTopology().localStripLength(lp); }
0094   float localStripLength(const LocalPoint& lp, const Topology::LocalTrackAngles& dir) const override;
0095 
0096   virtual const GeomDetType& type() const { return *theType; }
0097   virtual StripGeomDetType const& specificType() const { return *theType; }
0098 
0099   const SurfaceDeformation* surfaceDeformation() const { return theSurfaceDeformation.operator->(); }
0100   virtual void setSurfaceDeformation(const SurfaceDeformation* deformation);
0101 
0102   virtual const StripTopology& specificTopology() const { return specificType().specificTopology(); }
0103 
0104 private:
0105   /// Internal method to get correction of the position from SurfaceDeformation,
0106   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0107   SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint& pos,
0108                                                        const Topology::LocalTrackAngles& dir) const;
0109   /// Internal method to get correction of the position from SurfaceDeformation,
0110   /// must not be called if 'theSurfaceDeformation' is a null pointer.
0111   SurfaceDeformation::Local2DVector positionCorrection(const Topology::LocalTrackPred& trk) const;
0112 
0113   StripGeomDetType const* theType;
0114   float theLength, theWidth;
0115   std::unique_ptr<const SurfaceDeformation> theSurfaceDeformation;
0116 };
0117 
0118 #endif