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

Constructor & Destructor Documentation

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

Definition at line 74 of file StateSegmentMatcher.cc.

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

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

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  setAPE4d(*apeLoc);
26 
27  match2D = false;
28  AlgebraicVector dtseg = dtseg4d->parameters();
29  v1[0] = dtseg[0];
30  v1[1] = dtseg[1];
31  v1[2] = dtseg[2];
32  v1[3] = dtseg[3];
33 
34  AlgebraicSymMatrix rhErr_vect = dtseg4d->parametersError();
35  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);
36  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);
37  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);
38  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);
39 
40  Tsos4D tsos4d = Tsos4D(tsos);
41  v2 = tsos4d.paramVector();
42  m2 = tsos4d.errorMatrix();
43 
44  } else {
45 
46  setAPE2d(*apeLoc);
47 
48  match2D = true;
49  AlgebraicVector dtseg = dtseg4d->parameters();
50  v1_2d[0] = dtseg[0];
51  v1_2d[1] = dtseg[1];
52 
53  AlgebraicSymMatrix rhErr_vect = dtseg4d->parametersError();
54  m1_2d(0,0) = rhErr_vect(1,1); m1_2d(0,1) = rhErr_vect(1,2);
55  m1_2d(1,0) = rhErr_vect(2,1); m1_2d(1,1) = rhErr_vect(2,2);
56 
57 
58  if (dtseg4d->hasPhi()) {
59  Tsos2DPhi tsos2d = Tsos2DPhi(tsos);
60  v2_2d = tsos2d.paramVector();
61  m2_2d = tsos2d.errorMatrix();
62  }
63 
64  if (dtseg4d->hasZed()) {
65  Tsos2DZed tsos2d = Tsos2DZed(tsos);
66  v2_2d = tsos2d.paramVector();
67  m2_2d = tsos2d.errorMatrix();
68  }
69  }
70 }
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 112 of file StateSegmentMatcher.h.

References ape_2d, and LocalError::xx().

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

Definition at line 103 of file StateSegmentMatcher.h.

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

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

Definition at line 99 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::getBest().

100 {
101  if (match2D) {
104  bool m3i = !m3.Invert();
105  if ( m3i ) {
106  return 1e7;
107  } else {
108  estValue = ROOT::Math::Similarity(v3,m3);
109  }
110 
111  } else {
112  AlgebraicVector4 v3(v1 - v2);
113  AlgebraicSymMatrix44 m3(m1 + m2 + ape);
114  bool m3i = !m3.Invert();
115  if ( m3i ) {
116  return 1e7;
117  } else {
118  estValue = ROOT::Math::Similarity(v3,m3);
119  }
120  }
121  return estValue;
122 }
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 97 of file StateSegmentMatcher.h.

Referenced by setAPE4d().

AlgebraicSymMatrix22 StateSegmentMatcher::ape_2d
private

Definition at line 99 of file StateSegmentMatcher.h.

Referenced by setAPE2d().

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.