00001 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
00002 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
00003
00004 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
00005 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00006 #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h"
00007 #include "TrackingTools/TransientTrackingRecHit/interface/HelpertRecHit2DLocalPos.h"
00008 #include "DataFormats/Common/interface/RefGetter.h"
00009 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00010
00011 class TSiStripRecHit2DLocalPos : public TransientTrackingRecHit{
00012 public:
00013
00014 typedef SiStripRecHit2D::ClusterRef SiStripClusterRef;
00015
00016 typedef edm::LazyGetter<SiStripCluster>::value_ref SiStripRegionalClusterRef;
00017
00018 virtual ~TSiStripRecHit2DLocalPos() {}
00019
00020
00021 virtual void getKfComponents( KfComponentsHolder & holder ) const {
00022 HelpertRecHit2DLocalPos().getKfComponents(holder, theHitData, *det());
00023 }
00024
00025 virtual AlgebraicVector parameters() const {return theHitData.parameters();}
00026 virtual AlgebraicSymMatrix parametersError() const {
00027 return HelpertRecHit2DLocalPos().parError( theHitData.localPositionError(), *det());
00028
00029 }
00030
00031 virtual AlgebraicMatrix projectionMatrix() const {return theHitData.projectionMatrix();}
00032 virtual int dimension() const {return theHitData.dimension();}
00033
00034 virtual LocalPoint localPosition() const {return theHitData.localPosition();}
00035 virtual LocalError localPositionError() const {return theHitData.localPositionError();}
00036
00037 virtual const TrackingRecHit * hit() const {return &theHitData;};
00038
00039 virtual std::vector<const TrackingRecHit*> recHits() const {
00040 return hit()->recHits();
00041 }
00042 virtual std::vector<TrackingRecHit*> recHits() {
00043 return theHitData.recHits();
00044 }
00045
00046 virtual const GeomDetUnit* detUnit() const;
00047
00048 virtual bool canImproveWithTrack() const {return true;}
00049
00050
00051 virtual RecHitPointer clone(const TrajectoryStateOnSurface& ts) const;
00052
00053
00054
00055 const SiStripRecHit2D* specificHit() const {return &theHitData;};
00056 const StripClusterParameterEstimator* cpe() const {return theCPE;}
00057
00058 static RecHitPointer build( const GeomDet * geom, const SiStripRecHit2D* rh,
00059 const StripClusterParameterEstimator* cpe,
00060 float weight=1., float annealing=1.) {
00061 return RecHitPointer( new TSiStripRecHit2DLocalPos( geom, rh, cpe, weight, annealing));
00062 }
00063
00064 static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
00065 const GeomDet* det,
00066 const SiStripClusterRef clust,
00067 const StripClusterParameterEstimator* cpe,
00068 float weight=1., float annealing=1.) {
00069 return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, clust, cpe, weight, annealing));
00070 }
00071
00072 static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
00073 const GeomDet* det,
00074 const SiStripRegionalClusterRef clust,
00075 const StripClusterParameterEstimator* cpe,
00076 float weight=1., float annealing=1.) {
00077 return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, clust, cpe, weight, annealing));
00078 }
00079
00080
00081
00082 private:
00083
00084 SiStripRecHit2D theHitData;
00085 const StripClusterParameterEstimator* theCPE;
00086
00087 TSiStripRecHit2DLocalPos (const GeomDet * geom, const SiStripRecHit2D* rh,
00088 const StripClusterParameterEstimator* cpe,
00089 float weight, float annealing) :
00090 TransientTrackingRecHit(geom, weight, annealing), theHitData(*rh), theCPE(cpe)
00091 {}
00092
00094 TSiStripRecHit2DLocalPos( const LocalPoint& pos, const LocalError& err,
00095 const GeomDet* det,
00096 const SiStripClusterRef clust,
00097 const StripClusterParameterEstimator* cpe,
00098 float weight, float annealing) :
00099 TransientTrackingRecHit(det, weight, annealing), theHitData(pos, err, det->geographicalId(), clust),
00100 theCPE(cpe){}
00101
00102
00103
00104
00105
00106
00107 TSiStripRecHit2DLocalPos( const LocalPoint& pos, const LocalError& err,
00108 const GeomDet* det,
00109 const SiStripRegionalClusterRef clust,
00110 const StripClusterParameterEstimator* cpe,
00111 float weight, float annealing) :
00112 TransientTrackingRecHit(det, weight, annealing), theHitData(pos, err, det->geographicalId(), clust),
00113 theCPE(cpe){}
00114
00115
00116
00117 virtual TSiStripRecHit2DLocalPos* clone() const {
00118 return new TSiStripRecHit2DLocalPos(*this);
00119 }
00120
00121 };
00122
00123 #endif