CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoTracker/TransientTrackingRecHit/interface/TRecHit5DParamConstraint.h

Go to the documentation of this file.
00001 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit5DParamConstraint_H
00002 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit5DParamConstraint_H
00003 
00004 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00005 #include "DataFormats/GeometryCommonDetAlgo/interface/ErrorFrameTransformer.h"
00006 #include "DataFormats/CLHEP/interface/Migration.h"
00007 
00008 class GeomDetUnit;
00009 
00010 class TRecHit5DParamConstraint GCC11_FINAL : public TransientTrackingRecHit {
00011 
00012 private:
00013 
00014   TRecHit5DParamConstraint( const TrajectoryStateOnSurface& tsos ) : tsos_( tsos ) {}
00015 
00016   TRecHit5DParamConstraint( const TRecHit5DParamConstraint& other ) : tsos_( other.trajectoryState() ) {}
00017 
00018 public:
00019 
00020   virtual ~TRecHit5DParamConstraint() {}
00021 
00022   virtual int dimension() const { return 5; }
00023 
00024   virtual AlgebraicMatrix projectionMatrix() const {
00025     AlgebraicMatrix projectionMatrix( 5, 5, 1 );
00026     return projectionMatrix;
00027   }
00028 
00029   virtual AlgebraicVector parameters() const { return asHepVector( tsos_.localParameters().vector() ); }
00030 
00031   virtual AlgebraicSymMatrix parametersError() const { return asHepMatrix( tsos_.localError().matrix() ); }
00032 
00033   virtual LocalPoint localPosition() const { return tsos_.localPosition(); }
00034 
00035   virtual LocalError localPositionError() const { return tsos_.localError().positionError(); }
00036 
00037   virtual int charge() const { return tsos_.charge(); }
00038 
00039   virtual bool canImproveWithTrack() const { return false; }
00040 
00041   virtual const TrackingRecHit* hit() const { return 0; }
00042   virtual TrackingRecHit * cloneHit() const { return 0;}
00043   
00044   virtual std::vector<const TrackingRecHit*> recHits() const { return std::vector<const TrackingRecHit*>(); }
00045   virtual std::vector<TrackingRecHit*> recHits() { return std::vector<TrackingRecHit*>(); }
00046   virtual bool sharesInput( const TrackingRecHit*, SharedInputType) const { return false;}
00047 
00048 
00049   virtual const GeomDetUnit* detUnit() const { return 0; }
00050 
00051   virtual const GeomDet* det() const { return 0; }
00052 
00053   virtual const Surface* surface() const { return &tsos_.surface(); }
00054 
00055   virtual GlobalPoint globalPosition() const { return  surface()->toGlobal(localPosition());}
00056   virtual GlobalError globalPositionError() const { return ErrorFrameTransformer().transform( localPositionError(), *surface() );}
00057   virtual float errorGlobalR() const { return std::sqrt(globalPositionError().rerr(globalPosition()));}
00058   virtual float errorGlobalZ() const { return std::sqrt(globalPositionError().czz()); }
00059   virtual float errorGlobalRPhi() const { return globalPosition().perp()*sqrt(globalPositionError().phierr(globalPosition())); }
00060 
00061 
00062   virtual TransientTrackingRecHit::RecHitPointer clone( const TrajectoryStateOnSurface& tsos ) const {
00063     //return new TRecHit5DParamConstraint( this->trajectoryState() );
00064     return new TRecHit5DParamConstraint( tsos );
00065   }
00066 
00067   static TransientTrackingRecHit::RecHitPointer build( const TrajectoryStateOnSurface& tsos ) {
00068     return RecHitPointer( new TRecHit5DParamConstraint( tsos ) );
00069   }
00070 
00071 private:
00072 
00073   const TrajectoryStateOnSurface tsos_;
00074   
00075   virtual TRecHit5DParamConstraint* clone() const {
00076     return new TRecHit5DParamConstraint( this->trajectoryState() );
00077   }
00078 
00079   const TrajectoryStateOnSurface& trajectoryState() const { return tsos_; }
00080 
00081 };
00082 
00083 #endif