CMS 3D CMS Logo

Public Member Functions | Private Attributes

SeedGeneratorFromRegionHits Class Reference

#include <SeedGeneratorFromRegionHits.h>

List of all members.

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)
 ~SeedGeneratorFromRegionHits ()

Private Attributes

SeedComparitortheComparitor
OrderedHitsGeneratortheHitsGenerator
SeedCreatortheSeedCreator

Detailed Description

Definition at line 14 of file SeedGeneratorFromRegionHits.h.


Constructor & Destructor Documentation

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

Definition at line 24 of file SeedGeneratorFromRegionHits.cc.

SeedGeneratorFromRegionHits::~SeedGeneratorFromRegionHits ( )

Definition at line 30 of file SeedGeneratorFromRegionHits.cc.

References theComparitor, theHitsGenerator, and theSeedCreator.

{
  delete theHitsGenerator;
  delete theComparitor;
  delete theSeedCreator;
}

Member Function Documentation

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

Definition at line 37 of file SeedGeneratorFromRegionHits.cc.

References OrderedHitsGenerator::clear(), SeedComparitor::compatible(), SeedComparitor::init(), OrderedHitsGenerator::run(), OrderedSeedingHits::size(), theComparitor, theHitsGenerator, theSeedCreator, and SeedCreator::trajectorySeed().

Referenced by EgammaHLTRegionalPixelSeedGeneratorProducers::produce(), SeedGeneratorFromRegionHitsEDProducer::produce(), TSGFromOrderedHits::run(), and TSGSmart::run().

{
  if (theComparitor) theComparitor->init(es);
  const OrderedSeedingHits & hitss = theHitsGenerator->run(region, ev, es);

  unsigned int nHitss =  hitss.size();
  if (seedCollection.empty()) seedCollection.reserve(nHitss); // don't do multiple reserves in the case of multiple regions: it would make things even worse
                                                              // as it will cause N re-allocations instead of the normal log(N)/log(2)
  for (unsigned int iHits = 0; iHits < nHitss; ++iHits) { 
    const SeedingHitSet & hits =  hitss[iHits];
    if (!theComparitor || theComparitor->compatible(hits, region) ) {
      theSeedCreator->trajectorySeed(seedCollection, hits, region, es, theComparitor);
    }
  }
  theHitsGenerator->clear();
}

Member Data Documentation

Definition at line 33 of file SeedGeneratorFromRegionHits.h.

Referenced by run(), and ~SeedGeneratorFromRegionHits().

Definition at line 32 of file SeedGeneratorFromRegionHits.h.

Referenced by run(), and ~SeedGeneratorFromRegionHits().

Definition at line 34 of file SeedGeneratorFromRegionHits.h.

Referenced by run(), and ~SeedGeneratorFromRegionHits().