RecoLocalTracker
SiPhase2VectorHitBuilder
plugins
SiPhase2RecHitMatcherESProducer.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/interface/EventSetup.h
"
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
FWCore/Framework/interface/ModuleFactory.h
"
5
#include "
FWCore/Framework/interface/ESProducer.h
"
6
#include "
FWCore/Utilities/interface/EDMException.h
"
7
#include "
RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h
"
8
#include "
RecoTracker/Record/interface/CkfComponentsRecord.h
"
9
10
#include "
FWCore/Framework/interface/ESProducer.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
#include "
RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h
"
13
#include <memory>
14
15
class
SiPhase2RecHitMatcherESProducer
:
public
edm::ESProducer
{
16
public
:
17
SiPhase2RecHitMatcherESProducer
(
const
edm::ParameterSet
&);
18
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
19
std::unique_ptr<VectorHitBuilderAlgorithm>
produce
(
const
TkPhase2OTCPERecord
&);
20
21
private
:
22
std::string
name_
;
23
edm::ParameterSet
pset_
;
24
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>
geometryToken_
;
25
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd>
trackerTopoToken_
;
26
edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>
,
TkPhase2OTCPERecord
>
cpeToken_
;
27
};
28
29
SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer
(
const
edm::ParameterSet
&
p
) {
30
name_
=
p
.getParameter<
std::string
>(
"ComponentName"
);
31
if
(!(
name_
==
"SiPhase2VectorHitMatcher"
)) {
32
throw
cms::Exception
(
"ConfigurationError"
) <<
"Configuration specifies unknown ComponentName .\n"
33
<<
"Currently only 'SiPhase2VectorHitMatcher' is supported\n"
;
34
}
35
pset_
=
p
;
36
auto
cc
=
setWhatProduced
(
this
,
name_
);
37
geometryToken_
=
cc
.consumes();
38
trackerTopoToken_
=
cc
.consumes();
39
cpeToken_
=
cc
.consumes(
p
.getParameter<
edm::ESInputTag
>(
"CPE"
));
40
}
41
42
std::unique_ptr<VectorHitBuilderAlgorithm>
SiPhase2RecHitMatcherESProducer::produce
(
const
TkPhase2OTCPERecord
& iRecord) {
43
std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>(
44
pset_
,
45
&iRecord.
get
(
geometryToken_
),
46
&iRecord.
getRecord
<
TrackerDigiGeometryRecord
>().
get
(
trackerTopoToken_
),
47
&iRecord.
get
(
cpeToken_
));
48
49
return
matcher;
50
}
51
52
void
SiPhase2RecHitMatcherESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
53
edm::ParameterSetDescription
desc
;
54
desc
.add<
std::string
>(
"offlinestubs"
,
"vectorHits"
);
55
desc
.add<
int
>(
"maxVectorHits"
, 999999999);
56
desc
.add<
std::string
>(
"Algorithm"
,
"VectorHitBuilderAlgorithm"
);
57
desc
.add<
std::string
>(
"ComponentName"
,
"SiPhase2VectorHitMatcher"
);
58
desc
.add<
edm::ESInputTag
>(
"CPE"
,
edm::ESInputTag
(
""
,
"Phase2StripCPE"
));
59
desc
.add<std::vector<double>>(
"BarrelCut"
,
60
{
61
0.0,
62
0.05,
63
0.06,
64
0.08,
65
0.09,
66
0.12,
67
0.2,
68
});
69
desc
.add<
std::string
>(
"Phase2CPE_name"
,
"Phase2StripCPE"
);
70
desc
.add<
std::string
>(
"Clusters"
,
"siPhase2Clusters"
);
71
desc
.add<
int
>(
"maxVectorHitsInAStack"
, 999);
72
desc
.add<std::vector<double>>(
"EndcapCut"
,
73
{
74
0.0,
75
0.1,
76
0.1,
77
0.1,
78
0.1,
79
0.1,
80
});
81
descriptions.
add
(
"siPhase2RecHitMatcher"
,
desc
);
82
}
83
84
DEFINE_FWK_EVENTSETUP_MODULE
(
SiPhase2RecHitMatcherESProducer
);
edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition:
DependentRecordImplementation.h:50
edm::ESInputTag
Definition:
ESInputTag.h:87
ESHandle.h
SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer
SiPhase2RecHitMatcherESProducer(const edm::ParameterSet &)
Definition:
SiPhase2RecHitMatcherESProducer.cc:29
VectorHitBuilderAlgorithm.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
TkPhase2OTCPERecord.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
CkfComponentsRecord.h
EDMException.h
SiPhase2RecHitMatcherESProducer::pset_
edm::ParameterSet pset_
Definition:
SiPhase2RecHitMatcherESProducer.cc:23
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
TrackerDigiGeometryRecord
Definition:
TrackerDigiGeometryRecord.h:15
SiPhase2RecHitMatcherESProducer::cpeToken_
edm::ESGetToken< ClusterParameterEstimator< Phase2TrackerCluster1D >, TkPhase2OTCPERecord > cpeToken_
Definition:
SiPhase2RecHitMatcherESProducer.cc:26
SiPhase2RecHitMatcherESProducer::name_
std::string name_
Definition:
SiPhase2RecHitMatcherESProducer.cc:22
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
TkPhase2OTCPERecord
Definition:
TkPhase2OTCPERecord.h:12
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
SiPhase2RecHitMatcherESProducer
Definition:
SiPhase2RecHitMatcherESProducer.cc:15
get
#define get
cc
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
SiPhase2RecHitMatcherESProducer::geometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
Definition:
SiPhase2RecHitMatcherESProducer.cc:24
SiPhase2RecHitMatcherESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
SiPhase2RecHitMatcherESProducer.cc:52
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
SiPhase2RecHitMatcherESProducer::trackerTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
Definition:
SiPhase2RecHitMatcherESProducer.cc:25
Exception
Definition:
hltDiff.cc:245
EventSetup.h
SiPhase2RecHitMatcherESProducer::produce
std::unique_ptr< VectorHitBuilderAlgorithm > produce(const TkPhase2OTCPERecord &)
Definition:
SiPhase2RecHitMatcherESProducer.cc:42
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
Generated for CMSSW Reference Manual by
1.8.16