CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SeedGeneratorFromRegionHits Class Reference

#include <SeedGeneratorFromRegionHits.h>

Public Member Functions

void run (TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
 SeedGeneratorFromRegionHits (std::unique_ptr< OrderedHitsGenerator > aGenerator, std::unique_ptr< SeedComparitor > aComparitor=0, std::unique_ptr< SeedCreator > aSeedCreator=0)
 

Private Attributes

std::unique_ptr< SeedComparitortheComparitor
 
std::unique_ptr< OrderedHitsGeneratortheHitsGenerator
 
std::unique_ptr< SeedCreatortheSeedCreator
 

Detailed Description

Definition at line 19 of file SeedGeneratorFromRegionHits.h.

Constructor & Destructor Documentation

SeedGeneratorFromRegionHits::SeedGeneratorFromRegionHits ( std::unique_ptr< OrderedHitsGenerator aGenerator,
std::unique_ptr< SeedComparitor aComparitor = 0,
std::unique_ptr< SeedCreator aSeedCreator = 0 
)

Definition at line 7 of file SeedGeneratorFromRegionHits.cc.

References eostools::move(), theComparitor, and theSeedCreator.

std::unique_ptr< SeedComparitor > theComparitor
std::unique_ptr< SeedCreator > theSeedCreator
std::unique_ptr< OrderedHitsGenerator > theHitsGenerator
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

void SeedGeneratorFromRegionHits::run ( TrajectorySeedCollection seedCollection,
const TrackingRegion region,
const edm::Event ev,
const edm::EventSetup es 
)

Definition at line 12 of file SeedGeneratorFromRegionHits.cc.

References hfClusterShapes_cfi::hits, OrderedSeedingHits::size(), theComparitor, theHitsGenerator, and theSeedCreator.

15  {
16  if (theComparitor)
17  theComparitor->init(ev, es);
18  theSeedCreator->init(region, es, theComparitor.get());
19  const OrderedSeedingHits& hitss = theHitsGenerator->run(region, ev, es);
20 
21  unsigned int nHitss = hitss.size();
22  // Modified 10/Jun/2014 Mark Grimes - At 140 pileup this reserve massively overestimates
23  // the amount of memory required. Removing it doesn't appear to slow down the algorithm
24  // noticeably.
25  //if (seedCollection.empty()) seedCollection.reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
26  // // as it will cause N re-allocations instead of the normal log(N)/log(2)
27  for (unsigned int iHits = 0; iHits < nHitss; ++iHits) {
28  const SeedingHitSet& hits = hitss[iHits];
29  if (!theComparitor || theComparitor->compatible(hits)) {
30  theSeedCreator->makeSeed(seedCollection, hits);
31  }
32  }
33  theHitsGenerator->clear();
34 }
std::unique_ptr< SeedComparitor > theComparitor
virtual unsigned int size() const =0
std::unique_ptr< SeedCreator > theSeedCreator
std::unique_ptr< OrderedHitsGenerator > theHitsGenerator

Member Data Documentation

std::unique_ptr<SeedComparitor> SeedGeneratorFromRegionHits::theComparitor
private

Definition at line 33 of file SeedGeneratorFromRegionHits.h.

Referenced by run(), and SeedGeneratorFromRegionHits().

std::unique_ptr<OrderedHitsGenerator> SeedGeneratorFromRegionHits::theHitsGenerator
private

Definition at line 32 of file SeedGeneratorFromRegionHits.h.

Referenced by run().

std::unique_ptr<SeedCreator> SeedGeneratorFromRegionHits::theSeedCreator
private

Definition at line 34 of file SeedGeneratorFromRegionHits.h.

Referenced by run(), and SeedGeneratorFromRegionHits().