RecoTracker
FinalTrackSelectors
plugins
TrackAlgoPriorityOrderESProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ModuleFactory.h
"
2
#include "
FWCore/Framework/interface/ESProducer.h
"
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
5
#include "
RecoTracker/FinalTrackSelectors/interface/TrackAlgoPriorityOrder.h
"
6
7
#include "
RecoTracker/Record/interface/CkfComponentsRecord.h
"
8
9
class
TrackAlgoPriorityOrderESProducer
:
public
edm::ESProducer
{
10
public
:
11
TrackAlgoPriorityOrderESProducer
(
const
edm::ParameterSet
& iConfig);
12
~TrackAlgoPriorityOrderESProducer
()
override
=
default
;
13
14
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
15
16
std::unique_ptr<TrackAlgoPriorityOrder>
produce
(
const
CkfComponentsRecord
& iRecord);
17
18
private
:
19
std::vector<reco::TrackBase::TrackAlgorithm>
algoOrder_
;
20
};
21
22
TrackAlgoPriorityOrderESProducer::TrackAlgoPriorityOrderESProducer
(
const
edm::ParameterSet
& iConfig) {
23
const
auto
& algoNames = iConfig.
getParameter
<std::vector<std::string> >(
"algoOrder"
);
24
algoOrder_
.reserve(algoNames.size());
25
for
(
const
auto
&
name
: algoNames) {
26
auto
algo
=
reco::TrackBase::algoByName
(
name
);
27
if
(
algo
==
reco::TrackBase::undefAlgorithm
&&
name
!=
"undefAlgorithm"
) {
28
throw
cms::Exception
(
"Configuration"
) <<
"Incorrect track algo "
<<
name
;
29
}
30
algoOrder_
.push_back(
algo
);
31
}
32
33
auto
componentName = iConfig.
getParameter
<
std::string
>(
"ComponentName"
);
34
setWhatProduced
(
this
, componentName);
35
}
36
37
void
TrackAlgoPriorityOrderESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
38
edm::ParameterSetDescription
desc
;
39
desc
.add<
std::string
>(
"ComponentName"
,
"trackAlgoPriorityOrder"
);
40
desc
.add<std::vector<std::string> >(
"algoOrder"
, std::vector<std::string>());
41
descriptions.
add
(
"trackAlgoPriorityOrderDefault"
,
desc
);
42
}
43
44
std::unique_ptr<TrackAlgoPriorityOrder>
TrackAlgoPriorityOrderESProducer::produce
(
const
CkfComponentsRecord
& iRecord) {
45
return
std::make_unique<TrackAlgoPriorityOrder>(
algoOrder_
);
46
}
47
48
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
49
#include "
FWCore/Framework/interface/MakerMacros.h
"
50
DEFINE_FWK_EVENTSETUP_MODULE
(
TrackAlgoPriorityOrderESProducer
);
TrackAlgoPriorityOrderESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TrackAlgoPriorityOrderESProducer.cc:37
ESHandle.h
TrackAlgoPriorityOrderESProducer::produce
std::unique_ptr< TrackAlgoPriorityOrder > produce(const CkfComponentsRecord &iRecord)
Definition:
TrackAlgoPriorityOrderESProducer.cc:44
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
TrackAlgoPriorityOrder.h
TrackAlgoPriorityOrderESProducer::~TrackAlgoPriorityOrderESProducer
~TrackAlgoPriorityOrderESProducer() override=default
CkfComponentsRecord.h
cmsdt::algo
algo
Definition:
constants.h:171
MakerMacros.h
TrackAlgoPriorityOrderESProducer::algoOrder_
std::vector< reco::TrackBase::TrackAlgorithm > algoOrder_
Definition:
TrackAlgoPriorityOrderESProducer.cc:19
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
CkfComponentsRecord
Definition:
CkfComponentsRecord.h:22
TrackAlgoPriorityOrderESProducer
Definition:
TrackAlgoPriorityOrderESProducer.cc:9
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
TrackAlgoPriorityOrderESProducer::TrackAlgoPriorityOrderESProducer
TrackAlgoPriorityOrderESProducer(const edm::ParameterSet &iConfig)
Definition:
TrackAlgoPriorityOrderESProducer.cc:22
edm::ParameterSet
Definition:
ParameterSet.h:47
reco::TrackBase::undefAlgorithm
Definition:
TrackBase.h:90
ModuleDef.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
Exception
Definition:
hltDiff.cc:245
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
edm::ESProducer
Definition:
ESProducer.h:104
reco::TrackBase::algoByName
static TrackAlgorithm algoByName(const std::string &name)
Definition:
TrackBase.cc:137
Generated for CMSSW Reference Manual by
1.8.16