1 #ifndef FASTSIMULATION_TRACKING_SEEDFINDER_H 2 #define FASTSIMULATION_TRACKING_SEEDFINDER_H 30 _seedingTree(seedingTree),
31 _trackerTopology(&trackerTopology)
37 if (_selectorFunctionsByHits.size()<nHits)
39 _selectorFunctionsByHits.resize(nHits);
40 _selectorFunctionsByHits.reserve(nHits);
43 _selectorFunctionsByHits[nHits-1].push_back(seedFinderSelector);
46 std::vector<unsigned int>
getSeed(
const std::vector<const FastTrackerRecHit *>& trackerRecHits)
const 48 std::vector<int> hitIndicesInTree(_seedingTree.
numberOfNodes(),-1);
61 std::vector<TrajectorySeedHitCandidate> seedHitCandidates;
65 seedHitCandidates.push_back(
std::move(seedHitCandidate));
67 return iterateHits(0,seedHitCandidates,hitIndicesInTree,
true);
75 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
76 std::vector<int>& hitIndicesInTree,
81 if (hitIndicesInTree[node->
getIndex()]<0)
90 if (_selectorFunctionsByHits.size()>=
NHits)
93 if (!_selectorFunctionsByHits[NHits-1].
empty())
96 std::vector<const FastTrackerRecHit*> seedCandidateHitList(node->
getDepth()+1);
97 seedCandidateHitList[node->
getDepth()]=currentTrackerHit.
hit();
99 while (parentNode!=
nullptr)
101 seedCandidateHitList[parentNode->
getDepth()]=trackerRecHits[hitIndicesInTree[parentNode->
getIndex()]].hit();
108 if (!selectorFunction->pass(seedCandidateHitList))
117 hitIndicesInTree[node->
getIndex()]=trackerHit;
127 for (
unsigned int ichild = 0; ichild<node->
getChildrenSize(); ++ichild)
142 const std::vector<TrajectorySeedHitCandidate>& trackerRecHits,
143 std::vector<int> hitIndicesInTree,
144 bool processSkippedHits)
const 146 for (
unsigned int irecHit = start; irecHit<trackerRecHits.size(); ++irecHit)
155 unsigned int currentHitIndex=irecHit;
157 for (
unsigned int inext=currentHitIndex+1; inext< trackerRecHits.size(); ++inext)
160 if (trackerRecHits[currentHitIndex].getTrackingLayer()==trackerRecHits[inext].getTrackingLayer())
162 if (processSkippedHits)
171 if (!seedHits.empty())
187 for (
unsigned int iroot=0; seedNode==
nullptr && iroot<_seedingTree.
numberOfRoots(); ++iroot)
189 seedNode=
insertHit(trackerRecHits,hitIndicesInTree,_seedingTree.
getRoot(iroot), currentHitIndex);
193 std::vector<unsigned int> seedIndices(seedNode->
getDepth()+1);
204 return std::vector<unsigned int>();
const SingleSet & getSingleSet() const
const DATA & getData() const
unsigned int getChildrenSize() const
const SeedingNode< TrackingLayer > * insertHit(const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > &hitIndicesInTree, const SeedingNode< TrackingLayer > *node, unsigned int trackerHit) const
unsigned int getDepth() const
const SeedingNode * getParent() const
unsigned int numberOfNodes() const
unsigned int numberOfRoots() const
std::vector< unsigned int > getSeed(const std::vector< const FastTrackerRecHit * > &trackerRecHits) const
SeedFinder(const SeedingTree< TrackingLayer > &seedingTree, const TrackerTopology &trackerTopology)
std::vector< unsigned int > iterateHits(unsigned int start, const std::vector< TrajectorySeedHitCandidate > &trackerRecHits, std::vector< int > hitIndicesInTree, bool processSkippedHits) const
const SeedingTree< TrackingLayer > & _seedingTree
void addHitSelector(SeedFinderSelector *seedFinderSelector, unsigned int nHits)
const SeedingNode< DATA > * getRoot(unsigned int i) const
const FastTrackerRecHit * hit() const
The Hit itself.
unsigned int getIndex() const
const TrackingLayer & getTrackingLayer() const
const SeedingNode< DATA > * getChild(unsigned int ichild) const
const TrackerTopology * _trackerTopology
std::vector< std::vector< SeedFinderSelector * > > _selectorFunctionsByHits