CMS 3D CMS Logo

CombinedHitQuadrupletGenerator.cc
Go to the documentation of this file.
2 
8 #include "LayerQuadruplets.h"
12 
13 
14 using namespace std;
15 using namespace ctfseeding;
16 
18  theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(cfg.getParameter<edm::InputTag>("SeedingLayers")))
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 }
32 
34 
36  const TrackingRegion& region, OrderedHitSeeds & result,
37  const edm::Event& ev, const edm::EventSetup& es)
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 }
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
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
CombinedHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
bool ev
std::unique_ptr< HitQuadrupletGeneratorFromTripletAndLayers > theGenerator
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
void hitQuadruplets(const TrackingRegion &reg, OrderedHitSeeds &triplets, const edm::Event &ev, const edm::EventSetup &es) override
from base class
HLT enums.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
def move(src, dest)
Definition: eostools.py:510
T get(const Candidate &c)
Definition: component.h:55