CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
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:539
def ls
Definition: eostools.py:349
virtual Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
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
BaseTrackerRecHit const * SeedingHit
GenericPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)