CMS 3D CMS Logo

MultiRecHitCollectorESProducer.cc
Go to the documentation of this file.
1 // user includes
21 
22 // system includes
23 #include <string>
24 #include <memory>
25 
27 public:
29  ~MultiRecHitCollectorESProducer() override = default;
30  std::unique_ptr<MultiRecHitCollector> produce(const MultiRecHitRecord&);
31 
32 private:
33  // es tokens
40 
41  // configuration
48  bool debug_;
50 };
51 
52 using namespace edm;
53 
55  : myname_(iConfig.getParameter<std::string>("ComponentName")),
56  mrhupdator_(iConfig.getParameter<std::string>("MultiRecHitUpdator")),
57  propagatorAlongName_(iConfig.getParameter<std::string>("propagatorAlong")),
58  estimatorName_(iConfig.getParameter<std::string>("estimator")),
59  measurementTrackerName_(iConfig.getParameter<std::string>("MeasurementTrackerName")),
60  mode_(iConfig.getParameter<std::string>("Mode")),
61  debug_(iConfig.getParameter<bool>("Debug")),
62  propagatorOppositeName_(iConfig.getParameter<std::string>("propagatorOpposite")) {
63  auto cc = setWhatProduced(this, myname_);
64 
65  mrhToken = cc.consumes();
67  chi2MeasToken = cc.consumes(edm::ESInputTag("", estimatorName_));
69  topoToken = cc.consumes();
71 }
72 
73 std::unique_ptr<MultiRecHitCollector> MultiRecHitCollectorESProducer::produce(const MultiRecHitRecord& iRecord) {
74  const SiTrackerMultiRecHitUpdator* mrhu = &iRecord.get(mrhToken);
75  const Propagator* propagator = &iRecord.get(propAlongToken);
77  const MeasurementTracker* measurement = &iRecord.get(measToken);
78  const TrackerTopology* trackerTopology = &iRecord.get(topoToken);
79 
80  if (mode_ == "Grouped") {
82 
83  return std::make_unique<GroupedDAFHitCollector>(
84  measurement, mrhu, estimator, propagator, propagatorOpposite, debug_);
85  } else {
86  return std::make_unique<SimpleDAFHitCollector>(trackerTopology, measurement, mrhu, estimator, propagator, debug_);
87  }
88 }
89 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
~MultiRecHitCollectorESProducer() override=default
edm::ESGetToken< Propagator, CkfComponentsRecord > propAlongToken
edm::ESGetToken< Propagator, CkfComponentsRecord > propOppositeToken
edm::ESGetToken< Chi2MeasurementEstimatorBase, CkfComponentsRecord > chi2MeasToken
edm::ESGetToken< TrackerTopology, CkfComponentsRecord > topoToken
std::unique_ptr< MultiRecHitCollector > produce(const MultiRecHitRecord &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
MultiRecHitCollectorESProducer(const edm::ParameterSet &iConfig)
edm::ESGetToken< SiTrackerMultiRecHitUpdator, MultiRecHitRecord > mrhToken
HLT enums.
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measToken