CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombinedHitTripletGenerator.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.reset(HitTripletGeneratorFromPairAndLayersFactory::get()->create(generatorName, generatorPSet, iC));
18 }
19 
21 
23  const TrackingRegion& region, OrderedHitTriplets & 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") << "CombinedHitTripletGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 3, got " << layers.numberOfLayersInSet();
31 
32  std::vector<LayerTriplets::LayerSetAndLayers> trilayers = LayerTriplets::layers(layers);
33  for(const auto& setAndLayers: trilayers) {
34  theGenerator->setSeedingLayers(setAndLayers.first, setAndLayers.second);
35  theGenerator->hitTriplets( region, result, ev, es);
36  }
38 }
39 
T getParameter(std::string const &) const
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
tuple cfg
Definition: looper.py:237
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
bool ev
CombinedHitTripletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
tuple result
Definition: query.py:137
std::unique_ptr< HitTripletGeneratorFromPairAndLayers > theGenerator
virtual void hitTriplets(const TrackingRegion &reg, OrderedHitTriplets &triplets, const edm::Event &ev, const edm::EventSetup &es)
from base class
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55