CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
15  theSeedingLayerToken(cb.theSeedingLayerToken),
16  theGenerator(std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &theLayerCache, cb.theMaxElement))
17 {
19 }
20 
22 
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.
tuple cfg
Definition: looper.py:293
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool ev
virtual unsigned int size() const
std::unique_ptr< HitPairGeneratorFromLayerPair > theGenerator
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
tuple result
Definition: mps_fire.py:84
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)