CMS 3D CMS Logo

MultiRecHitCollectorESProducer.cc
Go to the documentation of this file.
4 
12 
17 
18 #include <string>
19 #include <memory>
20 
21 using namespace edm;
22 
24  std::string myname = iConfig.getParameter<std::string>("ComponentName");
25  setConf(iConfig);
26  setWhatProduced(this, myname);
27 }
28 
30 
31 std::unique_ptr<MultiRecHitCollector> MultiRecHitCollectorESProducer::produce(const MultiRecHitRecord& iRecord) {
32  std::string mode = "Grouped";
33  if (conf_.getParameter<std::string>("Mode") == "Simple")
34  mode = "Simple";
35 
36  std::string mrhupdator = conf_.getParameter<std::string>("MultiRecHitUpdator");
37  std::string propagatorAlongName = conf_.getParameter<std::string>("propagatorAlong");
38  std::string estimatorName = conf_.getParameter<std::string>("estimator");
39  std::string measurementTrackerName = conf_.getParameter<std::string>("MeasurementTrackerName");
40  bool debug = conf_.getParameter<bool>("Debug");
41 
43  iRecord.get(mrhupdator, mrhuhandle);
44  ESHandle<Propagator> propagatorhandle;
45  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(propagatorAlongName,
46  propagatorhandle);
48  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(estimatorName, estimatorhandle);
49  ESHandle<MeasurementTracker> measurementhandle;
50  iRecord.getRecord<CkfComponentsRecord>().get(measurementTrackerName, measurementhandle);
51  ESHandle<TrackerTopology> trackerTopologyHandle;
52  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackerTopologyRcd>().get(trackerTopologyHandle);
53 
54  if (mode == "Grouped") {
55  std::string propagatorOppositeName = conf_.getParameter<std::string>("propagatorOpposite");
56  ESHandle<Propagator> propagatorOppositehandle;
57  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(propagatorOppositeName,
58  propagatorOppositehandle);
59  return std::make_unique<GroupedDAFHitCollector>(measurementhandle.product(),
60  mrhuhandle.product(),
61  estimatorhandle.product(),
62  propagatorhandle.product(),
63  propagatorOppositehandle.product(),
64  debug);
65  } else {
66  return std::make_unique<SimpleDAFHitCollector>(trackerTopologyHandle.product(),
67  measurementhandle.product(),
68  mrhuhandle.product(),
69  estimatorhandle.product(),
70  propagatorhandle.product(),
71  debug);
72  }
73 }
T getParameter(std::string const &) const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< MultiRecHitCollector > produce(const MultiRecHitRecord &)
MultiRecHitCollectorESProducer(const edm::ParameterSet &iConfig)
#define debug
Definition: HDRShower.cc:19
HLT enums.
T const * product() const
Definition: ESHandle.h:86