10 using namespace pixeltrackfitting;
24 return ((pos1.
x() == pos2.
x()) && (pos1.
y() == pos2.
y()));
32 typedef std::vector<const TrackingRecHit *> RecHits;
33 vector<TrackWithRecHits> cleanedTracks;
35 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
36 unsigned int size = trackHitPairs.size();
37 if (size == 0)
return cleanedTracks;
40 for (
auto i = 0U;
i <
size;
i++) trackOk[
i] =
true;
42 for (
auto iTrack1 = 0U; iTrack1 <
size; iTrack1++) {
43 auto track1 = trackHitPairs[iTrack1].first;
44 const RecHits& recHits1 = trackHitPairs[iTrack1].second;
46 if (!trackOk[iTrack1])
continue;
48 for (
auto iTrack2 = iTrack1 + 1U; iTrack2 <
size; iTrack2++)
50 if ( !trackOk[iTrack2])
continue;
52 auto track2 = trackHitPairs[iTrack2].first;
53 const RecHits& recHits2 = trackHitPairs[iTrack2].second;
55 auto commonRecHits = 0U;
56 for (
auto iRecHit1 = 0U; iRecHit1 < recHits1.size(); iRecHit1++) {
57 for (
auto iRecHit2 = 0U; iRecHit2 < recHits2.size(); iRecHit2++) {
58 if (recHitsAreEqual(recHits1[iRecHit1], recHits2[iRecHit2])) { commonRecHits++;
break;}
60 if (commonRecHits > 1)
break;
63 if (commonRecHits > 1) {
64 if (track1->pt() > track2->pt()) trackOk[iTrack2] =
false;
65 else { trackOk[iTrack1] =
false;
break;}
71 for (
auto i = 0U;
i <
size;
i++)
73 if (trackOk[
i]) cleanedTracks.push_back(trackHitPairs[i]);
74 else delete trackHitPairs[
i].first;
PixelTrackCleanerBySharedHits(const edm::ParameterSet &cfg)
virtual TracksWithRecHits cleanTracks(const TracksWithRecHits &tracksWithRecHits, const TrackerTopology *tTopo)
virtual ~PixelTrackCleanerBySharedHits()
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
tuple size
Write out results.
pixeltrackfitting::TracksWithRecHits TracksWithRecHits