From 2cbafd50b199523f4f6006790e1b89987f6fc9fe Mon Sep 17 00:00:00 2001 From: YoungKwonJo Date: Wed, 30 Sep 2015 20:46:30 +0900 Subject: [PATCH 1/5] update it for Backport from 7_6_X: ttbar event categorizer, miniAOD jet flavour improvements --- .../python/catGenHFHadronMatching_cff.py | 65 ++++++++++--------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/CatProducer/python/catGenHFHadronMatching_cff.py b/CatProducer/python/catGenHFHadronMatching_cff.py index d0c22af7168..2d8d49539a3 100644 --- a/CatProducer/python/catGenHFHadronMatching_cff.py +++ b/CatProducer/python/catGenHFHadronMatching_cff.py @@ -4,53 +4,60 @@ def genHFTool(process, useMiniAOD = True): # Setting input particle collections to be used by the tools genParticleCollection = '' - genJetInputParticleCollection = '' genJetCollection = 'ak4GenJetsCustom' if useMiniAOD: genParticleCollection = 'prunedGenParticles' - genJetInputParticleCollection = 'packedGenParticles' + genJetCollection = 'slimmedGenJets' else: genParticleCollection = 'genParticles' - genJetInputParticleCollection = 'genParticlesForJets' - ## producing a subset of genParticles to be used for jet clustering in AOD - process.load("RecoJets.Configuration.GenJetParticles_cff") - + ## producing a subset of genParticles to be used for jet reclustering + from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJetsNoNu + process.genParticlesForJetsCustom = genParticlesForJetsNoNu.clone( + src = genParticleCollection + ) + # Producing own jets for testing purposes + from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets + process.ak4GenJetsCustom = ak4GenJets.clone( + src = 'genParticlesForJetsCustom', + rParam = cms.double(0.4), + jetAlgorithm = cms.string("AntiKt") + ) + # Supplies PDG ID to real name resolution of MC particles process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") - - # Producing own jets for testing purposes - process.load("RecoJets.JetProducers.ak4GenJets_cfi") - process.ak4GenJetsCustom = process.ak4GenJets.clone( - src = cms.InputTag(genJetInputParticleCollection), - rParam = cms.double(0.4), - jetAlgorithm = cms.string("AntiKt") - ) - + # Ghost particle collection used for Hadron-Jet association # MUST use proper input particle collection process.load("PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi") process.selectedHadronsAndPartons.particles = genParticleCollection - - # Input particle collection for matching to gen jets (partons + leptons) + + ## Input particle collection for matching to gen jets (partons + leptons) # MUST use use proper input jet collection: the jets to which hadrons should be associated # rParam and jetAlgorithm MUST match those used for jets to be associated with hadrons # More details on the tool: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideBTagMCTools#New_jet_flavour_definition - process.load("PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff") - process.genJetFlavourPlusLeptonInfos.jets = genJetCollection - process.genJetFlavourPlusLeptonInfos.rParam = cms.double(0.4) - process.genJetFlavourPlusLeptonInfos.jetAlgorithm = cms.string("AntiKt") - - # Plugin for analysing B hadrons + from PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi import ak4JetFlavourInfos + process.genJetFlavourInfos = ak4JetFlavourInfos.clone( jets = genJetCollection ) + + #for cmssw_7_6_X + #process.load("PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cff") + #added the 3-lines instead of GenHFHadronMatcher_cff + from PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cfi import matchGenHFHadron + process.matchGenBHadron=matchGenHFHadron.clone( flavour = 5) + process.matchGenCHadron=matchGenHFHadron.clone( flavour = 4) + ## Plugin for analysing B hadrons # MUST use the same particle collection as in selectedHadronsAndPartons - process.load("PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff") - process.matchGenBHadron.genParticles = genParticleCollection - - # Plugin for analysing C hadrons + process.matchGenBHadron.genParticles = genParticleCollection + process.matchGenBHadron.jetFlavourInfos = "genJetFlavourInfos" + ## Plugin for analysing C hadrons # MUST use the same particle collection as in selectedHadronsAndPartons - process.load("PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff") process.matchGenCHadron.genParticles = genParticleCollection - + process.matchGenCHadron.jetFlavourInfos = "genJetFlavourInfos" + + #related the issue : https://github.com/vallot/CATTools/issues/226 + #process.load("TopQuarkAnalysis.TopTools.GenTtbarCategorizer_cfi") + #remove CatProducer/plugins/GenTtbarCategorizer.cc process.load("CATTools.CatProducer.mcTruthTop.GenTtbarCategorizer_cfi") process.GenTtbarCategories = process.categorizeGenTtbar.clone( genJets = cms.InputTag(genJetCollection) ) + From b1d0e4d29978d587933b6b33dc09b6914dfd8a10 Mon Sep 17 00:00:00 2001 From: YoungKwonJo Date: Thu, 1 Oct 2015 09:28:48 +0900 Subject: [PATCH 2/5] rm GenTtbarCategorizer.cc --- CatProducer/plugins/GenTtbarCategorizer.cc | 317 --------------------- 1 file changed, 317 deletions(-) delete mode 100644 CatProducer/plugins/GenTtbarCategorizer.cc diff --git a/CatProducer/plugins/GenTtbarCategorizer.cc b/CatProducer/plugins/GenTtbarCategorizer.cc deleted file mode 100644 index ce17e793a2a..00000000000 --- a/CatProducer/plugins/GenTtbarCategorizer.cc +++ /dev/null @@ -1,317 +0,0 @@ -// -*- C++ -*- -// -// Package: PhysicsTools/GenTtbarCategorizer -// Class: GenTtbarCategorizer -// -/**\class GenTtbarCategorizer GenTtbarCategorizer.cc PhysicsTools/JetMCAlgos/plugins/GenTtbarCategorizer.cc -//https://twiki.cern.ch/twiki/pub/CMSPublic/GenHFHadronMatcher/GenTtbarCategorizer.cc -// - Description: Categorization of different tt+xx processes, returning unique ID for each process as e.g. tt+bb, tt+b, tt+2b, tt+cc, ... - - Implementation: - - The classification scheme returns an ID per event, and works as follows: - - All jets in the following need to be in the acceptance as given by the config parameters |eta|, pt. - - First, jets from top are identified, i.e. jets containing a b hadron from top. These are excluded from the search for additional jets. - They are encoded in the ID as numberOfBjetsFromTop*100, i.e. - 0xx: no b jets from top in acceptance - 1xx: 1 b jet from top in acceptance - 2xx: both b jets from top in acceptance - - From the remaining jets, the ID is formed based on the additional b jets (IDs x5x) and c jets (IDs x4x) in the following order: - x55: at least 2 additional b jets with two of them having >= 2 b hadrons - x54: at least 2 additional b jets with one of them having >= 2 b hadrons, the other having =1 b hadron - x53: at least 2 additional b jets with all having =1 b hadron - x52: exactly 1 additional b jet having >=2 b hadrons - x51: exactly 1 additional b jet having =1 b hadron - x45: at least 2 additional c jets with two of them having >= 2 c hadrons - x44: at least 2 additional c jets with one of them having >= 2 c hadrons, the other having =1 c hadron - x43: at least 2 additional c jets with all having =1 c hadron - x42: exactly 1 additional c jet having >=2 c hadrons - x41: exactly 1 additional c jet having =1 c hadron - x00: No additional b or c jet, i.e. only light flavour jets -*/ -// -// Original Author: Johannes Hauk -// Created: Sun, 14 Jun 2015 19:42:58 GMT -// -// - - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/HepMCCandidate/interface/GenParticle.h" - - -// -// class declaration -// - -class GenTtbarCategorizer : public edm::stream::EDProducer<> { - public: - explicit GenTtbarCategorizer(const edm::ParameterSet&); - ~GenTtbarCategorizer() {}; - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - - private: - void produce(edm::Event&, const edm::EventSetup&) override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - - // ----------member data --------------------------- - - // Jet configuration - const double genJetPtMin_; - const double genJetAbsEtaMax_; - - // Input tags - const edm::EDGetTokenT genJetsToken_; - - const edm::EDGetTokenT > genBHadJetIndexToken_; - const edm::EDGetTokenT > genBHadFlavourToken_; - const edm::EDGetTokenT > genBHadFromTopWeakDecayToken_; - const edm::EDGetTokenT > genBHadPlusMothersToken_; - const edm::EDGetTokenT > > genBHadPlusMothersIndicesToken_; - const edm::EDGetTokenT > genBHadIndexToken_; - const edm::EDGetTokenT > genBHadLeptonHadronIndexToken_; - const edm::EDGetTokenT > genBHadLeptonViaTauToken_; - - const edm::EDGetTokenT > genCHadJetIndexToken_; - const edm::EDGetTokenT > genCHadFlavourToken_; - const edm::EDGetTokenT > genCHadFromTopWeakDecayToken_; - const edm::EDGetTokenT > genCHadBHadronIdToken_; - - -}; - -// -// constructors and destructor -// -GenTtbarCategorizer::GenTtbarCategorizer(const edm::ParameterSet& iConfig): -genJetPtMin_(iConfig.getParameter("genJetPtMin")), -genJetAbsEtaMax_(iConfig.getParameter("genJetAbsEtaMax")), -genJetsToken_(consumes(iConfig.getParameter("genJets"))), -genBHadJetIndexToken_(consumes >(iConfig.getParameter("genBHadJetIndex"))), -genBHadFlavourToken_(consumes >(iConfig.getParameter("genBHadFlavour"))), -genBHadFromTopWeakDecayToken_(consumes >(iConfig.getParameter("genBHadFromTopWeakDecay"))), -genBHadPlusMothersToken_(consumes >(iConfig.getParameter("genBHadPlusMothers"))), -genBHadPlusMothersIndicesToken_(consumes > >(iConfig.getParameter("genBHadPlusMothersIndices"))), -genBHadIndexToken_(consumes >(iConfig.getParameter("genBHadIndex"))), -genBHadLeptonHadronIndexToken_(consumes >(iConfig.getParameter("genBHadLeptonHadronIndex"))), -genBHadLeptonViaTauToken_(consumes >(iConfig.getParameter("genBHadLeptonViaTau"))), -genCHadJetIndexToken_(consumes >(iConfig.getParameter("genCHadJetIndex"))), -genCHadFlavourToken_(consumes >(iConfig.getParameter("genCHadFlavour"))), -genCHadFromTopWeakDecayToken_(consumes >(iConfig.getParameter("genCHadFromTopWeakDecay"))), -genCHadBHadronIdToken_(consumes >(iConfig.getParameter("genCHadBHadronId"))) -{ - produces("genTtbarId"); -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -GenTtbarCategorizer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - // Access gen jets - edm::Handle genJets; - iEvent.getByToken(genJetsToken_, genJets); - - // Access B hadrons information - edm::Handle > genBHadFlavour; - iEvent.getByToken(genBHadFlavourToken_, genBHadFlavour); - - edm::Handle > genBHadJetIndex; - iEvent.getByToken(genBHadJetIndexToken_, genBHadJetIndex); - - edm::Handle > genBHadFromTopWeakDecay; - iEvent.getByToken(genBHadFromTopWeakDecayToken_, genBHadFromTopWeakDecay); - - edm::Handle > genBHadPlusMothers; - iEvent.getByToken(genBHadPlusMothersToken_, genBHadPlusMothers); - - edm::Handle > > genBHadPlusMothersIndices; - iEvent.getByToken(genBHadPlusMothersIndicesToken_, genBHadPlusMothersIndices); - - edm::Handle > genBHadIndex; - iEvent.getByToken(genBHadIndexToken_, genBHadIndex); - - edm::Handle > genBHadLeptonHadronIndex; - iEvent.getByToken(genBHadLeptonHadronIndexToken_, genBHadLeptonHadronIndex); - - edm::Handle > genBHadLeptonViaTau; - iEvent.getByToken(genBHadLeptonViaTauToken_, genBHadLeptonViaTau); - - - // Access C hadrons information - edm::Handle > genCHadFlavour; - iEvent.getByToken(genCHadFlavourToken_, genCHadFlavour); - - edm::Handle > genCHadJetIndex; - iEvent.getByToken(genCHadJetIndexToken_, genCHadJetIndex); - - edm::Handle > genCHadFromTopWeakDecay; - iEvent.getByToken(genCHadFromTopWeakDecayToken_, genCHadFromTopWeakDecay); - - edm::Handle > genCHadBHadronId; - iEvent.getByToken(genCHadBHadronIdToken_, genCHadBHadronId); - - - // Map - // B jets with b hadrons directly from top quark decay - std::map bJetFromTopIds; - // B jets with b hadrons before top quark decay chain - std::map bJetIds; - // C jets with c hadrons before top quark decay chain - std::map cJetIds; - - - // Count number of specific b hadrons in each jet - for(size_t hadronId = 0; hadronId < genBHadIndex->size(); ++hadronId) { - // Flavour of the hadron's origin - const int flavour = genBHadFlavour->at(hadronId); - // Skip b hadrons coming for W decays (rare case due to CKM, in some generated samples not present at all) - if(std::abs(flavour) == 24) continue; - // Index of jet associated to the hadron - const int jetIndex = genBHadJetIndex->at(hadronId); - // Skip hadrons which have no associated jet - if(jetIndex < 0) continue; - // Skip if jet is not in acceptance - if(genJets->at(jetIndex).pt() < genJetPtMin_) continue; - if(std::abs(genJets->at(jetIndex).eta()) > genJetAbsEtaMax_) continue; - // Jet from direct top quark decay [pdgId(top)=6] - if(std::abs(flavour) == 6) { - if(bJetFromTopIds.count(jetIndex) < 1) bJetFromTopIds[jetIndex] = 1; - else bJetFromTopIds[jetIndex]++; - continue; - } - // Identify jets with b hadrons not from top quark decay - if(bJetIds.count(jetIndex) < 1) bJetIds[jetIndex] = 1; - else bJetIds[jetIndex]++; - } - - // Count number of specific c hadrons in each c jet - for(size_t hadronId = 0; hadronId < genCHadJetIndex->size(); ++hadronId) { - // Skip c hadrons that are coming from b hadrons - if(genCHadBHadronId->at(hadronId) >= 0) continue; - // Skip c hadrons coming from W decays - if(std::abs(genCHadFlavour->at(hadronId)) == 24) continue; - // Index of jet associated to the hadron - const int jetIndex = genCHadJetIndex->at(hadronId); - // Skip hadrons which have no associated jet - if(jetIndex < 0) continue; - // Skip if jet is not in acceptance - if(genJets->at(jetIndex).pt() < genJetPtMin_) continue; - if(std::abs(genJets->at(jetIndex).eta()) > genJetAbsEtaMax_) continue; - // Identify jets with b hadrons - if(cJetIds.count(jetIndex) < 1) cJetIds[jetIndex] = 1; - else cJetIds[jetIndex]++; - } - - // Find additional b jets - std::vector additionalBJetIds; - for(std::map::iterator it = bJetIds.begin(); it != bJetIds.end(); ++it) { - const int jetId = it->first; - // Skip jet if it contains a b hadron directly from top quark decay - if(bJetFromTopIds.count(jetId) > 0) continue; - additionalBJetIds.push_back(jetId); - } - - // Find additional c jets - std::vector additionalCJetIds; - for(std::map::iterator it = cJetIds.begin(); it != cJetIds.end(); ++it) { - const int jetId = it->first; - // Skip jet if it contains a b hadron, thus being a b jet - if(bJetFromTopIds.count(jetId) > 0) continue; - additionalCJetIds.push_back(jetId); - } - - - // Categorize event based on number of additional b/c jets - // and number of corresponding hadrons in each of them - int additionalJetEventId = bJetFromTopIds.size()*100; - // tt + 1 additional b jet - if(additionalBJetIds.size() == 1){ - int nHadronsInJet = bJetIds[additionalBJetIds.at(0)]; - // tt + 1 additional b jet from 1 additional b hadron - if(nHadronsInJet == 1) additionalJetEventId += 51; - // tt + 1 additional b jet from >=2 additional b hadrons - else additionalJetEventId += 52; - } - // tt + >=2 additional b jets - else if(additionalBJetIds.size() > 1){ - // Check first two additional b jets (rare cases could have more) - int nHadronsInJet1 = bJetIds[additionalBJetIds.at(0)]; - int nHadronsInJet2 = bJetIds[additionalBJetIds.at(1)]; - // tt + >=2 additional b jets each from 1 additional b hadron - if(std::max(nHadronsInJet1, nHadronsInJet2) == 1) additionalJetEventId += 53; - // tt + >=2 additional b jets one of which from >=2 additional b hadrons - else if(std::min(nHadronsInJet1, nHadronsInJet2) == 1 && std::max(nHadronsInJet1, nHadronsInJet2) > 1) additionalJetEventId += 54; - // tt + >=2 additional b jets each from >=2 additional b hadrons - else if(std::min(nHadronsInJet1, nHadronsInJet2) > 1) additionalJetEventId += 55; - } - // tt + no additional b jets - else{ - // tt + 1 additional c jet - if(additionalCJetIds.size() == 1){ - int nHadronsInJet = cJetIds[additionalCJetIds.at(0)]; - // tt + 1 additional c jet from 1 additional c hadron - if(nHadronsInJet == 1) additionalJetEventId += 41; - // tt + 1 additional c jet from >=2 additional c hadrons - else additionalJetEventId += 42; - } - // tt + >=2 additional c jets - else if(additionalCJetIds.size() > 1){ - // Check first two additional c jets (rare cases could have more) - int nHadronsInJet1 = cJetIds[additionalCJetIds.at(0)]; - int nHadronsInJet2 = cJetIds[additionalCJetIds.at(1)]; - // tt + >=2 additional c jets each from 1 additional c hadron - if(std::max(nHadronsInJet1, nHadronsInJet2) == 1) additionalJetEventId += 43; - // tt + >=2 additional c jets one of which from >=2 additional c hadrons - else if(std::min(nHadronsInJet1, nHadronsInJet2) == 1 && std::max(nHadronsInJet1, nHadronsInJet2) > 1) additionalJetEventId += 44; - // tt + >=2 additional c jets each from >=2 additional c hadrons - else if(std::min(nHadronsInJet1, nHadronsInJet2) > 1) additionalJetEventId += 45; - } - // tt + no additional c jets - else{ - // tt + light jets - additionalJetEventId += 0; - } - } - - std::auto_ptr ttbarId(new int); - *ttbarId = additionalJetEventId; - iEvent.put(ttbarId, "genTtbarId"); - -} - -// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ -void -GenTtbarCategorizer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters - edm::ParameterSetDescription desc; - desc.setUnknown(); - descriptions.addDefault(desc); -} - -//define this as a plug-in -DEFINE_FWK_MODULE(GenTtbarCategorizer); From 0445a35e22688a80567296d075dc2914d5aa5a3b Mon Sep 17 00:00:00 2001 From: YoungKwonJo Date: Thu, 1 Oct 2015 09:35:09 +0900 Subject: [PATCH 3/5] update it for Backport from 7_6_X: ttbar event categorizer, miniAOD jet flavour improvements --- .../python/catGetHFHadronMatching_cff.py | 61 ------------------- .../mcTruthTop/GenTtbarCategorizer_cfi.py | 23 ------- 2 files changed, 84 deletions(-) delete mode 100644 CatProducer/python/catGetHFHadronMatching_cff.py delete mode 100644 CatProducer/python/mcTruthTop/GenTtbarCategorizer_cfi.py diff --git a/CatProducer/python/catGetHFHadronMatching_cff.py b/CatProducer/python/catGetHFHadronMatching_cff.py deleted file mode 100644 index f891cbd1901..00000000000 --- a/CatProducer/python/catGetHFHadronMatching_cff.py +++ /dev/null @@ -1,61 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -def genHFTool(process, runOnMC=True, useMiniAOD = True): - # Setting input particle collections to be used by the tools - genParticleCollection = '' - genJetInputParticleCollection = '' - genJetCollection = 'ak4GenJetsCustom' - if useMiniAOD: - genParticleCollection = 'prunedGenParticles' - genJetInputParticleCollection = 'packedGenParticles' - else: - genParticleCollection = 'genParticles' - genJetInputParticleCollection = 'genParticlesForJets' - ## producing a subset of genParticles to be used for jet clustering in AOD - from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets - process.genParticlesForJets = genParticlesForJets.clone() - - # Supplies PDG ID to real name resolution of MC particles - process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") - - # Producing own jets for testing purposes - from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets - process.ak4GenJetsCustom = ak4GenJets.clone( - src = genJetInputParticleCollection, - rParam = cms.double(0.4), - jetAlgorithm = cms.string("AntiKt") - ) - - # Ghost particle collection used for Hadron-Jet association - # MUST use proper input particle collection - from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons - process.selectedHadronsAndPartons = selectedHadronsAndPartons.clone( - particles = genParticleCollection - ) - - # Input particle collection for matching to gen jets (partons + leptons) - # MUST use use proper input jet collection: the jets to which hadrons should be associated - # rParam and jetAlgorithm MUST match those used for jets to be associated with hadrons - # More details on the tool: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideBTagMCTools#New_jet_flavour_definition - from PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff import genJetFlavourPlusLeptonInfos - process.genJetFlavourPlusLeptonInfos = genJetFlavourPlusLeptonInfos.clone( - jets = genJetCollection, - rParam = cms.double(0.4), - jetAlgorithm = cms.string("AntiKt") - ) - - - # Plugin for analysing B hadrons - # MUST use the same particle collection as in selectedHadronsAndPartons - from PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff import matchGenBHadron - process.matchGenBHadron = matchGenBHadron.clone( - genParticles = genParticleCollection - ) - - # Plugin for analysing C hadrons - # MUST use the same particle collection as in selectedHadronsAndPartons - from PhysicsTools.JetMCAlgos.sequences.GenHFHadronMatching_cff import matchGenCHadron - process.matchGenCHadron = matchGenCHadron.clone( - genParticles = genParticleCollection - ) - diff --git a/CatProducer/python/mcTruthTop/GenTtbarCategorizer_cfi.py b/CatProducer/python/mcTruthTop/GenTtbarCategorizer_cfi.py deleted file mode 100644 index c34f946a842..00000000000 --- a/CatProducer/python/mcTruthTop/GenTtbarCategorizer_cfi.py +++ /dev/null @@ -1,23 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -#ref. https://twiki.cern.ch/twiki/pub/CMSPublic/GenHFHadronMatcher/GenTtbarCategorizer_cfi.py.txt -categorizeGenTtbar = cms.EDProducer("GenTtbarCategorizer", - # Phase space of additional jets - genJetPtMin = cms.double(20.), - genJetAbsEtaMax = cms.double(2.4), - # Input tags holding information about b/c hadron matching - genJets = cms.InputTag("ak4GenJets"), - genBHadJetIndex = cms.InputTag("matchGenBHadron", "genBHadJetIndex"), - genBHadFlavour = cms.InputTag("matchGenBHadron", "genBHadFlavour"), - genBHadFromTopWeakDecay = cms.InputTag("matchGenBHadron", "genBHadFromTopWeakDecay"), - genBHadPlusMothers = cms.InputTag("matchGenBHadron", "genBHadPlusMothers"), - genBHadPlusMothersIndices = cms.InputTag("matchGenBHadron", "genBHadPlusMothersIndices"), - genBHadIndex = cms.InputTag("matchGenBHadron", "genBHadIndex"), - genBHadLeptonHadronIndex = cms.InputTag("matchGenBHadron", "genBHadLeptonHadronIndex"), - genBHadLeptonViaTau = cms.InputTag("matchGenBHadron", "genBHadLeptonViaTau"), - genCHadJetIndex = cms.InputTag("matchGenCHadron", "genCHadJetIndex"), - genCHadFlavour = cms.InputTag("matchGenCHadron", "genCHadFlavour"), - genCHadFromTopWeakDecay = cms.InputTag("matchGenCHadron", "genCHadFromTopWeakDecay"), - genCHadBHadronId = cms.InputTag("matchGenCHadron", "genCHadBHadronId"), -) - From b20cc9236736b23d60d418280343bb173e3ae447 Mon Sep 17 00:00:00 2001 From: YoungKwonJo Date: Thu, 1 Oct 2015 09:35:43 +0900 Subject: [PATCH 4/5] update it for Backport from 7_6_X: ttbar event categorizer, miniAOD jet flavour improvements --- CatProducer/python/mcTruthTop/mcTruthTop_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CatProducer/python/mcTruthTop/mcTruthTop_cff.py b/CatProducer/python/mcTruthTop/mcTruthTop_cff.py index fb372bea14c..822da6cda56 100644 --- a/CatProducer/python/mcTruthTop/mcTruthTop_cff.py +++ b/CatProducer/python/mcTruthTop/mcTruthTop_cff.py @@ -9,5 +9,5 @@ from TopQuarkAnalysis.TopEventProducers.producers.pseudoTop_cfi import * -from CATTools.CatProducer.mcTruthTop.GenTtbarCategorizer_cfi import * +from TopQuarkAnalysis.TopTools.GenTtbarCategorizer_cfi import * from CATTools.CatProducer.mcTruthTop.genTopProducer_cfi import * From dde5c6521a20a67846e1a4052c61338c066987b2 Mon Sep 17 00:00:00 2001 From: YoungKwonJo Date: Thu, 1 Oct 2015 09:36:11 +0900 Subject: [PATCH 5/5] update it for Backport from 7_6_X: ttbar event categorizer, miniAOD jet flavour improvements --- CatProducer/python/catGenHFHadronMatching_cff.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CatProducer/python/catGenHFHadronMatching_cff.py b/CatProducer/python/catGenHFHadronMatching_cff.py index 2d8d49539a3..d8b6e43466b 100644 --- a/CatProducer/python/catGenHFHadronMatching_cff.py +++ b/CatProducer/python/catGenHFHadronMatching_cff.py @@ -38,7 +38,7 @@ def genHFTool(process, useMiniAOD = True): from PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi import ak4JetFlavourInfos process.genJetFlavourInfos = ak4JetFlavourInfos.clone( jets = genJetCollection ) - #for cmssw_7_6_X + #for cmssw_7_6_X, not ready for 74x #process.load("PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cff") #added the 3-lines instead of GenHFHadronMatcher_cff from PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cfi import matchGenHFHadron @@ -53,10 +53,7 @@ def genHFTool(process, useMiniAOD = True): process.matchGenCHadron.genParticles = genParticleCollection process.matchGenCHadron.jetFlavourInfos = "genJetFlavourInfos" - #related the issue : https://github.com/vallot/CATTools/issues/226 - #process.load("TopQuarkAnalysis.TopTools.GenTtbarCategorizer_cfi") - #remove CatProducer/plugins/GenTtbarCategorizer.cc - process.load("CATTools.CatProducer.mcTruthTop.GenTtbarCategorizer_cfi") + process.load("TopQuarkAnalysis.TopTools.GenTtbarCategorizer_cfi") process.GenTtbarCategories = process.categorizeGenTtbar.clone( genJets = cms.InputTag(genJetCollection) )