55 std::vector<weightedTrajectorySeed> sortweightedSeeds;
56 std::vector<weightedTrajectorySeed> tempweightedSeeds;
62 while (!weightedSeedsRef->empty()) {
63 cout <<
"Finding the weighted seeds group from " << weightedSeedsRef->size() <<
" seeds which share some recHits"
67 tempweightedSeeds.clear();
69 for (vector<weightedTrajectorySeed>::iterator itweightedseed = weightedSeedsRef->begin();
70 itweightedseed != weightedSeedsRef->end();
74 cout <<
"Always take the 1st weighted seed to be the referrence." << endl;
76 cout <<
"Put its recHits to tempRecHits" << endl;
79 cout <<
"Put it to tempweightedSeeds" << endl;
80 tempweightedSeeds.push_back(*itweightedseed);
81 cout <<
"Then erase from weightedSeedsRef->" << endl;
82 itweightedseed = weightedSeedsRef->erase(itweightedseed);
84 cout <<
"Come to other weighted seed for checking " << itweightedseed->first.nHits() <<
" recHits from "
85 << tempRecHits.
size() <<
" temp recHits" << endl;
86 unsigned int ShareRecHitsNumber = 0;
92 cout <<
"This seed is found to belong to current share group" << endl;
94 if (!
isShareHit(tempRecHits, *it, rpcGeometry)) {
95 cout <<
"Put its extra recHits to tempRecHits" << endl;
99 cout <<
"Put it to tempSeeds" << endl;
100 tempweightedSeeds.push_back(*itweightedseed);
101 cout <<
"Then erase from SeedsRef" << endl;
102 itweightedseed = weightedSeedsRef->erase(itweightedseed);
110 vector<weightedTrajectorySeed>::iterator bestweightediter;
113 unsigned NumberofHits = 0;
114 cout <<
"Find " << tempweightedSeeds.size() <<
" seeds into one trajectory group" << endl;
115 for (vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin();
116 itweightedseed != tempweightedSeeds.end();
118 unsigned int nHits = itweightedseed->first.nHits();
121 double weightedQuality = itweightedseed->second;
122 cout <<
"Find a weighted seed with quality " << weightedQuality << endl;
123 if ((NumberofHits < nHits) || (NumberofHits == nHits && weightedQuality <
Quality)) {
124 NumberofHits = nHits;
126 bestweightedSeed = *itweightedseed;
127 bestweightediter = itweightedseed;
130 cout <<
"Best good temp seed's quality is " <<
Quality << endl;
131 sortweightedSeeds.push_back(bestweightedSeed);
132 tempweightedSeeds.erase(bestweightediter);
136 it != bestweightedSeed.first.recHits().second;
140 for (vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin();
141 itweightedseed != tempweightedSeeds.end();) {
142 cout <<
"Checking the temp weighted seed's " << itweightedseed->first.nHits() <<
" hits to " << tempRecHits.
size()
143 <<
" temp recHits" << endl;
145 bool isShare =
false;
147 if (
isShareHit(tempRecHits, *it, rpcGeometry))
150 if (isShare ==
true) {
151 cout <<
"Find one temp seed share some recHits with best weighted seed" << endl;
152 itweightedseed = tempweightedSeeds.erase(itweightedseed);
154 cout <<
"This seed has no relation with best weighted seed" << endl;
155 weightedSeedsRef->push_back(*itweightedseed);
156 itweightedseed = tempweightedSeeds.erase(itweightedseed);
161 weightedSeedsRef->clear();
162 *weightedSeedsRef = sortweightedSeeds;