10 using namespace pixeltrackfitting;
23 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
24 unsigned int size = trackHitPairs.size();
25 if (size <= 1)
return;
27 auto kill = [&](
unsigned int i) {
delete trackHitPairs[
i].first; trackHitPairs[
i].first=
nullptr;};
29 for (
auto iTrack1 = 0U; iTrack1 <
size; iTrack1++) {
31 auto track1 = trackHitPairs[iTrack1].first;
32 if (!track1)
continue;
34 auto const & recHits1 = trackHitPairs[iTrack1].second;
35 auto s1 = recHits1.size();
36 for (
auto iTrack2 = iTrack1 + 1U; iTrack2 <
size; iTrack2++)
38 auto track2 = trackHitPairs[iTrack2].first;
39 if (!track2)
continue;
40 auto const & recHits2 = trackHitPairs[iTrack2].second;
41 auto s2 = recHits2.size();
43 auto commonRecHits = 0U;
44 for (
auto iRecHit1 = 0U; iRecHit1 < s1; ++iRecHit1) {
45 for (
auto iRecHit2 =
f2; iRecHit2 <
s2; ++iRecHit2) {
46 if (recHits1[iRecHit1] == recHits2[iRecHit2]) { ++commonRecHits;
f2=iRecHit2+1;
break;}
48 if (commonRecHits > 1)
break;
51 if (commonRecHits > 1) {
52 if (track1->pt() > track2->pt()) kill(iTrack2);
53 else { kill(iTrack1);
break;}
59 trackHitPairs.erase(std::remove_if(trackHitPairs.begin(),trackHitPairs.end(),[&](
TrackWithTTRHs &
v){
return nullptr==
v.first;}),trackHitPairs.end());
void cleanTracks(TracksWithTTRHs &tracksWithRecHits, const TrackerTopology *tTopo) const override
PixelTrackCleanerBySharedHits(const edm::ParameterSet &cfg)
~PixelTrackCleanerBySharedHits()
pixeltrackfitting::TrackWithTTRHs TrackWithTTRHs
pixeltrackfitting::TracksWithTTRHs TracksWithTTRHs
tuple size
Write out results.