CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PixelTrackCleanerWrapper Class Reference

#include <PixelTrackCleanerWrapper.h>

Public Member Functions

pixeltrackfitting::TracksWithTTRHs clean (const pixeltrackfitting::TracksWithTTRHs &initialT_TTRHs)
 
 PixelTrackCleanerWrapper (PixelTrackCleaner *tc)
 

Private Attributes

PixelTrackCleanertheCleaner
 

Detailed Description

Definition at line 9 of file PixelTrackCleanerWrapper.h.

Constructor & Destructor Documentation

PixelTrackCleanerWrapper::PixelTrackCleanerWrapper ( PixelTrackCleaner tc)
inline

Definition at line 11 of file PixelTrackCleanerWrapper.h.

11 : theCleaner(tc) {}

Member Function Documentation

pixeltrackfitting::TracksWithTTRHs PixelTrackCleanerWrapper::clean ( const pixeltrackfitting::TracksWithTTRHs initialT_TTRHs)
inline

Definition at line 12 of file PixelTrackCleanerWrapper.h.

References PixelTrackCleaner::cleanTracks(), i, n, SeedingHitSet::nullPtr(), SeedingHitSet::size(), and theCleaner.

Referenced by PixelTrackReconstruction::run().

13  {
14 
16  std::map<const TrackingRecHit *, TransientTrackingRecHit::ConstRecHitPointer> hitMap;
17 
18  for (pixeltrackfitting::TracksWithTTRHs::const_iterator it = initialT_TTRHs.begin(), iend = initialT_TTRHs.end(); it < iend; ++it) {
19  SeedingHitSet ttrhs = it->second;
20  std::vector<const TrackingRecHit *> trhs;
21  for (unsigned int i=0, n=ttrhs.size(); i < n; ++i) {
22  const TrackingRecHit * trh = ttrhs[i]->hit();
23  trhs.push_back(trh);
24  hitMap[trh]=ttrhs[i];
25  }
26  initialT_TRHs.push_back( pixeltrackfitting::TrackWithRecHits(it->first, trhs) );
27  }
28 
29  pixeltrackfitting::TracksWithRecHits finalT_TRHs = theCleaner->cleanTracks(initialT_TRHs);
31 
32  for (pixeltrackfitting::TracksWithRecHits::const_iterator it = finalT_TRHs.begin(), iend = finalT_TRHs.end(); it < iend; ++it) {
33  const std::vector<const TrackingRecHit *> & trhs = it->second;
34  assert(!(trhs.size()<2));
35  if (trhs.size()<2) continue;
36  SeedingHitSet ttrhs( hitMap[trhs[0]], hitMap[trhs[1]], trhs.size()>2 ? hitMap[trhs[2]] : SeedingHitSet::nullPtr());
37  finalT_TTRHs.push_back( pixeltrackfitting::TrackWithTTRHs(it->first, ttrhs));
38  }
39  return finalT_TTRHs;
40  }
int i
Definition: DBlmapReader.cc:9
std::pair< reco::Track *, SeedingHitSet > TrackWithTTRHs
std::vector< TrackWithTTRHs > TracksWithTTRHs
static ConstRecHitPointer nullPtr()
Definition: SeedingHitSet.h:11
std::pair< reco::Track *, std::vector< const TrackingRecHit * > > TrackWithRecHits
std::vector< TrackWithRecHits > TracksWithRecHits
unsigned int size() const
Definition: SeedingHitSet.h:31
virtual TracksWithRecHits cleanTracks(const TracksWithRecHits &tracksWithRecHits)=0

Member Data Documentation

PixelTrackCleaner* PixelTrackCleanerWrapper::theCleaner
private

Definition at line 42 of file PixelTrackCleanerWrapper.h.

Referenced by clean().