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 }
CombinedHitPairGeneratorForPhotonConversion::hitPairs
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
Definition: CombinedHitPairGeneratorForPhotonConversion.cc:35
RunningAverage.h
CombinedHitPairGeneratorForPhotonConversion::theMaxElement
unsigned int theMaxElement
Definition: CombinedHitPairGeneratorForPhotonConversion.h:61
ConversionRegion
Definition: ConversionRegion.h:8
CombinedHitPairGeneratorForPhotonConversion::theLayerCache
LayerCacheType theLayerCache
Definition: CombinedHitPairGeneratorForPhotonConversion.h:55
Handle.h
OrderedHitPairs
Definition: OrderedHitPairs.h:8
mps_fire.i
i
Definition: mps_fire.py:428
CombinedHitPairGeneratorForPhotonConversion::theGenerator
std::unique_ptr< HitPairGeneratorFromLayerPairForPhotonConversion > theGenerator
Definition: CombinedHitPairGeneratorForPhotonConversion.h:57
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
cms::cuda::assert
assert(be >=bs)
edm::Handle
Definition: AssociativeIterator.h:50
SeedingLayerSetsHits::LayerSetIndex
unsigned short LayerSetIndex
Definition: SeedingLayerSetsHits.h:28
CombinedHitPairGeneratorForPhotonConversion::run
const OrderedHitPairs & run(const ConversionRegion &convRegion, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
Definition: CombinedHitPairGeneratorForPhotonConversion.cc:24
CombinedHitPairGeneratorForPhotonConversion::thePairs
OrderedHitPairs thePairs
Definition: CombinedHitPairGeneratorForPhotonConversion.h:59
CombinedHitPairGeneratorForPhotonConversion::CombinedHitPairGeneratorForPhotonConversion
CombinedHitPairGeneratorForPhotonConversion(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition: CombinedHitPairGeneratorForPhotonConversion.cc:15
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:84949
edm::EventSetup
Definition: EventSetup.h:57
looper.cfg
cfg
Definition: looper.py:297
CombinedHitPairGeneratorForPhotonConversion::maxHitPairsPerTrackAndGenerator
uint32_t maxHitPairsPerTrackAndGenerator
Definition: CombinedHitPairGeneratorForPhotonConversion.h:53
HitPairGeneratorFromLayerPairForPhotonConversion.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
LayerHitMapCache::clear
void clear()
Definition: LayerHitMapCache.h:69
OrderedHitPairs::size
unsigned int size() const override
Definition: OrderedHitPairs.h:12
TrackingRegion
Definition: TrackingRegion.h:41
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
CombinedHitPairGeneratorForPhotonConversion.h
CombinedHitPairGeneratorForPhotonConversion::theSeedingLayerToken
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Definition: CombinedHitPairGeneratorForPhotonConversion.h:51
edm::Event
Definition: Event.h:73
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
CombinedHitPairGeneratorForPhotonConversion::clearCache
void clearCache()
Definition: CombinedHitPairGeneratorForPhotonConversion.cc:50
edm::RunningAverage
Definition: RunningAverage.h:17