CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/GeneratorInterface/GenFilters/interface/XtoFFbarFilter.h

Go to the documentation of this file.
00001 #ifndef XtoFFbarFilter_h
00002 #define XtoFFbarFilter_h
00003 
00016 // system include files
00017 #include <memory>
00018 
00019 // user include files
00020 #include "FWCore/Framework/interface/Frameworkfwd.h"
00021 #include "FWCore/Framework/interface/EDFilter.h"
00022 #include "FWCore/Framework/interface/Event.h"
00023 #include "FWCore/Framework/interface/EventSetup.h"
00024 #include "FWCore/Framework/interface/MakerMacros.h"
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 #include "FWCore/Utilities/interface/InputTag.h"
00027 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00028 #include <vector>
00029 
00030 class XtoFFbarFilter : public edm::EDFilter {
00031 public:
00032   XtoFFbarFilter(const edm::ParameterSet&);
00033   ~XtoFFbarFilter() {}
00034   
00035   virtual bool filter(edm::Event& iEvent, const edm::EventSetup& iSetup);
00036   
00037 private:
00038   
00039   // Check if given integer is present in vector.
00040   bool found(const std::vector<int> v, int j) {
00041     return std::find(v.begin(), v.end(), j) != v.end();
00042   }
00043   
00044   // Check if given particle is X-->f fbar
00045   bool foundXtoFFbar(const reco::GenParticleRef& moth, 
00046                      const std::vector<int>& idMotherX,
00047                      const std::vector<int>& idDaughterF);
00048 
00049   virtual void endJob();
00050 
00051 private:
00052 
00053   edm::InputTag src_;
00054   std::vector<int> idMotherX_;
00055   std::vector<int> idDaughterF_;
00056   std::vector<int> idMotherY_;
00057   std::vector<int> idDaughterG_;
00058   bool requireY_;
00059 
00060   edm::Handle<reco::GenParticleCollection> genParticles_;
00061 
00062   // For statistics only
00063   unsigned int xTotal_;
00064   double xSumPt_;
00065   double xSumR_;
00066   unsigned int totalEvents_;
00067   unsigned int rejectedEvents_;
00068 };
00069 
00070 #endif