#include <RecoVertex/TertiaryTracksVertexFinder/interface/GetLineCovMatrix.h>
Public Member Functions | |
GetLineCovMatrix (GlobalPoint, GlobalPoint, GlobalError, GlobalError) | |
GlobalError | GetMatrix (GlobalPoint) |
~GetLineCovMatrix () | |
Private Attributes | |
HepMatrix | B |
HepMatrix | CombinedErrorMatrix |
GlobalPoint | PointOne |
GlobalPoint | PointTwo |
Definition at line 12 of file GetLineCovMatrix.h.
GetLineCovMatrix::GetLineCovMatrix | ( | GlobalPoint | pointOne, | |
GlobalPoint | pointTwo, | |||
GlobalError | ErrorOne, | |||
GlobalError | ErrorTwo | |||
) |
Definition at line 4 of file GetLineCovMatrix.cc.
References CombinedErrorMatrix, GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::cyx(), GlobalErrorBase< T, ErrorWeightType >::cyy(), GlobalErrorBase< T, ErrorWeightType >::czx(), GlobalErrorBase< T, ErrorWeightType >::czy(), GlobalErrorBase< T, ErrorWeightType >::czz(), PointOne, and PointTwo.
00005 { 00006 00007 PointOne = pointOne; 00008 PointTwo = pointTwo; 00009 00010 CombinedErrorMatrix = HepMatrix(6, 6, 0); 00011 00012 CombinedErrorMatrix[0][0] = ErrorOne.cxx(); 00013 CombinedErrorMatrix[1][0] = ErrorOne.cyx(); 00014 CombinedErrorMatrix[0][1] = ErrorOne.cyx(); 00015 CombinedErrorMatrix[1][1] = ErrorOne.cyy(); 00016 CombinedErrorMatrix[2][0] = ErrorOne.czx(); 00017 CombinedErrorMatrix[0][2] = ErrorOne.czx(); 00018 CombinedErrorMatrix[2][1] = ErrorOne.czy(); 00019 CombinedErrorMatrix[1][2] = ErrorOne.czy(); 00020 CombinedErrorMatrix[2][2] = ErrorOne.czz(); 00021 00022 CombinedErrorMatrix[3][3] = ErrorTwo.cxx(); 00023 CombinedErrorMatrix[4][3] = ErrorTwo.cyx(); 00024 CombinedErrorMatrix[3][4] = ErrorTwo.cyx(); 00025 CombinedErrorMatrix[4][4] = ErrorTwo.cyy(); 00026 CombinedErrorMatrix[5][3] = ErrorTwo.czx(); 00027 CombinedErrorMatrix[3][5] = ErrorTwo.czx(); 00028 CombinedErrorMatrix[5][4] = ErrorTwo.czy(); 00029 CombinedErrorMatrix[4][5] = ErrorTwo.czy(); 00030 CombinedErrorMatrix[5][5] = ErrorTwo.czz(); 00031 00032 B = HepMatrix(3, 6, 0); 00033 }
GetLineCovMatrix::~GetLineCovMatrix | ( | ) | [inline] |
GlobalError GetLineCovMatrix::GetMatrix | ( | GlobalPoint | PointThree | ) |
Definition at line 36 of file GetLineCovMatrix.cc.
References CombinedErrorMatrix, PointOne, PointTwo, s, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00037 { 00038 // the linear equation is K = PointOne + (PointTwo-PointOne)*s 00039 double s; 00040 if( !fabs(PointTwo.x() - PointOne.x()) < 0.00000001 ) 00041 s = (PointThree.x() - PointOne.x()) / (PointTwo.x() - PointOne.x()) ; 00042 else { 00043 if( !fabs(PointTwo.y() - PointOne.y()) < 0.00000001 ) 00044 s = (PointThree.y() - PointOne.y()) / (PointTwo.y() - PointOne.y()) ; 00045 else { 00046 if( !fabs(PointTwo.z() - PointOne.z()) < 0.00000001 ) 00047 s = (PointThree.z() - PointOne.z()) / (PointTwo.z() - PointOne.z()) ; 00048 else { 00049 GlobalError EmptyError(0, 0, 0, 0, 0, 0); 00050 return EmptyError; 00051 } 00052 } 00053 } 00054 00055 B[0][0] = 1-s; 00056 B[0][3] = s; 00057 B[1][1] = 1-s; 00058 B[1][4] = s; 00059 B[2][2] = 1-s; 00060 B[2][5] = s; 00061 00062 HepMatrix Result = B * CombinedErrorMatrix * B.T(); 00063 00064 GlobalError TheGlobalError( Result[0][0], Result[1][0], Result[1][1], Result[2][0], Result[2][1], Result[2][2] ); 00065 return TheGlobalError; 00066 }
HepMatrix GetLineCovMatrix::B [private] |
Definition at line 27 of file GetLineCovMatrix.h.
HepMatrix GetLineCovMatrix::CombinedErrorMatrix [private] |
Definition at line 26 of file GetLineCovMatrix.h.
Referenced by GetLineCovMatrix(), and GetMatrix().
GlobalPoint GetLineCovMatrix::PointOne [private] |
Definition at line 24 of file GetLineCovMatrix.h.
Referenced by GetLineCovMatrix(), and GetMatrix().
GlobalPoint GetLineCovMatrix::PointTwo [private] |
Definition at line 25 of file GetLineCovMatrix.h.
Referenced by GetLineCovMatrix(), and GetMatrix().