CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Chi2StripEstimator.cc
Go to the documentation of this file.
7 
8 using namespace std;
9 
10 pair<bool,double>
12  const TransientTrackingRecHit& hit) const {
13 
14  if(//hit.isMatched() ||
15  hit.detUnit()->type().isTrackerPixel()) {
16  return HitReturnType(false,0);
17  }
18 
19  const StripTopology* topology =
20  dynamic_cast<const StripTopology*>(&(hit.detUnit()->topology()));
21 
24 
26  mp = topology->measurementPosition(hit.localPosition());
27  m[0] = mp.x();
28  m[1] = mp.y();
29 
31  me = topology->measurementError(hit.localPosition(),
32  hit.localPositionError());
33 
34  V(0,0) = me.uu();
35  V(1,0) = me.uv();
36  V(1,1) = me.vv();
37 
39  mp = topology->measurementPosition(state.localPosition());
40  m[0] = mp.x();
41  m[1] = mp.y();
42 
44  me = topology->measurementError(state.localPosition(),
45  state.localError().positionError());
46  C(0,0) = me.uu();
47  C(1,0) = me.uv();
48  C(1,1) = me.vv();
49 
50  AlgebraicVector2 r(m - x);
52  bool ierr = !invertPosDefMatrix(R);
53  if (ierr) {
54  edm::LogError("Chi2StripEstimator")<<" could not invert matrix:\n"<<(V+C);
55  return returnIt( 0.0 );
56  }
57 
58  double est = max(ROOT::Math::Similarity(r, R), 0.000001); // avoid exact zero
59 
60  return returnIt( est);
61 }
62 
float vv() const
T y() const
Definition: PV2DBase.h:45
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
LocalError positionError() const
virtual const Topology & topology() const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
const T & max(const T &a, const T &b)
float uu() const
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
virtual const GeomDetType & type() const =0
bool isTrackerPixel() const
Definition: GeomDetType.cc:30
std::pair< bool, double > HitReturnType
virtual LocalError localPositionError() const =0
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
char state
Definition: procUtils.cc:75
virtual const GeomDetUnit * detUnit() const
Definition: DDAxes.h:10
T x() const
Definition: PV2DBase.h:44
virtual LocalPoint localPosition() const =0
ROOT::Math::SVector< double, 2 > AlgebraicVector2
float uv() const