CMS 3D CMS Logo

jets_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
3 from Configuration.Eras.Modifier_run2_nanoAOD_92X_cff import run2_nanoAOD_92X
4 
6 
7 
8 
9 ##################### User floats producers, selectors ##########################
10 from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
11 
12 chsForSATkJets = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string('charge()!=0 && pvAssociationQuality()>=5 && vertexRef().key()==0'))
13 softActivityJets = ak4PFJets.clone(src = 'chsForSATkJets', doAreaFastjet = False, jetPtMin=1)
14 softActivityJets10 = cms.EDFilter("CandPtrSelector", src = cms.InputTag("chsForSATkJets"), cut = cms.string('pt>10'))
15 softActivityJets5 = cms.EDFilter("CandPtrSelector", src = cms.InputTag("chsForSATkJets"), cut = cms.string('pt>5'))
16 softActivityJets2 = cms.EDFilter("CandPtrSelector", src = cms.InputTag("chsForSATkJets"), cut = cms.string('pt>2'))
17 
18 looseJetId = cms.EDProducer("PatJetIDValueMapProducer",
19  filterParams=cms.PSet(
20  version = cms.string('WINTER16'),
21  quality = cms.string('LOOSE'),
22  ),
23  src = cms.InputTag("slimmedJets")
24 )
25 tightJetId = cms.EDProducer("PatJetIDValueMapProducer",
26  filterParams=cms.PSet(
27  version = cms.string('WINTER16'),
28  quality = cms.string('TIGHT'),
29  ),
30  src = cms.InputTag("slimmedJets")
31 )
32 looseJetIdAK8 = cms.EDProducer("PatJetIDValueMapProducer",
33  filterParams=cms.PSet(
34  version = cms.string('WINTER16'),
35  quality = cms.string('LOOSE'),
36  ),
37  src = cms.InputTag("slimmedJetsAK8")
38 )
39 tightJetIdAK8 = cms.EDProducer("PatJetIDValueMapProducer",
40  filterParams=cms.PSet(
41  version = cms.string('WINTER16'),
42  quality = cms.string('TIGHT'),
43  ),
44  src = cms.InputTag("slimmedJetsAK8")
45 )
46 
47 
48 slimmedJetsWithUserData = cms.EDProducer("PATJetUserDataEmbedder",
49  src = cms.InputTag("slimmedJets"),
50  userFloats = cms.PSet(),
51  userInts = cms.PSet(
52  tightId = cms.InputTag("tightJetId"),
53  looseId = cms.InputTag("looseJetId"),
54  ),
55 )
56 
57 slimmedJetsAK8WithUserData = cms.EDProducer("PATJetUserDataEmbedder",
58  src = cms.InputTag("slimmedJetsAK8"),
59  userFloats = cms.PSet(),
60  userInts = cms.PSet(
61  tightId = cms.InputTag("tightJetIdAK8"),
62  looseId = cms.InputTag("looseJetIdAK8"),
63  ),
64 )
65 
66 
68 jetCorrFactors = patJetCorrFactors.clone(src='slimmedJetsWithUserData',
69  levels = cms.vstring('L1FastJet',
70  'L2Relative',
71  'L3Absolute',
72  'L2L3Residual'),
73  primaryVertices = cms.InputTag("offlineSlimmedPrimaryVertices"),
74 )
75 jetCorrFactorsAK8 = patJetCorrFactors.clone(src='slimmedJetsAK8WithUserData',
76  levels = cms.vstring('L1FastJet',
77  'L2Relative',
78  'L3Absolute',
79  'L2L3Residual'),
80  payload = cms.string('AK8PFPuppi'),
81  primaryVertices = cms.InputTag("offlineSlimmedPrimaryVertices"),
82 )
83 
85 updatedJets = updatedPatJets.clone(
86  addBTagInfo=False,
87  jetSource='slimmedJetsWithUserData',
88  jetCorrFactorsSource=cms.VInputTag(cms.InputTag("jetCorrFactors") ),
89 )
90 
91 finalJets = cms.EDFilter("PATJetRefSelector",
92  src = cms.InputTag("updatedJets"),
93  cut = cms.string("pt > 15")
94 )
95 
96 updatedJetsAK8 = updatedPatJets.clone(
97  addBTagInfo=False,
98  jetSource='slimmedJetsAK8WithUserData',
99  jetCorrFactorsSource=cms.VInputTag(cms.InputTag("jetCorrFactorsAK8") ),
100 )
101 
102 finalJetsAK8 = cms.EDFilter("PATJetRefSelector",
103  src = cms.InputTag("updatedJetsAK8"),
104  cut = cms.string("pt > 170")
105 )
106 
107 
108 ##################### Tables for final output and docs ##########################
109 
110 
111 
112 jetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
113  src = cms.InputTag("linkedObjects","jets"),
114  cut = cms.string(""), #we should not filter on cross linked collections
115  name = cms.string("Jet"),
116  doc = cms.string("slimmedJets, i.e. ak4 PFJets CHS with JECs applied, after basic selection (" + finalJets.cut.value()+")"),
117  singleton = cms.bool(False), # the number of entries is variable
118  extension = cms.bool(False), # this is the main table for the jets
119  externalVariables = cms.PSet(
120  bReg = ExtVar(cms.InputTag("bjetMVA"),float, doc="pt corrected with b-jet regression",precision=14),
121  ),
122  variables = cms.PSet(P4Vars,
123  area = Var("jetArea()", float, doc="jet catchment area, for JECs",precision=10),
124  nMuons = Var("?hasOverlaps('muons')?overlaps('muons').size():0", int, doc="number of muons in the jet"),
125  muonIdx1 = Var("?overlaps('muons').size()>0?overlaps('muons')[0].key():-1", int, doc="index of first matching muon"),
126  muonIdx2 = Var("?overlaps('muons').size()>1?overlaps('muons')[1].key():-1", int, doc="index of second matching muon"),
127  electronIdx1 = Var("?overlaps('electrons').size()>0?overlaps('electrons')[0].key():-1", int, doc="index of first matching electron"),
128  electronIdx2 = Var("?overlaps('electrons').size()>1?overlaps('electrons')[1].key():-1", int, doc="index of second matching electron"),
129  nElectrons = Var("?hasOverlaps('electrons')?overlaps('electrons').size():0", int, doc="number of electrons in the jet"),
130  btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10),
131  btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10),
132  btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
133  btagDeepC = Var("bDiscriminator('pfDeepCSVJetTags:probc')",float,doc="DeepCSV charm btag discriminator",precision=10),
134  #puIdDisc = Var("userFloat('pileupJetId:fullDiscriminant')",float,doc="Pilup ID discriminant",precision=10),
135  puId = Var("userInt('pileupJetId:fullId')",int,doc="Pilup ID flags"),
136  jetId = Var("userInt('tightId')*2+userInt('looseId')",int,doc="Jet ID flags bit1 is loose, bit2 is tight"),
137  qgl = Var("userFloat('QGTagger:qgLikelihood')",float,doc="Quark vs Gluon likelihood discriminator",precision=10),
138  nConstituents = Var("numberOfDaughters()",int,doc="Number of particles in the jet"),
139  rawFactor = Var("1.-jecFactor('Uncorrected')",float,doc="1 - Factor to get back to raw pT",precision=6),
140  chHEF = Var("chargedHadronEnergyFraction()", float, doc="charged Hadron Energy Fraction", precision= 6),
141  neHEF = Var("neutralHadronEnergyFraction()", float, doc="neutral Hadron Energy Fraction", precision= 6),
142  chEmEF = Var("chargedEmEnergyFraction()", float, doc="charged Electromagnetic Energy Fraction", precision= 6),
143  neEmEF = Var("neutralEmEnergyFraction()", float, doc="neutral Electromagnetic Energy Fraction", precision= 6)
144  )
145 )
146 #jets are not as precise as muons
147 jetTable.variables.pt.precision=10
148 
149 ### Era dependent customization
150 run2_miniAOD_80XLegacy.toModify( slimmedJetsWithUserData, userFloats=cms.PSet(qgl=cms.InputTag('qgtagger80x:qgLikelihood')))
151 run2_miniAOD_80XLegacy.toModify( jetTable.variables.qgl, expr="userFloat('qgl')" )
152 
153 bjetMVA= cms.EDProducer("BJetEnergyRegressionMVA",
154  src = cms.InputTag("linkedObjects","jets"),
155  pvsrc = cms.InputTag("offlineSlimmedPrimaryVertices"),
156  svsrc = cms.InputTag("slimmedSecondaryVertices"),
157  weightFile = cms.FileInPath("PhysicsTools/NanoAOD/data/bjet-regression.xml"),
158  name = cms.string("JetReg"),
159  isClassifier = cms.bool(False),
160  variablesOrder = cms.vstring(["Jet_pt","nPVs","Jet_eta","Jet_mt","Jet_leadTrackPt","Jet_leptonPtRel","Jet_leptonPt","Jet_leptonDeltaR","Jet_neHEF","Jet_neEmEF","Jet_vtxPt","Jet_vtxMass","Jet_vtx3dL","Jet_vtxNtrk","Jet_vtx3deL"]),
161  variables = cms.PSet(
162  Jet_pt = cms.string("pt"),
163  Jet_eta = cms.string("eta"),
164  Jet_mt = cms.string("mt"),
165  Jet_leptonPt = cms.string("?overlaps('muons').size()>0?overlaps('muons')[0].pt():(?overlaps('electrons').size()>0?overlaps('electrons')[0].pt():0)"),
166  Jet_neHEF = cms.string("neutralHadronEnergy()/energy()"),
167  Jet_neEmEF = cms.string("neutralEmEnergy()/energy()"),
168  Jet_leptonDeltaR = cms.string('''?overlaps('muons').size()>0?deltaR(eta,phi,overlaps('muons')[0].eta,overlaps('muons')[0].phi):
169  (?overlaps('electrons').size()>0?deltaR(eta,phi,overlaps('electrons')[0].eta,overlaps('electrons')[0].phi):
170  0)'''),
171  )
172 
173 )
174 
175 ##### Soft Activity tables
176 saJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
177  src = cms.InputTag("softActivityJets"),
178  cut = cms.string(""),
179  maxLen = cms.uint32(6),
180  name = cms.string("SoftActivityJet"),
181  doc = cms.string("jets clustered from charged candidates compatible with primary vertex (" + chsForSATkJets.cut.value()+")"),
182  singleton = cms.bool(False), # the number of entries is variable
183  extension = cms.bool(False), # this is the main table for the jets
184  variables = cms.PSet(P3Vars,
185  )
186 )
187 
188 saJetTable.variables.pt.precision=10
189 saJetTable.variables.eta.precision=8
190 saJetTable.variables.phi.precision=8
191 
192 saTable = cms.EDProducer("GlobalVariablesTableProducer",
193  variables = cms.PSet(
194  SoftActivityJetHT = ExtVar( cms.InputTag("softActivityJets"), "candidatescalarsum", doc = "scalar sum of soft activity jet pt, pt>1" ),
195  SoftActivityJetHT10 = ExtVar( cms.InputTag("softActivityJets10"), "candidatescalarsum", doc = "scalar sum of soft activity jet pt , pt >10" ),
196  SoftActivityJetHT5 = ExtVar( cms.InputTag("softActivityJets5"), "candidatescalarsum", doc = "scalar sum of soft activity jet pt, pt>5" ),
197  SoftActivityJetHT2 = ExtVar( cms.InputTag("softActivityJets2"), "candidatescalarsum", doc = "scalar sum of soft activity jet pt, pt >2" ),
198  SoftActivityJetNjets10 = ExtVar( cms.InputTag("softActivityJets10"), "candidatesize", doc = "number of soft activity jet pt, pt >2" ),
199  SoftActivityJetNjets5 = ExtVar( cms.InputTag("softActivityJets5"), "candidatesize", doc = "number of soft activity jet pt, pt >5" ),
200  SoftActivityJetNjets2 = ExtVar( cms.InputTag("softActivityJets2"), "candidatesize", doc = "number of soft activity jet pt, pt >10" ),
201 
202  )
203 )
204 
205 
206 
207 ## BOOSTED STUFF #################
208 fatJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
209  src = cms.InputTag("finalJetsAK8"),
210  cut = cms.string(" pt > 170"), #probably already applied in miniaod
211  name = cms.string("FatJet"),
212  doc = cms.string("slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
213  singleton = cms.bool(False), # the number of entries is variable
214  extension = cms.bool(False), # this is the main table for the jets
215  variables = cms.PSet(P4Vars,
216  jetId = Var("userInt('tightId')*2+userInt('looseId')",int,doc="Jet ID flags bit1 is loose, bit2 is tight"),
217  area = Var("jetArea()", float, doc="jet catchment area, for JECs",precision=10),
218  tau1 = Var("userFloat('NjettinessAK8Puppi:tau1')",float, doc="Nsubjettiness (1 axis)",precision=10),
219  tau2 = Var("userFloat('NjettinessAK8Puppi:tau2')",float, doc="Nsubjettiness (2 axis)",precision=10),
220  tau3 = Var("userFloat('NjettinessAK8Puppi:tau3')",float, doc="Nsubjettiness (3 axis)",precision=10),
221  tau4 = Var("userFloat('NjettinessAK8Puppi:tau4')",float, doc="Nsubjettiness (4 axis)",precision=10),
222  n2b1 = Var("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')", float, doc="N2 with beta=1", precision=10),
223  n3b1 = Var("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')", float, doc="N3 with beta=1", precision=10),
224  msoftdrop = Var("groomedMass('SoftDropPuppi')",float, doc="Corrected soft drop mass with PUPPI",precision=10),
225  btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10),
226  btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10),
227  btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
228  btagHbb = Var("bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc="Higgs to BB tagger discriminator",precision=10),
229  subJetIdx1 = Var("?numberOfSourceCandidatePtrs()>0 && sourceCandidatePtr(0).numberOfSourceCandidatePtrs()>0?sourceCandidatePtr(0).key():-1", int,
230  doc="index of first subjet"),
231  subJetIdx2 = Var("?numberOfSourceCandidatePtrs()>1 && sourceCandidatePtr(1).numberOfSourceCandidatePtrs()>0?sourceCandidatePtr(1).key():-1", int,
232  doc="index of second subjet"),
233 
234 # btagDeepC = Var("bDiscriminator('pfDeepCSVJetTags:probc')",float,doc="CMVA V2 btag discriminator",precision=10),
235 #puIdDisc = Var("userFloat('pileupJetId:fullDiscriminant')",float,doc="Pilup ID discriminant",precision=10),
236 # nConstituents = Var("numberOfDaughters()",int,doc="Number of particles in the jet"),
237 # rawFactor = Var("1.-jecFactor('Uncorrected')",float,doc="1 - Factor to get back to raw pT",precision=6),
238  )
239 )
240 ### Era dependent customization
241 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, msoftdrop_chs = Var("userFloat('ak8PFJetsCHSSoftDropMass')",float, doc="Legacy uncorrected soft drop mass with CHS",precision=10))
242 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau1, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau1\')"),)
243 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau2, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau2\')"),)
244 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau3, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau3\')"),)
245 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau4, expr = cms.string("-1"),)
246 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.n2b1, expr = cms.string("-1"),)
247 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.n3b1, expr = cms.string("-1"),)
248 
249 run2_nanoAOD_92X.toModify( fatJetTable.variables.tau4, expr = cms.string("-1"),)
250 run2_nanoAOD_92X.toModify( fatJetTable.variables.n2b1, expr = cms.string("-1"),)
251 run2_nanoAOD_92X.toModify( fatJetTable.variables.n3b1, expr = cms.string("-1"),)
252 
253 
254 
255 subJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
256  src = cms.InputTag("slimmedJetsAK8PFPuppiSoftDropPacked","SubJets"),
257  cut = cms.string(""), #probably already applied in miniaod
258  name = cms.string("SubJet"),
259  doc = cms.string("slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
260  singleton = cms.bool(False), # the number of entries is variable
261  extension = cms.bool(False), # this is the main table for the jets
262  variables = cms.PSet(P4Vars,
263  btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10),
264  btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10),
265  btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
266  tau1 = Var("userFloat('NjettinessAK8Subjets:tau1')",float, doc="Nsubjettiness (1 axis)",precision=10),
267  tau2 = Var("userFloat('NjettinessAK8Subjets:tau2')",float, doc="Nsubjettiness (2 axis)",precision=10),
268  tau3 = Var("userFloat('NjettinessAK8Subjets:tau3')",float, doc="Nsubjettiness (3 axis)",precision=10),
269  tau4 = Var("userFloat('NjettinessAK8Subjets:tau4')",float, doc="Nsubjettiness (4 axis)",precision=10),
270  n2b1 = Var("userFloat('nb1AK8PuppiSoftDropSubjets:ecfN2')", float, doc="N2 with beta=1", precision=10),
271  n3b1 = Var("userFloat('nb1AK8PuppiSoftDropSubjets:ecfN3')", float, doc="N3 with beta=1", precision=10),
272  )
273 )
274 
275 #jets are not as precise as muons
276 fatJetTable.variables.pt.precision=10
277 subJetTable.variables.pt.precision=10
278 
279 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.tau1, expr = cms.string("-1"),)
280 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.tau2, expr = cms.string("-1"),)
281 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.tau3, expr = cms.string("-1"),)
282 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.tau4, expr = cms.string("-1"),)
283 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.n2b1, expr = cms.string("-1"),)
284 run2_miniAOD_80XLegacy.toModify( subJetTable.variables.n3b1, expr = cms.string("-1"),)
285 
286 run2_nanoAOD_92X.toModify( subJetTable.variables.tau4, expr = cms.string("-1"),)
287 run2_nanoAOD_92X.toModify( subJetTable.variables.n2b1, expr = cms.string("-1"),)
288 run2_nanoAOD_92X.toModify( subJetTable.variables.n3b1, expr = cms.string("-1"),)
289 
290 
291 
292 
293 
294 ## MC STUFF ######################
295 jetMCTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
296  src = cms.InputTag("linkedObjects","jets"),
297  cut = cms.string(""), #we should not filter on cross linked collections
298  name = cms.string("Jet"),
299  singleton = cms.bool(False), # the number of entries is variable
300  extension = cms.bool(True), # this is an extension table for the jets
301  variables = cms.PSet(
302  partonFlavour = Var("partonFlavour()", int, doc="flavour from parton matching"),
303  hadronFlavour = Var("hadronFlavour()", int, doc="flavour from hadron ghost clustering"),
304  genJetIdx = Var("?genJetFwdRef().backRef().isNonnull()?genJetFwdRef().backRef().key():-1", int, doc="index of matched gen jet"),
305  )
306 )
307 genJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
308  src = cms.InputTag("slimmedGenJets"),
309  cut = cms.string("pt > 10"),
310  name = cms.string("GenJet"),
311  doc = cms.string("slimmedGenJets, i.e. ak4 Jets made with visible genparticles"),
312  singleton = cms.bool(False), # the number of entries is variable
313  extension = cms.bool(False), # this is the main table for the genjets
314  variables = cms.PSet(P4Vars,
315  #anything else?
316  )
317 )
318 patJetPartons = cms.EDProducer('HadronAndPartonSelector',
319  src = cms.InputTag("generator"),
320  particles = cms.InputTag("prunedGenParticles"),
321  partonMode = cms.string("Auto"),
322  fullChainPhysPartons = cms.bool(True)
323 )
324 genJetFlavourAssociation = cms.EDProducer("JetFlavourClustering",
325  jets = genJetTable.src,
326  bHadrons = cms.InputTag("patJetPartons","bHadrons"),
327  cHadrons = cms.InputTag("patJetPartons","cHadrons"),
328  partons = cms.InputTag("patJetPartons","physicsPartons"),
329  leptons = cms.InputTag("patJetPartons","leptons"),
330  jetAlgorithm = cms.string("AntiKt"),
331  rParam = cms.double(0.4),
332  ghostRescaling = cms.double(1e-18),
333  hadronFlavourHasPriority = cms.bool(False)
334 )
335 genJetFlavourTable = cms.EDProducer("GenJetFlavourTableProducer",
336  name = genJetTable.name,
337  src = genJetTable.src,
338  cut = genJetTable.cut,
339  deltaR = cms.double(0.1),
340  jetFlavourInfos = cms.InputTag("slimmedGenJetsFlavourInfos"),
341 )
342 
343 genJetAK8Table = cms.EDProducer("SimpleCandidateFlatTableProducer",
344  src = cms.InputTag("slimmedGenJetsAK8"),
345  cut = cms.string("pt > 100."),
346  name = cms.string("GenJetAK8"),
347  doc = cms.string("slimmedGenJetsAK8SoftDropSubJets, i.e. subjets of ak8 Jets made with visible genparticles"),
348  singleton = cms.bool(False), # the number of entries is variable
349  extension = cms.bool(False), # this is the main table for the genjets
350  variables = cms.PSet(P4Vars,
351  #anything else?
352  )
353 )
354 genJetAK8FlavourAssociation = cms.EDProducer("JetFlavourClustering",
355  jets = genJetAK8Table.src,
356  bHadrons = cms.InputTag("patJetPartons","bHadrons"),
357  cHadrons = cms.InputTag("patJetPartons","cHadrons"),
358  partons = cms.InputTag("patJetPartons","physicsPartons"),
359  leptons = cms.InputTag("patJetPartons","leptons"),
360  jetAlgorithm = cms.string("AntiKt"),
361  rParam = cms.double(0.8),
362  ghostRescaling = cms.double(1e-18),
363  hadronFlavourHasPriority = cms.bool(False)
364 )
365 genJetAK8FlavourTable = cms.EDProducer("GenJetFlavourTableProducer",
366  name = genJetAK8Table.name,
367  src = genJetAK8Table.src,
368  cut = genJetAK8Table.cut,
369  deltaR = cms.double(0.1),
370  jetFlavourInfos = cms.InputTag("genJetAK8FlavourAssociation"),
371 )
372 genSubJetAK8Table = cms.EDProducer("SimpleCandidateFlatTableProducer",
373  src = cms.InputTag("slimmedGenJetsAK8SoftDropSubJets"),
374  cut = cms.string(""), ## These don't get a pt cut, but in miniAOD only subjets from fat jets with pt > 100 are kept
375  name = cms.string("SubGenJetAK8"),
376  doc = cms.string("slimmedGenJetsAK8SoftDropSubJets, i.e. subjets of ak8 Jets made with visible genparticles"),
377  singleton = cms.bool(False), # the number of entries is variable
378  extension = cms.bool(False), # this is the main table for the genjets
379  variables = cms.PSet(P4Vars,
380  #anything else?
381  )
382 )
383 ### Era dependent customization
384 run2_miniAOD_80XLegacy.toModify( genJetFlavourTable, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
385 
386 run2_nanoAOD_92X.toModify( genJetFlavourTable, jetFlavourInfos = cms.InputTag("genJetFlavourAssociation"),)
387 
388 #before cross linking
389 jetSequence = cms.Sequence(looseJetId+tightJetId+slimmedJetsWithUserData+jetCorrFactors+updatedJets+looseJetIdAK8+tightJetIdAK8+slimmedJetsAK8WithUserData+jetCorrFactorsAK8+updatedJetsAK8+chsForSATkJets+softActivityJets+softActivityJets2+softActivityJets5+softActivityJets10+finalJets+finalJetsAK8)
390 #after cross linkining
391 jetTables = cms.Sequence(bjetMVA+ jetTable+fatJetTable+subJetTable+saJetTable+saTable)
392 
393 #MC only producers and tables
394 jetMC = cms.Sequence(jetMCTable+genJetTable+patJetPartons+genJetFlavourTable+genJetAK8Table+genJetAK8FlavourAssociation+genJetAK8FlavourTable+genSubJetAK8Table)
395 
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:31
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20