CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/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) ?  fabs(p.thickness/track.z()) : 
00017     (track.z()>0) ? -fabs(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, fabs(fullProjection) );
00023   const float strip = cluster.barycenter() -  0.5*(1-shift[p.moduleGeom]) * fullProjection
00024     + 0.5*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( (N-uProj) > 3.5 )  
00035     return N*N/12.;
00036   else {
00037     const float P1=-0.339;
00038     const float P2=0.90;
00039     const float P3=0.279;
00040     const float uerr = P1*uProj*exp(-uProj*P2)+P3;
00041     return uerr*uerr;
00042   }
00043 }