CMS 3D CMS Logo

KalmanSmoothedVertexChi2Estimator.cc
Go to the documentation of this file.
2 // #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackCompatibilityEstimator.h"
3 
4 template <unsigned int N>
6  const CachingVertex<N>& vertex) const {
7  //initial vertex part
8  float v_part = 0.;
9  float returnChi = 0.;
10 
11  if (vertex.hasPrior()) {
12  v_part = helper.vertexChi2(vertex.priorVertexState(), vertex.vertexState());
13  }
14 
15  //vector of tracks part
17  std::vector<RefCountedVertexTrack> tracks = vertex.tracks();
18  float sum = 0.;
19  bool success = true;
20  for (typename std::vector<RefCountedVertexTrack>::iterator i = tracks.begin(); i != tracks.end(); i++) {
21  BDpair result = helper.trackParameterChi2((*i)->linearizedTrack(), (*i)->refittedState());
22  success = success && result.first;
23  sum += (*i)->weight() * result.second;
24  }
25  returnChi = v_part + sum;
26  return BDpair(success, returnChi);
27 }
28 
Definition: helper.py:1
BDpair estimate(const CachingVertex< N > &vertex) const override
auto const & tracks
cannot be loose