31 if (
i1.subdetId() !=
i2.subdetId()) {
53 if (
a->geographicalId() <
b->geographicalId())
55 if (
b->geographicalId() <
a->geographicalId())
58 if (
a->localPosition().x() <
b->localPosition().x() - 1
e-5)
60 if (
b->localPosition().x() <
a->localPosition().x() - 1
e-5)
63 if (
a->localPosition().y() <
b->localPosition().y() - 1
e-5)
65 if (
b->localPosition().y() <
a->localPosition().y() - 1
e-5)
80 if (
a->geographicalId() !=
b->geographicalId())
83 if (fabs(
a->localPosition().x() -
b->localPosition().x()) < 1
e-5 &&
84 fabs(
a->localPosition().y() -
b->localPosition().y()) < 1
e-5)
93 if (
i1.subdetId() !=
i2.subdetId())
104 constexpr
int max[4] = {20, 32, 44, 64};
107 if (dphi >
max[aLayer] / 2)
108 dphi =
max[aLayer] - dphi;
112 if (dphi == 1 &&
dz <= 1)
120 constexpr
int max = 24;
127 if (dphi <= 1 &&
dr <= 1 && !(dphi == 0 &&
dr == 0))
136 const vector<const TrackingRecHit *> &recHitsB)
const {
139 for (vector<const TrackingRecHit *>::const_iterator recHitA = recHitsA.begin(); recHitA != recHitsA.end(); recHitA++)
140 for (vector<const TrackingRecHit *>::const_iterator recHitB = recHitsB.begin(); recHitB != recHitsB.end();
142 if (!
areSame(*recHitA, *recHitB))
143 if (!
isCompatible((*recHitA)->geographicalId(), (*recHitB)->geographicalId()))
154 typedef map<const TrackingRecHit *, vector<unsigned int>,
HitComparator> RecHitMap;
160 LogTrace(
"MinBiasTracking") <<
" [TrackCleaner] initial tracks : " <<
tracks.size();
162 for (
unsigned int i = 0;
i <
tracks.size();
i++)
176 for (
unsigned int i = 0;
i <
tracks.size();
i++)
181 recHitMap[*
recHit].push_back(
i);
185 typedef map<unsigned int, int, less<unsigned int> > TrackMap;
187 for (
unsigned int i = 0;
i <
tracks.size();
i++) {
205 vector<unsigned int> sharing = recHitMap[*
recHit];
207 for (vector<unsigned int>::iterator
j = sharing.begin();
j != sharing.end();
j++)
213 for (TrackMap::iterator sharing = trackMap.begin(); sharing != trackMap.end(); sharing++) {
214 unsigned int j = (*sharing).first;
228 for (vector<const TrackingRecHit *>::const_iterator recHitA =
tracks[
i].
second.begin();
229 recHitA !=
tracks[
i].second.end();
236 recHitMap[*
recHit].push_back(
i);
244 LogTrace(
"TrackCleaner") <<
" Merge #" <<
i <<
" #" <<
j <<
", first now has "
257 LogTrace(
"TrackCleaner") <<
" Clash #" <<
i <<
" #" <<
j <<
" keep lower d0 " <<
tracks[
i].first->d0()
258 <<
" " <<
tracks[
j].first->d0() <<
", keep #"
264 if ((*sharing).second > 1) {
272 LogTrace(
"TrackCleaner") <<
" Sharing " << (*sharing).second <<
" remove by size";
280 LogTrace(
"TrackCleaner") <<
" Sharing " << (*sharing).second <<
" remove by d0";
285 if ((*sharing).second > 0) {
298 }
while (changes > 0);
303 for (
unsigned int i = 0;
i <
tracks.size();
i++)
307 delete tracks_[
i].first;
309 LogTrace(
"MinBiasTracking") <<
" [TrackCleaner] cleaned tracks : " << cleaned.size();
311 for (
unsigned int i = 0;
i < cleaned.size();
i++)