CMS 3D CMS Logo

Public Member Functions | Private Attributes

StateSegmentMatcher Class Reference

#include <StateSegmentMatcher.h>

List of all members.

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().

{
  match2D = false;
  AlgebraicVector cscseg = cscseg4d->parameters();
  v1[0] = cscseg[0];
  v1[1] = cscseg[1];
  v1[2] = cscseg[2];
  v1[3] = cscseg[3];

  AlgebraicSymMatrix rhErr_vect = cscseg4d->parametersError();
  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);
  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);
  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);
  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);


  Tsos4D tsos4d = Tsos4D(tsos);
  v2 = tsos4d.paramVector();
  m2 = tsos4d.errorMatrix();
}
StateSegmentMatcher::StateSegmentMatcher ( TrajectoryStateOnSurface tsos,
DTRecSegment4D dtseg4d 
)

Definition at line 21 of file StateSegmentMatcher.cc.

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

{
  if (dtseg4d->hasPhi() && dtseg4d->hasZed()) {
    
    match2D = false;
    AlgebraicVector dtseg       = dtseg4d->parameters();                                                         
    v1[0]       = dtseg[0]; 
    v1[1]       = dtseg[1]; 
    v1[2]       = dtseg[2]; 
    v1[3]       = dtseg[3]; 

    AlgebraicSymMatrix rhErr_vect       = dtseg4d->parametersError(); 
    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); 
    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); 
    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); 
    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);
    
    Tsos4D tsos4d = Tsos4D(tsos);                                                                                                                                             
    v2 = tsos4d.paramVector();                                                            
    m2 = tsos4d.errorMatrix();  
    
  } else {

    match2D = true;
    AlgebraicVector dtseg       = dtseg4d->parameters();
    v1_2d[0]       = dtseg[0];
    v1_2d[1]       = dtseg[1];

    AlgebraicSymMatrix rhErr_vect       = dtseg4d->parametersError();
    m1_2d(0,0) = rhErr_vect(1,1); m1_2d(0,1) = rhErr_vect(1,2); 
    m1_2d(1,0) = rhErr_vect(2,1); m1_2d(1,1) = rhErr_vect(2,2); 
    
        
    if (dtseg4d->hasPhi()) {
      Tsos2DPhi  tsos2d = Tsos2DPhi(tsos);
      v2_2d = tsos2d.paramVector();
      m2_2d = tsos2d.errorMatrix();
    }

    if (dtseg4d->hasZed()) {
      Tsos2DZed  tsos2d = Tsos2DZed(tsos);
      v2_2d = tsos2d.paramVector();
      m2_2d = tsos2d.errorMatrix();
    }
  }
}

Member Function Documentation

double StateSegmentMatcher::value ( )

Definition at line 93 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::getBest().

{
  if (match2D) {
    AlgebraicVector2 v3(v1_2d - v2_2d);
    AlgebraicSymMatrix22 m3(m1_2d + m2_2d);
    bool m3i = !m3.Invert();
    if ( m3i ) {
      return 1e7;
    } else {
      estValue = ROOT::Math::Similarity(v3,m3);
    }
    
  } else {
    AlgebraicVector4 v3(v1 - v2);
    AlgebraicSymMatrix44 m3(m1 + m2);
    bool m3i = !m3.Invert();
    if ( m3i ) {
      return 1e7;
    } else {
      estValue = ROOT::Math::Similarity(v3,m3);
    }
  }
  return estValue;
}

Member Data Documentation

Definition at line 101 of file StateSegmentMatcher.h.

Definition at line 97 of file StateSegmentMatcher.h.

Definition at line 99 of file StateSegmentMatcher.h.

Definition at line 97 of file StateSegmentMatcher.h.

Definition at line 99 of file StateSegmentMatcher.h.

Definition at line 100 of file StateSegmentMatcher.h.

Definition at line 96 of file StateSegmentMatcher.h.

Definition at line 98 of file StateSegmentMatcher.h.

Definition at line 96 of file StateSegmentMatcher.h.

Definition at line 98 of file StateSegmentMatcher.h.