Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-18 03:27:24

0001 #ifndef PhysicsTools_NanoAOD_NanoAODBaseCrossCleaner_h
0002 #define PhysicsTools_NanoAOD_NanoAODBaseCrossCleaner_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    PhysicsTools/NanoAOD
0007 // Class:      NanoAODBaseCrossCleaner
0008 //
0009 /**\class NanoAODBaseCrossCleaner NanoAODBaseCrossCleaner.cc PhysicsTools/NanoAODBaseCrossCleaner/plugins/NanoAODBaseCrossCleaner.cc
0010 
0011  Description: [one line class summary]
0012 
0013  Implementation:
0014      [Notes on implementation]
0015 */
0016 //
0017 // Original Author:  Andrea Rizzi
0018 //         Created:  Mon, 28 Aug 2017 09:26:39 GMT
0019 //
0020 //
0021 
0022 // system include files
0023 #include <memory>
0024 
0025 // user include files
0026 #include "FWCore/Framework/interface/Frameworkfwd.h"
0027 #include "FWCore/Framework/interface/stream/EDProducer.h"
0028 
0029 #include "FWCore/Framework/interface/Event.h"
0030 #include "FWCore/Framework/interface/MakerMacros.h"
0031 
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "FWCore/Utilities/interface/StreamID.h"
0034 
0035 #include "DataFormats/PatCandidates/interface/Muon.h"
0036 #include "DataFormats/PatCandidates/interface/Jet.h"
0037 #include "DataFormats/PatCandidates/interface/Electron.h"
0038 #include "DataFormats/PatCandidates/interface/Photon.h"
0039 #include "DataFormats/PatCandidates/interface/Tau.h"
0040 
0041 #include "DataFormats/Common/interface/View.h"
0042 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0043 
0044 //
0045 // class declaration
0046 //
0047 
0048 class NanoAODBaseCrossCleaner : public edm::stream::EDProducer<> {
0049 public:
0050   explicit NanoAODBaseCrossCleaner(const edm::ParameterSet&);
0051   ~NanoAODBaseCrossCleaner() override;
0052 
0053   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0054 
0055 private:
0056   void beginStream(edm::StreamID) override;
0057   void produce(edm::Event&, const edm::EventSetup&) override;
0058   void endStream() override;
0059   virtual void objectSelection(const edm::View<pat::Jet>& jets,
0060                                const edm::View<pat::Muon>& muons,
0061                                const edm::View<pat::Electron>& eles,
0062                                const edm::View<pat::Tau>& taus,
0063                                const edm::View<pat::Photon>& photons,
0064                                std::vector<uint8_t>& jetBits,
0065                                std::vector<uint8_t>& muonBits,
0066                                std::vector<uint8_t>& eleBits,
0067                                std::vector<uint8_t>& tauBits,
0068                                std::vector<uint8_t>& photonBits){};
0069 
0070   //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
0071   //virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
0072   //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0073   //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0074 
0075   // ----------member data ---------------------------
0076   const std::string name_;
0077   const std::string doc_;
0078 
0079   const edm::EDGetTokenT<edm::View<pat::Jet>> jets_;
0080   const edm::EDGetTokenT<edm::View<pat::Muon>> muons_;
0081   const edm::EDGetTokenT<edm::View<pat::Electron>> electrons_;
0082   edm::InputTag lowPtElectronsTag_;
0083   edm::EDGetTokenT<edm::View<pat::Electron>> lowPtElectrons_;
0084   const edm::EDGetTokenT<edm::View<pat::Tau>> taus_;
0085   const edm::EDGetTokenT<edm::View<pat::Photon>> photons_;
0086   const StringCutObjectSelector<pat::Jet> jetSel_;
0087   const StringCutObjectSelector<pat::Muon> muonSel_;
0088   const StringCutObjectSelector<pat::Electron> electronSel_;
0089   const StringCutObjectSelector<pat::Electron> lowPtElectronSel_;
0090   const StringCutObjectSelector<pat::Tau> tauSel_;
0091   const StringCutObjectSelector<pat::Photon> photonSel_;
0092   const std::string jetName_;
0093   const std::string muonName_;
0094   const std::string electronName_;
0095   const std::string lowPtElectronName_;
0096   const std::string tauName_;
0097   const std::string photonName_;
0098 };
0099 
0100 #endif