CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/RecoTracker/TransientTrackingRecHit/interface/TRecHit1DMomConstraint.h

Go to the documentation of this file.
00001 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
00002 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit1DMomConstraint_H
00003 
00004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00005 
00006 class GeomDetUnit;
00007 
00008 class TRecHit1DMomConstraint GCC11_FINAL : public TransientTrackingRecHit {
00009  public:
00010 
00011   virtual ~TRecHit1DMomConstraint() {}
00012 
00013   virtual AlgebraicVector parameters() const {
00014     AlgebraicVector result(1);
00015     result[0] = charge_/fabs(mom_);
00016     return result;
00017   }
00018   
00019   virtual AlgebraicSymMatrix parametersError() const {
00020     AlgebraicSymMatrix m(1);
00021     m[0][0] = err_/(mom_*mom_);//parametersErrors are squared
00022     m[0][0] *= m[0][0];
00023     return m;
00024   }
00025 
00026   virtual AlgebraicMatrix projectionMatrix() const {
00027     AlgebraicMatrix theProjectionMatrix;
00028     theProjectionMatrix = AlgebraicMatrix( 1, 5, 0);
00029     theProjectionMatrix[0][0] = 1;
00030     return theProjectionMatrix;
00031   }
00032   virtual int dimension() const {return 1;}
00033 
00034   virtual LocalPoint localPosition() const {return LocalPoint(0,0,0);}
00035   virtual LocalError localPositionError() const {return LocalError(0,0,0);}
00036 
00037   double mom() const {return mom_;}
00038   double err() const {return err_;}
00039   int charge() const {return charge_;}
00040 
00041   virtual const TrackingRecHit * hit() const {return 0;}//fixme return invalid
00042   
00043 
00044 
00045   virtual std::vector<const TrackingRecHit*> recHits() const {
00046     return hit()->recHits();
00047   }
00048   virtual std::vector<TrackingRecHit*> recHits() {
00049     return std::vector<TrackingRecHit*>();
00050   }
00051 
00052   virtual bool canImproveWithTrack() const {return false;}
00053 
00054   virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return clone();}
00055 
00056   virtual const GeomDetUnit* detUnit() const {return 0;}
00057   virtual const GeomDet* det() const {return 0;}
00058 
00059   static RecHitPointer build(const int charge,
00060                              const double mom,
00061                              const double err,//not sqared!!!
00062                              const Surface* surface) {
00063     return RecHitPointer( new TRecHit1DMomConstraint( charge, mom, err, surface));
00064   }
00065 
00066   virtual const Surface * surface() const {return surface_;}
00067 
00068  private:
00069   const int    charge_;
00070   const double mom_;
00071   const double err_;
00072   const Surface* surface_;
00074   TRecHit1DMomConstraint(const int charge,
00075                          const double mom,
00076                          const double err,//notsquared
00077                          const Surface* surface): 
00078     charge_(charge),mom_(mom),err_(err),surface_(surface) {}
00079   
00080   TRecHit1DMomConstraint( const TRecHit1DMomConstraint& other ):
00081     charge_( other.charge() ), mom_( other.mom() ),err_( other.err() ), surface_((other.surface())) {}
00082   
00083   virtual TRecHit1DMomConstraint * clone() const {
00084     return new TRecHit1DMomConstraint(*this);
00085   }
00086 
00087 };
00088 
00089 #endif