CMS 3D CMS Logo

ttbarCategorization_cff.py
Go to the documentation of this file.
1 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
2 from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff import run2_nanoAOD_92X
3 
4 
5 import FWCore.ParameterSet.Config as cms
7 
8 
9 ##################### User floats producers, selectors ##########################
10 
11 from PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cff import matchGenBHadron
12 matchGenBHadron = matchGenBHadron.clone(
13  genParticles = cms.InputTag("prunedGenParticles"),
14  jetFlavourInfos = cms.InputTag("slimmedGenJetsFlavourInfos"),
15 )
16 
17 ## Plugin for analysing C hadrons
18 # MUST use the same particle collection as in selectedHadronsAndPartons
19 from PhysicsTools.JetMCAlgos.GenHFHadronMatcher_cff import matchGenCHadron
20 matchGenCHadron = matchGenCHadron.clone(
21  genParticles = cms.InputTag("prunedGenParticles"),
22  jetFlavourInfos = cms.InputTag("slimmedGenJetsFlavourInfos"),
23 )
24 
25 ## Producer for ttbar categorisation ID
26 from TopQuarkAnalysis.TopTools.GenTtbarCategorizer_cfi import categorizeGenTtbar
27 categorizeGenTtbar = categorizeGenTtbar.clone(
28  genJetPtMin = 20.,
29  genJetAbsEtaMax = 2.4,
30  genJets = cms.InputTag("slimmedGenJets"),
31 )
32 
33 
34 ### Era dependent customization
35 run2_miniAOD_80XLegacy.toModify( matchGenBHadron, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
36 run2_nanoAOD_92X.toModify( matchGenBHadron, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
37 
38 run2_miniAOD_80XLegacy.toModify( matchGenCHadron, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
39 run2_nanoAOD_92X.toModify( matchGenCHadron, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
40 
41 
42 ##################### Tables for final output and docs ##########################
43 ttbarCategoryTable = cms.EDProducer("GlobalVariablesTableProducer",
44  variables = cms.PSet(
45  genTtbarId = ExtVar( cms.InputTag("categorizeGenTtbar:genTtbarId"), "int", doc = "ttbar categorization")
46  )
47 )
48 
49 ttbarCatMCProducers = cms.Sequence(matchGenBHadron + matchGenCHadron + categorizeGenTtbar)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:31