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