CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoLocalTracker/SiStripRecHitConverter/src/StripCPEfromTrackAngle.cc

Go to the documentation of this file.
00001 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTrackAngle.h"
00002 #include "Geometry/CommonTopologies/interface/StripTopology.h"                                                           
00003 
00004 
00005 StripClusterParameterEstimator::LocalValues StripCPEfromTrackAngle::
00006 localParameters( const SiStripCluster& cluster, const GeomDetUnit& det, const LocalTrajectoryParameters& ltp) const {
00007   return localParameters(cluster,ltp);
00008 }
00009 
00010 StripClusterParameterEstimator::LocalValues StripCPEfromTrackAngle::
00011 localParameters( const SiStripCluster& cluster, const LocalTrajectoryParameters& ltp) const {
00012   StripCPE::Param const & p = param(cluster.geographicalId());
00013   
00014   LocalVector track = ltp.momentum();
00015   track *= 
00016     (track.z()<0) ?  std::abs(p.thickness/track.z()) : 
00017     (track.z()>0) ? -std::abs(p.thickness/track.z()) :  
00018                          p.maxLength/track.mag() ;
00019 
00020   const unsigned N = cluster.amplitudes().size();
00021   const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
00022   const float uerr2 = stripErrorSquared( N, std::abs(fullProjection) );
00023   const float strip = cluster.barycenter() -  0.5f*(1.f-shift[p.moduleGeom]) * fullProjection
00024     + 0.5f*p.coveredStrips(track, ltp.position());
00025   
00026   return std::make_pair( p.topology->localPosition(strip, ltp.vector()),
00027                          p.topology->localError(strip, uerr2, ltp.vector()) );
00028 }
00029 
00030 inline
00031 float StripCPEfromTrackAngle::
00032 stripErrorSquared(const unsigned N, const float uProj) const
00033 {
00034   if( (float(N)-uProj) > 3.5f )  
00035     return float(N*N)/12.f;
00036   else {
00037     const float P1=-0.339f;
00038     const float P2=0.90f;
00039     const float P3=0.279f;
00040     const float uerr = P1*uProj*std::exp(-uProj*P2)+P3;
00041     return uerr*uerr;
00042   }
00043 }