Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-18 02:29:47

0001 /* \class DoubleProducer
0002  *
0003  * \author Luca Lista, INFN
0004  *
0005  * $Id: DoubleProducer.cc,v 1.1 2009/03/03 13:07:29 llista Exp $
0006  *
0007  */
0008 
0009 #include "FWCore/Framework/interface/stream/EDProducer.h"
0010 
0011 class DoubleProducer : public edm::stream::EDProducer<> {
0012 public:
0013   DoubleProducer(const edm::ParameterSet& cfg);
0014 
0015 private:
0016   void produce(edm::Event& evt, const edm::EventSetup&) override;
0017   double value_;
0018 };
0019 
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 
0023 using namespace edm;
0024 using namespace std;
0025 
0026 DoubleProducer::DoubleProducer(const ParameterSet& cfg) : value_(cfg.getParameter<double>("value")) {
0027   produces<double>();
0028 }
0029 
0030 void DoubleProducer::produce(Event& evt, const EventSetup&) {
0031   unique_ptr<double> value(new double(value_));
0032   evt.put(std::move(value));
0033 }
0034 
0035 #include "FWCore/Framework/interface/MakerMacros.h"
0036 
0037 DEFINE_FWK_MODULE(DoubleProducer);