Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-14 00:04:41

0001 // -*- C++ -*-
0002 //
0003 // Package:    __subsys__/__pkgname__
0004 // Class:      __class__
0005 //
0006 /**\class __class__ __class__.cc __subsys__/__pkgname__/plugins/__class__.cc
0007 
0008  Description: [one line class summary]
0009 
0010  Implementation:
0011      [Notes on implementation]
0012 */
0013 //
0014 // Original Author:  __author__
0015 //         Created:  __date__
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/stream/EDFilter.h"
0025 
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/MakerMacros.h"
0028 
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 #include "FWCore/Utilities/interface/StreamID.h"
0031 
0032 //
0033 // class declaration
0034 //
0035 
0036 class __class__ : public edm::stream::EDFilter<> {
0037 public:
0038   explicit __class__(const edm::ParameterSet&);
0039   ~__class__() override;
0040 
0041   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0042 
0043 private:
0044   void beginStream(edm::StreamID) override;
0045   bool filter(edm::Event&, const edm::EventSetup&) override;
0046   void endStream() override;
0047 
0048   //void beginRun(edm::Run const&, edm::EventSetup const&) override;
0049   //void endRun(edm::Run const&, edm::EventSetup const&) override;
0050   //void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0051   //void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0052 
0053   // ----------member data ---------------------------
0054 #ifdef THIS_IS_AN_EVENT_EXAMPLE
0055   edm::EDGetTokenT<ExampleData> exampleToken_;
0056 #endif
0057 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
0058   edm::ESGetToken<SetupData, SetupRecord> setupToken_;
0059 #endif
0060 };
0061 
0062 //
0063 // constants, enums and typedefs
0064 //
0065 
0066 //
0067 // static data member definitions
0068 //
0069 
0070 //
0071 // constructors and destructor
0072 //
0073 __class__::__class__(const edm::ParameterSet& iConfig) {
0074   //now do what ever initialization is needed
0075 #ifdef THIS_IS_AN_EVENT_EXAMPLE
0076   exampleToken_ = consumes<ExampleData>(iConfig.getParameter<edm::InputTag>("examples"));
0077 #endif
0078 #ifdef THIS_IS_EN_EVENTSETUP_EXAMPLE
0079   setupToken_ = esConsumes<SetupData, SetupRecord>();
0080 #endif
0081 }
0082 
0083 __class__::~__class__() {
0084   // do anything here that needs to be done at destruction time
0085   // (e.g. close files, deallocate resources etc.)
0086   //
0087   // please remove this method altogether if it would be left empty
0088 }
0089 
0090 //
0091 // member functions
0092 //
0093 
0094 // ------------ method called on each new Event  ------------
0095 bool __class__::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0096   using namespace edm;
0097 #ifdef THIS_IS_AN_EVENT_EXAMPLE
0098   ExampleData const& in = iEvent.get(exampleToken_);
0099 #endif
0100 
0101 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
0102   SetupData const& setup = iSetup.getData(setupToken_);
0103 #endif
0104   return true;
0105 }
0106 
0107 // ------------ method called once each stream before processing any runs, lumis or events  ------------
0108 void __class__::beginStream(edm::StreamID) {
0109   // please remove this method if not needed
0110 }
0111 
0112 // ------------ method called once each stream after processing all runs, lumis and events  ------------
0113 void __class__::endStream() {
0114   // please remove this method if not needed
0115 }
0116 
0117 // ------------ method called when starting to processes a run  ------------
0118 /*
0119 void
0120 __class__::beginRun(edm::Run const&, edm::EventSetup const&)
0121 { 
0122 }
0123 */
0124 
0125 // ------------ method called when ending the processing of a run  ------------
0126 /*
0127 void
0128 __class__::endRun(edm::Run const&, edm::EventSetup const&)
0129 {
0130 }
0131 */
0132 
0133 // ------------ method called when starting to processes a luminosity block  ------------
0134 /*
0135 void
0136 __class__::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
0137 {
0138 }
0139 */
0140 
0141 // ------------ method called when ending the processing of a luminosity block  ------------
0142 /*
0143 void
0144 __class__::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
0145 {
0146 }
0147 */
0148 
0149 // ------------ method fills 'descriptions' with the allowed parameters for the module  ------------
0150 void __class__::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0151   //The following says we do not know what parameters are allowed so do no validation
0152   // Please change this to state exactly what you do use, even if it is no parameters
0153   edm::ParameterSetDescription desc;
0154   desc.setUnknown();
0155   descriptions.addDefault(desc);
0156 }
0157 //define this as a plug-in
0158 DEFINE_FWK_MODULE(__class__);