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 | Private Member Functions | Private Attributes
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)
 
 PixelTrackCleanerBySharedHits (const edm::ParameterSet &cfg)
 
virtual ~PixelTrackCleanerBySharedHits ()
 
- Public Member Functions inherited from PixelTrackCleaner
virtual ~PixelTrackCleaner ()
 

Private Member Functions

void cleanTrack ()
 
bool recHitsAreEqual (const TrackingRecHit *recHit1, const TrackingRecHit *recHit2)
 

Private Attributes

int iTrack1
 
int iTrack2
 
reco::Tracktrack1
 
reco::Tracktrack2
 
std::vector< bool > trackOk
 

Detailed Description

Definition at line 15 of file PixelTrackCleanerBySharedHits.h.

Member Typedef Documentation

Definition at line 22 of file PixelTrackCleanerBySharedHits.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file PixelTrackCleanerBySharedHits.cc.

14 {}
PixelTrackCleanerBySharedHits::~PixelTrackCleanerBySharedHits ( )
virtual

Definition at line 16 of file PixelTrackCleanerBySharedHits.cc.

17 {}

Member Function Documentation

void PixelTrackCleanerBySharedHits::cleanTrack ( )
private

Definition at line 65 of file PixelTrackCleanerBySharedHits.cc.

TracksWithRecHits PixelTrackCleanerBySharedHits::cleanTracks ( const TracksWithRecHits tracksWithRecHits)
virtual

Implements PixelTrackCleaner.

Definition at line 19 of file PixelTrackCleanerBySharedHits.cc.

References i, LogDebug, and findQualityFiles::size.

20 {
21  typedef std::vector<const TrackingRecHit *> RecHits;
22  trackOk.clear();
23 
24  LogDebug("PixelTrackCleanerBySharedHits") << "Cleanering tracks" << "\n";
25  int size = trackHitPairs.size();
26  for (int i = 0; i < size; i++) trackOk.push_back(true);
27 
28  for (iTrack1 = 0; iTrack1 < size; iTrack1++)
29  {
30  track1 = trackHitPairs.at(iTrack1).first;
31  const RecHits& recHits1 = trackHitPairs.at(iTrack1).second;
32 
33  if (!trackOk.at(iTrack1)) continue;
34 
35  for (iTrack2 = iTrack1 + 1; iTrack2 < size; iTrack2++)
36  {
37  if (!trackOk.at(iTrack1) || !trackOk.at(iTrack2)) continue;
38 
39  track2 = trackHitPairs.at(iTrack2).first;
40  const RecHits& recHits2 = trackHitPairs.at(iTrack2).second;
41 
42  int commonRecHits = 0;
43  for (int iRecHit1 = 0; iRecHit1 < (int)recHits1.size(); iRecHit1++)
44  {
45  for (int iRecHit2 = 0; iRecHit2 < (int)recHits2.size(); iRecHit2++)
46  {
47  if (recHitsAreEqual(recHits1.at(iRecHit1), recHits2.at(iRecHit2))) commonRecHits++;
48  }
49  }
50  if (commonRecHits > 1) cleanTrack();
51  }
52  }
53 
54  vector<TrackWithRecHits> cleanedTracks;
55 
56  for (int i = 0; i < size; i++)
57  {
58  if (trackOk.at(i)) cleanedTracks.push_back(trackHitPairs.at(i));
59  else delete trackHitPairs.at(i).first;
60  }
61  return cleanedTracks;
62 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
bool recHitsAreEqual(const TrackingRecHit *recHit1, const TrackingRecHit *recHit2)
tuple size
Write out results.
bool PixelTrackCleanerBySharedHits::recHitsAreEqual ( const TrackingRecHit recHit1,
const TrackingRecHit recHit2 
)
private

Definition at line 72 of file PixelTrackCleanerBySharedHits.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::localPosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

73 {
74  if (recHit1->geographicalId() != recHit2->geographicalId()) return false;
75  LocalPoint pos1 = recHit1->localPosition();
76  LocalPoint pos2 = recHit2->localPosition();
77  return ((pos1.x() == pos2.x()) && (pos1.y() == pos2.y()));
78 }
T y() const
Definition: PV3DBase.h:62
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:61
virtual LocalPoint localPosition() const =0

Member Data Documentation

int PixelTrackCleanerBySharedHits::iTrack1
private

Definition at line 32 of file PixelTrackCleanerBySharedHits.h.

int PixelTrackCleanerBySharedHits::iTrack2
private

Definition at line 32 of file PixelTrackCleanerBySharedHits.h.

reco::Track* PixelTrackCleanerBySharedHits::track1
private

Definition at line 31 of file PixelTrackCleanerBySharedHits.h.

reco::Track * PixelTrackCleanerBySharedHits::track2
private

Definition at line 31 of file PixelTrackCleanerBySharedHits.h.

std::vector<bool> PixelTrackCleanerBySharedHits::trackOk
private

Definition at line 30 of file PixelTrackCleanerBySharedHits.h.