CMS 3D CMS Logo

CombinedHitPairGenerator.cc
Go to the documentation of this file.
6 
8  theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(cfg.getParameter<edm::InputTag>("SeedingLayers")))
9 {
10  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
11  theGenerator = std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &theLayerCache, theMaxElement);
12 }
13 
17 {
19 }
20 
22 
24  const TrackingRegion& region, OrderedHitPairs & result,
25  const edm::Event& ev, const edm::EventSetup& es)
26 {
28  ev.getByToken(theSeedingLayerToken, hlayers);
29  const SeedingLayerSetsHits& layers = *hlayers;
30  if(layers.numberOfLayersInSet() != 2)
31  throw cms::Exception("Configuration") << "CombinedHitPairGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 2, got " << layers.numberOfLayersInSet();
32 
33  for(SeedingLayerSetsHits::SeedingLayerSet layerSet: layers) {
34  theGenerator->hitPairs( region, result, ev, es, layerSet);
35  }
36 
38 
39  LogDebug("CombinedHitPairGenerator")<<" total number of pairs provided back CHPG : "<<result.size();
40 
41 }
#define LogDebug(id)
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:457
bool ev
virtual unsigned int size() const
std::unique_ptr< HitPairGeneratorFromLayerPair > theGenerator
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
virtual void hitPairs(const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
form base class
CombinedHitPairGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
HLT enums.