CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CombinedMultiHitGenerator.cc
Go to the documentation of this file.
2 
10 
12  : theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(cfg.getParameter<edm::InputTag>("SeedingLayers"))) {
13  edm::ParameterSet generatorPSet = cfg.getParameter<edm::ParameterSet>("GeneratorPSet");
14  std::string generatorName = generatorPSet.getParameter<std::string>("ComponentName");
15  theGenerator = MultiHitGeneratorFromPairAndLayersFactory::get()->create(generatorName, generatorPSet, iC);
16  theGenerator->init(std::make_unique<HitPairGeneratorFromLayerPair>(iC, 0, 1, &theLayerCache), &theLayerCache);
17 }
18 
20 
23  const edm::Event& ev,
24  const edm::EventSetup& es) {
26  ev.getByToken(theSeedingLayerToken, hlayers);
27  const SeedingLayerSetsHits& layers = *hlayers;
28  if (layers.numberOfLayersInSet() != 3)
29  throw cms::Exception("Configuration")
30  << "CombinedMultiHitGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 3, got "
31  << layers.numberOfLayersInSet();
32 
33  theGenerator->initES(es);
34 
35  std::vector<LayerTriplets::LayerSetAndLayers> trilayers = LayerTriplets::layers(layers);
36  for (const auto& setAndLayers : trilayers) {
37  theGenerator->hitSets(region, result, ev, es, setAndLayers.first, setAndLayers.second);
38  }
40 }
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
tuple cfg
Definition: looper.py:296
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
void hitSets(const TrackingRegion &reg, OrderedMultiHits &result, const edm::Event &ev, const edm::EventSetup &es) override
from base class
tuple result
Definition: mps_fire.py:311
CombinedMultiHitGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
std::unique_ptr< MultiHitGeneratorFromPairAndLayers > theGenerator
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get