CMS 3D CMS Logo

CombinedHitPairGeneratorForPhotonConversion.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
9 
11 namespace {
12  edm::RunningAverage localRA;
13 }
14 
17  : theSeedingLayerToken(iC.consumes<SeedingLayerSetsHits>(cfg.getParameter<edm::InputTag>("SeedingLayers"))) {
18  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
19  maxHitPairsPerTrackAndGenerator = cfg.getParameter<unsigned int>("maxHitPairsPerTrackAndGenerator");
20  theGenerator = std::make_unique<HitPairGeneratorFromLayerPairForPhotonConversion>(
22 }
23 
25  const TrackingRegion& region,
26  const edm::Event& ev,
27  const edm::EventSetup& es) {
28  if (thePairs.capacity() == 0)
29  thePairs.reserve(localRA.upper());
30  thePairs.clear();
31  hitPairs(convRegion, region, thePairs, ev, es);
32  return thePairs;
33 }
34 
36  const TrackingRegion& region,
38  const edm::Event& ev,
39  const edm::EventSetup& es) {
41  ev.getByToken(theSeedingLayerToken, hlayers);
42  const SeedingLayerSetsHits& layers = *hlayers;
43  assert(layers.numberOfLayersInSet() == 2);
44 
45  for (SeedingLayerSetsHits::LayerSetIndex i = 0; i < layers.size(); ++i) {
46  theGenerator->hitPairs(convRegion, region, result, layers[i], ev, es);
47  }
48 }
49 
52  localRA.update(thePairs.size());
53  thePairs.clear();
54  thePairs.shrink_to_fit();
55 }
unsigned short LayerSetIndex
assert(be >=bs)
const OrderedHitPairs & run(const ConversionRegion &convRegion, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
CombinedHitPairGeneratorForPhotonConversion(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
unsigned int size() const override
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
HLT enums.
std::unique_ptr< HitPairGeneratorFromLayerPairForPhotonConversion > theGenerator