Go to the documentation of this file.00001 #include <memory>
00002 #include <string>
00003 #include <vector>
00004 #include <map>
00005
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "FWCore/Framework/interface/EDProducer.h"
00008 #include "FWCore/Framework/interface/Frameworkfwd.h"
00009
00010 #include "FWCore/Utilities/interface/InputTag.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00013
00027 class TopDecaySubset : public edm::EDProducer {
00028
00029 public:
00032 enum FillMode {kStable, kME};
00034 enum ShowerModel{kStart=-1, kNone, kPythia, kHerwig};
00035
00037 explicit TopDecaySubset(const edm::ParameterSet& cfg);
00039 ~TopDecaySubset();
00041 virtual void produce(edm::Event& event, const edm::EventSetup& setup);
00042
00043 private:
00045 std::vector<const reco::GenParticle*> findTops(const reco::GenParticleCollection& parts);
00047 ShowerModel checkShowerModel(const std::vector<const reco::GenParticle*>& tops) const;
00049 void checkWBosons(std::vector<const reco::GenParticle*>& tops) const;
00051 void fillListing(const std::vector<const reco::GenParticle*>& tops, reco::GenParticleCollection& target);
00052
00054 void clearReferences();
00056 void fillReferences(const reco::GenParticleRefProd& refProd, reco::GenParticleCollection& target);
00058 reco::Particle::LorentzVector p4(const std::vector<const reco::GenParticle*>::const_iterator top, int statusFlag);
00060 reco::Particle::LorentzVector p4(const reco::GenParticle::const_iterator part, int statusFlag);
00062 void addDaughters(int& idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection& target, bool recursive=true);
00064 void addRadiation(int& idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection& target);
00065
00066 private:
00068 edm::InputTag src_;
00070 bool addRadiation_;
00073 FillMode fillMode_;
00075 ShowerModel showerModel_;
00076
00080 int motherPartIdx_;
00082 std::map<int,std::vector<int> > refs_;
00083 };