File indexing completed on 2024-04-06 12:31:32
0001 #include "TrackingTools/KalmanUpdators/interface/Strip1DMeasurementTransformator.h"
0002 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0003 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0004
0005 #include "Geometry/CommonTopologies/interface/RadialStripTopology.h"
0006
0007 Strip1DMeasurementTransformator::Strip1DMeasurementTransformator(const TSOS& tsos, const TrackingRecHit& hit)
0008 : theRecHit(hit), theState(tsos), theTopology(nullptr) {
0009 init();
0010 }
0011
0012 void Strip1DMeasurementTransformator::init() {
0013 theTopology = dynamic_cast<const StripTopology*>(&(hit().detUnit()->topology()));
0014 theIdealTopology = dynamic_cast<const StripTopology*>(&(hit().detUnit()->type().topology()));
0015 }
0016
0017 double Strip1DMeasurementTransformator::hitParameters() const {
0018 return topology()->measurementPosition(hit().localPosition()).x();
0019 }
0020
0021 AlgebraicVector5 Strip1DMeasurementTransformator::trajectoryParameters() const {
0022 return state().localParameters().vector();
0023 }
0024
0025 double Strip1DMeasurementTransformator::projectedTrajectoryParameters() const {
0026 return topology()->measurementPosition(state().localPosition()).x();
0027 }
0028
0029 double Strip1DMeasurementTransformator::hitError() const {
0030 return topology()->measurementError(hit().localPosition(), hit().localPositionError()).uu();
0031 }
0032
0033 const AlgebraicSymMatrix55& Strip1DMeasurementTransformator::trajectoryError() const {
0034 return state().localError().matrix();
0035 }
0036
0037 double Strip1DMeasurementTransformator::projectedTrajectoryError() const {
0038 return topology()->measurementError(state().localPosition(), state().localError().positionError()).uu();
0039 }
0040
0041 AlgebraicMatrix15 Strip1DMeasurementTransformator::projectionMatrix() const {
0042
0043
0044 AlgebraicMatrix15 H;
0045 if (const RadialStripTopology* tmp = dynamic_cast<const RadialStripTopology*>(idealTopology())) {
0046 double yHitToInter = tmp->yDistanceToIntersection(hit().localPosition().y());
0047 double t = tmp->yAxisOrientation() * hit().localPosition().x() / yHitToInter;
0048 double c2 = 1. / (1. + t * t);
0049
0050 double s2 = 1. - c2;
0051 double A = tmp->angularWidth();
0052
0053 double D2 = hit().localPosition().x() * hit().localPosition().x() + yHitToInter * yHitToInter;
0054 double D = std::sqrt(D2);
0055
0056 double cp = std::sqrt(c2);
0057 double sp;
0058 if (t > 0) {
0059 sp = std::sqrt(s2);
0060 } else {
0061 sp = -std::sqrt(s2);
0062 }
0063 H(0, 3) = cp / (D * A);
0064 H(0, 4) = -sp / (D * A);
0065 } else {
0066 double phi = topology()->stripAngle(topology()->strip(state().localPosition()));
0067 double pitch = topology()->localPitch(state().localPosition());
0068 H(0, 3) = cos(phi) / pitch;
0069 H(0, 4) = sin(phi) / pitch;
0070 }
0071 return H;
0072 }