RecoTracker
TkHitPairs
src
CombinedHitPairGenerator.cc
Go to the documentation of this file.
1
#include "
RecoTracker/TkHitPairs/interface/CombinedHitPairGenerator.h
"
2
#include "
RecoTracker/TkHitPairs/interface/HitPairGeneratorFromLayerPair.h
"
3
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
DataFormats/Common/interface/Handle.h
"
6
7
CombinedHitPairGenerator::CombinedHitPairGenerator
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
& iC)
8
: theSeedingLayerToken(iC.consumes<
SeedingLayerSetsHits
>(
cfg
.getParameter<
edm
::
InputTag
>(
"SeedingLayers"
))) {
9
theMaxElement
=
cfg
.getParameter<
unsigned
int
>(
"maxElement"
);
10
theGenerator
= std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &
theLayerCache
,
theMaxElement
);
11
}
12
13
CombinedHitPairGenerator::CombinedHitPairGenerator
(
const
CombinedHitPairGenerator
& cb)
14
:
HitPairGenerator
(cb),
15
theSeedingLayerToken(cb.theSeedingLayerToken),
16
theGenerator(
std
::make_unique<
HitPairGeneratorFromLayerPair
>(0, 1, &theLayerCache, cb.theMaxElement)) {
17
theMaxElement
= cb.
theMaxElement
;
18
}
19
20
CombinedHitPairGenerator::~CombinedHitPairGenerator
() {}
21
22
void
CombinedHitPairGenerator::hitPairs
(
const
TrackingRegion
&
region
,
23
OrderedHitPairs
&
result
,
24
const
edm::Event
&
ev
,
25
const
edm::EventSetup
& es) {
26
edm::Handle<SeedingLayerSetsHits>
hlayers;
27
ev
.getByToken(
theSeedingLayerToken
, hlayers);
28
const
SeedingLayerSetsHits
&
layers
= *hlayers;
29
if
(
layers
.numberOfLayersInSet() != 2)
30
throw
cms::Exception
(
"Configuration"
)
31
<<
"CombinedHitPairGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 2, got "
32
<<
layers
.numberOfLayersInSet();
33
34
for
(
SeedingLayerSetsHits::SeedingLayerSet
layerSet :
layers
) {
35
theGenerator
->hitPairs(
region
,
result
,
ev
, es, layerSet);
36
}
37
38
theLayerCache
.
clear
();
39
40
LogDebug
(
"CombinedHitPairGenerator"
) <<
" total number of pairs provided back CHPG : "
<<
result
.size();
41
}
Handle.h
OrderedHitPairs
Definition:
OrderedHitPairs.h:8
OrderedHitsGenerator::theMaxElement
unsigned int theMaxElement
Definition:
OrderedHitsGenerator.h:23
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89285
CombinedHitPairGenerator::~CombinedHitPairGenerator
~CombinedHitPairGenerator() override
Definition:
CombinedHitPairGenerator.cc:20
SeedingLayerSetsHits
Definition:
SeedingLayerSetsHits.h:18
edm::Handle
Definition:
AssociativeIterator.h:50
HitPairGeneratorFromLayerPair
Definition:
HitPairGeneratorFromLayerPair.h:11
CombinedHitPairGenerator::theLayerCache
LayerCacheType theLayerCache
Definition:
CombinedHitPairGenerator.h:44
CombinedHitPairGenerator::CombinedHitPairGenerator
CombinedHitPairGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition:
CombinedHitPairGenerator.cc:7
HitPairGenerator
Definition:
HitPairGenerator.h:23
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
CombinedHitPairGenerator::theGenerator
std::unique_ptr< HitPairGeneratorFromLayerPair > theGenerator
Definition:
CombinedHitPairGenerator.h:46
HLT_FULL_cff.region
region
Definition:
HLT_FULL_cff.py:88271
edm::EventSetup
Definition:
EventSetup.h:58
looper.cfg
cfg
Definition:
looper.py:297
CombinedHitPairGenerator::theSeedingLayerToken
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Definition:
CombinedHitPairGenerator.h:42
std
Definition:
JetResolutionObject.h:76
CombinedHitPairGenerator.h
HitPairGeneratorFromLayerPair.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
SeedingLayerSetsHits::SeedingLayerSet
Definition:
SeedingLayerSetsHits.h:65
CombinedHitPairGenerator::hitPairs
void hitPairs(const TrackingRegion ®, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es) override
form base class
Definition:
CombinedHitPairGenerator.cc:22
LayerHitMapCache::clear
void clear()
Definition:
LayerHitMapCache.h:69
CombinedHitPairGenerator
Definition:
CombinedHitPairGenerator.h:25
TrackingRegion
Definition:
TrackingRegion.h:41
mps_fire.result
result
Definition:
mps_fire.py:311
ConsumesCollector.h
cms::Exception
Definition:
Exception.h:70
edm::Event
Definition:
Event.h:73
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
hgcalTopologyTester_cfi.layers
layers
Definition:
hgcalTopologyTester_cfi.py:8
Generated for CMSSW Reference Manual by
1.8.16