CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
StateSegmentMatcher Class Reference

#include <StateSegmentMatcher.h>

Public Member Functions

 StateSegmentMatcher (TrajectoryStateOnSurface *, CSCSegment *)
 
 StateSegmentMatcher (TrajectoryStateOnSurface *, DTRecSegment4D *)
 
double value ()
 

Private Attributes

double estValue
 
AlgebraicSymMatrix44 m1
 
AlgebraicSymMatrix22 m1_2d
 
AlgebraicSymMatrix44 m2
 
AlgebraicSymMatrix22 m2_2d
 
bool match2D
 
AlgebraicVector4 v1
 
AlgebraicVector2 v1_2d
 
AlgebraicVector4 v2
 
AlgebraicVector2 v2_2d
 

Detailed Description

Definition at line 81 of file StateSegmentMatcher.h.

Constructor & Destructor Documentation

StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface tsos,
CSCSegment cscseg4d 
)

Definition at line 70 of file StateSegmentMatcher.cc.

References Tsos4D::errorMatrix(), CSCSegment::parameters(), CSCSegment::parametersError(), and Tsos4D::paramVector().

71 {
72  match2D = false;
73  AlgebraicVector cscseg = cscseg4d->parameters();
74  v1[0] = cscseg[0];
75  v1[1] = cscseg[1];
76  v1[2] = cscseg[2];
77  v1[3] = cscseg[3];
78 
79  AlgebraicSymMatrix rhErr_vect = cscseg4d->parametersError();
80  m1(0,0) = rhErr_vect(1,1);m1(0,1) = rhErr_vect(1,2);m1(0,2) = rhErr_vect(1,3);m1(0,3) = rhErr_vect(1,4);
81  m1(1,0) = rhErr_vect(2,1);m1(1,1) = rhErr_vect(2,2);m1(1,2) = rhErr_vect(2,3);m1(1,3) = rhErr_vect(2,4);
82  m1(2,0) = rhErr_vect(3,1);m1(2,1) = rhErr_vect(3,2);m1(2,2) = rhErr_vect(3,3);m1(2,3) = rhErr_vect(3,4);
83  m1(3,0) = rhErr_vect(4,1);m1(3,1) = rhErr_vect(4,2);m1(3,2) = rhErr_vect(4,3);m1(3,3) = rhErr_vect(4,4);
84 
85 
86  Tsos4D tsos4d = Tsos4D(tsos);
87  v2 = tsos4d.paramVector();
88  m2 = tsos4d.errorMatrix();
89 }
AlgebraicVector parameters() const
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
Definition: CSCSegment.cc:57
AlgebraicSymMatrix44 m2
AlgebraicSymMatrix44 m1
CLHEP::HepVector AlgebraicVector
AlgebraicSymMatrix parametersError() const
Covariance matrix of parameters()
Definition: CSCSegment.h:49
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlgebraicSymMatrix44 errorMatrix() const
AlgebraicVector4 paramVector() const
StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface tsos,
DTRecSegment4D dtseg4d 
)

Definition at line 21 of file StateSegmentMatcher.cc.

References Tsos4D::errorMatrix(), Tsos2DPhi::errorMatrix(), Tsos2DZed::errorMatrix(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), DTRecSegment4D::parameters(), DTRecSegment4D::parametersError(), Tsos4D::paramVector(), Tsos2DPhi::paramVector(), and Tsos2DZed::paramVector().

22 {
23  if (dtseg4d->hasPhi() && dtseg4d->hasZed()) {
24 
25  match2D = false;
26  AlgebraicVector dtseg = dtseg4d->parameters();
27  v1[0] = dtseg[0];
28  v1[1] = dtseg[1];
29  v1[2] = dtseg[2];
30  v1[3] = dtseg[3];
31 
32  AlgebraicSymMatrix rhErr_vect = dtseg4d->parametersError();
33  m1(0,0) = rhErr_vect(1,1); m1(0,1) = rhErr_vect(1,2); m1(0,2) = rhErr_vect(1,3);m1(0,3) = rhErr_vect(1,4);
34  m1(1,0) = rhErr_vect(2,1); m1(1,1) = rhErr_vect(2,2); m1(1,2) = rhErr_vect(2,3);m1(1,3) = rhErr_vect(2,4);
35  m1(2,0) = rhErr_vect(3,1); m1(2,1) = rhErr_vect(3,2); m1(2,2) = rhErr_vect(3,3);m1(2,3) = rhErr_vect(3,4);
36  m1(3,0) = rhErr_vect(4,1); m1(3,1) = rhErr_vect(4,2); m1(3,2) = rhErr_vect(4,3);m1(3,3) = rhErr_vect(4,4);
37 
38  Tsos4D tsos4d = Tsos4D(tsos);
39  v2 = tsos4d.paramVector();
40  m2 = tsos4d.errorMatrix();
41 
42  } else {
43 
44  match2D = true;
45  AlgebraicVector dtseg = dtseg4d->parameters();
46  v1_2d[0] = dtseg[0];
47  v1_2d[1] = dtseg[1];
48 
49  AlgebraicSymMatrix rhErr_vect = dtseg4d->parametersError();
50  m1_2d(0,0) = rhErr_vect(1,1); m1_2d(0,1) = rhErr_vect(1,2);
51  m1_2d(1,0) = rhErr_vect(2,1); m1_2d(1,1) = rhErr_vect(2,2);
52 
53 
54  if (dtseg4d->hasPhi()) {
55  Tsos2DPhi tsos2d = Tsos2DPhi(tsos);
56  v2_2d = tsos2d.paramVector();
57  m2_2d = tsos2d.errorMatrix();
58  }
59 
60  if (dtseg4d->hasZed()) {
61  Tsos2DZed tsos2d = Tsos2DZed(tsos);
62  v2_2d = tsos2d.paramVector();
63  m2_2d = tsos2d.errorMatrix();
64  }
65  }
66 }
AlgebraicSymMatrix22 errorMatrix() const
AlgebraicVector parameters() const
AlgebraicVector2 v1_2d
AlgebraicVector2 paramVector() const
AlgebraicSymMatrix44 m2
AlgebraicVector2 paramVector() const
AlgebraicSymMatrix22 errorMatrix() const
AlgebraicSymMatrix44 m1
AlgebraicSymMatrix22 m2_2d
bool hasPhi() const
Does it have the Phi projection?
AlgebraicSymMatrix22 m1_2d
bool hasZed() const
Does it have the Z projection?
CLHEP::HepVector AlgebraicVector
AlgebraicSymMatrix parametersError() const
Covariance matrix fo parameters()
AlgebraicVector2 v2_2d
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlgebraicSymMatrix44 errorMatrix() const
AlgebraicVector4 paramVector() const

Member Function Documentation

double StateSegmentMatcher::value ( )

Definition at line 93 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::getBest().

94 {
95  if (match2D) {
98  bool m3i = !m3.Invert();
99  if ( m3i ) {
100  return 1e7;
101  } else {
102  estValue = ROOT::Math::Similarity(v3,m3);
103  }
104 
105  } else {
106  AlgebraicVector4 v3(v1 - v2);
107  AlgebraicSymMatrix44 m3(m1 + m2);
108  bool m3i = !m3.Invert();
109  if ( m3i ) {
110  return 1e7;
111  } else {
112  estValue = ROOT::Math::Similarity(v3,m3);
113  }
114  }
115  return estValue;
116 }
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
AlgebraicVector2 v1_2d
AlgebraicSymMatrix44 m2
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
AlgebraicSymMatrix44 m1
AlgebraicSymMatrix22 m2_2d
AlgebraicSymMatrix22 m1_2d
AlgebraicVector2 v2_2d
ROOT::Math::SVector< double, 4 > AlgebraicVector4
ROOT::Math::SVector< double, 2 > AlgebraicVector2

Member Data Documentation

double StateSegmentMatcher::estValue
private

Definition at line 101 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m1
private

Definition at line 97 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m1_2d
private

Definition at line 99 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m2
private

Definition at line 97 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m2_2d
private

Definition at line 99 of file StateSegmentMatcher.h.

bool StateSegmentMatcher::match2D
private

Definition at line 100 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v1
private

Definition at line 96 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v1_2d
private

Definition at line 98 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v2
private

Definition at line 96 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v2_2d
private

Definition at line 98 of file StateSegmentMatcher.h.