CMS 3D CMS Logo

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