Find matched tracks, hidden by ambiguities in the tensor.
40 ClusterSet usedClusters;
42 overlapTensor.GetSortedKeyClusters(sortedKeyClusters);
44 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
46 if (!pKeyCluster->IsAvailable())
49 unsigned int nU(0), nV(0), nW(0);
51 overlapTensor.GetConnectedElements(pKeyCluster,
true, elementList, nU, nV, nW);
53 if (nU * nV * nW == 0)
58 for (TensorType::ElementList::const_iterator iter = elementList.begin(); iter != elementList.end(); ++iter)
60 if (usedClusters.count(iter->GetClusterU()) || usedClusters.count(iter->GetClusterV()) || usedClusters.count(iter->GetClusterW()))
66 if (std::max(iter->GetOverlapResult().GetInnerChi2(), iter->GetOverlapResult().GetOuterChi2()) >
m_maxEndPointChi2)
69 ProtoParticle protoParticle;
70 protoParticle.m_clusterList.push_back(iter->GetClusterU());
71 protoParticle.m_clusterList.push_back(iter->GetClusterV());
72 protoParticle.m_clusterList.push_back(iter->GetClusterW());
73 protoParticleVector.push_back(protoParticle);
75 usedClusters.insert(iter->GetClusterU());
76 usedClusters.insert(iter->GetClusterV());
77 usedClusters.insert(iter->GetClusterW());
float m_maxEndPointChi2
The max chi2 of matched vertex and end points for particle creation.
std::vector< Element > ElementList
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
static bool SortByChiSquared(const TensorType::Element &lhs, const TensorType::Element &rhs)
Sort tensor elements by chi-squared.
std::vector< art::Ptr< recob::Cluster > > ClusterVector