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 const &, CSCSegment const &, LocalError const &)
 
 StateSegmentMatcher (TrajectoryStateOnSurface const &, DTRecSegment4D const &, LocalError const &)
 
double value ()
 

Private Member Functions

void setAPE2d (LocalError const &apeLoc)
 
void setAPE4d (LocalError const &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 78 of file StateSegmentMatcher.h.

Constructor & Destructor Documentation

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

Definition at line 65 of file StateSegmentMatcher.cc.

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

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

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

19 {
20  if (dtseg4d.hasPhi() && dtseg4d.hasZed()) {
21  setAPE4d(apeLoc);
22  match2D = false;
23  AlgebraicVector dtseg = dtseg4d.parameters();
24  v1[0] = dtseg[0];
25  v1[1] = dtseg[1];
26  v1[2] = dtseg[2];
27  v1[3] = dtseg[3];
28 
29  AlgebraicSymMatrix rhErr_vect = dtseg4d.parametersError();
30  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);
31  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);
32  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);
33  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);
34 
35  Tsos4D tsos4d = Tsos4D(tsos);
36  v2 = tsos4d.paramVector();
37  m2 = tsos4d.errorMatrix();
38  } else {
39  setAPE2d(apeLoc);
40  match2D = true;
41  AlgebraicVector dtseg = dtseg4d.parameters();
42  v1_2d[0] = dtseg[0];
43  v1_2d[1] = dtseg[1];
44 
45  AlgebraicSymMatrix rhErr_vect = dtseg4d.parametersError();
46  m1_2d(0,0) = rhErr_vect(1,1); m1_2d(0,1) = rhErr_vect(1,2);
47  m1_2d(1,0) = rhErr_vect(2,1); m1_2d(1,1) = rhErr_vect(2,2);
48 
49  if (dtseg4d.hasPhi()) {
50  Tsos2DPhi tsos2d = Tsos2DPhi(tsos);
51  v2_2d = tsos2d.paramVector();
52  m2_2d = tsos2d.errorMatrix();
53  }
54 
55  if (dtseg4d.hasZed()) {
56  Tsos2DZed tsos2d = Tsos2DZed(tsos);
57  v2_2d = tsos2d.paramVector();
58  m2_2d = tsos2d.errorMatrix();
59  }
60  }
61 }
AlgebraicSymMatrix22 errorMatrix() const
AlgebraicVector2 v1_2d
AlgebraicVector2 paramVector() const
AlgebraicSymMatrix44 m2
AlgebraicVector2 paramVector() const
AlgebraicSymMatrix22 errorMatrix() const
AlgebraicSymMatrix44 m1
AlgebraicSymMatrix22 m2_2d
void setAPE2d(LocalError const &apeLoc)
AlgebraicSymMatrix22 m1_2d
CLHEP::HepVector AlgebraicVector
AlgebraicVector2 v2_2d
CLHEP::HepSymMatrix AlgebraicSymMatrix
AlgebraicSymMatrix44 errorMatrix() const
AlgebraicVector4 paramVector() const
void setAPE4d(LocalError const &apeLoc)

Member Function Documentation

void StateSegmentMatcher::setAPE2d ( LocalError const &  apeLoc)
inlineprivate

Definition at line 109 of file StateSegmentMatcher.h.

References ape_2d, and LocalError::xx().

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

Definition at line 100 of file StateSegmentMatcher.h.

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

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

Definition at line 88 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::testCSCstation(), and DynamicTruncation::testDTstation().

89 {
90  if (match2D) {
93  bool m3i = !m3.Invert();
94  if ( m3i ) {
95  return 1e7;
96  } else {
97  estValue = ROOT::Math::Similarity(v3,m3);
98  }
99 
100  } else {
101  AlgebraicVector4 v3(v1 - v2);
102  AlgebraicSymMatrix44 m3(m1 + m2 + ape);
103  bool m3i = !m3.Invert();
104  if ( m3i ) {
105  return 1e7;
106  } else {
107  estValue = ROOT::Math::Similarity(v3,m3);
108  }
109  }
110  return estValue;
111 }
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 94 of file StateSegmentMatcher.h.

Referenced by setAPE4d().

AlgebraicSymMatrix22 StateSegmentMatcher::ape_2d
private

Definition at line 96 of file StateSegmentMatcher.h.

Referenced by setAPE2d().

double StateSegmentMatcher::estValue
private

Definition at line 98 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m1
private

Definition at line 94 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m1_2d
private

Definition at line 96 of file StateSegmentMatcher.h.

AlgebraicSymMatrix44 StateSegmentMatcher::m2
private

Definition at line 94 of file StateSegmentMatcher.h.

AlgebraicSymMatrix22 StateSegmentMatcher::m2_2d
private

Definition at line 96 of file StateSegmentMatcher.h.

bool StateSegmentMatcher::match2D
private

Definition at line 97 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v1
private

Definition at line 93 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v1_2d
private

Definition at line 95 of file StateSegmentMatcher.h.

AlgebraicVector4 StateSegmentMatcher::v2
private

Definition at line 93 of file StateSegmentMatcher.h.

AlgebraicVector2 StateSegmentMatcher::v2_2d
private

Definition at line 95 of file StateSegmentMatcher.h.