Identify the best 1:1:1 match in a group of connected elements and from it create a pfo.
80 unsigned int highestHitCount(0);
82 const Cluster *pBestClusterU(
nullptr), *pBestClusterV(
nullptr), *pBestClusterW(
nullptr);
84 for (
const TensorType::Element &element : elementList)
86 const Cluster *
const pClusterU(element.GetClusterU()), *
const pClusterV(element.GetClusterV()), *
const pClusterW(element.GetClusterW());
88 if (usedClusters.count(pClusterU) || usedClusters.count(pClusterV) || usedClusters.count(pClusterW))
91 const float chiSquared(element.GetOverlapResult().GetReducedChi2());
96 const unsigned int hitSum(pClusterU->GetNCaloHits() + pClusterV->GetNCaloHits() + pClusterW->GetNCaloHits());
98 if ((hitSum > highestHitCount) || ((hitSum == highestHitCount) && (chiSquared < bestChiSquared)))
100 bestChiSquared = chiSquared;
101 highestHitCount = hitSum;
102 pBestClusterU = pClusterU;
103 pBestClusterV = pClusterV;
104 pBestClusterW = pClusterW;
108 if (pBestClusterU && pBestClusterV && pBestClusterW)
111 usedClusters.insert(pBestClusterU);
112 usedClusters.insert(pBestClusterV);
113 usedClusters.insert(pBestClusterW);
115 ProtoParticle protoParticle;
116 protoParticle.m_clusterList.push_back(pBestClusterU);
117 protoParticle.m_clusterList.push_back(pBestClusterV);
118 protoParticle.m_clusterList.push_back(pBestClusterW);
119 protoParticleVector.push_back(protoParticle);
static int max(int a, int b)
float m_maxGoodMatchReducedChiSquared
The maximum reduced chi squared value of a good 1:1:1 match.