CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CommonTools/UtilAlgos/plugins/DoubleProducer.cc

Go to the documentation of this file.
00001 /* \class DoubleProducer
00002  *
00003  * \author Luca Lista, INFN
00004  *
00005  * $Id: DoubleProducer.cc,v 1.1 2009/03/03 13:07:29 llista Exp $
00006  *
00007  */
00008 
00009 #include "FWCore/Framework/interface/EDProducer.h"
00010 
00011 class DoubleProducer : public edm::EDProducer {
00012 public:
00013   DoubleProducer( const edm::ParameterSet & cfg );
00014 private:
00015   void produce( edm::Event & evt, const edm::EventSetup & );
00016   double value_;
00017 };
00018 
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 
00022 using namespace edm;
00023 using namespace std;
00024 
00025 DoubleProducer::DoubleProducer( const ParameterSet & cfg ) :
00026 value_( cfg.getParameter<double>( "value" ) ){
00027   produces<double>();
00028 }
00029 
00030 void DoubleProducer::produce( Event & evt, const EventSetup & ) {
00031   auto_ptr<double> value( new double( value_ ) );
00032   evt.put( value );
00033 }
00034 
00035 #include "FWCore/Framework/interface/MakerMacros.h"
00036 
00037 DEFINE_FWK_MODULE( DoubleProducer );