CMS 3D CMS Logo

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