14 useQuadrupletAlgo_(useQuadrupletAlgo)
24 LogDebug(
"PixelTrackCleanerBySharedHits") <<
"Cleanering tracks" <<
"\n";
25 unsigned int size = trackHitPairs.size();
26 if (size <= 1)
return;
28 auto kill = [&](
unsigned int i) {
delete trackHitPairs[
i].first; trackHitPairs[
i].first=
nullptr;};
30 for (
auto iTrack1 = 0
U; iTrack1 <
size; iTrack1++) {
32 auto track1 = trackHitPairs[iTrack1].first;
33 if (!track1)
continue;
35 auto const & recHits1 = trackHitPairs[iTrack1].second;
36 auto s1 = recHits1.size();
37 for (
auto iTrack2 = iTrack1 + 1
U; iTrack2 <
size; iTrack2++)
39 auto track2 = trackHitPairs[iTrack2].first;
40 if (!track2)
continue;
41 auto const & recHits2 = trackHitPairs[iTrack2].second;
42 auto s2 = recHits2.size();
44 auto commonRecHits = 0
U;
45 for (
auto iRecHit1 = 0
U; iRecHit1 < s1; ++iRecHit1) {
46 for (
auto iRecHit2 =
f2; iRecHit2 <
s2; ++iRecHit2) {
47 if (recHits1[iRecHit1] == recHits2[iRecHit2]) { ++commonRecHits;
f2=iRecHit2+1;
break;}
49 if (commonRecHits > 1)
break;
52 auto cleanTrack = [&](){
53 if (track1->pt() > track2->pt()) { kill(iTrack2);
return false; }
59 if(commonRecHits >= 1) {
60 if (s1 >
s2) kill(iTrack2);
61 else if(s1 <
s2) { kill(iTrack1);
break;}
62 else if(s1 == 3) {
if(cleanTrack())
break; }
63 else if(commonRecHits > 1) {
if(cleanTrack())
break; }
66 else if (commonRecHits > 1) {
67 if(cleanTrack())
break;
72 trackHitPairs.erase(std::remove_if(trackHitPairs.begin(),trackHitPairs.end(),[&](
TrackWithTTRHs &
v){
return nullptr==
v.first;}),trackHitPairs.end());
PixelTrackCleanerBySharedHits(bool useQuadrupletAlgo)
const bool useQuadrupletAlgo_
~PixelTrackCleanerBySharedHits()
void cleanTracks(TracksWithTTRHs &tracksWithRecHits) const override
pixeltrackfitting::TrackWithTTRHs TrackWithTTRHs
pixeltrackfitting::TracksWithTTRHs TracksWithTTRHs