Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:25

0001 /*
0002  Description: ESProducer to get the quark-gluon likelihood object "QGLikelihoodSystematicsObject"
0003               from record "QGLikelihoodRcd". 
0004 
0005  Implementation:
0006      Completely trivial, simply returns the QGLikelihoodSystematicsObject to the user. There is only
0007      one QGLikelihoodSystematicsObject 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/ModuleFactory.h"
0020 #include "FWCore/Utilities/interface/do_nothing_deleter.h"
0021 
0022 #include "CondFormats/JetMETObjects/interface/QGLikelihoodObject.h"
0023 #include "CondFormats/DataRecord/interface/QGLikelihoodSystematicsRcd.h"
0024 
0025 class QGLikelihoodSystematicsESProducer : public edm::ESProducer {
0026 public:
0027   QGLikelihoodSystematicsESProducer(const edm::ParameterSet&);
0028   ~QGLikelihoodSystematicsESProducer() override{};
0029 
0030   std::shared_ptr<const QGLikelihoodSystematicsObject> produce(const QGLikelihoodSystematicsRcd&);
0031 
0032 private:
0033   const edm::ESGetToken<QGLikelihoodSystematicsObject, QGLikelihoodSystematicsRcd> token_;
0034 };
0035 
0036 QGLikelihoodSystematicsESProducer::QGLikelihoodSystematicsESProducer(const edm::ParameterSet& iConfig)
0037     : token_(setWhatProduced(this, iConfig.getParameter<std::string>("@module_label"))
0038                  .consumes(edm::ESInputTag{"", iConfig.getParameter<std::string>("algo")})) {}
0039 
0040 // Produce the data
0041 std::shared_ptr<const QGLikelihoodSystematicsObject> QGLikelihoodSystematicsESProducer::produce(
0042     const QGLikelihoodSystematicsRcd& iRecord) {
0043   return std::shared_ptr<const QGLikelihoodSystematicsObject>(&iRecord.get(token_), edm::do_nothing_deleter());
0044 }
0045 
0046 DEFINE_FWK_EVENTSETUP_MODULE(QGLikelihoodSystematicsESProducer);