test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (OrderedHitsGenerator *aGenerator, SeedComparitor *aComparitor=0, SeedCreator *aSeedCreator=0)
 

Private Attributes

std::unique_ptr< SeedComparitortheComparitor
 
std::unique_ptr
< OrderedHitsGenerator
theHitsGenerator
 
std::unique_ptr< SeedCreatortheSeedCreator
 

Detailed Description

Definition at line 17 of file SeedGeneratorFromRegionHits.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file SeedGeneratorFromRegionHits.cc.

13 { }
std::unique_ptr< SeedComparitor > theComparitor
std::unique_ptr< SeedCreator > theSeedCreator
std::unique_ptr< OrderedHitsGenerator > theHitsGenerator

Member Function Documentation

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

Definition at line 16 of file SeedGeneratorFromRegionHits.cc.

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

Referenced by TSGSmart::run(), and TSGFromOrderedHits::run().

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

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().