Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-08 23:51:46

0001 #ifndef MCPdgIndexFilter_h
0002 #define MCPdgIndexFilter_h
0003 /*
0004  Description: filter events based on the particle PDG ID at a given
0005  index in the HepMC::GenEvent record.
0006 
0007  Original Author: Burt Betchart, 2013/08/09
0008 */
0009 
0010 #include <memory>
0011 
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "FWCore/Framework/interface/global/EDFilter.h"
0014 
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017 
0018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0019 
0020 namespace edm {
0021   class HepMCProduct;
0022 }
0023 
0024 class MCPdgIndexFilter : public edm::global::EDFilter<> {
0025 public:
0026   explicit MCPdgIndexFilter(const edm::ParameterSet&);
0027   ~MCPdgIndexFilter() override {}
0028 
0029   bool filter(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0030 
0031 private:
0032   bool pass(const edm::Event&) const;
0033   const edm::EDGetTokenT<edm::HepMCProduct> token_;
0034   const std::vector<int> pdgID;
0035   const std::vector<unsigned> index;
0036   edm::EDPutTokenT<bool> putToken_;
0037   const unsigned maxIndex;
0038   const bool taggingMode;
0039 };
0040 #endif