CMS 3D CMS Logo

CloseComponentsMergerESProducer.cc
Go to the documentation of this file.
9 
10 #include <iostream>
11 #include <memory>
12 #include <string>
13 
18 template <unsigned int N>
20 public:
23  std::unique_ptr<MultiGaussianStateMerger<N> > produce(const TrackingComponentsRecord&);
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
28  const int maxComp_;
30 };
31 
35 
36 template <unsigned int N>
38  : maxComp_(p.getParameter<int>("MaxComponents")),
39  distToken_(setWhatProduced(this, p.getParameter<std::string>("ComponentName"))
40  .consumes(edm::ESInputTag("", p.getParameter<std::string>("DistanceMeasure")))) {}
41 
42 template <unsigned int N>
44  // std::cout << "MultiGaussianState: "
45  // << MultiGaussianState<5>::instances_ << " "
46  // << MultiGaussianState<5>::maxInstances_ << " "
47  // << MultiGaussianState<5>::constructsCombinedState_ << std::endl;
48  // std::cout << "SingleGaussianState: "
49  // << SingleGaussianState<5>::instances_ << " "
50  // << SingleGaussianState<5>::maxInstances_ << " "
51  // << SingleGaussianState<5>::constructsWeightMatrix_ << std::endl;
52  // std::cout << "SingleGaussianState: "
53  // << SingleGaussianState<5>::instances_ << " "
54  // << SingleGaussianState<5>::maxInstances_ << " "
55  // << SingleGaussianState<5>::constructsWeightMatrix_ << std::endl;
56  // std::cout << "CloseComponentsMergerESProducer deleted" << std::endl;
57 }
58 
59 template <unsigned int N>
60 typename std::unique_ptr<MultiGaussianStateMerger<N> > CloseComponentsMergerESProducer<N>::produce(
61  const TrackingComponentsRecord& iRecord) {
62  return std::unique_ptr<MultiGaussianStateMerger<N> >(
63  new CloseComponentsMerger<N>(maxComp_, &iRecord.get(distToken_)));
64 }
65 
66 template <unsigned int N>
69  desc.add<std::string>("ComponentName");
70  desc.add<int>("MaxComponents");
71  desc.add<std::string>("DistanceMeasure");
72 
73  descriptions.addDefault(desc);
74 }
CloseComponentsMergerESProducer(const edm::ParameterSet &p)
std::unique_ptr< MultiGaussianStateMerger< N > > produce(const TrackingComponentsRecord &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
const edm::ESGetToken< DistanceBetweenComponents< N >, TrackingComponentsRecord > distToken_
HLT enums.
CloseComponentsMergerESProducer< 5 > CloseComponentsMergerESProducer5D
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const