21 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" 23 unsigned int size = trackHitPairs.size();
29 unsigned int ind[
size];
33 if (trackHitPairs[
i].
second.size() == 4)
38 auto kill = [&](
unsigned int k) {
39 delete trackHitPairs[
k].first;
40 trackHitPairs[
k].first =
nullptr;
47 auto iTrack1 = ind[
i];
48 auto track1 = trackHitPairs[iTrack1].first;
51 auto const& recHits1 = trackHitPairs[iTrack1].second;
52 for (
auto j =
i + 1;
j <
size; ++
j) {
53 auto iTrack2 = ind[
j];
54 auto track2 = trackHitPairs[iTrack2].first;
57 auto const& recHits2 = trackHitPairs[iTrack2].second;
58 if (recHits1[0] != recHits2[0])
60 if (recHits1[1] != recHits2[1])
68 auto iTrack1 = ind[
i];
69 auto track1 = trackHitPairs[iTrack1].first;
72 auto const& recHits1 = trackHitPairs[iTrack1].second;
73 if (recHits1.size() < 3)
75 for (
auto j =
i + 1;
j <
size; ++
j) {
76 auto iTrack2 = ind[
j];
77 auto track2 = trackHitPairs[iTrack2].first;
80 auto const& recHits2 = trackHitPairs[iTrack2].second;
81 if (recHits2.size() < 3)
83 if (recHits1[0] != recHits2[0])
85 if (recHits1[2] != recHits2[2])
93 auto iTrack1 = ind[
i];
94 auto track1 = trackHitPairs[iTrack1].first;
97 auto const& recHits1 = trackHitPairs[iTrack1].second;
98 auto s1 = recHits1.size();
99 for (
auto j =
i + 1;
j <
size; ++
j) {
100 auto iTrack2 = ind[
j];
101 auto track2 = trackHitPairs[iTrack2].first;
104 auto const& recHits2 = trackHitPairs[iTrack2].second;
105 auto s2 = recHits2.size();
106 auto commonRecHits = 0
U;
108 for (
auto iRecHit1 = 0
U; iRecHit1 < s1; ++iRecHit1) {
109 for (
auto iRecHit2 =
f2; iRecHit2 < s2; ++iRecHit2) {
110 if (recHits1[iRecHit1] == recHits2[iRecHit2]) {
116 if (commonRecHits > 1)
120 if (commonRecHits >= 1) {
121 if (s1 == 3 || commonRecHits > 1) {
125 }
else if (commonRecHits > 1) {
132 std::remove_if(trackHitPairs.begin(), trackHitPairs.end(), [&](
TrackWithTTRHs&
v) {
return nullptr ==
v.first; }),
133 trackHitPairs.end());
PixelTrackCleanerBySharedHits(bool useQuadrupletAlgo)
const bool useQuadrupletAlgo_
U second(std::pair< T, U > const &p)
void cleanTracks(TracksWithTTRHs &tracksWithRecHits) const override
pixeltrackfitting::TrackWithTTRHs TrackWithTTRHs
~PixelTrackCleanerBySharedHits() override
pixeltrackfitting::TracksWithTTRHs TracksWithTTRHs