CMS 3D CMS Logo

MultiRecHitCollectorESProducer.cc
Go to the documentation of this file.
4 
5 
13 
18 
19 #include <string>
20 #include <memory>
21 
22 using namespace edm;
23 
25 {
26  std::string myname = iConfig.getParameter<std::string>("ComponentName");
27  setConf(iConfig);
28  setWhatProduced(this,myname);
29 }
30 
32 
33 std::unique_ptr<MultiRecHitCollector>
35  std::string mode = "Grouped";
36  if (conf_.getParameter<std::string>("Mode")=="Simple") mode = "Simple";
37 
38  std::string mrhupdator = conf_.getParameter<std::string>("MultiRecHitUpdator");
39  std::string propagatorAlongName = conf_.getParameter<std::string>("propagatorAlong");
40  std::string estimatorName = conf_.getParameter<std::string>("estimator");
41  std::string measurementTrackerName = conf_.getParameter<std::string>("MeasurementTrackerName");
42  bool debug = conf_.getParameter<bool>("Debug");
43 
44 
46  iRecord.get(mrhupdator, mrhuhandle);
47  ESHandle<Propagator> propagatorhandle;
48  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(propagatorAlongName, propagatorhandle);
50  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(estimatorName, estimatorhandle);
51  ESHandle<MeasurementTracker> measurementhandle;
52  iRecord.getRecord<CkfComponentsRecord>().get(measurementTrackerName, measurementhandle);
53  ESHandle<TrackerTopology> trackerTopologyHandle;
54  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackerTopologyRcd>().get(trackerTopologyHandle);
55 
56  if (mode == "Grouped"){
57  std::string propagatorOppositeName = conf_.getParameter<std::string>("propagatorOpposite");
58  ESHandle<Propagator> propagatorOppositehandle;
59  iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(propagatorOppositeName, propagatorOppositehandle);
60  return std::make_unique<GroupedDAFHitCollector>(measurementhandle.product(),
61  mrhuhandle.product(),
62  estimatorhandle.product(),
63  propagatorhandle.product(),
64  propagatorOppositehandle.product(), debug);
65  }
66  else {
67  return std::make_unique<SimpleDAFHitCollector>(trackerTopologyHandle.product(),
68  measurementhandle.product(),
69  mrhuhandle.product(),
70  estimatorhandle.product(),
71  propagatorhandle.product(), debug);
72  }
73 
74 
75 }
76 
77 
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
measurementTrackerName
possibility to inhibit extended forward coverage
HLT enums.
T const * product() const
Definition: ESHandle.h:86