CMS 3D CMS Logo

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

#include <CombinedHitQuadrupletGenerator.h>

Inheritance diagram for CombinedHitQuadrupletGenerator:
HitQuadrupletGenerator OrderedHitsGenerator

Public Types

typedef LayerHitMapCache LayerCacheType
 

Public Member Functions

 CombinedHitQuadrupletGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
virtual void hitQuadruplets (const TrackingRegion &reg, OrderedHitSeeds &triplets, const edm::Event &ev, const edm::EventSetup &es)
 from base class More...
 
virtual ~CombinedHitQuadrupletGenerator ()
 
- Public Member Functions inherited from HitQuadrupletGenerator
virtual void clear () final
 
 HitQuadrupletGenerator (unsigned int size=500)
 
virtual const OrderedHitSeedsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) final
 
virtual ~HitQuadrupletGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Attributes

std::unique_ptr< HitQuadrupletGeneratorFromTripletAndLayerstheGenerator
 
LayerCacheType theLayerCache
 
edm::EDGetTokenT< SeedingLayerSetsHitstheSeedingLayerToken
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 23 of file CombinedHitQuadrupletGenerator.h.

Member Typedef Documentation

Definition at line 25 of file CombinedHitQuadrupletGenerator.h.

Constructor & Destructor Documentation

CombinedHitQuadrupletGenerator::CombinedHitQuadrupletGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 17 of file CombinedHitQuadrupletGenerator.cc.

References beamerCreator::create(), reco::get(), edm::ParameterSet::getParameter(), eostools::move(), AlCaHLTBitMon_QueryRunRegistry::string, theGenerator, and theLayerCache.

17  :
19 {
20  edm::ParameterSet generatorPSet = cfg.getParameter<edm::ParameterSet>("GeneratorPSet");
21  std::string generatorName = generatorPSet.getParameter<std::string>("ComponentName");
22  edm::ParameterSet tripletGeneratorPSet = cfg.getParameter<edm::ParameterSet>("TripletGeneratorPSet");
23  std::string tripletGeneratorName = tripletGeneratorPSet.getParameter<std::string>("ComponentName");
24 
25  std::unique_ptr<HitTripletGeneratorFromPairAndLayers> tripletGenerator(HitTripletGeneratorFromPairAndLayersFactory::get()->create(tripletGeneratorName, tripletGeneratorPSet, iC));
26  // Some CPU wasted here because same pairs are generated multiple times
27  tripletGenerator->init(std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &theLayerCache), &theLayerCache);
28 
29  theGenerator.reset(HitQuadrupletGeneratorFromTripletAndLayersFactory::get()->create(generatorName, generatorPSet, iC));
30  theGenerator->init(std::move(tripletGenerator), &theLayerCache);
31 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< HitQuadrupletGeneratorFromTripletAndLayers > theGenerator
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
def move(src, dest)
Definition: eostools.py:510
T get(const Candidate &c)
Definition: component.h:55
CombinedHitQuadrupletGenerator::~CombinedHitQuadrupletGenerator ( )
virtual

Definition at line 33 of file CombinedHitQuadrupletGenerator.cc.

33 {}

Member Function Documentation

void CombinedHitQuadrupletGenerator::hitQuadruplets ( const TrackingRegion reg,
OrderedHitSeeds triplets,
const edm::Event ev,
const edm::EventSetup es 
)
virtual

from base class

Implements HitQuadrupletGenerator.

Definition at line 35 of file CombinedHitQuadrupletGenerator.cc.

References LayerHitMapCache::clear(), edm::Event::getByToken(), LayerQuadruplets::layers(), LayerTriplets::layers(), SeedingLayerSetsHits::numberOfLayersInSet(), theGenerator, theLayerCache, and theSeedingLayerToken.

38 {
40  ev.getByToken(theSeedingLayerToken, hlayers);
41  const SeedingLayerSetsHits& layers = *hlayers;
42  if(layers.numberOfLayersInSet() != 4)
43  throw cms::Exception("Configuration") << "CombinedHitQuadrupletsGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 4, got " << layers.numberOfLayersInSet();
44 
45  std::vector<LayerQuadruplets::LayerSetAndLayers> quadlayers = LayerQuadruplets::layers(layers);
46  for(const auto& tripletAndLayers: quadlayers) {
47  theGenerator->hitQuadruplets(region, result, ev, es, tripletAndLayers.first, tripletAndLayers.second);
48  }
50 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::unique_ptr< HitQuadrupletGeneratorFromTripletAndLayers > theGenerator
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)

Member Data Documentation

std::unique_ptr<HitQuadrupletGeneratorFromTripletAndLayers> CombinedHitQuadrupletGenerator::theGenerator
private
LayerCacheType CombinedHitQuadrupletGenerator::theLayerCache
private
edm::EDGetTokenT<SeedingLayerSetsHits> CombinedHitQuadrupletGenerator::theSeedingLayerToken
private

Definition at line 38 of file CombinedHitQuadrupletGenerator.h.

Referenced by hitQuadruplets().