Given the list of hits this will search for candidate Seed objects and return them.
76 bool foundGoodSeed(
false);
88 if (eigenVal0 > 5. && eigenVal1 > 0.001)
97 hitPairListPtr.sort(SeedFinderAlgBase::Sort3DHitsByArcLen3D());
103 hit3DList.resize(hitPairListPtr.size());
105 std::copy(hitPairListPtr.begin(), hitPairListPtr.end(), hit3DList.begin());
116 checkList.resize(hitPairListPtr.size());
118 std::copy(hitPairListPtr.begin(), hitPairListPtr.end(), checkList.begin());
132 hit3DList.sort(SeedFinderAlgBase::Sort3DHitsByAbsArcLen3D());
135 double seedDir[3] = {seedPca.getEigenVectors()[0][0], seedPca.getEigenVectors()[0][1], seedPca.getEigenVectors()[0][2]};
136 double seedStart[3] = {hit3DList.front()->getX(), hit3DList.front()->getY(), hit3DList.front()->getZ()};
138 if (hit3DList.size() > 10)
144 LineFit2DHits(hit3DList, seedStart[0], newSeedPos, newSeedDir, chiDOF);
149 double cosAng = seedDir[0]*newSeedDir[0]+seedDir[1]*newSeedDir[1]+seedDir[2]*newSeedDir[2];
151 if (cosAng < 0.) newSeedDir *= -1.;
153 seedStart[0] = newSeedPos[0];
154 seedStart[1] = newSeedPos[1];
155 seedStart[2] = newSeedPos[2];
156 seedDir[0] = newSeedDir[0];
157 seedDir[1] = newSeedDir[1];
158 seedDir[2] = newSeedDir[2];
162 for(
const auto& hit3D : hit3DList) hit3D->setStatusBit(0x40000000);
164 seedHitPairVec.emplace_back(std::pair<recob::Seed, reco::HitPairListPtr>(
recob::Seed(seedStart, seedDir), hit3DList));
166 foundGoodSeed =
true;
171 return foundGoodSeed;
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
bool getHitsAtEnd(reco::HitPairListPtr &hit3DList, reco::PrincipalComponents &seedPca) const
Separate function to find hits at the ends of the input hits.
void flipAxis(size_t axis)
PrincipalComponentsAlg m_pcaAlg
const EigenValues & getEigenValues() const
std::list< const reco::ClusterHit3D * > HitPairListPtr
static unsigned int reverse(QString &chars, unsigned char *level, unsigned int a, unsigned int b)
void LineFit2DHits(const reco::HitPairListPtr &hitList, double XOrigin, TVector3 &Pos, TVector3 &Dir, double &ChiDOF) const
const EigenVectors & getEigenVectors() const