CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
tuple cfg
Definition: looper.py:296
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
unsigned short LayerSetIndex
bool ev
assert(be >=bs)
tuple result
Definition: mps_fire.py:311
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)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< HitPairGeneratorFromLayerPairForPhotonConversion > theGenerator
unsigned short size() const
Get the number of SeedingLayerSets.