File indexing completed on 2024-04-06 12:25:56
0001 #include "RecoLocalFastTime/Records/interface/MTDCPERecord.h"
0002 #include "RecoLocalFastTime/FTLClusterizer/interface/MTDClusterParameterEstimator.h"
0003 #include "RecoLocalFastTime/FTLClusterizer/interface/MTDCPEBase.h"
0004
0005 #include "Geometry/Records/interface/MTDDigiGeometryRecord.h"
0006
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/Framework/interface/ModuleFactory.h"
0010 #include "FWCore/Framework/interface/ESProducer.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012
0013 #include <string>
0014 #include <memory>
0015
0016 using namespace edm;
0017
0018 class MTDCPEESProducer : public edm::ESProducer {
0019 public:
0020 MTDCPEESProducer(const edm::ParameterSet& p);
0021 ~MTDCPEESProducer() override = default;
0022
0023 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0024
0025 std::unique_ptr<MTDClusterParameterEstimator> produce(const MTDCPERecord&);
0026
0027 private:
0028 const edm::ParameterSet pset_;
0029 const edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> ddToken_;
0030 };
0031
0032 MTDCPEESProducer::MTDCPEESProducer(const edm::ParameterSet& p)
0033 : pset_(p), ddToken_(setWhatProduced(this, "MTDCPEBase").consumes()) {}
0034
0035
0036 void MTDCPEESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0037 edm::ParameterSetDescription desc;
0038 descriptions.add("MTDCPEESProducer", desc);
0039 }
0040
0041 std::unique_ptr<MTDClusterParameterEstimator> MTDCPEESProducer::produce(const MTDCPERecord& iRecord) {
0042 return std::make_unique<MTDCPEBase>(pset_, iRecord.get(ddToken_));
0043 }
0044
0045 #include "FWCore/PluginManager/interface/ModuleDef.h"
0046 #include "FWCore/Framework/interface/MakerMacros.h"
0047
0048 DEFINE_FWK_EVENTSETUP_MODULE(MTDCPEESProducer);