00001 #include "RecoTracker/TransientTrackingRecHit/interface/ProjectedRecHit2D.h" 00002 #include "TrackingTools/TransientTrackingRecHit/interface/TrackingRecHitProjector.h" 00003 #include "RecoTracker/TransientTrackingRecHit/interface/TSiStripRecHit2DLocalPos.h" 00004 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h" 00005 00006 00007 ProjectedRecHit2D::ProjectedRecHit2D( const LocalPoint& pos, const LocalError& err, 00008 const GeomDet* det, const GeomDet* originalDet, 00009 const TransientTrackingRecHit& originalTransientHit, 00010 float weight, float annealing ) : 00011 GenericTransientTrackingRecHit( det, new ProjectedSiStripRecHit2D( pos, err, det->geographicalId(), 00012 static_cast<const SiStripRecHit2D*>(originalTransientHit.hit())),weight, annealing) 00013 { 00014 const TSiStripRecHit2DLocalPos* specificOriginalTransientHit = static_cast<const TSiStripRecHit2DLocalPos*>(&originalTransientHit); 00015 theCPE = specificOriginalTransientHit->cpe(); 00016 theOriginalDet = originalDet; 00017 } 00018 00019 ProjectedRecHit2D::RecHitPointer 00020 ProjectedRecHit2D::clone( const TrajectoryStateOnSurface& ts) const 00021 { 00022 if (theCPE != 0) { 00023 TrackingRecHitProjector<ProjectedRecHit2D> proj; 00024 if(!originalHit().cluster().isNull()){ 00025 const SiStripCluster& clust = *(originalHit().cluster()); 00026 00027 StripClusterParameterEstimator::LocalValues lv = 00028 theCPE->localParameters( clust, *detUnit(), ts.localParameters()); 00029 00030 RecHitPointer updatedOriginalHit = 00031 TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet, 00032 originalHit().cluster(), theCPE, weight(), getAnnealingFactor()); 00033 00034 RecHitPointer hit = proj.project( *updatedOriginalHit, *det(), ts); 00035 00036 return hit; 00037 }else{ 00038 const SiStripCluster& clust = *(originalHit().cluster_regional()); 00039 00040 StripClusterParameterEstimator::LocalValues lv = 00041 theCPE->localParameters( clust, *detUnit(), ts.localParameters()); 00042 00043 RecHitPointer updatedOriginalHit = 00044 TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet, 00045 originalHit().cluster_regional(), theCPE, weight(), getAnnealingFactor()); 00046 00047 RecHitPointer hit = proj.project( *updatedOriginalHit, *det(), ts); 00048 00049 return hit; 00050 00051 } 00052 } 00054 else return clone(); 00055 } 00056 00057 TransientTrackingRecHit::ConstRecHitContainer 00058 ProjectedRecHit2D::transientHits () const { 00059 ConstRecHitContainer result; 00060 result.push_back(TSiStripRecHit2DLocalPos::build( theOriginalDet,&originalHit(),theCPE)); 00061 00062 return result; 00063 }