CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Strip1DMeasurementTransformator.cc
Go to the documentation of this file.
4 // #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
6 
8  const TrackingRecHit& hit) :
9  theRecHit(hit),
10  theState(tsos),
11  theTopology(0) {
12 
13  init();
14 }
15 
17 
18  theTopology = dynamic_cast<const StripTopology*>(&(hit().detUnit()->topology()));
19  theIdealTopology = dynamic_cast<const StripTopology*>(&(hit().detUnit()->type().topology()));
20 }
21 
23 
24  return topology()->measurementPosition(hit().localPosition()).x();
25 }
26 
28 
29  return state().localParameters().vector();
30 }
31 
33 
34  return topology()->measurementPosition(state().localPosition()).x();
35 }
36 
38 
39  return
40  topology()->measurementError(hit().localPosition(),
41  hit().localPositionError()).uu();
42 }
43 
45 
46  return state().localError().matrix();
47 }
48 
50 
51  return
52  topology()->measurementError(state().localPosition(),
53  state().localError().positionError()).uu();
54 }
55 
57 
58  // H(measurement <- local)
59  // m_meas = H*x_local + c
61  if(const RadialStripTopology* tmp = dynamic_cast<const RadialStripTopology*>(idealTopology())) {
62  double yHitToInter = tmp->yDistanceToIntersection( hit().localPosition().y() );
63  double t = tmp->yAxisOrientation() * hit().localPosition().x() / yHitToInter;
64  double c2 = 1./(1. + t*t); // cos(angle)**2
65  //double cs = t*c2; // sin(angle)*cos(angle); tan carries sign of sin!
66  double s2 = 1. - c2; // sin(angle)**2
67  double A = tmp->angularWidth();
68  // D is distance from intersection of edges to hit on strip
69  double D2 = hit().localPosition().x()*hit().localPosition().x() + yHitToInter*yHitToInter;
70  double D = std::sqrt(D2);
71 
72  double cp = std::sqrt(c2);
73  double sp;
74  if(t > 0) {
75  sp = std::sqrt(s2);
76  } else {
77  sp = -std::sqrt(s2);
78  }
79  H(0,3) = cp/(D*A); H(0,4) = -sp/(D*A);
80  } else {
81  double phi =
82  topology()->stripAngle(topology()->strip(state().localPosition()));
83  double pitch = topology()->localPitch(state().localPosition());
84  H(0,3) = cos(phi)/pitch; H(0,4) = sin(phi)/pitch;
85  }
86  return H;
87 }
88 
89 
90 
91 
92 
93 
Divides< B, C > D2
Definition: Factorize.h:145
tuple t
Definition: tree.py:139
virtual float stripAngle(float strip) const =0
virtual const GeomDetType & type() const
Definition: GeomDet.cc:90
const LocalTrajectoryParameters & localParameters() const
virtual const Topology & topology() const
Definition: GeomDet.cc:86
Strip1DMeasurementTransformator(const TSOS &aTsos, const TrackingRecHit &aHit)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
tuple s2
Definition: indexGen.py:106
tuple c2
Definition: counter.py:145
AlgebraicVector5 vector() const
virtual float localPitch(const LocalPoint &) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
const StripTopology * idealTopology() const
return ideal topology, as if the sensor were flat
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float uu() const
ROOT::Math::SMatrix< double, 1, 5, ROOT::Math::MatRepStd< double, 1, 5 > > AlgebraicMatrix15
const AlgebraicSymMatrix55 & matrix() const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
const StripTopology * topology() const
return real topology, taking sensor deformations into account
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
ROOT::Math::SVector< double, 5 > AlgebraicVector5
virtual const Topology & topology() const =0
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual const GeomDetUnit * detUnit() const
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const =0