CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenericPairGenerator.cc
Go to the documentation of this file.
2 //#include "RecoTracker/TkSeedingLayers/interface/SeedingLayerSetsBuilder.h"
4 
8 using namespace ctfseeding;
9 
10 
12  theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(conf.getParameter<edm::InputTag>("LayerSrc"))) {
13  edm::LogInfo("CtfSpecialSeedGenerator|GenericPairGenerator") << "Constructing GenericPairGenerator";
14 }
15 
16 
18  const edm::Event& e,
19  const edm::EventSetup& es){
20  hitPairs.clear();
21  hitPairs.reserve(0);
23  e.getByToken(theSeedingLayerToken, hlayers);
24  const SeedingLayerSetsHits& layers = *hlayers;
25  if(layers.numberOfLayersInSet() != 2)
26  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << layers.numberOfLayersInSet() <<" layers in set instead of 2 ";
27 
29  auto innerHits = region.hits(e, es, ls[0]);
30  auto outerHits = region.hits(e, es, ls[1]);
31  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
32  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
33  hitPairs.push_back(OrderedHitPair(&(**iInnerHit),
34  &(**iOuterHit))
35  );
36  }
37  }
38  }
39  return hitPairs;
40 }
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
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11
tuple conf
Definition: dbtoconf.py:185
virtual const OrderedSeedingHits & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
BaseTrackerRecHit const * SeedingHit
GenericPairGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)