CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoTracker/RoadSearchSeedFinder/interface/RoadSearchCircleSeed.h

Go to the documentation of this file.
00001 #ifndef RoadSearchCircleSeed_h
00002 #define RoadSearchCircleSeed_h
00003 
00004 //
00005 // Package:         RecoTracker/RoadSearchSeedFinder
00006 // Class:           RoadSearchCircleSeed
00007 // 
00008 // Description:     circle from three global points in 2D 
00009 //                  all data members restricted to 2 dimensions
00010 //
00011 // Original Author: Oliver Gutsche, gutsche@fnal.gov
00012 // Created:         Mon Jan 22 21:42:35 UTC 2007
00013 //
00014 // $Author: mkirn $
00015 // $Date: 2007/09/07 16:28:51 $
00016 // $Revision: 1.7 $
00017 //
00018 
00019 #include <utility>
00020 #include <vector>
00021 #include <iosfwd>
00022 
00023 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00024 
00025 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00026 
00027 #include "RecoTracker/RoadMapRecord/interface/Roads.h"
00028 
00029 class RoadSearchCircleSeed
00030 {
00031  public:
00032 
00033   // line, first parameter slope, second offset
00034   typedef std::pair<double,double> line;
00035 
00036   enum type {
00037     circle,
00038     straightLine
00039   };
00040   
00041   RoadSearchCircleSeed(const TrackingRecHit *hit1,
00042                        const TrackingRecHit *hit2,
00043                        const TrackingRecHit *hit3,
00044                        GlobalPoint &point1,
00045                        GlobalPoint &point2,
00046                        GlobalPoint &point3);
00047   RoadSearchCircleSeed(const TrackingRecHit *hit1,
00048                        const TrackingRecHit *hit2,
00049                        GlobalPoint &point1,
00050                        GlobalPoint &point2);
00051 
00052   ~RoadSearchCircleSeed();
00053 
00054   inline std::vector<GlobalPoint>  Points() const { return points_; }
00055   inline std::vector<GlobalPoint>::const_iterator begin_points() const { return points_.begin(); }
00056   inline std::vector<GlobalPoint>::const_iterator end_points()   const { return points_.end();   }
00057 
00058   inline std::vector<const TrackingRecHit*> Hits() const { return hits_; }
00059   inline std::vector<const TrackingRecHit*>::const_iterator begin_hits() const { return hits_.begin(); }
00060   inline std::vector<const TrackingRecHit*>::const_iterator end_hits()   const { return hits_.end();   }
00061 
00062   inline GlobalPoint  Center()          const { return center_;}
00063   inline double       Radius()          const { return radius_;}
00064   inline double       ImpactParameter() const { return impactParameter_;}
00065   inline double       Eta()             const { return calculateEta(Theta());}
00066   inline double       Type()            const { return type_; }
00067   inline bool         InBarrel()        const { return inBarrel_; }
00068 
00069   inline void                   setSeed(const Roads::RoadSeed *input) { seed_ = input; }
00070   inline const Roads::RoadSeed* getSeed()                             { return seed_;  }
00071 
00072   inline void                   setSet(const Roads::RoadSet *input)   { set_ = input; }
00073   inline const Roads::RoadSet*  getSet()                              { return set_;  }
00074 
00075   bool Compare(const RoadSearchCircleSeed *circle,
00076                double centerCut,
00077                double radiusCut,
00078                unsigned int differentHitsCut) const;
00079 
00080   bool CompareCenter(const RoadSearchCircleSeed *circle,
00081                      double centerCut) const;
00082 
00083   bool CompareRadius(const RoadSearchCircleSeed *circle,
00084                      double radiusCut) const;
00085 
00086   bool CompareDifferentHits(const RoadSearchCircleSeed *circle,
00087                             unsigned int differentHitsCut) const;
00088 
00089   double determinant(double array[][3], unsigned int bins);
00090   bool   calculateInBarrel();
00091   double calculateImpactParameter(GlobalPoint &center,
00092                                   double radius);
00093   double calculateEta(double theta) const;
00094   double Theta       ()             const;
00095   double Phi0        ()             const;
00096 
00097   std::string print() const;
00098 
00099  private:
00100 
00101   std::vector<GlobalPoint> points_;
00102 
00103   std::vector<const TrackingRecHit*> hits_;
00104 
00105   type             type_;
00106   bool             inBarrel_;
00107   GlobalPoint      center_;
00108   double           radius_;
00109   double           impactParameter_;
00110 
00111   const Roads::RoadSeed *seed_;
00112   const Roads::RoadSet  *set_;
00113 
00114 };
00115 
00116 //
00117 // class declaration
00118 //
00119 
00120 class LineRZ {
00121   public:
00122     LineRZ(GlobalPoint point1, GlobalPoint point2);
00123     ~LineRZ();
00124 
00125     inline double Theta() const { return atan2(theR_,theZ_); }
00126 
00127   private:
00128     double theR_;
00129     double theZ_;
00130 };
00131 
00132 //
00133 // class declaration
00134 //
00135 
00136 class LineXY {
00137   public:
00138     LineXY(GlobalPoint point1, GlobalPoint point2);
00139     ~LineXY();
00140 
00141     inline double Phi() const { return atan2(theY_,theX_); }
00142 
00143   private:
00144     double theX_;
00145     double theY_;
00146 };
00147 
00148 std::ostream& operator<<(std::ostream& ost, const RoadSearchCircleSeed & seed);
00149 
00150 #endif