00001 #include "RecoVertex/KalmanVertexFit/interface/KalmanSmoothedVertexChi2Estimator.h" 00002 // #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackCompatibilityEstimator.h" 00003 00004 00005 template <unsigned int N> 00006 typename KalmanSmoothedVertexChi2Estimator<N>::BDpair 00007 KalmanSmoothedVertexChi2Estimator<N>::estimate(const CachingVertex<N> & vertex) const 00008 { 00009 //initial vertex part 00010 float v_part = 0.; 00011 float returnChi = 0.; 00012 00013 if (vertex.hasPrior()) { 00014 v_part = helper.vertexChi2(vertex.priorVertexState(), vertex.vertexState()); 00015 } 00016 00017 //vector of tracks part 00018 typedef typename CachingVertex<N>::RefCountedVertexTrack RefCountedVertexTrack; 00019 std::vector< RefCountedVertexTrack > tracks = vertex.tracks(); 00020 float sum = 0.; 00021 bool success = true; 00022 for(typename std::vector<RefCountedVertexTrack>::iterator i = tracks.begin(); i != tracks.end(); i++) 00023 { 00024 BDpair result = helper.trackParameterChi2((*i)->linearizedTrack(), (*i)->refittedState()); 00025 success = success && result.first; 00026 sum += (*i)->weight() * result.second; 00027 } 00028 returnChi = v_part + sum; 00029 return BDpair(success, returnChi); 00030 } 00031 00032 template class KalmanSmoothedVertexChi2Estimator<5>; 00033 template class KalmanSmoothedVertexChi2Estimator<6>;