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_94X2016_cff
import run2_nanoAOD_94X2016
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(
"softActivityJets"), cut = cms.string(
'pt>10'))
15 softActivityJets5 = cms.EDFilter(
"CandPtrSelector", src = cms.InputTag(
"softActivityJets"), cut = cms.string(
'pt>5'))
16 softActivityJets2 = cms.EDFilter(
"CandPtrSelector", src = cms.InputTag(
"softActivityJets"), cut = cms.string(
'pt>2'))
21 jetCorrFactorsNano = patJetCorrFactors.clone(src=
'slimmedJets',
22 levels = cms.vstring(
'L1FastJet',
26 primaryVertices = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
28 jetCorrFactorsAK8 = patJetCorrFactors.clone(src=
'slimmedJetsAK8',
29 levels = cms.vstring(
'L1FastJet',
33 payload = cms.string(
'AK8PFPuppi'),
34 primaryVertices = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
36 run2_miniAOD_80XLegacy.toModify(jetCorrFactorsAK8, payload = cms.string(
'AK8PFchs'))
40 updatedJets = updatedPatJets.clone(
42 jetSource=
'slimmedJets',
43 jetCorrFactorsSource=cms.VInputTag(cms.InputTag(
"jetCorrFactorsNano") ),
46 updatedJetsAK8 = updatedPatJets.clone(
48 jetSource=
'slimmedJetsAK8',
49 jetCorrFactorsSource=cms.VInputTag(cms.InputTag(
"jetCorrFactorsAK8") ),
53 looseJetId = cms.EDProducer(
"PatJetIDValueMapProducer",
54 filterParams=cms.PSet(
55 version = cms.string(
'WINTER16'),
56 quality = cms.string(
'LOOSE'),
58 src = cms.InputTag(
"updatedJets")
60 tightJetId = cms.EDProducer(
"PatJetIDValueMapProducer",
61 filterParams=cms.PSet(
62 version = cms.string(
'WINTER17'),
63 quality = cms.string(
'TIGHT'),
65 src = cms.InputTag(
"updatedJets")
67 tightJetIdLepVeto = cms.EDProducer(
"PatJetIDValueMapProducer",
68 filterParams=cms.PSet(
69 version = cms.string(
'WINTER17'),
70 quality = cms.string(
'TIGHTLEPVETO'),
72 src = cms.InputTag(
"updatedJets")
74 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
75 modifier.toModify( tightJetId.filterParams, version =
"WINTER16" )
76 modifier.toModify( tightJetIdLepVeto.filterParams, version =
"WINTER16" )
79 looseJetIdAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
80 filterParams=cms.PSet(
81 version = cms.string(
'WINTER16'),
82 quality = cms.string(
'LOOSE'),
84 src = cms.InputTag(
"updatedJetsAK8")
86 tightJetIdAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
87 filterParams=cms.PSet(
88 version = cms.string(
'WINTER17'),
89 quality = cms.string(
'TIGHT'),
91 src = cms.InputTag(
"updatedJetsAK8")
93 tightJetIdLepVetoAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
94 filterParams=cms.PSet(
95 version = cms.string(
'WINTER17'),
96 quality = cms.string(
'TIGHTLEPVETO'),
98 src = cms.InputTag(
"updatedJetsAK8")
100 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
101 modifier.toModify( tightJetIdAK8.filterParams, version =
"WINTER16" )
102 modifier.toModify( tightJetIdLepVetoAK8.filterParams, version =
"WINTER16" )
105 bJetVars = cms.EDProducer(
"JetRegressionVarProducer",
106 pvsrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
107 src = cms.InputTag(
"updatedJets"),
108 svsrc = cms.InputTag(
"slimmedSecondaryVertices"),
109 gpsrc = cms.InputTag(
"prunedGenParticles"),
114 jercVars = cms.EDProducer(
"BetaStarPackedCandidateVarProducer",
115 srcJet = cms.InputTag(
"updatedJets"),
116 srcPF = cms.InputTag(
"packedPFCandidates"),
117 maxDR = cms.double(0.4)
121 updatedJetsWithUserData = cms.EDProducer(
"PATJetUserDataEmbedder",
122 src = cms.InputTag(
"updatedJets"),
123 userFloats = cms.PSet(
124 leadTrackPt = cms.InputTag(
"bJetVars:leadTrackPt"),
125 leptonPtRel = cms.InputTag(
"bJetVars:leptonPtRel"),
126 leptonPtRatio = cms.InputTag(
"bJetVars:leptonPtRatio"),
127 leptonPtRelInv = cms.InputTag(
"bJetVars:leptonPtRelInv"),
128 leptonPtRelv0 = cms.InputTag(
"bJetVars:leptonPtRelv0"),
129 leptonPtRatiov0 = cms.InputTag(
"bJetVars:leptonPtRatiov0"),
130 leptonPtRelInvv0 = cms.InputTag(
"bJetVars:leptonPtRelInvv0"),
131 leptonDeltaR = cms.InputTag(
"bJetVars:leptonDeltaR"),
132 leptonPt = cms.InputTag(
"bJetVars:leptonPt"),
133 vtxPt = cms.InputTag(
"bJetVars:vtxPt"),
134 vtxMass = cms.InputTag(
"bJetVars:vtxMass"),
135 vtx3dL = cms.InputTag(
"bJetVars:vtx3dL"),
136 vtx3deL = cms.InputTag(
"bJetVars:vtx3deL"),
137 ptD = cms.InputTag(
"bJetVars:ptD"),
138 genPtwNu = cms.InputTag(
"bJetVars:genPtwNu"),
139 qgl = cms.InputTag(
'qgtagger:qgLikelihood'),
140 jercCHPUF = cms.InputTag(
"jercVars:chargedHadronPUEnergyFraction"),
141 jercCHF = cms.InputTag(
"jercVars:chargedHadronCHSEnergyFraction"),
144 tightId = cms.InputTag(
"tightJetId"),
145 tightIdLepVeto = cms.InputTag(
"tightJetIdLepVeto"),
146 vtxNtrk = cms.InputTag(
"bJetVars:vtxNtrk"),
147 leptonPdgId = cms.InputTag(
"bJetVars:leptonPdgId"),
151 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
152 modifier.toModify( updatedJetsWithUserData.userInts,
153 looseId = cms.InputTag(
"looseJetId"),
156 updatedJetsAK8WithUserData = cms.EDProducer(
"PATJetUserDataEmbedder",
157 src = cms.InputTag(
"updatedJetsAK8"),
158 userFloats = cms.PSet(),
160 tightId = cms.InputTag(
"tightJetIdAK8"),
161 tightIdLepVeto = cms.InputTag(
"tightJetIdLepVetoAK8"),
164 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
165 modifier.toModify( updatedJetsAK8WithUserData.userInts,
166 looseId = cms.InputTag(
"looseJetIdAK8"),
170 finalJets = cms.EDFilter(
"PATJetRefSelector",
171 src = cms.InputTag(
"updatedJetsWithUserData"),
172 cut = cms.string(
"pt > 15")
175 finalJetsAK8 = cms.EDFilter(
"PATJetRefSelector",
176 src = cms.InputTag(
"updatedJetsAK8WithUserData"),
177 cut = cms.string(
"pt > 170")
188 jetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
189 src = cms.InputTag(
"linkedObjects",
"jets"),
190 cut = cms.string(
""),
191 name = cms.string(
"Jet"),
192 doc = cms.string(
"slimmedJets, i.e. ak4 PFJets CHS with JECs applied, after basic selection (" + finalJets.cut.value()+
")"),
193 singleton = cms.bool(
False),
194 extension = cms.bool(
False),
195 externalVariables = cms.PSet(
197 bRegCorr =
ExtVar(cms.InputTag(
"bjetNN:corr"),float, doc=
"pt correction for b-jet energy regression",precision=12),
198 bRegRes =
ExtVar(cms.InputTag(
"bjetNN:res"),float, doc=
"res on pt corrected with b-jet regression",precision=8),
200 variables = cms.PSet(P4Vars,
201 area =
Var(
"jetArea()", float, doc=
"jet catchment area, for JECs",precision=10),
202 nMuons =
Var(
"?hasOverlaps('muons')?overlaps('muons').size():0", int, doc=
"number of muons in the jet"),
203 muonIdx1 =
Var(
"?overlaps('muons').size()>0?overlaps('muons')[0].key():-1", int, doc=
"index of first matching muon"),
204 muonIdx2 =
Var(
"?overlaps('muons').size()>1?overlaps('muons')[1].key():-1", int, doc=
"index of second matching muon"),
205 electronIdx1 =
Var(
"?overlaps('electrons').size()>0?overlaps('electrons')[0].key():-1", int, doc=
"index of first matching electron"),
206 electronIdx2 =
Var(
"?overlaps('electrons').size()>1?overlaps('electrons')[1].key():-1", int, doc=
"index of second matching electron"),
207 nElectrons =
Var(
"?hasOverlaps('electrons')?overlaps('electrons').size():0", int, doc=
"number of electrons in the jet"),
208 btagCMVA =
Var(
"bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc=
"CMVA V2 btag discriminator",precision=10),
209 btagDeepB =
Var(
"bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc=
"DeepCSV b+bb tag discriminator",precision=10),
210 btagDeepFlavB =
Var(
"bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb')",float,doc=
"DeepFlavour b+bb+lepb tag discriminator",precision=10),
211 btagCSVV2 =
Var(
"bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=
" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
212 btagDeepC =
Var(
"bDiscriminator('pfDeepCSVJetTags:probc')",float,doc=
"DeepCSV charm btag discriminator",precision=10),
213 btagDeepFlavC =
Var(
"bDiscriminator('pfDeepFlavourJetTags:probc')",float,doc=
"DeepFlavour charm tag discriminator",precision=10),
215 puId =
Var(
"userInt('pileupJetId:fullId')",int,doc=
"Pilup ID flags"),
216 jetId =
Var(
"userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc=
"Jet ID flags bit1 is loose (always false in 2017 since it does not exist), bit2 is tight, bit3 is tightLepVeto"),
217 qgl =
Var(
"userFloat('qgl')",float,doc=
"Quark vs Gluon likelihood discriminator",precision=10),
218 nConstituents =
Var(
"numberOfDaughters()",int,doc=
"Number of particles in the jet"),
219 rawFactor =
Var(
"1.-jecFactor('Uncorrected')",float,doc=
"1 - Factor to get back to raw pT",precision=6),
220 chHEF =
Var(
"chargedHadronEnergyFraction()", float, doc=
"charged Hadron Energy Fraction", precision= 6),
221 neHEF =
Var(
"neutralHadronEnergyFraction()", float, doc=
"neutral Hadron Energy Fraction", precision= 6),
222 chEmEF =
Var(
"chargedEmEnergyFraction()", float, doc=
"charged Electromagnetic Energy Fraction", precision= 6),
223 neEmEF =
Var(
"neutralEmEnergyFraction()", float, doc=
"neutral Electromagnetic Energy Fraction", precision= 6),
224 muEF =
Var(
"muonEnergyFraction()", float, doc=
"muon Energy Fraction", precision= 6),
225 jercCHPUF =
Var(
"userFloat('jercCHPUF')", float, doc=
"Pileup Charged Hadron Energy Fraction with the JERC group definition", precision= 6),
226 jercCHF =
Var(
"userFloat('jercCHF')", float, doc=
"Charged Hadron Energy Fraction with the JERC group definition", precision= 6),
231 jetTable.variables.pt.precision=10
234 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
235 modifier.toModify( jetTable.variables, jetId =
Var(
"userInt('tightIdLepVeto')*4+userInt('tightId')*2+userInt('looseId')",int,doc=
"Jet ID flags bit1 is loose, bit2 is tight, bit3 is tightLepVeto"))
237 bjetMVA= cms.EDProducer(
"BJetEnergyRegressionMVA",
238 backend = cms.string(
"TMVA"),
239 src = cms.InputTag(
"linkedObjects",
"jets"),
240 pvsrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
241 svsrc = cms.InputTag(
"slimmedSecondaryVertices"),
242 rhosrc = cms.InputTag(
"fixedGridRhoFastjetAll"),
243 weightFile = cms.FileInPath(
"PhysicsTools/NanoAOD/data/bjet-regression.xml"),
244 name = cms.string(
"JetReg"),
245 isClassifier = cms.bool(
False),
246 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"]),
247 variables = cms.PSet(
248 Jet_pt = cms.string(
"pt"),
249 Jet_eta = cms.string(
"eta"),
250 Jet_mt = cms.string(
"mt"),
251 Jet_leadTrackPt = cms.string(
"userFloat('leadTrackPt')"),
252 Jet_vtxNtrk = cms.string(
"userInt('vtxNtrk')"),
253 Jet_vtxMass = cms.string(
"userFloat('vtxMass')"),
254 Jet_vtx3dL = cms.string(
"userFloat('vtx3dL')"),
255 Jet_vtx3deL = cms.string(
"userFloat('vtx3deL')"),
256 Jet_vtxPt = cms.string(
"userFloat('vtxPt')"),
257 Jet_leptonPtRel = cms.string(
"userFloat('leptonPtRelv0')"),
258 Jet_leptonPt = cms.string(
"?overlaps('muons').size()>0?overlaps('muons')[0].pt():(?overlaps('electrons').size()>0?overlaps('electrons')[0].pt():0)"),
259 Jet_neHEF = cms.string(
"neutralHadronEnergy()/energy()"),
260 Jet_neEmEF = cms.string(
"neutralEmEnergy()/energy()"),
261 Jet_leptonDeltaR = cms.string(
'''?overlaps('muons').size()>0?deltaR(eta,phi,overlaps('muons')[0].eta,overlaps('muons')[0].phi): 262 (?overlaps('electrons').size()>0?deltaR(eta,phi,overlaps('electrons')[0].eta,overlaps('electrons')[0].phi): 268 bjetNN= cms.EDProducer(
"BJetEnergyRegressionMVA",
269 backend = cms.string(
"TF"),
270 src = cms.InputTag(
"linkedObjects",
"jets"),
271 pvsrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
272 svsrc = cms.InputTag(
"slimmedSecondaryVertices"),
273 rhosrc = cms.InputTag(
"fixedGridRhoFastjetAll"),
275 weightFile = cms.FileInPath(
"PhysicsTools/NanoAOD/data/breg_training_2017.pb"),
276 name = cms.string(
"JetRegNN"),
277 isClassifier = cms.bool(
False),
278 variablesOrder = cms.vstring([
"Jet_pt",
"Jet_eta",
"rho",
"Jet_mt",
"Jet_leadTrackPt",
"Jet_leptonPtRel",
"Jet_leptonDeltaR",
"Jet_neHEF",
"Jet_neEmEF",
"Jet_vtxPt",
"Jet_vtxMass",
"Jet_vtx3dL",
"Jet_vtxNtrk",
"Jet_vtx3deL",
"Jet_numDaughters_pt03",
"Jet_energyRing_dR0_em_Jet_rawEnergy",
"Jet_energyRing_dR1_em_Jet_rawEnergy",
"Jet_energyRing_dR2_em_Jet_rawEnergy",
"Jet_energyRing_dR3_em_Jet_rawEnergy",
"Jet_energyRing_dR4_em_Jet_rawEnergy",
"Jet_energyRing_dR0_neut_Jet_rawEnergy",
"Jet_energyRing_dR1_neut_Jet_rawEnergy",
"Jet_energyRing_dR2_neut_Jet_rawEnergy",
"Jet_energyRing_dR3_neut_Jet_rawEnergy",
"Jet_energyRing_dR4_neut_Jet_rawEnergy",
"Jet_energyRing_dR0_ch_Jet_rawEnergy",
"Jet_energyRing_dR1_ch_Jet_rawEnergy",
"Jet_energyRing_dR2_ch_Jet_rawEnergy",
"Jet_energyRing_dR3_ch_Jet_rawEnergy",
"Jet_energyRing_dR4_ch_Jet_rawEnergy",
"Jet_energyRing_dR0_mu_Jet_rawEnergy",
"Jet_energyRing_dR1_mu_Jet_rawEnergy",
"Jet_energyRing_dR2_mu_Jet_rawEnergy",
"Jet_energyRing_dR3_mu_Jet_rawEnergy",
"Jet_energyRing_dR4_mu_Jet_rawEnergy",
"Jet_chHEF",
"Jet_chEmEF",
"Jet_leptonPtRelInv",
"isEle",
"isMu",
"isOther",
"Jet_mass",
"Jet_ptd"]),
279 variables = cms.PSet(
280 Jet_pt = cms.string(
"pt*jecFactor('Uncorrected')"),
281 Jet_mt = cms.string(
"mt*jecFactor('Uncorrected')"),
282 Jet_eta = cms.string(
"eta"),
283 Jet_mass = cms.string(
"mass*jecFactor('Uncorrected')"),
284 Jet_ptd = cms.string(
"userFloat('ptD')"),
285 Jet_leadTrackPt = cms.string(
"userFloat('leadTrackPt')"),
286 Jet_vtxNtrk = cms.string(
"userInt('vtxNtrk')"),
287 Jet_vtxMass = cms.string(
"userFloat('vtxMass')"),
288 Jet_vtx3dL = cms.string(
"userFloat('vtx3dL')"),
289 Jet_vtx3deL = cms.string(
"userFloat('vtx3deL')"),
290 Jet_vtxPt = cms.string(
"userFloat('vtxPt')"),
292 Jet_leptonPtRel = cms.string(
"userFloat('leptonPtRelv0')"),
293 Jet_leptonPtRelInv = cms.string(
"userFloat('leptonPtRelInvv0')*jecFactor('Uncorrected')"),
294 Jet_leptonDeltaR = cms.string(
"userFloat('leptonDeltaR')"),
296 Jet_neHEF = cms.string(
"neutralHadronEnergyFraction()"),
297 Jet_neEmEF = cms.string(
"neutralEmEnergyFraction()"),
298 Jet_chHEF = cms.string(
"chargedHadronEnergyFraction()"),
299 Jet_chEmEF = cms.string(
"chargedEmEnergyFraction()"),
300 isMu = cms.string(
"?abs(userInt('leptonPdgId'))==13?1:0"),
301 isEle = cms.string(
"?abs(userInt('leptonPdgId'))==11?1:0"),
302 isOther = cms.string(
"?userInt('leptonPdgId')==0?1:0"),
304 inputTensorName = cms.string(
"ffwd_inp"),
305 outputTensorName = cms.string(
"ffwd_out/BiasAdd"),
306 outputNames = cms.vstring([
"corr",
"res"]),
307 outputFormulas = cms.vstring([
"at(0)*0.28492164611816406+1.0596693754196167",
"0.5*(at(2)-at(1))*0.28492164611816406"]),
308 nThreads = cms.uint32(1),
309 singleThreadPool = cms.string(
"no_threads"),
315 saJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
316 src = cms.InputTag(
"softActivityJets"),
317 cut = cms.string(
""),
318 maxLen = cms.uint32(6),
319 name = cms.string(
"SoftActivityJet"),
320 doc = cms.string(
"jets clustered from charged candidates compatible with primary vertex (" + chsForSATkJets.cut.value()+
")"),
321 singleton = cms.bool(
False),
322 extension = cms.bool(
False),
323 variables = cms.PSet(P3Vars,
327 saJetTable.variables.pt.precision=10
328 saJetTable.variables.eta.precision=8
329 saJetTable.variables.phi.precision=8
331 saTable = cms.EDProducer(
"GlobalVariablesTableProducer",
332 variables = cms.PSet(
333 SoftActivityJetHT =
ExtVar( cms.InputTag(
"softActivityJets"),
"candidatescalarsum", doc =
"scalar sum of soft activity jet pt, pt>1" ),
334 SoftActivityJetHT10 =
ExtVar( cms.InputTag(
"softActivityJets10"),
"candidatescalarsum", doc =
"scalar sum of soft activity jet pt , pt >10" ),
335 SoftActivityJetHT5 =
ExtVar( cms.InputTag(
"softActivityJets5"),
"candidatescalarsum", doc =
"scalar sum of soft activity jet pt, pt>5" ),
336 SoftActivityJetHT2 =
ExtVar( cms.InputTag(
"softActivityJets2"),
"candidatescalarsum", doc =
"scalar sum of soft activity jet pt, pt >2" ),
337 SoftActivityJetNjets10 =
ExtVar( cms.InputTag(
"softActivityJets10"),
"candidatesize", doc =
"number of soft activity jet pt, pt >2" ),
338 SoftActivityJetNjets5 =
ExtVar( cms.InputTag(
"softActivityJets5"),
"candidatesize", doc =
"number of soft activity jet pt, pt >5" ),
339 SoftActivityJetNjets2 =
ExtVar( cms.InputTag(
"softActivityJets2"),
"candidatesize", doc =
"number of soft activity jet pt, pt >10" ),
347 fatJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
348 src = cms.InputTag(
"finalJetsAK8"),
349 cut = cms.string(
" pt > 170"),
350 name = cms.string(
"FatJet"),
351 doc = cms.string(
"slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
352 singleton = cms.bool(
False),
353 extension = cms.bool(
False),
354 variables = cms.PSet(P4Vars,
355 jetId =
Var(
"userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc=
"Jet ID flags bit1 is loose (always false in 2017 since it does not exist), bit2 is tight, bit3 is tightLepVeto"),
356 area =
Var(
"jetArea()", float, doc=
"jet catchment area, for JECs",precision=10),
357 rawFactor =
Var(
"1.-jecFactor('Uncorrected')",float,doc=
"1 - Factor to get back to raw pT",precision=6),
358 tau1 =
Var(
"userFloat('NjettinessAK8Puppi:tau1')",float, doc=
"Nsubjettiness (1 axis)",precision=10),
359 tau2 =
Var(
"userFloat('NjettinessAK8Puppi:tau2')",float, doc=
"Nsubjettiness (2 axis)",precision=10),
360 tau3 =
Var(
"userFloat('NjettinessAK8Puppi:tau3')",float, doc=
"Nsubjettiness (3 axis)",precision=10),
361 tau4 =
Var(
"userFloat('NjettinessAK8Puppi:tau4')",float, doc=
"Nsubjettiness (4 axis)",precision=10),
362 n2b1 =
Var(
"userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')", float, doc=
"N2 with beta=1", precision=10),
363 n3b1 =
Var(
"userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')", float, doc=
"N3 with beta=1", precision=10),
364 msoftdrop =
Var(
"groomedMass('SoftDropPuppi')",float, doc=
"Corrected soft drop mass with PUPPI",precision=10),
365 btagCMVA =
Var(
"bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc=
"CMVA V2 btag discriminator",precision=10),
366 btagDeepB =
Var(
"bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc=
"DeepCSV b+bb tag discriminator",precision=10),
367 btagCSVV2 =
Var(
"bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=
" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
368 btagHbb =
Var(
"bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc=
"Higgs to BB tagger discriminator",precision=10),
369 btagDDBvL =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleBvLJetTags:probHbb')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10),
370 btagDDCvL =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvLJetTags:probHcc')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10),
371 btagDDCvB =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvBJetTags:probHcc')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10),
372 deepTag_TvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:TvsQCD')",float,doc=
"DeepBoostedJet tagger top vs QCD discriminator",precision=10),
373 deepTag_WvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:WvsQCD')",float,doc=
"DeepBoostedJet tagger W vs QCD discriminator",precision=10),
374 deepTag_ZvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:ZvsQCD')",float,doc=
"DeepBoostedJet tagger Z vs QCD discriminator",precision=10),
375 deepTag_H =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probHbb')+bDiscriminator('pfDeepBoostedJetTags:probHcc')+bDiscriminator('pfDeepBoostedJetTags:probHqqqq')",float,doc=
"DeepBoostedJet tagger H(bb,cc,4q) sum",precision=10),
376 deepTag_QCD =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probQCDbb')+bDiscriminator('pfDeepBoostedJetTags:probQCDcc')+bDiscriminator('pfDeepBoostedJetTags:probQCDb')+bDiscriminator('pfDeepBoostedJetTags:probQCDc')+bDiscriminator('pfDeepBoostedJetTags:probQCDothers')",float,doc=
"DeepBoostedJet tagger QCD(bb,cc,b,c,others) sum",precision=10),
377 deepTag_QCDothers =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probQCDothers')",float,doc=
"DeepBoostedJet tagger QCDothers value",precision=10),
378 deepTagMD_TvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:TvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger top vs QCD discriminator",precision=10),
379 deepTagMD_WvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:WvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger W vs QCD discriminator",precision=10),
380 deepTagMD_ZvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z vs QCD discriminator",precision=10),
381 deepTagMD_ZHbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H->bb vs QCD discriminator",precision=10),
382 deepTagMD_ZbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z->bb vs QCD discriminator",precision=10),
383 deepTagMD_HbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:HbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger H->bb vs QCD discriminator",precision=10),
384 deepTagMD_ZHccvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHccvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H->cc vs QCD discriminator",precision=10),
385 deepTagMD_H4qvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:H4qvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger H->4q vs QCD discriminator",precision=10),
386 deepTagMD_bbvsLight =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:bbvsLight')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H/gluon->bb vs light flavour discriminator",precision=10),
387 deepTagMD_ccvsLight =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ccvsLight')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H/gluon->cc vs light flavour discriminator",precision=10),
388 subJetIdx1 =
Var(
"?nSubjetCollections()>0 && subjets('SoftDropPuppi').size()>0?subjets('SoftDropPuppi')[0].key():-1", int,
389 doc=
"index of first subjet"),
390 subJetIdx2 =
Var(
"?nSubjetCollections()>0 && subjets('SoftDropPuppi').size()>1?subjets('SoftDropPuppi')[1].key():-1", int,
391 doc=
"index of second subjet"),
400 run2_miniAOD_80XLegacy.toModify( bjetNN,outputFormulas = cms.vstring([
"at(0)*0.31628304719924927+1.0454729795455933",
"0.5*(at(2)-at(1))*0.31628304719924927"]))
401 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, msoftdrop_chs =
Var(
"userFloat('ak8PFJetsCHSSoftDropMass')",float, doc=
"Legacy uncorrected soft drop mass with CHS",precision=10))
402 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau1, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau1\')"),)
403 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau2, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau2\')"),)
404 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau3, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau3\')"),)
405 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, tau4 =
None)
406 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, n2b1 =
None)
407 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, n3b1 =
None)
408 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
409 modifier.toModify( fatJetTable.variables, jetId =
Var(
"userInt('tightId')*2+userInt('looseId')",int,doc=
"Jet ID flags bit1 is loose, bit2 is tight"))
414 subJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
415 src = cms.InputTag(
"slimmedJetsAK8PFPuppiSoftDropPacked",
"SubJets"),
416 cut = cms.string(
""),
417 name = cms.string(
"SubJet"),
418 doc = cms.string(
"slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
419 singleton = cms.bool(
False),
420 extension = cms.bool(
False),
421 variables = cms.PSet(P4Vars,
422 btagCMVA =
Var(
"bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc=
"CMVA V2 btag discriminator",precision=10),
423 btagDeepB =
Var(
"bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc=
"DeepCSV b+bb tag discriminator",precision=10),
424 btagCSVV2 =
Var(
"bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=
" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
425 rawFactor =
Var(
"1.-jecFactor('Uncorrected')",float,doc=
"1 - Factor to get back to raw pT",precision=6),
426 tau1 =
Var(
"userFloat('NjettinessAK8Subjets:tau1')",float, doc=
"Nsubjettiness (1 axis)",precision=10),
427 tau2 =
Var(
"userFloat('NjettinessAK8Subjets:tau2')",float, doc=
"Nsubjettiness (2 axis)",precision=10),
428 tau3 =
Var(
"userFloat('NjettinessAK8Subjets:tau3')",float, doc=
"Nsubjettiness (3 axis)",precision=10),
429 tau4 =
Var(
"userFloat('NjettinessAK8Subjets:tau4')",float, doc=
"Nsubjettiness (4 axis)",precision=10),
430 n2b1 =
Var(
"userFloat('nb1AK8PuppiSoftDropSubjets:ecfN2')", float, doc=
"N2 with beta=1", precision=10),
431 n3b1 =
Var(
"userFloat('nb1AK8PuppiSoftDropSubjets:ecfN3')", float, doc=
"N3 with beta=1", precision=10),
436 fatJetTable.variables.pt.precision=10
437 subJetTable.variables.pt.precision=10
439 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau1 =
None)
440 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau2 =
None)
441 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau3 =
None)
442 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau4 =
None)
443 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, n2b1 =
None)
444 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, n3b1 =
None)
445 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, btagCMVA =
None, btagDeepB =
None)
448 corrT1METJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
449 src = cms.InputTag(
"corrT1METJets"),
450 cut = cms.string(
""),
451 name = cms.string(
"CorrT1METJet"),
452 doc = cms.string(
"Additional low-pt jets for Type-1 MET re-correction"),
453 singleton = cms.bool(
False),
454 extension = cms.bool(
False),
455 variables = cms.PSet(
456 rawPt =
Var(
"pt()*jecFactor('Uncorrected')",float,precision=10),
457 eta =
Var(
"eta", float,precision=12),
458 phi =
Var(
"phi", float, precision=12),
459 area =
Var(
"jetArea()", float, doc=
"jet catchment area, for JECs",precision=10),
466 jetMCTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
467 src = cms.InputTag(
"linkedObjects",
"jets"),
468 cut = cms.string(
""),
469 name = cms.string(
"Jet"),
470 singleton = cms.bool(
False),
471 extension = cms.bool(
True),
472 variables = cms.PSet(
473 partonFlavour =
Var(
"partonFlavour()", int, doc=
"flavour from parton matching"),
474 hadronFlavour =
Var(
"hadronFlavour()", int, doc=
"flavour from hadron ghost clustering"),
475 genJetIdx =
Var(
"?genJetFwdRef().backRef().isNonnull()?genJetFwdRef().backRef().key():-1", int, doc=
"index of matched gen jet"),
478 genJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
479 src = cms.InputTag(
"slimmedGenJets"),
480 cut = cms.string(
"pt > 10"),
481 name = cms.string(
"GenJet"),
482 doc = cms.string(
"slimmedGenJets, i.e. ak4 Jets made with visible genparticles"),
483 singleton = cms.bool(
False),
484 extension = cms.bool(
False),
485 variables = cms.PSet(P4Vars,
489 patJetPartons = cms.EDProducer(
'HadronAndPartonSelector',
490 src = cms.InputTag(
"generator"),
491 particles = cms.InputTag(
"prunedGenParticles"),
492 partonMode = cms.string(
"Auto"),
493 fullChainPhysPartons = cms.bool(
True)
495 genJetFlavourAssociation = cms.EDProducer(
"JetFlavourClustering",
496 jets = genJetTable.src,
497 bHadrons = cms.InputTag(
"patJetPartons",
"bHadrons"),
498 cHadrons = cms.InputTag(
"patJetPartons",
"cHadrons"),
499 partons = cms.InputTag(
"patJetPartons",
"physicsPartons"),
500 leptons = cms.InputTag(
"patJetPartons",
"leptons"),
501 jetAlgorithm = cms.string(
"AntiKt"),
502 rParam = cms.double(0.4),
503 ghostRescaling = cms.double(1e-18),
504 hadronFlavourHasPriority = cms.bool(
False)
506 genJetFlavourTable = cms.EDProducer(
"GenJetFlavourTableProducer",
507 name = genJetTable.name,
508 src = genJetTable.src,
509 cut = genJetTable.cut,
510 deltaR = cms.double(0.1),
511 jetFlavourInfos = cms.InputTag(
"slimmedGenJetsFlavourInfos"),
514 genJetAK8Table = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
515 src = cms.InputTag(
"slimmedGenJetsAK8"),
516 cut = cms.string(
"pt > 100."),
517 name = cms.string(
"GenJetAK8"),
518 doc = cms.string(
"slimmedGenJetsAK8, i.e. ak8 Jets made with visible genparticles"),
519 singleton = cms.bool(
False),
520 extension = cms.bool(
False),
521 variables = cms.PSet(P4Vars,
525 genJetAK8FlavourAssociation = cms.EDProducer(
"JetFlavourClustering",
526 jets = genJetAK8Table.src,
527 bHadrons = cms.InputTag(
"patJetPartons",
"bHadrons"),
528 cHadrons = cms.InputTag(
"patJetPartons",
"cHadrons"),
529 partons = cms.InputTag(
"patJetPartons",
"physicsPartons"),
530 leptons = cms.InputTag(
"patJetPartons",
"leptons"),
531 jetAlgorithm = cms.string(
"AntiKt"),
532 rParam = cms.double(0.8),
533 ghostRescaling = cms.double(1e-18),
534 hadronFlavourHasPriority = cms.bool(
False)
536 genJetAK8FlavourTable = cms.EDProducer(
"GenJetFlavourTableProducer",
537 name = genJetAK8Table.name,
538 src = genJetAK8Table.src,
539 cut = genJetAK8Table.cut,
540 deltaR = cms.double(0.1),
541 jetFlavourInfos = cms.InputTag(
"genJetAK8FlavourAssociation"),
543 genSubJetAK8Table = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
544 src = cms.InputTag(
"slimmedGenJetsAK8SoftDropSubJets"),
545 cut = cms.string(
""),
546 name = cms.string(
"SubGenJetAK8"),
547 doc = cms.string(
"slimmedGenJetsAK8SoftDropSubJets, i.e. subjets of ak8 Jets made with visible genparticles"),
548 singleton = cms.bool(
False),
549 extension = cms.bool(
False),
550 variables = cms.PSet(P4Vars,
555 run2_miniAOD_80XLegacy.toModify( genJetFlavourTable, jetFlavourInfos = cms.InputTag(
"genJetFlavourAssociation"),)
558 qgtagger=QGTagger.clone(srcJets=
"updatedJets",srcVertexCollection=
"offlineSlimmedPrimaryVertices")
561 jetSequence = cms.Sequence(jetCorrFactorsNano+updatedJets+tightJetId+tightJetIdLepVeto+bJetVars+jercVars+qgtagger+updatedJetsWithUserData+jetCorrFactorsAK8+updatedJetsAK8+tightJetIdAK8+tightJetIdLepVetoAK8+updatedJetsAK8WithUserData+chsForSATkJets+softActivityJets+softActivityJets2+softActivityJets5+softActivityJets10+finalJets+finalJetsAK8)
563 _jetSequence_2016 = jetSequence.copy()
564 _jetSequence_2016.insert(_jetSequence_2016.index(tightJetId), looseJetId)
565 _jetSequence_2016.insert(_jetSequence_2016.index(tightJetIdAK8), looseJetIdAK8)
566 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
567 modifier.toReplaceWith(jetSequence, _jetSequence_2016)
570 jetTables = cms.Sequence(bjetMVA+bjetNN+jetTable+fatJetTable+subJetTable+saJetTable+saTable)
573 jetMC = cms.Sequence(jetMCTable+genJetTable+patJetPartons+genJetFlavourTable+genJetAK8Table+genJetAK8FlavourAssociation+genJetAK8FlavourTable+genSubJetAK8Table)
574 _jetMC_pre94X = jetMC.copy()
575 _jetMC_pre94X.insert(_jetMC_pre94X.index(genJetFlavourTable),genJetFlavourAssociation)
576 _jetMC_pre94X.remove(genSubJetAK8Table)
577 run2_miniAOD_80XLegacy.toReplaceWith(jetMC, _jetMC_pre94X)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)