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 Member Functions | Private Attributes
StateSegmentMatcher Class Reference

#include <StateSegmentMatcher.h>

Public Member Functions

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

Private Member Functions

void setAPE2d (LocalError &apeLoc)
 
void setAPE4d (LocalError &apeLoc)
 

Private Attributes

AlgebraicSymMatrix44 ape
 
AlgebraicSymMatrix22 ape_2d
 
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 79 of file StateSegmentMatcher.h.

Constructor & Destructor Documentation

StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface tsos,
CSCSegment cscseg4d,
LocalError apeLoc 
)

Definition at line 72 of file StateSegmentMatcher.cc.

References Tsos4D::errorMatrix(), and Tsos4D::paramVector().

73 {
74  setAPE4d(*apeLoc);
75 
76  match2D = false;
77  AlgebraicVector cscseg = cscseg4d->parameters();
78  v1[0] = cscseg[0];
79  v1[1] = cscseg[1];
80  v1[2] = cscseg[2];
81  v1[3] = cscseg[3];
82 
83  AlgebraicSymMatrix rhErr_vect = cscseg4d->parametersError();
84  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);
85  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);
86  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);
87  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);
88 
89 
90  Tsos4D tsos4d = Tsos4D(tsos);
91  v2 = tsos4d.paramVector();
92  m2 = tsos4d.errorMatrix();
93 }
AlgebraicSymMatrix44 m2
AlgebraicSymMatrix44 m1
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setAPE4d(LocalError &apeLoc)
AlgebraicSymMatrix44 errorMatrix() const
AlgebraicVector4 paramVector() const
StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface tsos,
DTRecSegment4D dtseg4d,
LocalError apeLoc 
)

Definition at line 19 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().

20 {
21  if (dtseg4d->hasPhi() && dtseg4d->hasZed()) {
22 
23  setAPE4d(*apeLoc);
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  setAPE2d(*apeLoc);
45 
46  match2D = true;
47  AlgebraicVector dtseg = dtseg4d->parameters();
48  v1_2d[0] = dtseg[0];
49  v1_2d[1] = dtseg[1];
50 
51  AlgebraicSymMatrix rhErr_vect = dtseg4d->parametersError();
52  m1_2d(0,0) = rhErr_vect(1,1); m1_2d(0,1) = rhErr_vect(1,2);
53  m1_2d(1,0) = rhErr_vect(2,1); m1_2d(1,1) = rhErr_vect(2,2);
54 
55 
56  if (dtseg4d->hasPhi()) {
57  Tsos2DPhi tsos2d = Tsos2DPhi(tsos);
58  v2_2d = tsos2d.paramVector();
59  m2_2d = tsos2d.errorMatrix();
60  }
61 
62  if (dtseg4d->hasZed()) {
63  Tsos2DZed tsos2d = Tsos2DZed(tsos);
64  v2_2d = tsos2d.paramVector();
65  m2_2d = tsos2d.errorMatrix();
66  }
67  }
68 }
AlgebraicSymMatrix22 errorMatrix() const
void setAPE2d(LocalError &apeLoc)
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
void setAPE4d(LocalError &apeLoc)
AlgebraicSymMatrix44 errorMatrix() const
AlgebraicVector4 paramVector() const

Member Function Documentation

void StateSegmentMatcher::setAPE2d ( LocalError apeLoc)
inlineprivate

Definition at line 110 of file StateSegmentMatcher.h.

References ape_2d, and LocalError::xx().

110  {
111  ape_2d[0][0] = 0; //sigma (dx/dz)
112  ape_2d[1][1] = apeLoc.xx(); //sigma (x)
113  ape_2d[0][1] = 0; //cov(dx/dz,x)
114  };
float xx() const
Definition: LocalError.h:24
AlgebraicSymMatrix22 ape_2d
void StateSegmentMatcher::setAPE4d ( LocalError apeLoc)
inlineprivate

Definition at line 101 of file StateSegmentMatcher.h.

References ape, LocalError::xx(), and LocalError::yy().

101  {
102  ape[0][0] = 0; //sigma (dx/dz)
103  ape[1][1] = 0; //sigma (dy/dz)
104  ape[2][2] = apeLoc.xx(); //sigma (x)
105  ape[3][3] = apeLoc.yy(); //sigma (y)
106  ape[0][2] = 0; //cov(dx/dz,x)
107  ape[1][3] = 0; //cov(dy/dz,y)
108  };
float xx() const
Definition: LocalError.h:24
AlgebraicSymMatrix44 ape
float yy() const
Definition: LocalError.h:26
double StateSegmentMatcher::value ( void  )

Definition at line 97 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::getBest().

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

Member Data Documentation

AlgebraicSymMatrix44 StateSegmentMatcher::ape
private

Definition at line 95 of file StateSegmentMatcher.h.

Referenced by setAPE4d().

AlgebraicSymMatrix22 StateSegmentMatcher::ape_2d
private

Definition at line 97 of file StateSegmentMatcher.h.

Referenced by setAPE2d().

double StateSegmentMatcher::estValue
private

Definition at line 99 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m1
private

Definition at line 95 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m1_2d
private

Definition at line 97 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m2
private

Definition at line 95 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m2_2d
private

Definition at line 97 of file StateSegmentMatcher.h.

bool StateSegmentMatcher::match2D
private

Definition at line 98 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v1
private

Definition at line 94 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v1_2d
private

Definition at line 96 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v2
private

Definition at line 94 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v2_2d
private

Definition at line 96 of file StateSegmentMatcher.h.