28 : m_maxNumEdgeHits(1000)
31 , m_pcaAlg(pset.
get<
fhicl::ParameterSet>(
"PrincipalComponentsAlg"))
44 bool foundGoodSeeds(
false);
60 inputHitPairListPtr.sort(SeedFinderAlgBase::Sort3DHitsByArcLen3D());
65 std::set<const reco::ClusterHit2D*> hit2DSet;
68 double lastArcLen = inputHitPairListPtr.front()->getArclenToPoca();
70 for (
const auto& hit3D : inputHitPairListPtr) {
71 double arcLen = hit3D->getArclenToPoca();
74 seedHit3DList.clear();
78 seedHit3DList.push_back(hit3D);
80 for (
const auto& hit2D : hit3D->getHits()) {
81 hit2DSet.insert(hit2D);
92 size_t num3DHitsToKeep =
std::min(2 * seedHit3DList.size(), inputHitPairListPtr.size());
98 std::advance(edgeHitItr, numEdgeHits);
103 hit3DList.resize(2 * numEdgeHits);
107 std::copy(inputHitPairListPtr.begin(), edgeHitItr, hit3DList.begin());
110 seedHit3DList.clear();
111 seedHit3DList.resize(numEdgeHits);
113 std::copy(inputHitPairListPtr.begin(), edgeHitItr, seedHit3DList.begin());
116 std::advance(edgeHitItr, inputHitPairListPtr.size() - 2 * numEdgeHits);
118 std::copy(edgeHitItr, inputHitPairListPtr.end(), nextHit3DItr);
126 if (seedPCA.getSvdOK()) {
128 if (seedPCA.getEigenVectors().row(2)(1) > 0.) seedPCA.flipAxis(0);
135 seedHit3DList.sort(SeedFinderAlgBase::Sort3DHitsByArcLen3D());
138 double seedDir[3] = {seedPCA.getEigenVectors().row(2)(0),
139 seedPCA.getEigenVectors().row(2)(1),
140 seedPCA.getEigenVectors().row(2)(2)};
141 double seedStart[3] = {seedHit3DList.front()->getX(),
142 seedHit3DList.front()->getY(),
143 seedHit3DList.front()->getZ()};
146 double halfArcLen = 0.5 * fabs(seedHit3DList.back()->getArclenToPoca() -
147 seedHit3DList.front()->getArclenToPoca());
149 seedStart[0] += halfArcLen * seedDir[0];
150 seedStart[1] += halfArcLen * seedDir[1];
151 seedStart[2] += halfArcLen * seedDir[2];
153 for (
const auto& hit3D : seedHit3DList)
154 hit3D->setStatusBit(0x40000000);
156 seedHitPairVec.emplace_back(std::pair<recob::Seed, reco::HitPairListPtr>(
161 foundGoodSeeds =
true;
166 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
ParallelHitsSeedFinderAlg(fhicl::ParameterSet const &pset)
Constructor.
T get(std::string const &key) const
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.
std::vector< SeedHitPairListPair > SeedHitPairListPairVec
auto const & get(AssnsNode< L, R, D > const &r)
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitMap) const
Given the list of hits this will search for candidate Seed objects and return them.
const EigenVectors & getEigenVectors() const