CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

StateSegmentMatcher Class Reference

#include <StateSegmentMatcher.h>

List of all members.

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(), and Tsos4D::paramVector().

{
  setAPE4d(*apeLoc);

  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,
LocalError apeLoc 
)

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()) {
    
    setAPE4d(*apeLoc);

    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 {

    setAPE2d(*apeLoc);

    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

void StateSegmentMatcher::setAPE2d ( LocalError apeLoc) [inline, private]

Definition at line 112 of file StateSegmentMatcher.h.

References ape_2d, and LocalError::xx().

                                    {
    ape_2d[0][0] = 0; //sigma (dx/dz)
    ape_2d[1][1] = apeLoc.xx(); //sigma (x)
    ape_2d[0][1] = 0; //cov(dx/dz,x) 
  };
void StateSegmentMatcher::setAPE4d ( LocalError apeLoc) [inline, private]

Definition at line 103 of file StateSegmentMatcher.h.

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

                                    {
    ape[0][0] = 0; //sigma (dx/dz) 
    ape[1][1] = 0; //sigma (dy/dz)
    ape[2][2] = apeLoc.xx(); //sigma (x)  
    ape[3][3] = apeLoc.yy(); //sigma (y)
    ape[0][2] = 0; //cov(dx/dz,x) 
    ape[1][3] = 0; //cov(dy/dz,y)
  };
double StateSegmentMatcher::value ( void  )

Definition at line 99 of file StateSegmentMatcher.cc.

Referenced by DynamicTruncation::getBest().

{
  if (match2D) {
    AlgebraicVector2 v3(v1_2d - v2_2d);
    AlgebraicSymMatrix22 m3(m1_2d + m2_2d + ape_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 + ape);
    bool m3i = !m3.Invert();
    if ( m3i ) {
      return 1e7;
    } else {
      estValue = ROOT::Math::Similarity(v3,m3);
    }
  }
  return estValue;
}

Member Data Documentation

Definition at line 97 of file StateSegmentMatcher.h.

Referenced by setAPE4d().

Definition at line 99 of file StateSegmentMatcher.h.

Referenced by setAPE2d().

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.