10 using namespace pixeltrackfitting;
24 return ((pos1.
x() == pos2.
x()) && (pos1.
y() == pos2.
y()));
32 typedef std::vector<const TrackingRecHit *> RecHits;
35 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
36 int size = trackHitPairs.size();
39 for (
int i = 0;
i <
size;
i++) trackOk[
i] =
true;
41 for (
auto iTrack1 = 0; iTrack1 <
size; iTrack1++) {
42 auto track1 = trackHitPairs[iTrack1].first;
43 const RecHits& recHits1 = trackHitPairs[iTrack1].second;
45 if (!trackOk[iTrack1])
continue;
47 for (
auto iTrack2 = iTrack1 + 1; iTrack2 <
size; iTrack2++)
49 if ( !trackOk[iTrack2])
continue;
51 auto track2 = trackHitPairs[iTrack2].first;
52 const RecHits& recHits2 = trackHitPairs[iTrack2].second;
54 int commonRecHits = 0;
55 for (
auto iRecHit1 = 0U; iRecHit1 < recHits1.size(); iRecHit1++) {
56 for (
auto iRecHit2 = 0U; iRecHit2 < recHits2.size(); iRecHit2++) {
57 if (recHitsAreEqual(recHits1[iRecHit1], recHits2[iRecHit2])) { commonRecHits++;
break;}
59 if (commonRecHits > 1)
break;
62 if (commonRecHits > 1) {
63 if (track1->pt() > track2->pt()) trackOk[iTrack2] =
false;
64 else { trackOk[iTrack1] =
false;
break;}
70 vector<TrackWithRecHits> cleanedTracks;
74 if (trackOk[
i]) cleanedTracks.push_back(trackHitPairs[i]);
75 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