CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/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 namespace {
00006   inline
00007   float stripErrorSquared(const unsigned N, const float uProj) {
00008     if( (float(N)-uProj) > 3.5f )  
00009       return float(N*N)/12.f;
00010     else {
00011       const float P1=-0.339f;
00012       const float P2=0.90f;
00013       const float P3=0.279f;
00014       const float uerr = P1*uProj*std::exp(-uProj*P2)+P3;
00015       return uerr*uerr;
00016     }
00017   }
00018 }
00019 
00020 StripClusterParameterEstimator::LocalValues StripCPEfromTrackAngle::
00021 localParameters( const SiStripCluster& cluster, const GeomDetUnit& det, const LocalTrajectoryParameters& ltp) const {
00022   
00023   StripCPE::Param const & p = param(det);
00024   
00025   LocalVector track = ltp.momentum();
00026   track *= 
00027     (track.z()<0) ?  std::abs(p.thickness/track.z()) : 
00028     (track.z()>0) ? -std::abs(p.thickness/track.z()) :  
00029                          p.maxLength/track.mag() ;
00030 
00031   const unsigned N = cluster.amplitudes().size();
00032   const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
00033   const float uerr2 = stripErrorSquared( N, std::abs(fullProjection) );
00034   const float strip = cluster.barycenter() -  0.5f*(1.f-shift[p.moduleGeom]) * fullProjection
00035     + 0.5f*p.coveredStrips(track, ltp.position());
00036   
00037   return std::make_pair( p.topology->localPosition(strip, ltp.vector()),
00038                          p.topology->localError(strip, uerr2, ltp.vector()) );
00039 }
00040