RecoTracker
ConversionSeedGenerators
plugins
CombinedHitPairGeneratorForPhotonConversion.cc
Go to the documentation of this file.
1
#include "
CombinedHitPairGeneratorForPhotonConversion.h
"
2
#include "
HitPairGeneratorFromLayerPairForPhotonConversion.h
"
3
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
DataFormats/Common/interface/Handle.h
"
6
7
#include "
FWCore/Utilities/interface/RunningAverage.h
"
8
namespace
{
9
edm::RunningAverage
localRA;
10
}
11
12
CombinedHitPairGeneratorForPhotonConversion::CombinedHitPairGeneratorForPhotonConversion
(
const
edm::ParameterSet
&
cfg
,
13
edm::ConsumesCollector
& iC)
14
: theSeedingLayerToken(iC.consumes<
SeedingLayerSetsHits
>(
cfg
.getParameter<
edm
::
InputTag
>(
"SeedingLayers"
))) {
15
theMaxElement
=
cfg
.getParameter<
unsigned
int
>(
"maxElement"
);
16
maxHitPairsPerTrackAndGenerator
=
cfg
.getParameter<
unsigned
int
>(
"maxHitPairsPerTrackAndGenerator"
);
17
theGenerator
.reset(
18
new
HitPairGeneratorFromLayerPairForPhotonConversion
(0, 1, &
theLayerCache
, 0,
maxHitPairsPerTrackAndGenerator
));
19
}
20
21
const
OrderedHitPairs
&
CombinedHitPairGeneratorForPhotonConversion::run
(
const
ConversionRegion
& convRegion,
22
const
TrackingRegion
&
region
,
23
const
edm::Event
&
ev
,
24
const
edm::EventSetup
& es) {
25
if
(
thePairs
.capacity() == 0)
26
thePairs
.reserve(localRA.upper());
27
thePairs
.clear();
28
hitPairs
(convRegion,
region
,
thePairs
,
ev
, es);
29
return
thePairs
;
30
}
31
32
void
CombinedHitPairGeneratorForPhotonConversion::hitPairs
(
const
ConversionRegion
& convRegion,
33
const
TrackingRegion
&
region
,
34
OrderedHitPairs
&
result
,
35
const
edm::Event
&
ev
,
36
const
edm::EventSetup
& es) {
37
edm::Handle<SeedingLayerSetsHits>
hlayers;
38
ev
.getByToken(
theSeedingLayerToken
, hlayers);
39
const
SeedingLayerSetsHits
&
layers
= *hlayers;
40
assert
(
layers
.numberOfLayersInSet() == 2);
41
42
for
(
SeedingLayerSetsHits::LayerSetIndex
i
= 0;
i
<
layers
.size(); ++
i
) {
43
theGenerator
->hitPairs(convRegion,
region
,
result
,
layers
[
i
],
ev
, es);
44
}
45
}
46
47
void
CombinedHitPairGeneratorForPhotonConversion::clearCache
() {
48
theLayerCache
.
clear
();
49
localRA.update(
thePairs
.
size
());
50
thePairs
.clear();
51
thePairs
.shrink_to_fit();
52
}
CombinedHitPairGeneratorForPhotonConversion::hitPairs
void hitPairs(const ConversionRegion &convRegion, const TrackingRegion ®, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
Definition:
CombinedHitPairGeneratorForPhotonConversion.cc:32
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:355
CombinedHitPairGeneratorForPhotonConversion::theGenerator
std::unique_ptr< HitPairGeneratorFromLayerPairForPhotonConversion > theGenerator
Definition:
CombinedHitPairGeneratorForPhotonConversion.h:57
edm
HLT enums.
Definition:
AlignableModifier.h:19
SeedingLayerSetsHits
Definition:
SeedingLayerSetsHits.h:18
cms::cuda::assert
assert(be >=bs)
HitPairGeneratorFromLayerPairForPhotonConversion
Definition:
HitPairGeneratorFromLayerPairForPhotonConversion.h:14
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 ®ion, const edm::Event &ev, const edm::EventSetup &es)
Definition:
CombinedHitPairGeneratorForPhotonConversion.cc:21
CombinedHitPairGeneratorForPhotonConversion::thePairs
OrderedHitPairs thePairs
Definition:
CombinedHitPairGeneratorForPhotonConversion.h:59
CombinedHitPairGeneratorForPhotonConversion::CombinedHitPairGeneratorForPhotonConversion
CombinedHitPairGeneratorForPhotonConversion(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition:
CombinedHitPairGeneratorForPhotonConversion.cc:12
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
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
HLT_2018_cff.region
region
Definition:
HLT_2018_cff.py:81479
LayerHitMapCache::clear
void clear()
Definition:
LayerHitMapCache.h:69
OrderedHitPairs::size
unsigned int size() const override
Definition:
OrderedHitPairs.h:12
TrackingRegion
Definition:
TrackingRegion.h:40
mps_fire.result
result
Definition:
mps_fire.py:303
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:39
hgcalTopologyTester_cfi.layers
layers
Definition:
hgcalTopologyTester_cfi.py:8
CombinedHitPairGeneratorForPhotonConversion::clearCache
void clearCache()
Definition:
CombinedHitPairGeneratorForPhotonConversion.cc:47
edm::RunningAverage
Definition:
RunningAverage.h:17
Generated for CMSSW Reference Manual by
1.8.16