CMS 3D CMS Logo

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 68 of file StateSegmentMatcher.h.

Constructor & Destructor Documentation

◆ StateSegmentMatcher() [1/2]

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

Definition at line 76 of file StateSegmentMatcher.cc.

78  {
79  setAPE4d(apeLoc);
80  match2D = false;
81  AlgebraicVector cscseg = cscseg4d.parameters();
82  v1[0] = cscseg[0];
83  v1[1] = cscseg[1];
84  v1[2] = cscseg[2];
85  v1[3] = cscseg[3];
86 
87  AlgebraicSymMatrix rhErr_vect = cscseg4d.parametersError();
88  m1(0, 0) = rhErr_vect(1, 1);
89  m1(0, 1) = rhErr_vect(1, 2);
90  m1(0, 2) = rhErr_vect(1, 3);
91  m1(0, 3) = rhErr_vect(1, 4);
92  m1(1, 0) = rhErr_vect(2, 1);
93  m1(1, 1) = rhErr_vect(2, 2);
94  m1(1, 2) = rhErr_vect(2, 3);
95  m1(1, 3) = rhErr_vect(2, 4);
96  m1(2, 0) = rhErr_vect(3, 1);
97  m1(2, 1) = rhErr_vect(3, 2);
98  m1(2, 2) = rhErr_vect(3, 3);
99  m1(2, 3) = rhErr_vect(3, 4);
100  m1(3, 0) = rhErr_vect(4, 1);
101  m1(3, 1) = rhErr_vect(4, 2);
102  m1(3, 2) = rhErr_vect(4, 3);
103  m1(3, 3) = rhErr_vect(4, 4);
104 
105  Tsos4D tsos4d = Tsos4D(tsos);
106  v2 = tsos4d.paramVector();
107  m2 = tsos4d.errorMatrix();
108 }

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

◆ StateSegmentMatcher() [2/2]

StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface const &  tsos,
DTRecSegment4D const &  dtseg4d,
LocalError const &  apeLoc 
)

Definition at line 16 of file StateSegmentMatcher.cc.

18  {
19  if (dtseg4d.hasPhi() && dtseg4d.hasZed()) {
20  setAPE4d(apeLoc);
21  match2D = false;
22  AlgebraicVector dtseg = dtseg4d.parameters();
23  v1[0] = dtseg[0];
24  v1[1] = dtseg[1];
25  v1[2] = dtseg[2];
26  v1[3] = dtseg[3];
27 
28  AlgebraicSymMatrix rhErr_vect = dtseg4d.parametersError();
29  m1(0, 0) = rhErr_vect(1, 1);
30  m1(0, 1) = rhErr_vect(1, 2);
31  m1(0, 2) = rhErr_vect(1, 3);
32  m1(0, 3) = rhErr_vect(1, 4);
33  m1(1, 0) = rhErr_vect(2, 1);
34  m1(1, 1) = rhErr_vect(2, 2);
35  m1(1, 2) = rhErr_vect(2, 3);
36  m1(1, 3) = rhErr_vect(2, 4);
37  m1(2, 0) = rhErr_vect(3, 1);
38  m1(2, 1) = rhErr_vect(3, 2);
39  m1(2, 2) = rhErr_vect(3, 3);
40  m1(2, 3) = rhErr_vect(3, 4);
41  m1(3, 0) = rhErr_vect(4, 1);
42  m1(3, 1) = rhErr_vect(4, 2);
43  m1(3, 2) = rhErr_vect(4, 3);
44  m1(3, 3) = rhErr_vect(4, 4);
45 
46  Tsos4D tsos4d = Tsos4D(tsos);
47  v2 = tsos4d.paramVector();
48  m2 = tsos4d.errorMatrix();
49  } else {
50  setAPE2d(apeLoc);
51  match2D = true;
52  AlgebraicVector dtseg = dtseg4d.parameters();
53  v1_2d[0] = dtseg[0];
54  v1_2d[1] = dtseg[1];
55 
56  AlgebraicSymMatrix rhErr_vect = dtseg4d.parametersError();
57  m1_2d(0, 0) = rhErr_vect(1, 1);
58  m1_2d(0, 1) = rhErr_vect(1, 2);
59  m1_2d(1, 0) = rhErr_vect(2, 1);
60  m1_2d(1, 1) = rhErr_vect(2, 2);
61 
62  if (dtseg4d.hasPhi()) {
63  Tsos2DPhi tsos2d = Tsos2DPhi(tsos);
64  v2_2d = tsos2d.paramVector();
65  m2_2d = tsos2d.errorMatrix();
66  }
67 
68  if (dtseg4d.hasZed()) {
69  Tsos2DZed tsos2d = Tsos2DZed(tsos);
70  v2_2d = tsos2d.paramVector();
71  m2_2d = tsos2d.errorMatrix();
72  }
73  }
74 }

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

Member Function Documentation

◆ setAPE2d()

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

Definition at line 96 of file StateSegmentMatcher.h.

96  {
97  ape_2d[0][0] = 0; //sigma (dx/dz)
98  ape_2d[1][1] = apeLoc.xx(); //sigma (x)
99  ape_2d[0][1] = 0; //cov(dx/dz,x)
100  };

References ape_2d, and LocalError::xx().

◆ setAPE4d()

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

Definition at line 87 of file StateSegmentMatcher.h.

87  {
88  ape[0][0] = 0; //sigma (dx/dz)
89  ape[1][1] = 0; //sigma (dy/dz)
90  ape[2][2] = apeLoc.xx(); //sigma (x)
91  ape[3][3] = apeLoc.yy(); //sigma (y)
92  ape[0][2] = 0; //cov(dx/dz,x)
93  ape[1][3] = 0; //cov(dy/dz,y)
94  };

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

◆ value()

double StateSegmentMatcher::value ( void  )

Definition at line 110 of file StateSegmentMatcher.cc.

110  {
111  if (match2D) {
114  bool m3i = !m3.Invert();
115  if (m3i) {
116  return 1e7;
117  } else {
118  estValue = ROOT::Math::Similarity(v3, m3);
119  }
120 
121  } else {
122  AlgebraicVector4 v3(v1 - v2);
123  AlgebraicSymMatrix44 m3(m1 + m2 + ape);
124  bool m3i = !m3.Invert();
125  if (m3i) {
126  return 1e7;
127  } else {
128  estValue = ROOT::Math::Similarity(v3, m3);
129  }
130  }
131  return estValue;
132 }

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

Member Data Documentation

◆ ape

AlgebraicSymMatrix44 StateSegmentMatcher::ape
private

Definition at line 81 of file StateSegmentMatcher.h.

Referenced by setAPE4d().

◆ ape_2d

AlgebraicSymMatrix22 StateSegmentMatcher::ape_2d
private

Definition at line 83 of file StateSegmentMatcher.h.

Referenced by setAPE2d().

◆ estValue

double StateSegmentMatcher::estValue
private

Definition at line 85 of file StateSegmentMatcher.h.

◆ m1

AlgebraicSymMatrix44 StateSegmentMatcher::m1
private

Definition at line 81 of file StateSegmentMatcher.h.

◆ m1_2d

AlgebraicSymMatrix22 StateSegmentMatcher::m1_2d
private

Definition at line 83 of file StateSegmentMatcher.h.

◆ m2

AlgebraicSymMatrix44 StateSegmentMatcher::m2
private

Definition at line 81 of file StateSegmentMatcher.h.

◆ m2_2d

AlgebraicSymMatrix22 StateSegmentMatcher::m2_2d
private

Definition at line 83 of file StateSegmentMatcher.h.

◆ match2D

bool StateSegmentMatcher::match2D
private

Definition at line 84 of file StateSegmentMatcher.h.

◆ v1

AlgebraicVector4 StateSegmentMatcher::v1
private

Definition at line 80 of file StateSegmentMatcher.h.

◆ v1_2d

AlgebraicVector2 StateSegmentMatcher::v1_2d
private

Definition at line 82 of file StateSegmentMatcher.h.

◆ v2

AlgebraicVector4 StateSegmentMatcher::v2
private

Definition at line 80 of file StateSegmentMatcher.h.

◆ v2_2d

AlgebraicVector2 StateSegmentMatcher::v2_2d
private

Definition at line 82 of file StateSegmentMatcher.h.

StateSegmentMatcher::v2_2d
AlgebraicVector2 v2_2d
Definition: StateSegmentMatcher.h:82
StateSegmentMatcher::v2
AlgebraicVector4 v2
Definition: StateSegmentMatcher.h:80
StateSegmentMatcher::estValue
double estValue
Definition: StateSegmentMatcher.h:85
Tsos2DPhi::errorMatrix
AlgebraicSymMatrix22 errorMatrix() const
Definition: StateSegmentMatcher.cc:178
Tsos4D
Definition: StateSegmentMatcher.h:22
StateSegmentMatcher::setAPE4d
void setAPE4d(LocalError const &apeLoc)
Definition: StateSegmentMatcher.h:87
StateSegmentMatcher::v1
AlgebraicVector4 v1
Definition: StateSegmentMatcher.h:80
StateSegmentMatcher::m1_2d
AlgebraicSymMatrix22 m1_2d
Definition: StateSegmentMatcher.h:83
StateSegmentMatcher::setAPE2d
void setAPE2d(LocalError const &apeLoc)
Definition: StateSegmentMatcher.h:96
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
Tsos4D::errorMatrix
AlgebraicSymMatrix44 errorMatrix() const
Definition: StateSegmentMatcher.cc:162
StateSegmentMatcher::ape_2d
AlgebraicSymMatrix22 ape_2d
Definition: StateSegmentMatcher.h:83
StateSegmentMatcher::ape
AlgebraicSymMatrix44 ape
Definition: StateSegmentMatcher.h:81
Tsos2DZed
Definition: StateSegmentMatcher.h:53
AlgebraicVector2
ROOT::Math::SVector< double, 2 > AlgebraicVector2
Definition: AlgebraicROOTObjects.h:11
Tsos2DPhi::paramVector
AlgebraicVector2 paramVector() const
Definition: StateSegmentMatcher.cc:176
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
Tsos2DZed::paramVector
AlgebraicVector2 paramVector() const
Definition: StateSegmentMatcher.cc:192
Tsos2DZed::errorMatrix
AlgebraicSymMatrix22 errorMatrix() const
Definition: StateSegmentMatcher.cc:194
AlgebraicSymMatrix44
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
Definition: AlgebraicROOTObjects.h:22
StateSegmentMatcher::m2
AlgebraicSymMatrix44 m2
Definition: StateSegmentMatcher.h:81
AlgebraicVector4
ROOT::Math::SVector< double, 4 > AlgebraicVector4
Definition: AlgebraicROOTObjects.h:13
Tsos2DPhi
Definition: StateSegmentMatcher.h:37
StateSegmentMatcher::m2_2d
AlgebraicSymMatrix22 m2_2d
Definition: StateSegmentMatcher.h:83
Tsos4D::paramVector
AlgebraicVector4 paramVector() const
Definition: StateSegmentMatcher.cc:160
StateSegmentMatcher::v1_2d
AlgebraicVector2 v1_2d
Definition: StateSegmentMatcher.h:82
StateSegmentMatcher::match2D
bool match2D
Definition: StateSegmentMatcher.h:84
StateSegmentMatcher::m1
AlgebraicSymMatrix44 m1
Definition: StateSegmentMatcher.h:81
AlgebraicSymMatrix22
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
Definition: AlgebraicROOTObjects.h:20