CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoLocalCalo/HcalRecAlgos/plugins/HcalRecAlgoESProducer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    HcalRecAlgoESProducer
00004 // Class:      HcalRecAlgoESProducer
00005 // 
00013 //
00014 // Original Author:  Radek Ofierzynski
00015 //         Created:  Mon Feb  9 10:59:46 CET 2009
00016 // $Id: HcalRecAlgoESProducer.cc,v 1.1 2009/02/09 16:51:44 rofierzy Exp $
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 #include <memory>
00023 #include "boost/shared_ptr.hpp"
00024 
00025 // user include files
00026 #include "FWCore/Framework/interface/ModuleFactory.h"
00027 #include "FWCore/Framework/interface/ESProducer.h"
00028 
00029 #include "FWCore/Framework/interface/ESHandle.h"
00030 
00031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00032 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
00033 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
00034 
00035 
00036 
00037 //
00038 // class decleration
00039 //
00040 
00041 class HcalRecAlgoESProducer : public edm::ESProducer {
00042    public:
00043       HcalRecAlgoESProducer(const edm::ParameterSet&);
00044 
00045       ~HcalRecAlgoESProducer();
00046 
00047       typedef boost::shared_ptr<HcalSeverityLevelComputer> ReturnType;
00048 
00049       ReturnType produce(const HcalSeverityLevelComputerRcd&);
00050    private:
00051       // ----------member data ---------------------------
00052   ReturnType myComputer;
00053 };
00054 
00055 //
00056 // constants, enums and typedefs
00057 //
00058 
00059 //
00060 // static data member definitions
00061 //
00062 
00063 //
00064 // constructors and destructor
00065 //
00066 HcalRecAlgoESProducer::HcalRecAlgoESProducer(const edm::ParameterSet& iConfig)
00067 {
00068    //the following line is needed to tell the framework what
00069    // data is being produced
00070    setWhatProduced(this);
00071 
00072    //now do what ever other initialization is needed
00073    myComputer = ReturnType(new HcalSeverityLevelComputer(iConfig));
00074 }
00075 
00076 
00077 HcalRecAlgoESProducer::~HcalRecAlgoESProducer()
00078 {
00079  
00080    // do anything here that needs to be done at desctruction time
00081    // (e.g. close files, deallocate resources etc.)
00082 
00083 }
00084 
00085 
00086 //
00087 // member functions
00088 //
00089 
00090 // ------------ method called to produce the data  ------------
00091 HcalRecAlgoESProducer::ReturnType
00092 HcalRecAlgoESProducer::produce(const HcalSeverityLevelComputerRcd& iRecord)
00093 {
00094    using namespace edm::es;
00095 
00096    return myComputer ;
00097 }
00098 
00099 //define this as a plug-in
00100 DEFINE_FWK_EVENTSETUP_MODULE(HcalRecAlgoESProducer);