65 std::vector<weightedTrajectorySeed> sortweightedSeeds;
66 std::vector<weightedTrajectorySeed> tempweightedSeeds;
72 while(weightedSeedsRef->size() != 0) {
73 cout <<
"Finding the weighted seeds group from " << weightedSeedsRef->size() <<
" seeds which share some recHits" << endl;
76 tempweightedSeeds.clear();
78 for(vector<weightedTrajectorySeed>::iterator itweightedseed = weightedSeedsRef->begin(); itweightedseed != weightedSeedsRef->end(); N++) {
81 cout <<
"Always take the 1st weighted seed to be the referrence." << endl;
83 cout <<
"Put its recHits to tempRecHits" << endl;
86 cout <<
"Put it to tempweightedSeeds" << endl;
87 tempweightedSeeds.push_back(*itweightedseed);
88 cout <<
"Then erase from weightedSeedsRef->" << endl;
89 itweightedseed = weightedSeedsRef->erase(itweightedseed);
92 cout <<
"Come to other weighted seed for checking " << itweightedseed->first.nHits() <<
" recHits from " << tempRecHits.
size() <<
" temp recHits" << endl;
93 unsigned int ShareRecHitsNumber = 0;
99 cout <<
"This seed is found to belong to current share group" << endl;
101 if(!
isShareHit(tempRecHits, *it, rpcGeometry)) {
102 cout <<
"Put its extra recHits to tempRecHits" << endl;
106 cout <<
"Put it to tempSeeds" << endl;
107 tempweightedSeeds.push_back(*itweightedseed);
108 cout <<
"Then erase from SeedsRef" << endl;
109 itweightedseed = weightedSeedsRef->erase(itweightedseed);
118 vector<weightedTrajectorySeed>::iterator bestweightediter;
120 double Quality = 1000000;
121 unsigned NumberofHits = 0;
122 cout <<
"Find " << tempweightedSeeds.size() <<
" seeds into one trajectory group" << endl;
123 for(vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin(); itweightedseed != tempweightedSeeds.end(); itweightedseed++) {
124 unsigned int nHits = itweightedseed->first.nHits();
127 double weightedQuality = itweightedseed->second;
128 cout <<
"Find a weighted seed with quality " << weightedQuality << endl;
129 if((NumberofHits < nHits) || (NumberofHits == nHits && weightedQuality < Quality)) {
130 NumberofHits = nHits;
131 Quality = weightedQuality;
132 bestweightedSeed = *itweightedseed;
133 bestweightediter = itweightedseed;
136 cout <<
"Best good temp seed's quality is " << Quality <<endl;
137 sortweightedSeeds.push_back(bestweightedSeed);
138 tempweightedSeeds.erase(bestweightediter);
144 for(vector<weightedTrajectorySeed>::iterator itweightedseed = tempweightedSeeds.begin(); itweightedseed != tempweightedSeeds.end(); ) {
145 cout <<
"Checking the temp weighted seed's " << itweightedseed->first.nHits() <<
" hits to " << tempRecHits.
size() <<
" temp recHits" << endl;
147 bool isShare =
false;
152 if(isShare ==
true) {
153 cout <<
"Find one temp seed share some recHits with best weighted seed" << endl;
154 itweightedseed = tempweightedSeeds.erase(itweightedseed);
157 cout <<
"This seed has no relation with best weighted seed" << endl;
158 weightedSeedsRef->push_back(*itweightedseed);
159 itweightedseed = tempweightedSeeds.erase(itweightedseed);
164 weightedSeedsRef->clear();
165 *weightedSeedsRef = sortweightedSeeds;
bool isShareHit(const edm::OwnVector< TrackingRecHit > &RecHits, const TrackingRecHit &hit, edm::ESHandle< RPCGeometry > rpcGeometry)
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
unsigned int ShareRecHitsNumberThreshold
RPCSeedPattern::weightedTrajectorySeed weightedTrajectorySeed