Given the list of hits this will search for candidate Seed objects and return them.
73 bool foundGoodSeeds(
false);
90 inputHitPairListPtr.sort(SeedFinderAlgBase::Sort3DHitsByArcLen3D());
95 std::set<const reco::ClusterHit2D*> hit2DSet;
98 double lastArcLen = inputHitPairListPtr.front()->getArclenToPoca();
100 for(
const auto& hit3D : inputHitPairListPtr)
102 double arcLen = hit3D->getArclenToPoca();
106 seedHit3DList.clear();
110 seedHit3DList.push_back(hit3D);
112 for(
const auto& hit2D : hit3D->getHits())
114 hit2DSet.insert(hit2D);
126 size_t num3DHitsToKeep =
std::min(2*seedHit3DList.size(), inputHitPairListPtr.size());
132 std::advance(edgeHitItr, numEdgeHits);
137 hit3DList.resize(2*numEdgeHits);
143 seedHit3DList.clear();
144 seedHit3DList.resize(numEdgeHits);
146 std::copy(inputHitPairListPtr.begin(), edgeHitItr, seedHit3DList.begin());
149 std::advance(edgeHitItr, inputHitPairListPtr.size() - 2 * numEdgeHits);
151 std::copy(edgeHitItr, inputHitPairListPtr.end(), nextHit3DItr);
159 if (seedPCA.getSvdOK())
162 if (seedPCA.getEigenVectors()[0][1] > 0.) seedPCA.flipAxis(0);
169 seedHit3DList.sort(SeedFinderAlgBase::Sort3DHitsByArcLen3D());
172 double seedDir[3] = {seedPCA.getEigenVectors()[0][0], seedPCA.getEigenVectors()[0][1], seedPCA.getEigenVectors()[0][2]};
173 double seedStart[3] = {seedHit3DList.front()->getX(), seedHit3DList.front()->getY(), seedHit3DList.front()->getZ()};
176 double halfArcLen = 0.5 * fabs(seedHit3DList.back()->getArclenToPoca() - seedHit3DList.front()->getArclenToPoca());
178 seedStart[0] += halfArcLen * seedDir[0];
179 seedStart[1] += halfArcLen * seedDir[1];
180 seedStart[2] += halfArcLen * seedDir[2];
182 for(
const auto& hit3D : seedHit3DList) hit3D->setStatusBit(0x40000000);
184 seedHitPairVec.emplace_back(std::pair<recob::Seed, reco::HitPairListPtr>(
recob::Seed(seedStart, seedDir), seedHit3DList));
188 foundGoodSeeds =
true;
193 return foundGoodSeeds;
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
void PCAAnalysis_3D(const reco::HitPairListPtr &hitPairList, reco::PrincipalComponents &pca, bool skeletonOnly=false) const
double m_gapDistance
Maximum allowed distance between hits.
void flipAxis(size_t axis)
size_t m_maxNumEdgeHits
Maximum number hits each end of PCA axis.
PrincipalComponentsAlg m_pcaAlg
std::list< const reco::ClusterHit3D * > HitPairListPtr
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
size_t m_numSeed2DHits
Number 2D seed hits desired.
const EigenVectors & getEigenVectors() const