File indexing completed on 2023-03-17 11:26:31
0001 #include "FWCore/Framework/interface/ModuleFactory.h"
0002 #include "FWCore/Framework/interface/ESProducer.h"
0003
0004 #include "FWCore/Framework/interface/ESHandle.h"
0005
0006 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0007 #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleaner.h"
0008
0009 #include "TrackingTools/TrajectoryCleaning/interface/TrajectoryCleanerFactory.h"
0010
0011 class TrajectoryCleanerESProducer : public edm::ESProducer {
0012 public:
0013 TrajectoryCleanerESProducer(const edm::ParameterSet&);
0014 ~TrajectoryCleanerESProducer() override;
0015
0016 typedef std::unique_ptr<TrajectoryCleaner> ReturnType;
0017
0018 ReturnType produce(const TrackingComponentsRecord&);
0019
0020 private:
0021 std::string theComponentName;
0022 std::string theComponentType;
0023 edm::ParameterSet theConfig;
0024 };
0025
0026 TrajectoryCleanerESProducer::TrajectoryCleanerESProducer(const edm::ParameterSet& iConfig) {
0027 theComponentName = iConfig.getParameter<std::string>("ComponentName");
0028 theComponentType = iConfig.getParameter<std::string>("ComponentType");
0029
0030 theConfig = iConfig;
0031 setWhatProduced(this, theComponentName);
0032 }
0033
0034 TrajectoryCleanerESProducer::~TrajectoryCleanerESProducer() {}
0035
0036
0037 TrajectoryCleanerESProducer::ReturnType TrajectoryCleanerESProducer::produce(const TrackingComponentsRecord& iRecord) {
0038 using namespace edm::es;
0039
0040 return ReturnType(TrajectoryCleanerFactory::get()->create(theComponentType, theConfig));
0041 }
0042
0043 DEFINE_FWK_EVENTSETUP_MODULE(TrajectoryCleanerESProducer);