Go to the documentation of this file.00001 #include "RecoTracker/TkSeedGenerator/interface/SeedGeneratorFromRegionHits.h"
00002
00003 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h"
00004 #include "RecoTracker/TkSeedingLayers/interface/SeedComparitor.h"
00005 #include "RecoTracker/TkSeedGenerator/interface/SeedCreator.h"
00006
00007
00008
00009
00010 SeedGeneratorFromRegionHits::SeedGeneratorFromRegionHits(
00011 OrderedHitsGenerator *ohg, SeedComparitor* asc, SeedCreator* asp)
00012 : theHitsGenerator(ohg), theComparitor(asc), theSeedCreator(asp)
00013 { }
00014
00015
00016 void SeedGeneratorFromRegionHits::run(TrajectorySeedCollection & seedCollection,
00017 const TrackingRegion & region, const edm::Event& ev, const edm::EventSetup& es)
00018 {
00019 if (theComparitor) theComparitor->init(es);
00020 theSeedCreator->init(region, es, theComparitor.get());
00021 const OrderedSeedingHits & hitss = theHitsGenerator->run(region, ev, es);
00022
00023 unsigned int nHitss = hitss.size();
00024 if (seedCollection.empty()) seedCollection.reserve(nHitss);
00025
00026 for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
00027 const SeedingHitSet & hits = hitss[iHits];
00028 if (!theComparitor || theComparitor->compatible(hits, region) ) {
00029 theSeedCreator->makeSeed(seedCollection, hits);
00030 }
00031 }
00032 theHitsGenerator->clear();
00033 }