CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
int i
Definition: DBlmapReader.cc:9
std::vector< RefCountedVertexTrack > tracks() const
VertexState const & vertexState() const
tuple result
Definition: mps_fire.py:84
bool hasPrior() const
VertexState const & priorVertexState() const
tuple tracks
Definition: testEve_cfg.py:39
BDpair estimate(const CachingVertex< N > &vertex) const