CMS 3D CMS Logo

TrackAlgoPriorityOrderESProducer.cc
Go to the documentation of this file.
4 
6 
8 
10 public:
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 
T getParameter(std::string const &) const
std::vector< reco::TrackBase::TrackAlgorithm > algoOrder_
std::unique_ptr< TrackAlgoPriorityOrder > produce(const CkfComponentsRecord &iRecord)
TrackAlgoPriorityOrderESProducer(const edm::ParameterSet &iConfig)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137