RecoTracker
TkSeedGenerator
plugins
CombinedMultiHitGenerator.cc
Go to the documentation of this file.
1
#include "
CombinedMultiHitGenerator.h
"
2
3
#include "
RecoTracker/TkHitPairs/interface/HitPairGeneratorFromLayerPair.h
"
4
#include "
RecoTracker/TkSeedGenerator/interface/MultiHitGeneratorFromPairAndLayers.h
"
5
#include "
RecoTracker/TkSeedGenerator/interface/MultiHitGeneratorFromPairAndLayersFactory.h
"
6
#include "
RecoPixelVertexing/PixelTriplets/interface/LayerTriplets.h
"
7
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
DataFormats/Common/interface/Handle.h
"
10
11
CombinedMultiHitGenerator::CombinedMultiHitGenerator
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
& iC)
12
: theSeedingLayerToken(iC.consumes<
SeedingLayerSetsHits
>(
cfg
.getParameter<
edm
::
InputTag
>(
"SeedingLayers"
))) {
13
edm::ParameterSet
generatorPSet =
cfg
.getParameter<
edm::ParameterSet
>(
"GeneratorPSet"
);
14
std::string
generatorName = generatorPSet.
getParameter
<
std::string
>(
"ComponentName"
);
15
theGenerator
=
MultiHitGeneratorFromPairAndLayersFactory::get
()->create(generatorName, generatorPSet);
16
theGenerator
->init(std::make_unique<HitPairGeneratorFromLayerPair>(0, 1, &
theLayerCache
), &
theLayerCache
);
17
}
18
19
CombinedMultiHitGenerator::~CombinedMultiHitGenerator
() {}
20
21
void
CombinedMultiHitGenerator::hitSets
(
const
TrackingRegion
&
region
,
22
OrderedMultiHits
&
result
,
23
const
edm::Event
&
ev
,
24
const
edm::EventSetup
& es) {
25
edm::Handle<SeedingLayerSetsHits>
hlayers;
26
ev
.getByToken(
theSeedingLayerToken
, hlayers);
27
const
SeedingLayerSetsHits
&
layers
= *hlayers;
28
if
(
layers
.numberOfLayersInSet() != 3)
29
throw
cms::Exception
(
"Configuration"
)
30
<<
"CombinedMultiHitGenerator expects SeedingLayerSetsHits::numberOfLayersInSet() to be 3, got "
31
<<
layers
.numberOfLayersInSet();
32
33
theGenerator
->initES(es);
34
35
std::vector<LayerTriplets::LayerSetAndLayers> trilayers =
LayerTriplets::layers
(
layers
);
36
for
(
const
auto
& setAndLayers : trilayers) {
37
theGenerator
->hitSets(
region
,
result
,
ev
, es, setAndLayers.first, setAndLayers.second);
38
}
39
theLayerCache
.
clear
();
40
}
Handle.h
CombinedMultiHitGenerator.h
OrderedMultiHits
Definition:
OrderedMultiHits.h:8
CombinedMultiHitGenerator::~CombinedMultiHitGenerator
~CombinedMultiHitGenerator() override
Definition:
CombinedMultiHitGenerator.cc:19
CombinedMultiHitGenerator::hitSets
void hitSets(const TrackingRegion ®, OrderedMultiHits &result, const edm::Event &ev, const edm::EventSetup &es) override
from base class
Definition:
CombinedMultiHitGenerator.cc:21
edm
HLT enums.
Definition:
AlignableModifier.h:19
CombinedMultiHitGenerator::CombinedMultiHitGenerator
CombinedMultiHitGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Definition:
CombinedMultiHitGenerator.cc:11
SeedingLayerSetsHits
Definition:
SeedingLayerSetsHits.h:18
MultiHitGeneratorFromPairAndLayersFactory.h
edm::Handle
Definition:
AssociativeIterator.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
MultiHitGeneratorFromPairAndLayers.h
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
get
#define get
looper.cfg
cfg
Definition:
looper.py:297
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CombinedMultiHitGenerator::theSeedingLayerToken
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
Definition:
CombinedMultiHitGenerator.h:50
HitPairGeneratorFromLayerPair.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
LayerTriplets.h
HLT_2018_cff.region
region
Definition:
HLT_2018_cff.py:81479
LayerHitMapCache::clear
void clear()
Definition:
LayerHitMapCache.h:69
TrackingRegion
Definition:
TrackingRegion.h:38
CombinedMultiHitGenerator::theLayerCache
LayerCacheType theLayerCache
Definition:
CombinedMultiHitGenerator.h:52
mps_fire.result
result
Definition:
mps_fire.py:303
ConsumesCollector.h
cms::Exception
Definition:
Exception.h:70
edm::Event
Definition:
Event.h:73
LayerTriplets::layers
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition:
LayerTriplets.cc:4
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
hgcalTopologyTester_cfi.layers
layers
Definition:
hgcalTopologyTester_cfi.py:8
CombinedMultiHitGenerator::theGenerator
std::unique_ptr< MultiHitGeneratorFromPairAndLayers > theGenerator
Definition:
CombinedMultiHitGenerator.h:54
Generated for CMSSW Reference Manual by
1.8.16