CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoTracker/TransientTrackingRecHit/src/ProjectedRecHit2D.cc

Go to the documentation of this file.
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);
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);
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 }
00064 
00065 ProjectedRecHit2D::ProjectedRecHit2D( const GeomDet * geom, const GeomDet* originaldet,
00066                                       const ProjectedSiStripRecHit2D* rh,
00067                                       const StripClusterParameterEstimator* cpe,
00068                                       float weight, float annealing,
00069                                       bool computeCoarseLocalPosition) :
00070   GenericTransientTrackingRecHit( geom, *rh,weight, annealing), theCPE(cpe), theOriginalDet(originaldet) {
00071   if (computeCoarseLocalPosition){
00072     if (theCPE != 0) {
00073       TrackingRecHitProjector<ProjectedRecHit2D> proj;
00074       if(!originalHit().cluster().isNull()){
00075         const SiStripCluster& clust = *(originalHit().cluster());  
00076         
00077         StripClusterParameterEstimator::LocalValues lv = 
00078           theCPE->localParameters( clust, *detUnit());
00079         
00080         RecHitPointer updatedOriginalHit = 
00081           TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet, 
00082                                            originalHit().cluster(), theCPE, weight, annealing);
00083         
00084         RecHitPointer hit = proj.project( *updatedOriginalHit, *det()); 
00085         trackingRecHit_ = hit->hit()->clone();
00086       }else{
00087         const SiStripCluster& clust = *(originalHit().cluster_regional());  
00088         
00089         StripClusterParameterEstimator::LocalValues lv = 
00090           theCPE->localParameters( clust, *detUnit());
00091         
00092         RecHitPointer updatedOriginalHit = 
00093           TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet, 
00094                                            originalHit().cluster_regional(), theCPE, weight, annealing);
00095         
00096         RecHitPointer hit = proj.project( *updatedOriginalHit, *det()); 
00097         trackingRecHit_ = hit->hit()->clone();
00098       }
00099     }
00100   }
00101 }