test
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 Reference

#include <PixelTrackCleanerBySharedHits.h>

Inheritance diagram for PixelTrackCleanerBySharedHits:
PixelTrackCleaner

Public Types

typedef
pixeltrackfitting::TracksWithRecHits 
TracksWithRecHits
 
- Public Types inherited from PixelTrackCleaner
typedef
pixeltrackfitting::TracksWithRecHits 
TracksWithRecHits
 

Public Member Functions

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

Detailed Description

Definition at line 17 of file PixelTrackCleanerBySharedHits.h.

Member Typedef Documentation

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 {}
PixelTrackCleanerBySharedHits::~PixelTrackCleanerBySharedHits ( )
virtual

Definition at line 15 of file PixelTrackCleanerBySharedHits.cc.

16 {}

Member Function Documentation

TracksWithRecHits PixelTrackCleanerBySharedHits::cleanTracks ( const TracksWithRecHits tracksWithRecHits,
const TrackerTopology tTopo 
)
virtual

Implements PixelTrackCleaner.

Definition at line 29 of file PixelTrackCleanerBySharedHits.cc.

References i, LogDebug, and findQualityFiles::size.

31 {
32  typedef std::vector<const TrackingRecHit *> RecHits;
33  vector<TrackWithRecHits> cleanedTracks;
34 
35  LogDebug("PixelTrackCleanerBySharedHits") << "Cleanering tracks" << "\n";
36  unsigned int size = trackHitPairs.size();
37  if (size == 0) return cleanedTracks;
38 
39  bool trackOk[size];
40  for (auto i = 0U; i < size; i++) trackOk[i] = true;
41 
42  for (auto iTrack1 = 0U; iTrack1 < size; iTrack1++) {
43  auto track1 = trackHitPairs[iTrack1].first;
44  const RecHits& recHits1 = trackHitPairs[iTrack1].second;
45 
46  if (!trackOk[iTrack1]) continue;
47 
48  for (auto iTrack2 = iTrack1 + 1U; iTrack2 < size; iTrack2++)
49  {
50  if ( !trackOk[iTrack2]) continue;
51 
52  auto track2 = trackHitPairs[iTrack2].first;
53  const RecHits& recHits2 = trackHitPairs[iTrack2].second;
54 
55  auto commonRecHits = 0U;
56  for (auto iRecHit1 = 0U; iRecHit1 < recHits1.size(); iRecHit1++) {
57  for (auto iRecHit2 = 0U; iRecHit2 < recHits2.size(); iRecHit2++) {
58  if (recHitsAreEqual(recHits1[iRecHit1], recHits2[iRecHit2])) { commonRecHits++; break;} // if a hit is common, no other can be the same!
59  }
60  if (commonRecHits > 1) break;
61  }
62 
63  if (commonRecHits > 1) {
64  if (track1->pt() > track2->pt()) trackOk[iTrack2] = false;
65  else { trackOk[iTrack1] = false; break;}
66  }
67 
68  }
69  }
70 
71  for (auto i = 0U; i < size; i++)
72  {
73  if (trackOk[i]) cleanedTracks.push_back(trackHitPairs[i]);
74  else delete trackHitPairs[i].first;
75  }
76  return cleanedTracks;
77 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
tuple size
Write out results.