CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Geometry/CommonTopologies/interface/Topology.h

Go to the documentation of this file.
00001 #ifndef Geometry_CommonTopologies_Topology_H
00002 #define Geometry_CommonTopologies_Topology_H
00003 
00004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00005 #include "DataFormats/GeometryCommonDetAlgo/interface/LocalError.h"
00006 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementPoint.h"
00007 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementError.h"
00008 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
00009 
00010 class GeomDetType;
00011 
00039 class Topology {
00040 public:
00041   typedef Basic2DVector<double> Vector2D;
00042   typedef Vector2D::MathVector MathVector2D;
00044   class LocalTrackAngles : public Vector2D {
00045   public:
00046     typedef  Basic2DVector<double> Base;
00047     LocalTrackAngles(const Base & v) : Base(v) {}
00048     LocalTrackAngles(double dxdz, double dydz) : Base(dxdz,dydz) {}
00049     double dxdz() const { return x(); }
00050     double dydz() const { return y(); }
00051   };
00052     typedef Point2DBase <double, LocalTag> Local2DPoint;
00055     class LocalTrackPred {
00056     public:
00057     LocalTrackPred(double x, double y, double dxdz, double dydz) : point_(x,y),angles_(dxdz,dydz){}
00060     LocalTrackPred(const AlgebraicVector5& localTrajPar) :
00061       point_(localTrajPar[3], localTrajPar[4]), angles_(localTrajPar[1], localTrajPar[2]) {}
00062       const Local2DPoint& point() const {return point_;}
00063       const LocalTrackAngles& angles() const {return angles_;}
00064     private:
00065       Local2DPoint     point_; 
00066       LocalTrackAngles angles_;
00067     };
00068     
00069   virtual ~Topology() {}
00070   
00071   // Conversion between measurement (strip, pixel, ...) coordinates
00072   // and local cartesian coordinates
00073 
00074   virtual LocalPoint localPosition( const MeasurementPoint& ) const = 0;
00075 
00076   virtual LocalError 
00077   localError( const MeasurementPoint&, const MeasurementError& ) const = 0;
00078 
00079   virtual MeasurementPoint measurementPosition( const LocalPoint&) const = 0;
00080 
00081   virtual MeasurementError 
00082   measurementError( const LocalPoint&, const LocalError& ) const = 0;
00083 
00084   virtual int channel( const LocalPoint& p) const = 0;
00085 
00086   // new sets of methods taking also an angle
00088   virtual LocalPoint localPosition(const MeasurementPoint &mp, const LocalTrackPred &/*trkPred*/) const {
00089       return localPosition(mp);
00090   }
00091 
00093   virtual LocalError 
00094   localError(const MeasurementPoint &mp, const MeasurementError &me,
00095              const LocalTrackPred &/*trkPred*/) const {
00096       return localError(mp,me);
00097   }
00098 
00100   virtual MeasurementPoint measurementPosition( const LocalPoint &lp, const LocalTrackAngles &/*dir*/) const {
00101       return measurementPosition(lp);
00102   }
00103 
00105   virtual MeasurementError 
00106   measurementError( const LocalPoint &lp, const LocalError &le, const LocalTrackAngles &/*dir*/) const {
00107       return measurementError(lp, le);
00108   }
00109 
00111   virtual int channel( const LocalPoint &lp, const LocalTrackAngles &/*dir*/) const {
00112       return channel(lp);
00113   }
00114 
00115 
00116 private:
00117 
00118 };
00119 
00120 #endif