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, const TrackerTopology *tTopo)
 
 PixelTrackCleanerWrapper (PixelTrackCleaner *tc)
 

Private Attributes

PixelTrackCleanertheCleaner
 

Detailed Description

Definition at line 11 of file PixelTrackCleanerWrapper.h.

Constructor & Destructor Documentation

PixelTrackCleanerWrapper::PixelTrackCleanerWrapper ( PixelTrackCleaner tc)
inline

Definition at line 13 of file PixelTrackCleanerWrapper.h.

13 : theCleaner(tc) {}

Member Function Documentation

pixeltrackfitting::TracksWithTTRHs PixelTrackCleanerWrapper::clean ( const pixeltrackfitting::TracksWithTTRHs initialT_TTRHs,
const TrackerTopology tTopo 
)
inline

Definition at line 14 of file PixelTrackCleanerWrapper.h.

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

Referenced by PixelTrackReconstruction::run().

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

Member Data Documentation

PixelTrackCleaner* PixelTrackCleanerWrapper::theCleaner
private

Definition at line 45 of file PixelTrackCleanerWrapper.h.

Referenced by clean().