1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
25 nanoMetadata = cms.EDProducer(
"UniqueStringProducer",
27 tag = cms.string(
"untagged"),
31 linkedObjects = cms.EDProducer(
"PATObjectCrossLinker",
32 jets=cms.InputTag(
"finalJets"),
33 muons=cms.InputTag(
"finalMuons"),
34 electrons=cms.InputTag(
"finalElectrons"),
35 taus=cms.InputTag(
"finalTaus"),
36 photons=cms.InputTag(
"finalPhotons"),
39 simpleCleanerTable = cms.EDProducer(
"NanoAODSimpleCrossCleaner",
40 name=cms.string(
"cleanmask"),
41 doc=cms.string(
"simple cleaning mask with priority to leptons"),
42 jets=cms.InputTag(
"linkedObjects",
"jets"),
43 muons=cms.InputTag(
"linkedObjects",
"muons"),
44 electrons=cms.InputTag(
"linkedObjects",
"electrons"),
45 taus=cms.InputTag(
"linkedObjects",
"taus"),
46 photons=cms.InputTag(
"linkedObjects",
"photons"),
47 jetSel=cms.string(
"pt>15"),
48 muonSel=cms.string(
"track.isNonnull && isLooseMuon && isPFMuon && innerTrack.validFraction >= 0.49 && ( isGlobalMuon && globalTrack.normalizedChi2 < 3 && combinedQuality.chi2LocalPosition < 12 && combinedQuality.trkKink < 20 && segmentCompatibility >= 0.303 || segmentCompatibility >= 0.451 )"),
49 electronSel=cms.string(
""),
50 tauSel=cms.string(
""),
51 photonSel=cms.string(
""),
52 jetName=cms.string(
"Jet"),muonName=cms.string(
"Muon"),electronName=cms.string(
"Electron"),
53 tauName=cms.string(
"Tau"),photonName=cms.string(
"Photon")
56 btagSFdir=
"PhysicsTools/NanoAOD/data/btagSF/" 58 btagWeightTable = cms.EDProducer(
"BTagSFProducer",
59 src = cms.InputTag(
"linkedObjects",
"jets"),
60 cut = cms.string(
"pt > 25. && abs(eta) < 2.5"),
61 discNames = cms.vstring(
62 "pfCombinedInclusiveSecondaryVertexV2BJetTags",
63 "pfDeepCSVJetTags:probb+pfDeepCSVJetTags:probbb",
64 "pfCombinedMVAV2BJetTags" 66 discShortNames = cms.vstring(
71 weightFiles = cms.vstring(
72 btagSFdir+
"CSVv2_94XSF_V2_B_F.csv",
73 btagSFdir+
"DeepCSV_94XSF_V2_B_F.csv",
76 operatingPoints = cms.vstring(
"3",
"3",
"3"),
77 measurementTypesB = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
78 measurementTypesC = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
79 measurementTypesUDSG = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
80 sysTypes = cms.vstring(
"central",
"central",
"central")
83 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
84 modifier.toModify(btagWeightTable,
85 cut = cms.string(
"pt > 25. && abs(eta) < 2.4"),
86 weightFiles = cms.vstring(
87 btagSFdir+
"CSVv2_Moriond17_B_H.csv",
89 btagSFdir+
"cMVAv2_Moriond17_B_H.csv" 94 lhcInfoTable = cms.EDProducer(
"LHCInfoProducer",
95 precision = cms.int32(10),
99 lheInfoTable = cms.EDProducer(
"LHETablesProducer",
100 lheInfo = cms.VInputTag(cms.InputTag(
"externalLHEProducer"), cms.InputTag(
"source")),
101 precision = cms.int32(14),
102 storeLHEParticles = cms.bool(
True)
105 l1bits=cms.EDProducer(
"L1TriggerResultsConverter", src=cms.InputTag(
"gtStage2Digis"), legacyL1=cms.bool(
False),
106 storeUnprefireableBit=cms.bool(
True), src_ext=cms.InputTag(
"gtStage2Digis"))
107 (run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toModify(l1bits, storeUnprefireableBit=
False)
109 nanoSequenceCommon = cms.Sequence(
110 nanoMetadata + jetSequence + muonSequence + tauSequence + boostedTauSequence + electronSequence+photonSequence+vertexSequence+
111 isoTrackSequence + jetLepSequence +
113 jetTables + muonTables + tauTables + boostedTauTables + electronTables + photonTables + globalTables +vertexTables+ metTables+simpleCleanerTable + isoTrackTables
116 (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toReplaceWith(nanoSequenceCommon, nanoSequenceCommon.copyAndExclude([boostedTauSequence, boostedTauTables]))
118 nanoSequenceOnlyFullSim = cms.Sequence(triggerObjectTables + l1bits)
120 nanoSequenceOnlyData = cms.Sequence(protonTables + lhcInfoTable)
122 nanoSequence = cms.Sequence(nanoSequenceCommon + nanoSequenceOnlyData + nanoSequenceOnlyFullSim)
124 ( run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toReplaceWith(nanoSequence, nanoSequence.copyAndExclude([nanoSequenceOnlyData]))
126 nanoSequenceFS = cms.Sequence(genParticleSequence + genVertexTables + particleLevelSequence + nanoSequenceCommon + jetMC + muonMC + electronMC + photonMC + tauMC + boostedTauMC + metMC + ttbarCatMCProducers + globalTablesMC + btagWeightTable + genWeightsTable + genVertexTable + genParticleTables + particleLevelTables + lheInfoTable + ttbarCategoryTable )
128 (run2_nanoAOD_92X | run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94X2016 | \
129 run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | \
130 run2_nanoAOD_102Xv1 ).toReplaceWith(nanoSequenceFS, nanoSequenceFS.copyAndExclude([genVertexTable, genVertexT0Table]))
133 (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toReplaceWith(nanoSequenceFS, nanoSequenceFS.copyAndExclude([boostedTauMC]))
136 nanoSequenceMC = nanoSequenceFS.copy()
137 nanoSequenceMC.insert(nanoSequenceFS.index(nanoSequenceCommon)+1,nanoSequenceOnlyFullSim)
140 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1:
141 modifier.toModify(extraFlagsTable, variables= cms.PSet())
142 modifier.toModify(extraFlagsTable, variables =
dict(Flag_ecalBadCalibFilterV2 =
ExtVar(cms.InputTag(
"ecalBadCalibFilterNanoTagger"), bool, doc =
"Bad ECAL calib flag (updated xtal list)")))
145 import RecoTauTag.RecoTau.tools.runTauIdMVA
as tauIdConfig
147 updatedTauName =
"slimmedTausUpdated" 148 tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug =
False, updatedTauName = updatedTauName,
149 toKeep = [
"deepTau2017v2p1" ])
150 tauIdEmbedder.runTauID()
151 process.patTauMVAIDsSeq.insert(process.patTauMVAIDsSeq.index(getattr(process, updatedTauName)),
152 process.rerunMvaIsolationSequence)
156 updatedBoostedTauName =
"slimmedTausBoostedNewID" 157 boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug=
False,
158 originalTauName =
"slimmedTausBoosted",
159 updatedTauName = updatedBoostedTauName,
161 toKeep = [
"2017v2",
"dR0p32017v2",
"newDM2017v2",
"againstEle2018",])
162 boostedTauIdEmbedder.runTauID()
163 process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
164 process.rerunMvaIsolationSequenceBoosted)
166 process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
167 getattr(process, updatedBoostedTauName))
174 _btagDiscriminators=[]
176 print(
"Updating process to run DeepCSV btag")
177 _btagDiscriminators += [
'pfDeepCSVJetTags:probb',
'pfDeepCSVJetTags:probbb',
'pfDeepCSVJetTags:probc']
179 print(
"Updating process to run DeepFlavour btag")
180 _btagDiscriminators += [
'pfDeepFlavourJetTags:probb',
'pfDeepFlavourJetTags:probbb',
'pfDeepFlavourJetTags:problepb',
'pfDeepFlavourJetTags:probc']
181 if len(_btagDiscriminators)==0:
return process
182 print(
"Will recalculate the following discriminators: "+
", ".
join(_btagDiscriminators))
185 jetSource = cms.InputTag(
'slimmedJets'),
186 jetCorrections = (
'AK4PFchs', cms.vstring([
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual']),
'None'),
187 btagDiscriminators = _btagDiscriminators,
188 postfix =
'WithDeepInfo',
190 process.load(
"Configuration.StandardSequences.MagneticField_cff")
191 process.jetCorrFactorsNano.src=
"selectedUpdatedPatJetsWithDeepInfo" 192 process.updatedJets.jetSource=
"selectedUpdatedPatJetsWithDeepInfo" 196 if addDeepMETProducer:
198 print(
"add DeepMET Producers")
199 process.load(
'RecoMET.METPUSubtraction.deepMETProducer_cfi')
200 process.deepMETsResolutionTune = process.deepMETProducer.clone()
201 process.deepMETsResponseTune = process.deepMETProducer.clone()
203 process.deepMETsResponseTune.graph_path = ResponseTune_Graph.value()
204 process.metTables += process.deepMetTables
207 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncFromMiniAOD
208 from PhysicsTools.PatAlgos.slimming.puppiForMET_cff
import makePuppiesFromMiniAOD
211 nanoAOD_DeepMET_switch = cms.PSet(
212 nanoAOD_addDeepMET_switch = cms.untracked.bool(
True),
213 nanoAOD_produceDeepMET_switch = cms.untracked.bool(
False),
214 ResponseTune_Graph = cms.untracked.string(
'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb')
217 (~(run2_nanoAOD_106Xv2 | run2_miniAOD_devel)).toModify(nanoAOD_DeepMET_switch, nanoAOD_produceDeepMET_switch = cms.untracked.bool(
True))
218 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
219 modifier.toModify(nanoAOD_DeepMET_switch, ResponseTune_Graph=cms.untracked.string(
"RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb"))
220 if nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch:
222 addDeepMETProducer=nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch,
223 ResponseTune_Graph=nanoAOD_DeepMET_switch.ResponseTune_Graph)
226 extractDeepMETs = nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch
and not nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch
229 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.fullPatMetSequence))
230 process.basicJetsForMetForT1METNano = process.basicJetsForMet.clone(
231 src = process.updatedJetsWithUserData.src,
233 type1JetPtThreshold = 0.0,
234 calcMuonSubtrRawPtAsValueMap = cms.bool(
True),
236 process.jetSequence.insert(process.jetSequence.index(process.updatedJetsWithUserData),cms.Sequence(process.basicJetsForMetForT1METNano))
237 process.updatedJetsWithUserData.userFloats.muonSubtrRawPt = cms.InputTag(
"basicJetsForMetForT1METNano:MuonSubtrRawPt")
238 process.corrT1METJetTable.src = process.finalJets.src
239 process.corrT1METJetTable.cut =
"pt<15 && abs(eta)<9.9" 240 for table
in process.jetTable, process.corrT1METJetTable:
241 table.variables.muonSubtrFactor =
Var(
"1-userFloat('muonSubtrRawPt')/(pt()*jecFactor('Uncorrected'))",float,doc=
"1-(muon-subtracted raw pt)/(raw pt)",precision=6)
242 process.metTables += process.corrT1METJetTable
244 nanoAOD_PuppiV15_switch = cms.PSet(
245 recoMetFromPFCs = cms.untracked.bool(
False),
246 reclusterJets = cms.untracked.bool(
False),
248 run2_nanoAOD_106Xv1.toModify(nanoAOD_PuppiV15_switch,recoMetFromPFCs=
True,reclusterJets=
True)
249 if nanoAOD_PuppiV15_switch.reclusterJets:
253 addToProcessAndTask(
'ak4PuppiJets', ak4PFJets.clone (src =
'puppi', doAreaFastjet =
True, jetPtMin = 10.), process, task)
255 addJetCollection(process,
257 jetSource = cms.InputTag(
'ak4PuppiJets'),
258 algo =
'AK', rParam=0.4,
259 genJetCollection=cms.InputTag(
'slimmedGenJets'),
260 jetCorrections = (
'AK4PFPuppi', [
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual'],
'None'),
261 pfCandidates = cms.InputTag(
'packedPFCandidates'),
262 pvSource = cms.InputTag(
'offlineSlimmedPrimaryVertices'),
263 svSource = cms.InputTag(
'slimmedSecondaryVertices'),
264 muSource =cms.InputTag(
'slimmedMuons'),
265 elSource = cms.InputTag(
'slimmedElectrons'),
266 genParticles= cms.InputTag(
'prunedGenParticles'),
267 getJetMCFlavour=
False 269 process.patJetsPuppi.addGenPartonMatch = cms.bool(
False)
270 process.patJetsPuppi.addGenJetMatch = cms.bool(
False)
272 runMetCorAndUncFromMiniAOD(process,isData=isData,metType=
"Puppi",postfix=
"Puppi",jetFlavor=
"AK4PFPuppi", recoMetFromPFCs=
bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=
bool(nanoAOD_PuppiV15_switch.reclusterJets))
273 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi))
279 for modname
in electron_id_modules_WorkingPoints_nanoAOD.modules:
281 process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence)
282 for modifier
in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1:
283 modifier.toModify(process.electronMVAValueMapProducer, srcMiniAOD =
"slimmedElectronsUpdated")
284 modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc =
"slimmedElectronsUpdated")
286 run2_nanoAOD_106Xv2.toModify(process.electronMVAValueMapProducer, src =
"slimmedElectrons")
287 run2_nanoAOD_106Xv2.toModify(process.egmGsfElectronIDs, physicsObjectSrc =
"slimmedElectrons")
289 for modname
in photon_id_modules_WorkingPoints_nanoAOD.modules:
291 process.photonSequence.insert(process.photonSequence.index(bitmapVIDForPho),process.egmPhotonIDSequence)
292 for modifier
in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1:
293 modifier.toModify(process.photonMVAValueMapProducer, srcMiniAOD =
"slimmedPhotonsTo106X")
294 modifier.toModify(process.egmPhotonIDs, physicsObjectSrc =
"slimmedPhotonsTo106X")
297 def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload):
298 _btagDiscriminators=[]
300 print(
"Updating process to run DeepCSV btag to AK8 jets")
301 _btagDiscriminators += [
'pfDeepCSVJetTags:probb',
'pfDeepCSVJetTags:probbb']
302 if addDeepBoostedJet:
303 print(
"Updating process to run DeepBoostedJet on datasets before 103X")
305 _btagDiscriminators += pfDeepBoostedJetTagsAll
307 print(
"Updating process to run ParticleNet before it's included in MiniAOD")
309 _btagDiscriminators += pfParticleNetJetTagsAll
310 if addParticleNetMass:
312 _btagDiscriminators += _pfParticleNetMassRegressionOutputs
314 print(
"Updating process to run DeepDoubleX on datasets before 104X")
315 _btagDiscriminators += [
'pfDeepDoubleBvLJetTags:probHbb', \
316 'pfDeepDoubleCvLJetTags:probHcc', \
317 'pfDeepDoubleCvBJetTags:probHcc', \
318 'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
'pfMassIndependentDeepDoubleCvBJetTags:probHcc']
320 print(
"Updating process to run DeepDoubleXv2 on datasets before 11X")
321 _btagDiscriminators += [
322 'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
323 'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
324 'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc' 326 if len(_btagDiscriminators)==0:
return process
327 print(
"Will recalculate the following discriminators on AK8 jets: "+
", ".
join(_btagDiscriminators))
330 jetSource = cms.InputTag(
'slimmedJetsAK8'),
331 pvSource = cms.InputTag(
'offlineSlimmedPrimaryVertices'),
332 svSource = cms.InputTag(
'slimmedSecondaryVertices'),
334 jetCorrections = (jecPayload.value(), cms.vstring([
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual']),
'None'),
335 btagDiscriminators = _btagDiscriminators,
336 postfix=
'AK8WithDeepInfo',
339 process.jetCorrFactorsAK8.src=
"selectedUpdatedPatJetsAK8WithDeepInfo" 340 process.updatedJetsAK8.jetSource=
"selectedUpdatedPatJetsAK8WithDeepInfo" 343 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncFromMiniAOD
347 fixEE2017Params = {
'userawPt':
True,
'ptThreshold':50.0,
'minEtaThreshold':2.65,
'maxEtaThreshold': 3.139},
348 postfix =
"FixEE2017")
349 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),process.fullPatMetSequenceFixEE2017)
353 process.puppiNoLep.useExistingWeights =
True 354 process.puppi.useExistingWeights =
True 355 run2_nanoAOD_106Xv1.toModify(process.puppiNoLep, useExistingWeights =
False)
356 run2_nanoAOD_106Xv1.toModify(process.puppi, useExistingWeights =
False)
358 nanoAOD_addDeepInfo_switch = cms.PSet(
359 nanoAOD_addDeepBTag_switch = cms.untracked.bool(
False),
360 nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(
False),
362 run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepBTag_switch = cms.untracked.bool(
True))
363 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
364 modifier.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(
True))
366 addDeepBTag=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepBTag_switch,
367 addDeepFlavour=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepFlavourTag_switch)
368 nanoAOD_addDeepInfoAK8_switch = cms.PSet(
369 nanoAOD_addDeepBTag_switch = cms.untracked.bool(
False),
370 nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(
True),
371 nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(
True),
372 nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(
True),
373 nanoAOD_addParticleNet_switch = cms.untracked.bool(
True),
374 nanoAOD_addParticleNetMass_switch = cms.untracked.bool(
True),
375 jecPayload = cms.untracked.string(
'AK8PFPuppi')
379 run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfoAK8_switch,
380 nanoAOD_addDeepBTag_switch =
True,
381 nanoAOD_addDeepBoostedJet_switch =
False,
382 nanoAOD_addDeepDoubleX_switch =
False,
383 nanoAOD_addDeepDoubleXV2_switch =
False,
384 nanoAOD_addParticleNet_switch =
False,
385 nanoAOD_addParticleNetMass_switch =
False,
386 jecPayload =
'AK8PFchs')
388 (run2_miniAOD_devel).toModify(
389 nanoAOD_addDeepInfoAK8_switch,
390 nanoAOD_addParticleNetMass_switch =
False,
392 (run2_nanoAOD_106Xv2 | run2_miniAOD_devel).toModify(
393 nanoAOD_addDeepInfoAK8_switch,
394 nanoAOD_addDeepBoostedJet_switch =
False,
395 nanoAOD_addDeepDoubleX_switch =
False,
396 nanoAOD_addDeepDoubleXV2_switch =
False,
397 nanoAOD_addParticleNet_switch =
False,
399 run2_nanoAOD_106Xv1.toModify(
400 nanoAOD_addDeepInfoAK8_switch,
401 nanoAOD_addDeepBoostedJet_switch =
False,
402 nanoAOD_addDeepDoubleX_switch =
False,
405 (run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(
406 nanoAOD_addDeepInfoAK8_switch,
407 nanoAOD_addParticleNetMass_switch =
False,
410 addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch,
411 addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch,
412 addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch,
413 addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch,
414 addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch,
415 addParticleNetMass=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNetMass_switch,
416 jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload)
417 addTauIds_switch = cms.PSet(
418 nanoAOD_addTauIds_switch = cms.untracked.bool(
True),
419 nanoAOD_addBoostedTauIds_switch = cms.untracked.bool(
False)
421 run2_miniAOD_80XLegacy.toModify(addTauIds_switch, nanoAOD_addTauIds_switch =
False)
422 ((run2_nanoAOD_106Xv2 | run2_miniAOD_devel | run2_tau_ul_2016 | run2_tau_ul_2018) & \
423 (~(run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1))).toModify(addTauIds_switch,
424 nanoAOD_addTauIds_switch =
False, nanoAOD_addBoostedTauIds_switch =
True)
425 if addTauIds_switch.nanoAOD_addTauIds_switch:
427 if addTauIds_switch.nanoAOD_addBoostedTauIds_switch:
434 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
441 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
446 pdgSelection=
"?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)==24|| pdgId== 23)" 448 ptPrecision=
"{}?{}:{}".
format(pdgSelection, CandVars.pt.precision.value(),genParticleTable.variables.pt.precision.value())
449 process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
450 phiPrecision=
"{} ? {} : {}".
format(pdgSelection, CandVars.phi.precision.value(), genParticleTable.variables.phi.precision.value())
451 process.genParticleTable.variables.phi.precision=cms.string(phiPrecision)
452 etaPrecision=
"{} ? {} : {}".
format(pdgSelection, CandVars.eta.precision.value(), genParticleTable.variables.eta.precision.value())
453 process.genParticleTable.variables.eta.precision=cms.string(etaPrecision)
457 _80x_sequence = nanoSequenceCommon.copy()
459 _80x_sequence.remove(isoTrackTables)
460 _80x_sequence.remove(isoTrackSequence)
462 _80x_sequence.insert(_80x_sequence.index(jetSequence), extraFlagsProducers)
463 _80x_sequence.insert(_80x_sequence.index(simpleCleanerTable)+1, extraFlagsTable)
465 run2_miniAOD_80XLegacy.toReplaceWith( nanoSequenceCommon, _80x_sequence)
467 _102x_sequence = nanoSequenceCommon.copy()
469 _102x_sequence.insert(_102x_sequence.index(jetSequence),extraFlagsProducers102x)
470 _102x_sequence.insert(_102x_sequence.index(simpleCleanerTable)+1,extraFlagsTable)
472 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1:
473 modifier.toReplaceWith(nanoSequenceCommon, _102x_sequence)
def nanoAOD_addDeepInfo(process, addDeepBTag, addDeepFlavour)
def addToProcessAndTask(label, module, process, task)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
S & print(S &os, JobReport::InputFile const &f)
def nanoAOD_customizeMC(process)
def nanoAOD_activateVID(process)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def nanoWmassGenCustomize(process)
def nanoAOD_customizeCommon(process)
def nanoAOD_recalibrateMETs(process, isData)
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
def nanoAOD_runMETfixEE2017(process, isData)
static std::string join(char **cmd)
def nanoAOD_addTauIds(process)
def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph)
def getPatAlgosToolsTask(process)
def nanoAOD_addBoostedTauIds(process)
def runMetCorAndUncFromMiniAOD(process, metType="PF", jetCollUnskimmed="slimmedJets", photonColl="slimmedPhotons", electronColl="slimmedElectrons", muonColl="slimmedMuons", tauColl="slimmedTaus", pfCandColl="packedPFCandidates", jetFlavor="AK4PFchs", jetCleaning="LepClean", isData=False, manualJetConfig=False, reclusterJets=None, jetSelection="pt>15 && abs(eta)<9.9", recoMetFromPFCs=None, jetCorLabelL3="ak4PFCHSL1FastL2L3Corrector", jetCorLabelRes="ak4PFCHSL1FastL2L3ResidualCorrector", CHS=False, reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, postfix="")
def nanoAOD_customizeData(process)