CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombinedHitPairGeneratorForPhotonConversion.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  maxHitPairsPerTrackAndGenerator = cfg.getParameter<unsigned int>("maxHitPairsPerTrackAndGenerator");
12  theGenerator.reset(new HitPairGeneratorFromLayerPairForPhotonConversion(0, 1, &theLayerCache, 0, maxHitPairsPerTrackAndGenerator));
13 }
14 
16  theSeedingLayerToken(cb.theSeedingLayerToken),
17  maxHitPairsPerTrackAndGenerator(cb.maxHitPairsPerTrackAndGenerator)
18 {
21 }
22 
23 
25 
27  assert(0 == "not implemented");
28 }
29 
31  const ConversionRegion& convRegion,
32  const TrackingRegion& region, const edm::Event & ev, const edm::EventSetup& es)
33 {
34  thePairs.clear();
35  hitPairs(convRegion, region, thePairs, ev, es);
36  return thePairs;
37 }
38 
39 
41  const ConversionRegion& convRegion,
42  const TrackingRegion& region, OrderedHitPairs & result,
43  const edm::Event& ev, const edm::EventSetup& es)
44 {
46  ev.getByToken(theSeedingLayerToken, hlayers);
47  assert(hlayers->numberOfLayersInSet() == 2);
48 
49  OrderedHitPairs resultTmp; // why is this needed?
50  resultTmp.reserve(maxHitPairsPerTrackAndGenerator);
51  for(SeedingLayerSetsHits::LayerSetIndex i=0; i<hlayers->size(); ++i) {
52  resultTmp.clear();
53  theGenerator->setSeedingLayers((*hlayers)[i]);
54  theGenerator->hitPairs( convRegion, region, resultTmp, ev, es); // why resultTmp and not result?
55  result.insert(result.end(),resultTmp.begin(),resultTmp.end());
56  }
57 
58  //theLayerCache.clear(); //Don't want to clear now, because have to loop on all the tracks. will be cleared later, calling a specific method
59 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
unsigned short LayerSetIndex
bool ev
virtual void hitPairs(const TrackingRegion &, OrderedHitPairs &, const edm::Event &, const edm::EventSetup &)
form base class
const OrderedHitPairs & run(const ConversionRegion &convRegion, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
tuple result
Definition: query.py:137
void setSeedingLayers(SeedingLayerSetsHits::SeedingLayerSet layers) override
CombinedHitPairGeneratorForPhotonConversion(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
std::unique_ptr< HitPairGeneratorFromLayerPairForPhotonConversion > theGenerator