CMS 3D CMS Logo

KVFHelper.cc
Go to the documentation of this file.
2 using namespace std;
3 
4 template <unsigned int N>
5 double KVFHelper<N>::vertexChi2(const CachingVertex<N>& vertexA, const CachingVertex<N>& vertexB) const {
6  return vertexChi2(vertexA.vertexState(), vertexB.vertexState());
7 }
8 
9 template <unsigned int N>
10 double KVFHelper<N>::vertexChi2(const VertexState& vertexA, const VertexState& vertexB) const {
11  // std::cout <<"Start\n";
12  GlobalPoint inPosition = vertexA.position();
13  GlobalPoint fnPosition = vertexB.position();
14  // std::cout << inPosition<< fnPosition<<std::endl;
15 
16  AlgebraicVector3 oldVertexPositionV;
17  oldVertexPositionV(0) = inPosition.x();
18  oldVertexPositionV(1) = inPosition.y();
19  oldVertexPositionV(2) = inPosition.z();
20 
21  AlgebraicVector3 newVertexPositionV;
22  newVertexPositionV(0) = fnPosition.x();
23  newVertexPositionV(1) = fnPosition.y();
24  newVertexPositionV(2) = fnPosition.z();
25 
26  AlgebraicVector3 positionResidual = newVertexPositionV - oldVertexPositionV;
27 
28  return ROOT::Math::Similarity(positionResidual, vertexA.weight().matrix());
29 }
30 
31 template <unsigned int N>
33  return trackParameterChi2(track->linearizedTrack(), track->refittedState());
34 }
35 
36 template <unsigned int N>
38  const RefCountedLinearizedTrackState linTrack, const RefCountedRefittedTrackState refittedTrackState) const {
39  typedef ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N> > AlgebraicSymMatrixNN;
40  typedef ROOT::Math::SVector<double, N> AlgebraicVectorN;
41 
42  AlgebraicVectorN parameterResiduals =
43  linTrack->predictedStateParameters() - linTrack->refittedParamFromEquation(refittedTrackState);
44  linTrack->checkParameters(parameterResiduals);
45  int error;
46  float lChi2 = ROOT::Math::Similarity(parameterResiduals, linTrack->predictedStateWeight(error));
47  if (error != 0)
48  return BDpair(false, -1.);
49  return BDpair(true, lChi2);
50 }
51 
52 template class KVFHelper<5>;
53 template class KVFHelper<6>;
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
KVFHelper::vertexChi2
double vertexChi2(const VertexState &vertexA, const VertexState &VertexB) const
Definition: KVFHelper.cc:10
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CachingVertex
Definition: CachingVertex.h:22
CachingVertex::vertexState
const VertexState & vertexState() const
Definition: CachingVertex.h:137
GlobalErrorBase::matrix
const AlgebraicSymMatrix33 matrix() const
Definition: GlobalErrorBase.h:121
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
relativeConstraints.error
error
Definition: relativeConstraints.py:53
KVFHelper::trackParameterChi2
BDpair trackParameterChi2(const RefCountedLinearizedTrackState linTrack, const RefCountedRefittedTrackState refittedTrackState) const
Definition: KVFHelper.cc:37
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
KVFHelper< 5 >
KVFHelper::BDpair
std::pair< bool, double > BDpair
Definition: KVFHelper.h:16
Point3DBase< float, GlobalTag >
KVFHelper.h
VertexState::weight
GlobalWeight weight() const
Definition: VertexState.h:69
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
std
Definition: JetResolutionObject.h:76
VertexState
Definition: VertexState.h:13
VertexState::position
GlobalPoint position() const
Definition: VertexState.h:62
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352