CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Skeletons/scripts/mkTemplates/EDFilter/edfilter.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    fltrname
00004 // Class:      fltrname
00005 // 
00013 //
00014 // Original Author:  John Doe
00015 //         Created:  day-mon-xx
00016 // RCS(Id)
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 #include <memory>
00023 
00024 // user include files
00025 #include "FWCore/Framework/interface/Frameworkfwd.h"
00026 #include "FWCore/Framework/interface/EDFilter.h"
00027 
00028 #include "FWCore/Framework/interface/Event.h"
00029 #include "FWCore/Framework/interface/MakerMacros.h"
00030 
00031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00032 
00033 //
00034 // class declaration
00035 //
00036 
00037 class fltrname : public edm::EDFilter {
00038    public:
00039       explicit fltrname(const edm::ParameterSet&);
00040       ~fltrname();
00041 
00042       static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
00043 
00044    private:
00045       virtual void beginJob() ;
00046       virtual bool filter(edm::Event&, const edm::EventSetup&);
00047       virtual void endJob() ;
00048       
00049       virtual bool beginRun(edm::Run&, edm::EventSetup const&);
00050       virtual bool endRun(edm::Run&, edm::EventSetup const&);
00051       virtual bool beginLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&);
00052       virtual bool endLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&);
00053 
00054       // ----------member data ---------------------------
00055 };
00056 
00057 //
00058 // constants, enums and typedefs
00059 //
00060 
00061 //
00062 // static data member definitions
00063 //
00064 
00065 //
00066 // constructors and destructor
00067 //
00068 fltrname::fltrname(const edm::ParameterSet& iConfig)
00069 {
00070    //now do what ever initialization is needed
00071 
00072 }
00073 
00074 
00075 fltrname::~fltrname()
00076 {
00077  
00078    // do anything here that needs to be done at desctruction time
00079    // (e.g. close files, deallocate resources etc.)
00080 
00081 }
00082 
00083 
00084 //
00085 // member functions
00086 //
00087 
00088 // ------------ method called on each new Event  ------------
00089 bool
00090 fltrname::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)
00091 {
00092    using namespace edm;
00093 #ifdef THIS_IS_AN_EVENT_EXAMPLE
00094    Handle<ExampleData> pIn;
00095    iEvent.getByLabel("example",pIn);
00096 #endif
00097 
00098 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
00099    ESHandle<SetupData> pSetup;
00100    iSetup.get<SetupRecord>().get(pSetup);
00101 #endif
00102    return true;
00103 }
00104 
00105 // ------------ method called once each job just before starting event loop  ------------
00106 void 
00107 fltrname::beginJob()
00108 {
00109 }
00110 
00111 // ------------ method called once each job just after ending the event loop  ------------
00112 void 
00113 fltrname::endJob() {
00114 }
00115 
00116 // ------------ method called when starting to processes a run  ------------
00117 bool 
00118 fltrname::beginRun(edm::Run&, edm::EventSetup const&)
00119 { 
00120   return true;
00121 }
00122 
00123 // ------------ method called when ending the processing of a run  ------------
00124 bool 
00125 fltrname::endRun(edm::Run&, edm::EventSetup const&)
00126 {
00127   return true;
00128 }
00129 
00130 // ------------ method called when starting to processes a luminosity block  ------------
00131 bool 
00132 fltrname::beginLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&)
00133 {
00134   return true;
00135 }
00136 
00137 // ------------ method called when ending the processing of a luminosity block  ------------
00138 bool 
00139 fltrname::endLuminosityBlock(edm::LuminosityBlock&, edm::EventSetup const&)
00140 {
00141   return true;
00142 }
00143 
00144 // ------------ method fills 'descriptions' with the allowed parameters for the module  ------------
00145 void
00146 fltrname::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
00147   //The following says we do not know what parameters are allowed so do no validation
00148   // Please change this to state exactly what you do use, even if it is no parameters
00149   edm::ParameterSetDescription desc;
00150   desc.setUnknown();
00151   descriptions.addDefault(desc);
00152 }
00153 //define this as a plug-in
00154 DEFINE_FWK_MODULE(fltrname);