CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TrackingTools/KalmanUpdators/src/Strip1DMeasurementTransformator.cc

Go to the documentation of this file.
00001 #include "TrackingTools/KalmanUpdators/interface/Strip1DMeasurementTransformator.h"
00002 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00003 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00004 // #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
00005 #include "Geometry/CommonTopologies/interface/RadialStripTopology.h"
00006 
00007 Strip1DMeasurementTransformator::Strip1DMeasurementTransformator(const TSOS& tsos,
00008                                                          const TransientTrackingRecHit& hit) : 
00009   theRecHit(hit),
00010   theState(tsos),
00011   theTopology(0) {
00012 
00013   init();
00014 }
00015 
00016 void Strip1DMeasurementTransformator::init() {
00017 
00018   theTopology =  dynamic_cast<const StripTopology*>(&(hit().detUnit()->topology()));
00019   theIdealTopology =  dynamic_cast<const StripTopology*>(&(hit().detUnit()->type().topology()));
00020 }
00021 
00022 double Strip1DMeasurementTransformator::hitParameters() const {
00023   
00024   return topology()->measurementPosition(hit().localPosition()).x();
00025 }
00026 
00027 AlgebraicVector5 Strip1DMeasurementTransformator::trajectoryParameters() const {
00028     
00029   return state().localParameters().vector();
00030 }
00031 
00032 double Strip1DMeasurementTransformator::projectedTrajectoryParameters() const {
00033 
00034   return topology()->measurementPosition(state().localPosition()).x();
00035 }
00036 
00037 double Strip1DMeasurementTransformator::hitError() const {
00038 
00039   return     
00040     topology()->measurementError(hit().localPosition(),
00041                                  hit().localPositionError()).uu();
00042 }
00043 
00044 const AlgebraicSymMatrix55 & Strip1DMeasurementTransformator::trajectoryError() const {
00045 
00046   return state().localError().matrix();
00047 }
00048 
00049 double Strip1DMeasurementTransformator::projectedTrajectoryError() const {
00050 
00051   return 
00052     topology()->measurementError(state().localPosition(),
00053                                  state().localError().positionError()).uu();
00054 }
00055 
00056 AlgebraicMatrix15 Strip1DMeasurementTransformator::projectionMatrix() const {
00057 
00058   //  H(measurement <- local)
00059   //  m_meas = H*x_local + c
00060   AlgebraicMatrix15 H;
00061   if(const RadialStripTopology* tmp = dynamic_cast<const RadialStripTopology*>(idealTopology())) {
00062     double yHitToInter = tmp->yDistanceToIntersection( hit().localPosition().y() );
00063     double t  = tmp->yAxisOrientation() * hit().localPosition().x() / yHitToInter;
00064     double c2 = 1./(1. + t*t);  // cos(angle)**2
00065     //double cs = t*c2;           // sin(angle)*cos(angle); tan carries sign of sin!
00066     double s2 = 1. - c2;        // sin(angle)**2
00067     double A  = tmp->angularWidth();
00068     // D is distance from intersection of edges to hit on strip
00069     double D2 = hit().localPosition().x()*hit().localPosition().x() + yHitToInter*yHitToInter;
00070     double D = std::sqrt(D2);
00071     
00072     double cp = std::sqrt(c2);
00073     double sp;
00074     if(t > 0) {
00075       sp = std::sqrt(s2);
00076     } else {
00077       sp = -std::sqrt(s2);
00078     }
00079     H(0,3) = cp/(D*A); H(0,4) = -sp/(D*A);
00080   } else {
00081     double phi = 
00082       topology()->stripAngle(topology()->strip(state().localPosition()));
00083     double pitch = topology()->localPitch(state().localPosition());
00084     H(0,3) = cos(phi)/pitch; H(0,4) = sin(phi)/pitch;
00085   }
00086   return H;
00087 }
00088 
00089 
00090 
00091 
00092 
00093