16 useQuadrupletAlgo_(useQuadrupletAlgo)
26 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
27 unsigned int size = trackHitPairs.size();
28 if (size <= 1)
return;
32 unsigned int ind[
size];
35 score[
i]= 32000-
std::min(32000,
int(trackHitPairs[
i].
first->chi2()*100.f));
36 if (trackHitPairs[
i].
second.size()==4) score[
i]+=32001;
38 std::sort(ind,ind+size,[&](
unsigned int i,
unsigned int j){
return score[
i]>score[j];});
40 auto kill = [&](
unsigned int k) {
delete trackHitPairs[
k].first; trackHitPairs[
k].first=
nullptr;};
45 for (
auto i = 0
U; i <
size; ++
i) {
46 auto iTrack1 = ind[
i];
47 auto track1 = trackHitPairs[iTrack1].first;
48 if (!track1)
continue;
49 auto const & recHits1 = trackHitPairs[iTrack1].second;
50 for (
auto j = i+1; j <
size; ++j) {
51 auto iTrack2 = ind[j];
52 auto track2 = trackHitPairs[iTrack2].first;
53 if (!track2)
continue;
54 auto const & recHits2 = trackHitPairs[iTrack2].second;
55 if (recHits1[0] != recHits2[0])
continue;
56 if (recHits1[1] != recHits2[1])
continue;
63 for (
auto i = 0
U; i <
size; ++
i) {
64 auto iTrack1 = ind[
i];
65 auto track1 = trackHitPairs[iTrack1].first;
66 if (!track1)
continue;
67 auto const & recHits1 = trackHitPairs[iTrack1].second;
68 if (recHits1.size()<3)
continue;
69 for (
auto j = i+1; j <
size; ++j) {
70 auto iTrack2 = ind[j];
71 auto track2 = trackHitPairs[iTrack2].first;
72 if (!track2)
continue;
73 auto const & recHits2 = trackHitPairs[iTrack2].second;
74 if (recHits2.size()<3)
continue;
75 if (recHits1[0] != recHits2[0])
continue;
76 if (recHits1[2] != recHits2[2])
continue;
83 for (
auto i = 0
U; i <
size; ++
i) {
84 auto iTrack1 = ind[
i];
85 auto track1 = trackHitPairs[iTrack1].first;
86 if (!track1)
continue;
87 auto const & recHits1 = trackHitPairs[iTrack1].second;
88 auto s1 = recHits1.size();
89 for (
auto j = i+1; j <
size; ++j) {
90 auto iTrack2 = ind[j];
91 auto track2 = trackHitPairs[iTrack2].first;
92 if (!track2)
continue;
93 auto const & recHits2 = trackHitPairs[iTrack2].second;
94 auto s2 = recHits2.size();
95 auto commonRecHits = 0
U;
97 for (
auto iRecHit1 = 0
U; iRecHit1 < s1; ++iRecHit1) {
98 for (
auto iRecHit2 =
f2; iRecHit2 <
s2; ++iRecHit2) {
99 if (recHits1[iRecHit1] == recHits2[iRecHit2]) { ++commonRecHits;
f2=iRecHit2+1;
break;}
101 if (commonRecHits > 1)
break;
104 if(commonRecHits >= 1) {
105 if(s1 == 3 || commonRecHits > 1) { kill(iTrack2); }
108 else if (commonRecHits > 1) {
114 trackHitPairs.erase(std::remove_if(trackHitPairs.begin(),trackHitPairs.end(),[&](
TrackWithTTRHs &
v){
return nullptr==
v.first;}),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