CMS 3D CMS Logo

CombinedMultiHitGenerator.cc
Go to the documentation of this file.
2 
10 
12  theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(cfg.getParameter<edm::InputTag>("SeedingLayers")))
13 {
14  edm::ParameterSet generatorPSet = cfg.getParameter<edm::ParameterSet>("GeneratorPSet");
15  std::string generatorName = generatorPSet.getParameter<std::string>("ComponentName");
16  theGenerator = std::unique_ptr<MultiHitGeneratorFromPairAndLayers>{MultiHitGeneratorFromPairAndLayersFactory::get()->create(generatorName, generatorPSet)};
17  theGenerator->init(std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &theLayerCache), &theLayerCache);
18 }
19 
21 
23  const TrackingRegion& region, OrderedMultiHits & result,
24  const edm::Event& ev, const edm::EventSetup& es)
25 {
27  ev.getByToken(theSeedingLayerToken, hlayers);
28  const SeedingLayerSetsHits& layers = *hlayers;
29  if(layers.numberOfLayersInSet() != 3)
30  throw cms::Exception("Configuration") << "CombinedMultiHitGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 3, got " << layers.numberOfLayersInSet();
31 
32  theGenerator->initES(es);
33 
34  std::vector<LayerTriplets::LayerSetAndLayers> trilayers = LayerTriplets::layers(layers);
35  for(const auto& setAndLayers: trilayers) {
36  theGenerator->hitSets( region, result, ev, es, setAndLayers.first, setAndLayers.second);
37  }
39 }
40 
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
T getParameter(std::string const &) const
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:517
void hitSets(const TrackingRegion &reg, OrderedMultiHits &result, const edm::Event &ev, const edm::EventSetup &es) override
from base class
bool ev
CombinedMultiHitGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
std::unique_ptr< MultiHitGeneratorFromPairAndLayers > theGenerator
HLT enums.
T get(const Candidate &c)
Definition: component.h:55