CMS 3D CMS Logo

GenericPairGenerator.cc
Go to the documentation of this file.
2 //#include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h"
4 
8 
9 
11  theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(conf.getParameter<edm::InputTag>("LayerSrc"))) {
12  edm::LogInfo("CtfSpecialSeedGenerator|GenericPairGenerator") << "Constructing GenericPairGenerator";
13 }
14 
15 
17  const edm::Event& e,
18  const edm::EventSetup& es){
19  hitPairs.clear();
20  hitPairs.reserve(0);
22  e.getByToken(theSeedingLayerToken, hlayers);
23  const SeedingLayerSetsHits& layers = *hlayers;
24  if(layers.numberOfLayersInSet() != 2)
25  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << layers.numberOfLayersInSet() <<" layers in set instead of 2 ";
26 
28  auto innerHits = region.hits(es, ls[0]);
29  auto outerHits = region.hits(es, ls[1]);
30  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
31  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
32  hitPairs.push_back(OrderedHitPair(&(**iInnerHit),
33  &(**iOuterHit))
34  );
35  }
36  }
37  }
38  return hitPairs;
39 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
SeedingHitSet::ConstRecHitPointer SeedingHit
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11
const OrderedSeedingHits & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) override
def ls(path, rec=False)
Definition: eostools.py:348
virtual Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
HLT enums.
GenericPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)