CMS 3D CMS Logo

TrackAlgoPriorityOrderESProducer.cc
Go to the documentation of this file.
4 
6 
8 
10 public:
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 
23  const auto& algoNames = iConfig.getParameter<std::vector<std::string> >("algoOrder");
24  algoOrder_.reserve(algoNames.size());
25  for (const auto& name : algoNames) {
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 
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 
TrackAlgoPriorityOrderESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrackAlgoPriorityOrderESProducer.cc:37
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
TrackAlgoPriorityOrder.h
TrackAlgoPriorityOrderESProducer::~TrackAlgoPriorityOrderESProducer
~TrackAlgoPriorityOrderESProducer() override=default
CkfComponentsRecord.h
cmsdt::algo
algo
Definition: constants.h:164
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackAlgoPriorityOrderESProducer::TrackAlgoPriorityOrderESProducer
TrackAlgoPriorityOrderESProducer(const edm::ParameterSet &iConfig)
Definition: TrackAlgoPriorityOrderESProducer.cc:22
edm::ParameterSet
Definition: ParameterSet.h:36
reco::TrackBase::undefAlgorithm
Definition: TrackBase.h:90
ModuleDef.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ESProducer
Definition: ESProducer.h:101
reco::TrackBase::algoByName
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137