CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_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 
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, propagatorOppositehandle);
58  collector_ = boost::shared_ptr<MultiRecHitCollector>(new GroupedDAFHitCollector(measurementhandle.product(),
59  mrhuhandle.product(),
60  estimatorhandle.product(),
61  propagatorhandle.product(),
62  propagatorOppositehandle.product(), debug));
63  }
64  else {
65  collector_ = boost::shared_ptr<MultiRecHitCollector>(new SimpleDAFHitCollector(measurementhandle.product(),
66  mrhuhandle.product(),
67  estimatorhandle.product(),
68  propagatorhandle.product(), debug));
69  }
70 
71  return collector_;
72 
73 }
74 
75 
T getParameter(std::string const &) const
void get(HolderT &iHolder) const
MultiRecHitCollectorESProducer(const edm::ParameterSet &iConfig)
#define debug
Definition: HDRShower.cc:19
T const * product() const
Definition: ESHandle.h:86
boost::shared_ptr< MultiRecHitCollector > produce(const MultiRecHitRecord &)