CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoMuon/TrackerSeedGenerator/interface/L1MuonPixelTrackFitter.h

Go to the documentation of this file.
00001 #ifndef RecoMuon_TrackerSeedGenerator_L1MuonPixelTrackFitter_H
00002 #define RecoMuon_TrackerSeedGenerator_L1MuonPixelTrackFitter_H
00003 
00004 #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelFitter.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 
00007 #include "DataFormats/GeometryVector/interface/GlobalTag.h"
00008 #include "DataFormats/GeometryVector/interface/Vector3DBase.h"
00009 #include "DataFormats/GeometryVector/interface/Point3DBase.h"
00010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00011 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00012 
00013 #include <vector>
00014 
00015 namespace edm {class EventSetup;}
00016 namespace reco { class Track;}
00017 
00018 class TrackingRegion;
00019 class TrackingRecHit;
00020 class L1MuGMTCand;
00021 class PixelRecoLineRZ;
00022 class SeedingHitSet;
00023 
00024 class L1MuonPixelTrackFitter : public PixelFitter {
00025 
00026 public:
00027   class Circle {
00028   public:
00029     typedef Vector3DBase< long double, GlobalTag>  Vector;
00030     typedef  Point3DBase< long double, GlobalTag>  Point;
00031     Circle() : theValid(false) {}
00032     Circle(const GlobalPoint& h1, const GlobalPoint& h2, double curvature):theCurvature(curvature){
00033       Point p1(h1); Point p2(h2); Vector dp = (p2-p1)/2.; int charge = theCurvature > 0 ? 1 : -1;
00034       Vector ec = charge * dp.cross(Vector(0,0,1)).unit();
00035       long double dist_tmp = 1./theCurvature/theCurvature - dp.perp2();
00036       theValid = (dist_tmp > 0.);
00037       theCenter = p1+dp + ec*sqrt( fabs(dist_tmp ) );
00038     }
00039     bool   isValid() const { return theValid; }
00040     const  Point & center() const { return theCenter; }
00041     const long double & curvature() const { return theCurvature; }
00042   private:
00043     bool theValid;
00044     long double theCurvature;
00045     Point theCenter;
00046   };
00047 
00048 public:
00049   L1MuonPixelTrackFitter() {}
00050   L1MuonPixelTrackFitter( const edm::ParameterSet& cfg);
00051 
00052   virtual ~L1MuonPixelTrackFitter(){}
00053 
00054   void setL1Constraint(const L1MuGMTCand& muon);
00055   void setPxConstraint(const SeedingHitSet & hits);
00056 
00057   virtual reco::Track* run( 
00058       const edm::EventSetup& es,
00059       const std::vector<const TrackingRecHit *>& hits, 
00060       const TrackingRegion& region) const;
00061 
00062   static double getBending( double invPt, double eta, int charge);
00063   static double getBendingError(double invPt, double eta);
00064 private:
00065 
00066   double valInversePt( double phi0, double phiL1, double eta) const;
00067   double errInversePt(double invPt, double eta) const;
00068 
00069   double valPhi(const Circle &c, int charge) const;
00070   double errPhi(double invPt, double eta) const;
00071 
00072   double valCotTheta(const PixelRecoLineRZ& line) const;
00073   double errCotTheta(double invPt, double eta) const;
00074 
00075   double valZip(double curvature, const GlobalPoint& p0, const GlobalPoint& p1) const;
00076   double errZip(double invPt, double eta) const;
00077 
00078   double valTip(const Circle &c, double curvature) const;
00079   double errTip(double invPt, double eta) const;
00080 
00081   double findPt(double phi0, double phiL1, double eta, int charge) const;
00082   double deltaPhi( double phi1, double phi2) const;
00083   static void param( double eta, double &p1, double& p2, double& p3);
00084 
00085 private:
00086 
00087   edm::ParameterSet theConfig;
00088 
00089   // L1 constraint
00090   double thePhiL1, theEtaL1; int theChargeL1;
00091 
00092   // Px constraint
00093   GlobalPoint theHit1, theHit2;
00094 
00095 private:
00096   friend class L1Seeding;
00097 };
00098 #endif