File indexing completed on 2024-09-07 04:36:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <memory>
0014
0015
0016 #include "FWCore/Framework/interface/ModuleFactory.h"
0017 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0018 #include "FWCore/Framework/interface/ESProducer.h"
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "FWCore/Framework/interface/ModuleFactory.h"
0021 #include "FWCore/Utilities/interface/do_nothing_deleter.h"
0022
0023 #include "CondFormats/JetMETObjects/interface/QGLikelihoodObject.h"
0024 #include "CondFormats/DataRecord/interface/QGLikelihoodRcd.h"
0025
0026 class QGLikelihoodESProducer : public edm::ESProducer {
0027 public:
0028 QGLikelihoodESProducer(const edm::ParameterSet&);
0029 ~QGLikelihoodESProducer() override {}
0030
0031 std::shared_ptr<const QGLikelihoodObject> produce(const QGLikelihoodRcd&);
0032
0033 private:
0034 const edm::ESGetToken<QGLikelihoodObject, QGLikelihoodRcd> token_;
0035 };
0036
0037 QGLikelihoodESProducer::QGLikelihoodESProducer(const edm::ParameterSet& iConfig)
0038 : token_(setWhatProduced(this, iConfig.getParameter<std::string>("@module_label"))
0039 .consumes(edm::ESInputTag{"", iConfig.getParameter<std::string>("algo")})) {}
0040
0041
0042 std::shared_ptr<const QGLikelihoodObject> QGLikelihoodESProducer::produce(const QGLikelihoodRcd& iRecord) {
0043 return std::shared_ptr<const QGLikelihoodObject>(&iRecord.get(token_), edm::do_nothing_deleter());
0044 }
0045
0046 DEFINE_FWK_EVENTSETUP_MODULE(QGLikelihoodESProducer);