00001 #ifndef PixelRecoLineRZ_H 00002 #define PixelRecoLineRZ_H 00003 00007 #include "RecoTracker/TkMSParametrization/interface/PixelRecoPointRZ.h" 00008 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00009 00010 class PixelRecoLineRZ { 00011 public: 00012 00013 typedef PixelRecoPointRZ LineOrigin; 00014 00015 PixelRecoLineRZ() { } 00016 00017 PixelRecoLineRZ(const GlobalPoint & p1, const GlobalPoint & p2) 00018 : theOrigin ( LineOrigin( p1.perp(), p1.z()) ), 00019 theCotLine ( initCot(theOrigin.z()-p2.z(), theOrigin.r()-p2.perp()) ) 00020 { } 00021 00022 00023 PixelRecoLineRZ(const LineOrigin & aOrigin, float aCotLine) 00024 : theOrigin(aOrigin), theCotLine(aCotLine) { } 00025 00026 PixelRecoLineRZ(const LineOrigin & aOrigin, const PixelRecoPointRZ & aPoint) 00027 : theOrigin(aOrigin), 00028 theCotLine( initCot( aPoint.z()-aOrigin.z(), aPoint.r()-aOrigin.r() ) ) 00029 { } 00030 00031 float cotLine() const {return theCotLine; } 00032 const LineOrigin & origin() const { return theOrigin; } 00033 00034 float zAtR (float r) const 00035 { return theOrigin.z()+(r-theOrigin.r())*theCotLine; } 00036 float rAtZ (float z) const 00037 { return (fabs(theCotLine) > 1.e-4) ? theOrigin.r()+(z-theOrigin.z())/theCotLine : 99999.; } 00038 00039 private: 00040 float initCot (float dz, float dr) { 00041 return (fabs(dr) > 1.e-4) ? dz/dr : 99999.; 00042 } 00043 private: 00044 LineOrigin theOrigin; 00045 float theCotLine; 00046 }; 00047 #endif