CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SeedGeneratorFromRegionHits.cc
Go to the documentation of this file.
2 
6 
7 
8 
9 
12  : theHitsGenerator(ohg), theComparitor(asc), theSeedCreator(asp)
13 { }
14 
15 
17  const TrackingRegion & region, const edm::Event& ev, const edm::EventSetup& es)
18 {
19  if (theComparitor) theComparitor->init(es);
20  theSeedCreator->init(region, es, theComparitor.get());
21  const OrderedSeedingHits & hitss = theHitsGenerator->run(region, ev, es);
22 
23  unsigned int nHitss = hitss.size();
24  if (seedCollection.empty()) seedCollection.reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
25  // as it will cause N re-allocations instead of the normal log(N)/log(2)
26  for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
27  const SeedingHitSet & hits = hitss[iHits];
28  if (!theComparitor || theComparitor->compatible(hits, region) ) {
29  theSeedCreator->makeSeed(seedCollection, hits);
30  }
31  }
32  theHitsGenerator->clear();
33 }
virtual unsigned int size() const =0
SeedGeneratorFromRegionHits(OrderedHitsGenerator *aGenerator, SeedComparitor *aComparitor=0, SeedCreator *aSeedCreator=0)
std::unique_ptr< SeedComparitor > theComparitor
std::vector< TrajectorySeed > TrajectorySeedCollection
std::unique_ptr< SeedCreator > theSeedCreator
void run(TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
std::unique_ptr< OrderedHitsGenerator > theHitsGenerator