CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/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 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00040 
00041 
00042 class Topology {
00043 public:
00044   typedef Basic2DVector<double> Vector2D;
00045   typedef Vector2D::MathVector MathVector2D;
00047   class LocalTrackAngles : public Vector2D {
00048   public:
00049     typedef  Basic2DVector<double> Base;
00050     LocalTrackAngles(const Base & v) : Base(v) {}
00051     LocalTrackAngles(double dxdz, double dydz) : Base(dxdz,dydz) {}
00052     double dxdz() const { return x(); }
00053     double dydz() const { return y(); }
00054   };
00055     typedef Point2DBase <double, LocalTag> Local2DPoint;
00058     class LocalTrackPred {
00059     public:
00060     LocalTrackPred(double x, double y, double dxdz, double dydz) : point_(x,y),angles_(dxdz,dydz){}
00063     LocalTrackPred(const AlgebraicVector5& localTrajPar) :
00064       point_(localTrajPar[3], localTrajPar[4]), angles_(localTrajPar[1], localTrajPar[2]) {}
00065       const Local2DPoint& point() const {return point_;}
00066       const LocalTrackAngles& angles() const {return angles_;}
00067     private:
00068       Local2DPoint     point_; 
00069       LocalTrackAngles angles_;
00070     };
00071     
00072   virtual ~Topology() {}
00073   
00074   // Conversion between measurement (strip, pixel, ...) coordinates
00075   // and local cartesian coordinates
00076 
00077   virtual LocalPoint localPosition( const MeasurementPoint& ) const = 0;
00078 
00079   virtual LocalError 
00080   localError( const MeasurementPoint&, const MeasurementError& ) const = 0;
00081 
00082   virtual MeasurementPoint measurementPosition( const LocalPoint&) const = 0;
00083 
00084   virtual MeasurementError 
00085   measurementError( const LocalPoint&, const LocalError& ) const = 0;
00086 
00087   virtual int channel( const LocalPoint& p) const = 0;
00088 
00089   // new sets of methods taking also an angle
00091   virtual LocalPoint localPosition(const MeasurementPoint &mp, const LocalTrackPred &/*trkPred*/) const {
00092       return localPosition(mp);
00093   }
00094 
00096   virtual LocalError 
00097   localError(const MeasurementPoint &mp, const MeasurementError &me,
00098              const LocalTrackPred &/*trkPred*/) const {
00099       return localError(mp,me);
00100   }
00101 
00103   virtual MeasurementPoint measurementPosition( const LocalPoint &lp, const LocalTrackAngles &/*dir*/) const {
00104       return measurementPosition(lp);
00105   }
00106 
00108   virtual MeasurementError 
00109   measurementError( const LocalPoint &lp, const LocalError &le, const LocalTrackAngles &/*dir*/) const {
00110       return measurementError(lp, le);
00111   }
00112 
00114   virtual int channel( const LocalPoint &lp, const LocalTrackAngles &/*dir*/) const {
00115       return channel(lp);
00116   }
00117 
00118 
00119 private:
00120 
00121 };
00122 
00123 #endif