#include <vector>
Go to the source code of this file.
|
float | FindPeakFastPV (const std::vector< float > &zProjections, const std::vector< float > &zWeights, const float oldVertex, const float m_zClusterWidth, const float m_zClusterSearchArea, const float m_weightCut) |
|
◆ FindPeakFastPV()
float FindPeakFastPV |
( |
const std::vector< float > & |
zProjections, |
|
|
const std::vector< float > & |
zWeights, |
|
|
const float |
oldVertex, |
|
|
const float |
m_zClusterWidth, |
|
|
const float |
m_zClusterSearchArea, |
|
|
const float |
m_weightCut |
|
) |
| |
|
inline |
Definition at line 13 of file FindPeakFastPV.h.
References cuy::ii.
Referenced by FastPrimaryVertexWithWeightsProducer::produce().
19 float centerWMax = oldVertex;
20 if (m_zClusterWidth > 0 && m_zClusterSearchArea > 0) {
21 std::vector<float>::const_iterator itCenter = zProjections.begin();
22 std::vector<float>::const_iterator itLeftSide = zProjections.begin();
23 std::vector<float>::const_iterator itRightSide = zProjections.begin();
24 const float zClusterWidth = m_zClusterWidth * 0.5;
25 const float zLowerBound = oldVertex - zClusterWidth - m_zClusterSearchArea;
26 const float zUpperBound = oldVertex + zClusterWidth + m_zClusterSearchArea;
28 for (; itCenter != zProjections.end(); itCenter++) {
30 if ((*itCenter < zLowerBound) || (*itCenter > zUpperBound))
33 while (itLeftSide != zProjections.end() && (*itCenter - *itLeftSide) > zClusterWidth)
35 while (itRightSide != zProjections.end() && (*itRightSide - *itCenter) < zClusterWidth)
40 for (std::vector<float>::const_iterator
ii = itLeftSide;
ii != itRightSide;
ii++) {
42 if (zWeights[
ii - zProjections.begin()] < m_weightCut)
44 nWeighted += zWeights[
ii - zProjections.begin()];
45 centerW += (*ii) * zWeights[
ii - zProjections.begin()];
48 if (nWeighted > maxW) {