CMS 3D CMS Logo

GenericPairGenerator.cc
Go to the documentation of this file.
2 //#include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h"
4 
8 
10  : theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(conf.getParameter<edm::InputTag>("LayerSrc"))) {
11  edm::LogInfo("CtfSpecialSeedGenerator|GenericPairGenerator") << "Constructing GenericPairGenerator";
12 }
13 
15  const edm::Event& e,
16  const edm::EventSetup& es) {
17  hitPairs.clear();
18  hitPairs.reserve(0);
20  e.getByToken(theSeedingLayerToken, hlayers);
21  const SeedingLayerSetsHits& layers = *hlayers;
22  if (layers.numberOfLayersInSet() != 2)
23  throw cms::Exception("CtfSpecialSeedGenerator")
24  << "You are using " << layers.numberOfLayersInSet() << " layers in set instead of 2 ";
25 
27  auto innerHits = region.hits(ls[0]);
28  auto outerHits = region.hits(ls[1]);
29  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++) {
30  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++) {
31  hitPairs.push_back(OrderedHitPair(&(**iInnerHit), &(**iOuterHit)));
32  }
33  }
34  }
35  return hitPairs;
36 }
SeedingHitSet::ConstRecHitPointer SeedingHit
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:14
const OrderedSeedingHits & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) override
Log< level::Info, false > LogInfo
def ls(path, rec=False)
Definition: eostools.py:349
HLT enums.
GenericPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)