11 using namespace pixeltrackfitting;
21 typedef std::vector<const TrackingRecHit *> RecHits;
24 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
25 int size = trackHitPairs.size();
26 for (
int i = 0;
i <
size;
i++) trackOk.push_back(
true);
28 for (iTrack1 = 0; iTrack1 <
size; iTrack1++)
30 track1 = trackHitPairs.at(iTrack1).first;
31 const RecHits& recHits1 = trackHitPairs.at(iTrack1).second;
33 if (!trackOk.at(iTrack1))
continue;
35 for (iTrack2 = iTrack1 + 1; iTrack2 <
size; iTrack2++)
37 if (!trackOk.at(iTrack1) || !trackOk.at(iTrack2))
continue;
39 track2 = trackHitPairs.at(iTrack2).first;
40 const RecHits& recHits2 = trackHitPairs.at(iTrack2).second;
42 int commonRecHits = 0;
43 for (
int iRecHit1 = 0; iRecHit1 < (int)recHits1.size(); iRecHit1++)
45 for (
int iRecHit2 = 0; iRecHit2 < (int)recHits2.size(); iRecHit2++)
47 if (recHitsAreEqual(recHits1.at(iRecHit1), recHits2.at(iRecHit2))) commonRecHits++;
50 if (commonRecHits > 1) cleanTrack();
54 vector<TrackWithRecHits> cleanedTracks;
58 if (trackOk.at(
i)) cleanedTracks.push_back(trackHitPairs.at(
i));
59 else delete trackHitPairs.at(
i).first;
67 if (track1->pt() > track2->pt()) trackOk.at(iTrack2) =
false;
68 else trackOk.at(iTrack1) =
false;
77 return ((pos1.
x() == pos2.
x()) && (pos1.
y() == pos2.
y()));
PixelTrackCleanerBySharedHits(const edm::ParameterSet &cfg)
bool recHitsAreEqual(const TrackingRecHit *recHit1, const TrackingRecHit *recHit2)
virtual ~PixelTrackCleanerBySharedHits()
virtual TracksWithRecHits cleanTracks(const TracksWithRecHits &tracksWithRecHits)
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
tuple size
Write out results.
pixeltrackfitting::TracksWithRecHits TracksWithRecHits