0016 0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 class TopDecaySubset : public edm::EDProducer {
0030
0031 public:
0032
0033
0034 enum FillMode {kStable, kME};
0035
0036 enum ShowerModel{kStart=-1, kNone, kPythia, kHerwig, kPythia8, kSherpa};
0037
0038 enum RunMode {kRun1, kRun2};
0039
0040
0041 explicit TopDecaySubset(const edm::ParameterSet& cfg);
0042
0043 ~TopDecaySubset() override;
0044
0045 void produce(edm::Event& event, const edm::EventSetup& setup) override;
0046
0047 private:
0048
0049 std::vector<const reco::GenParticle*> findTops(const reco::GenParticleCollection& parts);
0050
0051
0052 std::vector<const reco::GenParticle*> findPrimalTops(const reco::GenParticleCollection& parts);
0053
0054
0055 std::vector<const reco::GenParticle*> findDecayingTops(const reco::GenParticleCollection& parts);
0056
0057
0058 const reco::GenParticle* findPrimalW(const reco::GenParticle* top);
0059
0060
0061
0062
0063
0064
0065
0066 const reco::GenParticle* findLastParticleInChain(const reco::GenParticle* p);
0067
0068 ShowerModel checkShowerModel(const std::vector<const reco::GenParticle*>& tops) const;
0069 ShowerModel checkShowerModel(edm::Event& event);
0070
0071 void checkWBosons(std::vector<const reco::GenParticle*>& tops) const;
0072
0073 void fillListing(const std::vector<const reco::GenParticle*>& tops, reco::GenParticleCollection& target);
0074
0075 void fillListing(const std::vector<const reco::GenParticle*>& primalTops,
0076 const std::vector<const reco::GenParticle*>& decayingTops,
0077 reco::GenParticleCollection& target);
0078
0079
0080 void clearReferences();
0081
0082 void fillReferences(const reco::GenParticleRefProd& refProd, reco::GenParticleCollection& target);
0083
0084 reco::Particle::LorentzVector p4(const std::vector<const reco::GenParticle*>::const_iterator top, int statusFlag);
0085
0086 reco::Particle::LorentzVector p4(const reco::GenParticle::const_iterator part, int statusFlag);
0087
0088 void addDaughters(int& idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection& target, bool recursive=true);
0089
0090 void addRadiation(int& idx, const reco::GenParticle::const_iterator part, reco::GenParticleCollection& target);
0091 void addRadiation(int& idx, const reco::GenParticle* part, reco::GenParticleCollection& target);
0092
0093 private:
0094
0095 edm::EDGetTokenT<reco::GenParticleCollection> srcToken_;
0096
0097 edm::EDGetTokenT<GenEventInfoProduct> genEventInfo_srcToken_;
0098
0099 bool addRadiation_;
0100
0101
0102 FillMode fillMode_;
0103
0104 ShowerModel showerModel_;
0105
0106 RunMode runMode_;
0107
0108
0109
0110
0111 int motherPartIdx_;
0112
0113 std::map<int,std::vector<int> > refs_;
0114 };