CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
PixelTrackCleanerBySharedHits Class Referencefinal

#include <PixelTrackCleanerBySharedHits.h>

Inheritance diagram for PixelTrackCleanerBySharedHits:
PixelTrackCleaner

Public Types

using TracksWithTTRHs = pixeltrackfitting::TracksWithTTRHs
 
using TrackWithTTRHs = pixeltrackfitting::TrackWithTTRHs
 
- Public Types inherited from PixelTrackCleaner
typedef
pixeltrackfitting::TracksWithRecHits 
TracksWithRecHits
 
using TracksWithTTRHs = pixeltrackfitting::TracksWithTTRHs
 

Public Member Functions

void cleanTracks (TracksWithTTRHs &tracksWithRecHits, const TrackerTopology *tTopo) const override
 
 PixelTrackCleanerBySharedHits (const edm::ParameterSet &cfg)
 
 ~PixelTrackCleanerBySharedHits ()
 
- Public Member Functions inherited from PixelTrackCleaner
virtual TracksWithRecHits cleanTracks (const TracksWithRecHits &tracksWithRecHits, const TrackerTopology *tTopo)
 
virtual ~PixelTrackCleaner ()
 

Additional Inherited Members

- Public Attributes inherited from PixelTrackCleaner
bool fast =false
 

Detailed Description

Definition at line 17 of file PixelTrackCleanerBySharedHits.h.

Member Typedef Documentation

Definition at line 25 of file PixelTrackCleanerBySharedHits.h.

Definition at line 24 of file PixelTrackCleanerBySharedHits.h.

Constructor & Destructor Documentation

PixelTrackCleanerBySharedHits::PixelTrackCleanerBySharedHits ( const edm::ParameterSet cfg)

Definition at line 12 of file PixelTrackCleanerBySharedHits.cc.

13 {fast=true;}
PixelTrackCleanerBySharedHits::~PixelTrackCleanerBySharedHits ( )

Definition at line 15 of file PixelTrackCleanerBySharedHits.cc.

16 {}

Member Function Documentation

void PixelTrackCleanerBySharedHits::cleanTracks ( TracksWithTTRHs tracksWithRecHits,
const TrackerTopology tTopo 
) const
overridevirtual

Reimplemented from PixelTrackCleaner.

Definition at line 19 of file PixelTrackCleanerBySharedHits.cc.

References validate-o2o-wbm::f2, i, LogDebug, indexGen::s2, findQualityFiles::size, and findQualityFiles::v.

21 {
22 
23  LogDebug("PixelTrackCleanerBySharedHits") << "Cleanering tracks" << "\n";
24  unsigned int size = trackHitPairs.size();
25  if (size <= 1) return;
26 
27  auto kill = [&](unsigned int i) { delete trackHitPairs[i].first; trackHitPairs[i].first=nullptr;};
28 
29  for (auto iTrack1 = 0U; iTrack1 < size; iTrack1++) {
30 
31  auto track1 = trackHitPairs[iTrack1].first;
32  if (!track1) continue;
33 
34  auto const & recHits1 = trackHitPairs[iTrack1].second;
35  auto s1 = recHits1.size();
36  for (auto iTrack2 = iTrack1 + 1U; iTrack2 < size; iTrack2++)
37  {
38  auto track2 = trackHitPairs[iTrack2].first;
39  if (!track2) continue;
40  auto const & recHits2 = trackHitPairs[iTrack2].second;
41  auto s2 = recHits2.size();
42  auto f2=0U;
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;} // if a hit is common, no other can be the same!
47  }
48  if (commonRecHits > 1) break;
49  }
50 
51  if (commonRecHits > 1) {
52  if (track1->pt() > track2->pt()) kill(iTrack2);
53  else { kill(iTrack1); break;}
54  }
55 
56  }
57  }
58 
59  trackHitPairs.erase(std::remove_if(trackHitPairs.begin(),trackHitPairs.end(),[&](TrackWithTTRHs & v){ return nullptr==v.first;}),trackHitPairs.end());
60 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::pair< reco::Track *, SeedingHitSet > TrackWithTTRHs
tuple s2
Definition: indexGen.py:106
tuple size
Write out results.