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 #include <cassert>
8 
10 public:
13  const pixeltrackfitting::TracksWithTTRHs & initialT_TTRHs) {
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  }
41 private:
43 };
44 #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)
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