Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:36:41

0001 /*
0002  Description: ESProducer to get the quark-gluon likelihood object "QGLikelihoodObject"
0003               from record "QGLikelihoodRcd". 
0004 
0005  Implementation:
0006      Completely trivial, simply returns the QGLikelihoodObject to the user. There is only
0007      one QGLikelihoodObject object in each record. 
0008 */
0009 // Original Author:  Salvatore Rappoccio
0010 //         Created:  Thu, 13 Mar 2014 15:02:39 GMT
0011 
0012 // system include files
0013 #include <memory>
0014 
0015 // user include files
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 // Produce the data
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);