CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelTrackCleanerWrapper.h
Go to the documentation of this file.
1 #ifndef RecoPixelVertexing_PixelTrackFitting_PixelTrackCleanerWrapper_H
2 #define RecoPixelVertexing_PixelTrackFitting_PixelTrackCleanerWrapper_H
3 
6 #include <map>
7 
9 public:
12  const pixeltrackfitting::TracksWithTTRHs & initialT_TTRHs) {
13 
15  std::map<const TrackingRecHit *, TransientTrackingRecHit::ConstRecHitPointer> hitMap;
16 
17  for (pixeltrackfitting::TracksWithTTRHs::const_iterator it = initialT_TTRHs.begin(), iend = initialT_TTRHs.end(); it < iend; ++it) {
18  SeedingHitSet ttrhs = it->second;
19  std::vector<const TrackingRecHit *> trhs;
20  for (unsigned int i=0, n=ttrhs.size(); i < n; ++i) {
21  const TrackingRecHit * trh = ttrhs[i]->hit();
22  trhs.push_back(trh);
23  hitMap[trh]=ttrhs[i];
24  }
25  initialT_TRHs.push_back( pixeltrackfitting::TrackWithRecHits(it->first, trhs) );
26  }
27 
28  pixeltrackfitting::TracksWithRecHits finalT_TRHs = theCleaner->cleanTracks(initialT_TRHs);
30 
31  for (pixeltrackfitting::TracksWithRecHits::const_iterator it = finalT_TRHs.begin(), iend = finalT_TRHs.end(); it < iend; ++it) {
32  const std::vector<const TrackingRecHit *> & trhs = it->second;
33  SeedingHitSet ttrhs;
34  for (unsigned int i=0, n=trhs.size(); i < n; ++i) {
35  const TrackingRecHit * trh = trhs[i];
36  ttrhs.add( hitMap[trh]);
37  }
38  finalT_TTRHs.push_back( pixeltrackfitting::TrackWithTTRHs(it->first, ttrhs));
39  }
40  return finalT_TTRHs;
41  }
42 private:
44 };
45 #endif
int i
Definition: DBlmapReader.cc:9
std::pair< reco::Track *, SeedingHitSet > TrackWithTTRHs
pixeltrackfitting::TracksWithTTRHs clean(const pixeltrackfitting::TracksWithTTRHs &initialT_TTRHs)
std::vector< TrackWithTTRHs > TracksWithTTRHs
PixelTrackCleanerWrapper(PixelTrackCleaner *tc)
std::pair< reco::Track *, std::vector< const TrackingRecHit * > > TrackWithRecHits
std::vector< TrackWithRecHits > TracksWithRecHits
unsigned int size() const
Definition: SeedingHitSet.h:14
void add(TransientTrackingRecHit::ConstRecHitPointer pHit)
Definition: SeedingHitSet.h:15
virtual TracksWithRecHits cleanTracks(const TracksWithRecHits &tracksWithRecHits)=0