File indexing completed on 2024-04-06 12:28:55
0001 #include "RecoTracker/TkSeedGenerator/interface/SeedGeneratorFromRegionHits.h"
0002
0003 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h"
0004 #include "RecoTracker/TkSeedingLayers/interface/SeedComparitor.h"
0005 #include "RecoTracker/TkSeedGenerator/interface/SeedCreator.h"
0006
0007 SeedGeneratorFromRegionHits::SeedGeneratorFromRegionHits(std::unique_ptr<OrderedHitsGenerator> ohg,
0008 std::unique_ptr<SeedComparitor> asc,
0009 std::unique_ptr<SeedCreator> asp)
0010 : theHitsGenerator{std::move(ohg)}, theComparitor{std::move(asc)}, theSeedCreator{std::move(asp)} {}
0011
0012 void SeedGeneratorFromRegionHits::run(TrajectorySeedCollection& seedCollection,
0013 const TrackingRegion& region,
0014 const edm::Event& ev,
0015 const edm::EventSetup& es) {
0016 if (theComparitor)
0017 theComparitor->init(ev, es);
0018 theSeedCreator->init(region, es, theComparitor.get());
0019 const OrderedSeedingHits& hitss = theHitsGenerator->run(region, ev, es);
0020
0021 unsigned int nHitss = hitss.size();
0022
0023
0024
0025
0026
0027 for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
0028 const SeedingHitSet& hits = hitss[iHits];
0029 if (!theComparitor || theComparitor->compatible(hits)) {
0030 theSeedCreator->makeSeed(seedCollection, hits);
0031 }
0032 }
0033 theHitsGenerator->clear();
0034 }