CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiPhase2RecHitMatcherESProducer.cc
Go to the documentation of this file.
1 
9 
13 #include <memory>
14 
16 public:
18  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
19  std::unique_ptr<VectorHitBuilderAlgorithm> produce(const TkPhase2OTCPERecord&);
20 
21 private:
27 };
28 
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_),
47  &iRecord.get(cpeToken_));
48 
49  return matcher;
50 }
51 
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 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
edm::ESGetToken< ClusterParameterEstimator< Phase2TrackerCluster1D >, TkPhase2OTCPERecord > cpeToken_
std::unique_ptr< VectorHitBuilderAlgorithm > produce(const TkPhase2OTCPERecord &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
SiPhase2RecHitMatcherESProducer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_