CMS 3D CMS Logo

Functions | Variables
nano_cff Namespace Reference

Functions

def nanoAOD_activateVID (process)
 
def nanoAOD_addBoostedTauIds (process)
 
def nanoAOD_addDeepInfo (process, addDeepBTag, addDeepFlavour)
 
def nanoAOD_addDeepInfoAK8 (process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
 
def nanoAOD_addDeepMET (process, addDeepMETProducer, ResponseTune_Graph)
 
def nanoAOD_addTauIds (process)
 
def nanoAOD_customizeCommon (process)
 
def nanoAOD_customizeData (process)
 
def nanoAOD_customizeMC (process)
 
def nanoAOD_recalibrateMETs (process, isData)
 
def nanoAOD_runMETfixEE2017 (process, isData)
 
def nanoWmassGenCustomize (process)
 

Variables

 _102x_sequence
 
 _80x_sequence
 Era dependent customization. More...
 
 bool
 
 btagSFdir
 
 btagWeightTable
 
 cut
 
 discNames
 
 discShortNames
 
 doc
 
 electronName
 
 electrons
 
 electronSel
 
 extraFlagsTable
 
 Flag_ecalBadCalibFilterV2
 
 jetName
 
 jets
 
 jetSel
 
 l1bits
 
 legacyL1
 
 lhcInfoTable
 
 lheInfo
 
 lheInfoTable
 
 linkedObjects
 
 measurementTypesB
 
 measurementTypesC
 
 measurementTypesUDSG
 
 muonName
 
 muons
 
 muonSel
 
 name
 
 nanoMetadata
 
 nanoSequence
 
 nanoSequenceCommon
 
 nanoSequenceFS
 
 nanoSequenceMC
 
 nanoSequenceOnlyData
 
 nanoSequenceOnlyFullSim
 
 operatingPoints
 
 photonName
 
 photons
 
 photonSel
 
 precision
 
 simpleCleanerTable
 
 src
 
 src_ext
 
 storeLHEParticles
 
 storeUnprefireableBit
 
 strings
 
 sysTypes
 
 tag
 
 tauName
 
 taus
 
 tauSel
 
 variables
 
 weightFiles
 

Function Documentation

def nano_cff.nanoAOD_activateVID (   process)

Definition at line 278 of file nano_cff.py.

References vid_id_tools.setupAllVIDIdsInModule(), vid_id_tools.switchOnVIDElectronIdProducer(), and vid_id_tools.switchOnVIDPhotonIdProducer().

Referenced by nanoAOD_customizeCommon().

278 def nanoAOD_activateVID(process):
279  switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD)
280  for modname in electron_id_modules_WorkingPoints_nanoAOD.modules:
281  setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection)
282  process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence)
283  for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1:
284  modifier.toModify(process.electronMVAValueMapProducer, srcMiniAOD = "slimmedElectronsUpdated")
285  modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsUpdated")
286 
287  run2_nanoAOD_106Xv2.toModify(process.electronMVAValueMapProducer, src = "slimmedElectrons")
288  run2_nanoAOD_106Xv2.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectrons")
289  switchOnVIDPhotonIdProducer(process,DataFormat.MiniAOD) # do not call this to avoid resetting photon IDs in VID, if called before inside makePuppiesFromMiniAOD
290  for modname in photon_id_modules_WorkingPoints_nanoAOD.modules:
291  setupAllVIDIdsInModule(process,modname,setupVIDPhotonSelection)
292  process.photonSequence.insert(process.photonSequence.index(bitmapVIDForPho),process.egmPhotonIDSequence)
293  for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1:
294  modifier.toModify(process.photonMVAValueMapProducer, srcMiniAOD = "slimmedPhotonsTo106X")
295  modifier.toModify(process.egmPhotonIDs, physicsObjectSrc = "slimmedPhotonsTo106X")
296  return process
297 
def switchOnVIDElectronIdProducer(process, dataFormat, task=None)
Electrons.
Definition: vid_id_tools.py:66
def setupAllVIDIdsInModule(process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None)
Definition: vid_id_tools.py:49
def nanoAOD_activateVID(process)
Definition: nano_cff.py:278
def switchOnVIDPhotonIdProducer(process, dataFormat, task=None)
Photons.
def nano_cff.nanoAOD_addBoostedTauIds (   process)

Definition at line 156 of file nano_cff.py.

Referenced by nanoAOD_customizeCommon().

157  updatedBoostedTauName = "slimmedTausBoostedNewID"
158  boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug=False,
159  originalTauName = "slimmedTausBoosted",
160  updatedTauName = updatedBoostedTauName,
161  postfix="Boosted",
162  toKeep = [ "2017v2", "dR0p32017v2", "newDM2017v2", "againstEle2018",])
163  boostedTauIdEmbedder.runTauID()
164  process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
165  process.rerunMvaIsolationSequenceBoosted)
166 
167  process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
168  getattr(process, updatedBoostedTauName))
169 
170  return process
171 
172 
def nanoAOD_addBoostedTauIds(process)
Definition: nano_cff.py:156
def nano_cff.nanoAOD_addDeepInfo (   process,
  addDeepBTag,
  addDeepFlavour 
)

Definition at line 174 of file nano_cff.py.

References join(), and edm.print().

Referenced by nanoAOD_customizeCommon().

174 def nanoAOD_addDeepInfo(process,addDeepBTag,addDeepFlavour):
175  _btagDiscriminators=[]
176  if addDeepBTag:
177  print("Updating process to run DeepCSV btag")
178  _btagDiscriminators += ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb','pfDeepCSVJetTags:probc']
179  if addDeepFlavour:
180  print("Updating process to run DeepFlavour btag")
181  _btagDiscriminators += ['pfDeepFlavourJetTags:probb','pfDeepFlavourJetTags:probbb','pfDeepFlavourJetTags:problepb','pfDeepFlavourJetTags:probc']
182  if len(_btagDiscriminators)==0: return process
183  print("Will recalculate the following discriminators: "+", ".join(_btagDiscriminators))
184  updateJetCollection(
185  process,
186  jetSource = cms.InputTag('slimmedJets'),
187  jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual']), 'None'),
188  btagDiscriminators = _btagDiscriminators,
189  postfix = 'WithDeepInfo',
190  )
191  process.load("Configuration.StandardSequences.MagneticField_cff")
192  process.jetCorrFactorsNano.src="selectedUpdatedPatJetsWithDeepInfo"
193  process.updatedJets.jetSource="selectedUpdatedPatJetsWithDeepInfo"
194  return process
195 
def nanoAOD_addDeepInfo(process, addDeepBTag, addDeepFlavour)
Definition: nano_cff.py:174
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def nano_cff.nanoAOD_addDeepInfoAK8 (   process,
  addDeepBTag,
  addDeepBoostedJet,
  addDeepDoubleX,
  addDeepDoubleXV2,
  addParticleNet,
  addParticleNetMass,
  jecPayload 
)

Definition at line 298 of file nano_cff.py.

References join(), and edm.print().

Referenced by nanoAOD_customizeCommon().

298 def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload):
299  _btagDiscriminators=[]
300  if addDeepBTag:
301  print("Updating process to run DeepCSV btag to AK8 jets")
302  _btagDiscriminators += ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb']
303  if addDeepBoostedJet:
304  print("Updating process to run DeepBoostedJet on datasets before 103X")
305  from RecoBTag.ONNXRuntime.pfDeepBoostedJet_cff import _pfDeepBoostedJetTagsAll as pfDeepBoostedJetTagsAll
306  _btagDiscriminators += pfDeepBoostedJetTagsAll
307  if addParticleNet:
308  print("Updating process to run ParticleNet before it's included in MiniAOD")
309  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll
310  _btagDiscriminators += pfParticleNetJetTagsAll
311  if addParticleNetMass:
312  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassRegressionOutputs
313  _btagDiscriminators += _pfParticleNetMassRegressionOutputs
314  if addDeepDoubleX:
315  print("Updating process to run DeepDoubleX on datasets before 104X")
316  _btagDiscriminators += ['pfDeepDoubleBvLJetTags:probHbb', \
317  'pfDeepDoubleCvLJetTags:probHcc', \
318  'pfDeepDoubleCvBJetTags:probHcc', \
319  'pfMassIndependentDeepDoubleBvLJetTags:probHbb', 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', 'pfMassIndependentDeepDoubleCvBJetTags:probHcc']
320  if addDeepDoubleXV2:
321  print("Updating process to run DeepDoubleXv2 on datasets before 11X")
322  _btagDiscriminators += [
323  'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
324  'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
325  'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc'
326  ]
327  if len(_btagDiscriminators)==0: return process
328  print("Will recalculate the following discriminators on AK8 jets: "+", ".join(_btagDiscriminators))
329  updateJetCollection(
330  process,
331  jetSource = cms.InputTag('slimmedJetsAK8'),
332  pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
333  svSource = cms.InputTag('slimmedSecondaryVertices'),
334  rParam = 0.8,
335  jetCorrections = (jecPayload.value(), cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute', 'L2L3Residual']), 'None'),
336  btagDiscriminators = _btagDiscriminators,
337  postfix='AK8WithDeepInfo',
338  printWarning = False
339  )
340  process.jetCorrFactorsAK8.src="selectedUpdatedPatJetsAK8WithDeepInfo"
341  process.updatedJetsAK8.jetSource="selectedUpdatedPatJetsAK8WithDeepInfo"
342  return process
343 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
Definition: nano_cff.py:298
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def nano_cff.nanoAOD_addDeepMET (   process,
  addDeepMETProducer,
  ResponseTune_Graph 
)

Definition at line 196 of file nano_cff.py.

References edm.print().

Referenced by nanoAOD_recalibrateMETs().

196 def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph):
197  if addDeepMETProducer:
198  # produce DeepMET on the fly if it is not in MiniAOD
199  print("add DeepMET Producers")
200  process.load('RecoMET.METPUSubtraction.deepMETProducer_cfi')
201  process.deepMETsResolutionTune = process.deepMETProducer.clone()
202  process.deepMETsResponseTune = process.deepMETProducer.clone()
203  #process.deepMETsResponseTune.graph_path = 'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb'
204  process.deepMETsResponseTune.graph_path = ResponseTune_Graph.value()
205  process.metTables += process.deepMetTables
206  return process
207 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph)
Definition: nano_cff.py:196
def nano_cff.nanoAOD_addTauIds (   process)

Definition at line 147 of file nano_cff.py.

Referenced by nanoAOD_customizeCommon().

147 def nanoAOD_addTauIds(process):
148  updatedTauName = "slimmedTausUpdated"
149  tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug = False, updatedTauName = updatedTauName,
150  toKeep = [ "deepTau2017v2p1" ])
151  tauIdEmbedder.runTauID()
152  process.patTauMVAIDsSeq.insert(process.patTauMVAIDsSeq.index(getattr(process, updatedTauName)),
153  process.rerunMvaIsolationSequence)
154  return process
155 
def nanoAOD_addTauIds(process)
Definition: nano_cff.py:147
def nano_cff.nanoAOD_customizeCommon (   process)

Definition at line 352 of file nano_cff.py.

References puppiForMET_cff.makePuppiesFromMiniAOD(), nanoAOD_activateVID(), nanoAOD_addBoostedTauIds(), nanoAOD_addDeepInfo(), nanoAOD_addDeepInfoAK8(), and nanoAOD_addTauIds().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

353  makePuppiesFromMiniAOD(process,True)
354  process.puppiNoLep.useExistingWeights = True
355  process.puppi.useExistingWeights = True
356  run2_nanoAOD_106Xv1.toModify(process.puppiNoLep, useExistingWeights = False)
357  run2_nanoAOD_106Xv1.toModify(process.puppi, useExistingWeights = False)
358  process = nanoAOD_activateVID(process)
359  nanoAOD_addDeepInfo_switch = cms.PSet(
360  nanoAOD_addDeepBTag_switch = cms.untracked.bool(False),
361  nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(False),
362  )
363  run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepBTag_switch = cms.untracked.bool(True))
364  for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
365  modifier.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(True))
366  process = nanoAOD_addDeepInfo(process,
367  addDeepBTag=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepBTag_switch,
368  addDeepFlavour=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepFlavourTag_switch)
369  nanoAOD_addDeepInfoAK8_switch = cms.PSet(
370  nanoAOD_addDeepBTag_switch = cms.untracked.bool(False),
371  nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(True),
372  nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(True),
373  nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(True),
374  nanoAOD_addParticleNet_switch = cms.untracked.bool(True),
375  nanoAOD_addParticleNetMass_switch = cms.untracked.bool(True),
376  jecPayload = cms.untracked.string('AK8PFPuppi')
377  )
378  # Don't run on old mini due to compatibility
379  # 80X contains ak8PFJetsCHS jets instead of puppi
380  run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfoAK8_switch,
381  nanoAOD_addDeepBTag_switch = True,
382  nanoAOD_addDeepBoostedJet_switch = False,
383  nanoAOD_addDeepDoubleX_switch = False,
384  nanoAOD_addDeepDoubleXV2_switch = False,
385  nanoAOD_addParticleNet_switch = False,
386  nanoAOD_addParticleNetMass_switch = False,
387  jecPayload = 'AK8PFchs')
388  # Don't rerun where already present
389  (run2_miniAOD_devel).toModify(
390  nanoAOD_addDeepInfoAK8_switch,
391  nanoAOD_addParticleNetMass_switch = False,
392  )
393  (run2_nanoAOD_106Xv2 | run2_miniAOD_devel).toModify(
394  nanoAOD_addDeepInfoAK8_switch,
395  nanoAOD_addDeepBoostedJet_switch = False,
396  nanoAOD_addDeepDoubleX_switch = False,
397  nanoAOD_addDeepDoubleXV2_switch = False,
398  nanoAOD_addParticleNet_switch = False,
399  )
400  run2_nanoAOD_106Xv1.toModify(
401  nanoAOD_addDeepInfoAK8_switch,
402  nanoAOD_addDeepBoostedJet_switch = False,
403  nanoAOD_addDeepDoubleX_switch = False,
404  )
405  # no-change policy
406  (run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(
407  nanoAOD_addDeepInfoAK8_switch,
408  nanoAOD_addParticleNetMass_switch = False,
409  )
410  process = nanoAOD_addDeepInfoAK8(process,
411  addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch,
412  addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch,
413  addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch,
414  addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch,
415  addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch,
416  addParticleNetMass=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNetMass_switch,
417  jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload)
418  addTauIds_switch = cms.PSet(
419  nanoAOD_addTauIds_switch = cms.untracked.bool(True),
420  nanoAOD_addBoostedTauIds_switch = cms.untracked.bool(True)
421  )
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, nanoAOD_addTauIds_switch = False)
424  (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toModify(addTauIds_switch, nanoAOD_addBoostedTauIds_switch = False)
425  if addTauIds_switch.nanoAOD_addTauIds_switch:
426  process = nanoAOD_addTauIds(process)
427  if addTauIds_switch.nanoAOD_addBoostedTauIds_switch:
428  process = nanoAOD_addBoostedTauIds(process)
429  return process
430 
def nanoAOD_addDeepInfo(process, addDeepBTag, addDeepFlavour)
Definition: nano_cff.py:174
def nanoAOD_activateVID(process)
Definition: nano_cff.py:278
def nanoAOD_customizeCommon(process)
Definition: nano_cff.py:352
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
Definition: nano_cff.py:298
def nanoAOD_addTauIds(process)
Definition: nano_cff.py:147
def nanoAOD_addBoostedTauIds(process)
Definition: nano_cff.py:156
def makePuppiesFromMiniAOD(process, createScheduledSequence=False)
def nano_cff.nanoAOD_customizeData (   process)

Definition at line 431 of file nano_cff.py.

References nanoAOD_customizeCommon(), nanoAOD_recalibrateMETs(), and nanoAOD_runMETfixEE2017().

432  process = nanoAOD_customizeCommon(process)
433  process = nanoAOD_recalibrateMETs(process,isData=True)
434  for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
435  modifier.toModify(process, lambda p: nanoAOD_runMETfixEE2017(p,isData=True))
436  return process
437 
def nanoAOD_customizeCommon(process)
Definition: nano_cff.py:352
def nanoAOD_recalibrateMETs(process, isData)
Definition: nano_cff.py:210
def nanoAOD_runMETfixEE2017(process, isData)
Definition: nano_cff.py:345
def nanoAOD_customizeData(process)
Definition: nano_cff.py:431
def nano_cff.nanoAOD_customizeMC (   process)

Definition at line 438 of file nano_cff.py.

References nanoAOD_customizeCommon(), nanoAOD_recalibrateMETs(), and nanoAOD_runMETfixEE2017().

438 def nanoAOD_customizeMC(process):
439  process = nanoAOD_customizeCommon(process)
440  process = nanoAOD_recalibrateMETs(process,isData=False)
441  for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
442  modifier.toModify(process, lambda p: nanoAOD_runMETfixEE2017(p,isData=False))
443  return process
444 
def nanoAOD_customizeMC(process)
Definition: nano_cff.py:438
def nanoAOD_customizeCommon(process)
Definition: nano_cff.py:352
def nanoAOD_recalibrateMETs(process, isData)
Definition: nano_cff.py:210
def nanoAOD_runMETfixEE2017(process, isData)
Definition: nano_cff.py:345
def nano_cff.nanoAOD_recalibrateMETs (   process,
  isData 
)

Definition at line 210 of file nano_cff.py.

References helpers.addToProcessAndTask(), bool, helpers.getPatAlgosToolsTask(), nanoAOD_addDeepMET(), runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD(), and common_cff.Var().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

210 def nanoAOD_recalibrateMETs(process,isData):
211  # add DeepMETs
212  nanoAOD_DeepMET_switch = cms.PSet(
213  nanoAOD_addDeepMET_switch = cms.untracked.bool(True), # decide if DeeMET should be included in Nano
214  nanoAOD_produceDeepMET_switch = cms.untracked.bool(False), # decide if DeepMET should be computed on the fly
215  ResponseTune_Graph = cms.untracked.string('RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb')
216  )
217  # compute DeepMETs for the eras before UL-ReminiAOD
218  (~(run2_nanoAOD_106Xv2 | run2_miniAOD_devel)).toModify(nanoAOD_DeepMET_switch, nanoAOD_produceDeepMET_switch = cms.untracked.bool(True))
219  for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
220  modifier.toModify(nanoAOD_DeepMET_switch, ResponseTune_Graph=cms.untracked.string("RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb"))
221  if nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch:
222  process = nanoAOD_addDeepMET(process,
223  addDeepMETProducer=nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch,
224  ResponseTune_Graph=nanoAOD_DeepMET_switch.ResponseTune_Graph)
225 
226  # if included in Nano, and not computed in the fly, then it should be extracted from minAOD
227  extractDeepMETs = nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch and not nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch
228 
229  runMetCorAndUncFromMiniAOD(process,isData=isData, extractDeepMETs=extractDeepMETs)
230  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.fullPatMetSequence))
231  process.basicJetsForMetForT1METNano = process.basicJetsForMet.clone(
232  src = process.updatedJetsWithUserData.src,
233  skipEM = False,
234  type1JetPtThreshold = 0.0,
235  calcMuonSubtrRawPtAsValueMap = cms.bool(True),
236  )
237  process.jetSequence.insert(process.jetSequence.index(process.updatedJetsWithUserData),cms.Sequence(process.basicJetsForMetForT1METNano))
238  process.updatedJetsWithUserData.userFloats.muonSubtrRawPt = cms.InputTag("basicJetsForMetForT1METNano:MuonSubtrRawPt")
239  process.corrT1METJetTable.src = process.finalJets.src
240  process.corrT1METJetTable.cut = "pt<15 && abs(eta)<9.9"
241  for table in process.jetTable, process.corrT1METJetTable:
242  table.variables.muonSubtrFactor = Var("1-userFloat('muonSubtrRawPt')/(pt()*jecFactor('Uncorrected'))",float,doc="1-(muon-subtracted raw pt)/(raw pt)",precision=6)
243  process.metTables += process.corrT1METJetTable
244 # makePuppiesFromMiniAOD(process,True) # call this before in the global customizer otherwise it would reset photon IDs in VID
245  nanoAOD_PuppiV15_switch = cms.PSet(
246  recoMetFromPFCs = cms.untracked.bool(False),
247  reclusterJets = cms.untracked.bool(False),
248  )
249  run2_nanoAOD_106Xv1.toModify(nanoAOD_PuppiV15_switch,recoMetFromPFCs=True,reclusterJets=True)
250  if nanoAOD_PuppiV15_switch.reclusterJets:
251  from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
252  from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
253  task = getPatAlgosToolsTask(process)
254  addToProcessAndTask('ak4PuppiJets', ak4PFJets.clone (src = 'puppi', doAreaFastjet = True, jetPtMin = 10.), process, task)
255  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
256  addJetCollection(process,
257  labelName = 'Puppi',
258  jetSource = cms.InputTag('ak4PuppiJets'),
259  algo = 'AK', rParam=0.4,
260  genJetCollection=cms.InputTag('slimmedGenJets'),
261  jetCorrections = ('AK4PFPuppi', ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'], 'None'),
262  pfCandidates = cms.InputTag('packedPFCandidates'),
263  pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
264  svSource = cms.InputTag('slimmedSecondaryVertices'),
265  muSource =cms.InputTag( 'slimmedMuons'),
266  elSource = cms.InputTag('slimmedElectrons'),
267  genParticles= cms.InputTag('prunedGenParticles'),
268  getJetMCFlavour= False
269  )
270  process.patJetsPuppi.addGenPartonMatch = cms.bool(False)
271  process.patJetsPuppi.addGenJetMatch = cms.bool(False)
272 
273  runMetCorAndUncFromMiniAOD(process,isData=isData,metType="Puppi",postfix="Puppi",jetFlavor="AK4PFPuppi", recoMetFromPFCs=bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=bool(nanoAOD_PuppiV15_switch.reclusterJets))
274  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi))
275  return process
276 
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:29
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def nanoAOD_recalibrateMETs(process, isData)
Definition: nano_cff.py:210
def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph)
Definition: nano_cff.py:196
def getPatAlgosToolsTask(process)
Definition: helpers.py:14
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 nano_cff.nanoAOD_runMETfixEE2017 (   process,
  isData 
)

Definition at line 345 of file nano_cff.py.

References runMETCorrectionsAndUncertainties.runMetCorAndUncFromMiniAOD().

Referenced by nanoAOD_customizeData(), and nanoAOD_customizeMC().

345 def nanoAOD_runMETfixEE2017(process,isData):
346  runMetCorAndUncFromMiniAOD(process,isData=isData,
347  fixEE2017 = True,
348  fixEE2017Params = {'userawPt': True, 'ptThreshold':50.0, 'minEtaThreshold':2.65, 'maxEtaThreshold': 3.139},
349  postfix = "FixEE2017")
350  process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),process.fullPatMetSequenceFixEE2017)
351 
def nanoAOD_runMETfixEE2017(process, isData)
Definition: nano_cff.py:345
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 nano_cff.nanoWmassGenCustomize (   process)

Definition at line 445 of file nano_cff.py.

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)"
447  # Keep precision same as default RECO for selected particles
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)
454  return process
455 
def nanoWmassGenCustomize(process)
Definition: nano_cff.py:445

Variable Documentation

nano_cff._102x_sequence
private

Definition at line 467 of file nano_cff.py.

nano_cff._80x_sequence
private

Era dependent customization.

Definition at line 457 of file nano_cff.py.

nano_cff.bool

Definition at line 143 of file nano_cff.py.

Referenced by nanoAOD_recalibrateMETs().

nano_cff.btagSFdir

Definition at line 57 of file nano_cff.py.

nano_cff.btagWeightTable

Definition at line 59 of file nano_cff.py.

nano_cff.cut

Definition at line 61 of file nano_cff.py.

nano_cff.discNames

Definition at line 62 of file nano_cff.py.

nano_cff.discShortNames

Definition at line 67 of file nano_cff.py.

nano_cff.doc

Definition at line 42 of file nano_cff.py.

nano_cff.electronName

Definition at line 53 of file nano_cff.py.

nano_cff.electrons

Definition at line 35 of file nano_cff.py.

nano_cff.electronSel

Definition at line 50 of file nano_cff.py.

nano_cff.extraFlagsTable

Definition at line 142 of file nano_cff.py.

nano_cff.Flag_ecalBadCalibFilterV2

Definition at line 143 of file nano_cff.py.

nano_cff.jetName

Definition at line 53 of file nano_cff.py.

nano_cff.jets

Definition at line 33 of file nano_cff.py.

nano_cff.jetSel

Definition at line 48 of file nano_cff.py.

nano_cff.l1bits

Definition at line 106 of file nano_cff.py.

nano_cff.legacyL1

Definition at line 106 of file nano_cff.py.

nano_cff.lhcInfoTable

Definition at line 95 of file nano_cff.py.

nano_cff.lheInfo

Definition at line 101 of file nano_cff.py.

nano_cff.lheInfoTable

Definition at line 100 of file nano_cff.py.

nano_cff.linkedObjects

Definition at line 32 of file nano_cff.py.

nano_cff.measurementTypesB

Definition at line 78 of file nano_cff.py.

nano_cff.measurementTypesC

Definition at line 79 of file nano_cff.py.

nano_cff.measurementTypesUDSG

Definition at line 80 of file nano_cff.py.

nano_cff.muonName

Definition at line 53 of file nano_cff.py.

Referenced by main().

nano_cff.muons

Definition at line 34 of file nano_cff.py.

nano_cff.muonSel

Definition at line 49 of file nano_cff.py.

nano_cff.name

Definition at line 41 of file nano_cff.py.

nano_cff.nanoMetadata

Definition at line 26 of file nano_cff.py.

nano_cff.nanoSequence

Definition at line 123 of file nano_cff.py.

nano_cff.nanoSequenceCommon

Definition at line 110 of file nano_cff.py.

nano_cff.nanoSequenceFS

Definition at line 127 of file nano_cff.py.

nano_cff.nanoSequenceMC

Definition at line 137 of file nano_cff.py.

nano_cff.nanoSequenceOnlyData

Definition at line 121 of file nano_cff.py.

nano_cff.nanoSequenceOnlyFullSim

Definition at line 119 of file nano_cff.py.

nano_cff.operatingPoints

Definition at line 77 of file nano_cff.py.

nano_cff.photonName

Definition at line 54 of file nano_cff.py.

nano_cff.photons

Definition at line 37 of file nano_cff.py.

nano_cff.photonSel

Definition at line 52 of file nano_cff.py.

nano_cff.precision

Definition at line 96 of file nano_cff.py.

nano_cff.simpleCleanerTable

Definition at line 40 of file nano_cff.py.

nano_cff.src

Definition at line 60 of file nano_cff.py.

nano_cff.src_ext

Definition at line 107 of file nano_cff.py.

nano_cff.storeLHEParticles

Definition at line 103 of file nano_cff.py.

nano_cff.storeUnprefireableBit

Definition at line 107 of file nano_cff.py.

nano_cff.strings
nano_cff.sysTypes

Definition at line 81 of file nano_cff.py.

nano_cff.tag

Definition at line 28 of file nano_cff.py.

nano_cff.tauName

Definition at line 54 of file nano_cff.py.

nano_cff.taus

Definition at line 36 of file nano_cff.py.

Referenced by HLTTauDQML1Plotter.analyze(), TopTauAnalyzer.analyze(), PatBasicAnalyzer.analyze(), l1t::L1TStage2CaloAnalyzer.analyze(), ResolutionCreator.analyze(), TauValidationMiniAOD.analyze(), l1t::GtInputDump.analyze(), l1t::L1TGlobalAnalyzer.analyze(), l1t::GtRecordDump.analyze(), L1TTauOffline.analyze(), HPSPFRecoTauAlgorithm.buildOneProng(), HPSPFRecoTauAlgorithm.buildOneProngStrip(), HPSPFRecoTauAlgorithm.buildOneProngTwoStrips(), HPSPFRecoTauAlgorithm.buildThreeProngs(), L1TStage2CaloLayer2Comp.compareTaus(), l1t::GtRecordDump.dumpTestVectors(), L1RCTJetSummaryCard.fillTauBits(), pat::PATLeptonCountFilter.filter(), L1RCT.getRegions(), deep_tau::DeepTauBase.globalEndJob(), HLTPFTauPairLeadTrackDzMatchFilter.hltFilter(), HLTFiltCand.hltFilter(), L1TSummary.L1TSummary(), L1UpgradeTreeProducer.L1UpgradeTreeProducer(), deep_tau::DeepTauBase::Output.Output(), l1t::stage2::TauPacker.pack(), l1t::stage1::TauPacker.pack(), l1t::stage1::IsoTauPacker.pack(), TtDilepEvtSolutionMaker.produce(), PFJetsTauOverlapRemoval.produce(), PFTauL1TJetsMatching.produce(), RecoTauPiZeroUnembedder.produce(), pat::__class__Producer.produce(), l1t::FakeInputProducer.produce(), PATObjectCrossLinker.produce(), RecoTauProducer.produce(), NanoAODBaseCrossCleaner.produce(), L1TStage2Layer2Producer.produce(), l1t::GenToInputProducer.produce(), l1t::BXVectorInputProducer.produce(), TauDiscriminationProducerBase< TauType, TauDiscriminator >.produce(), L1TStage1Layer2Producer.produce(), deep_tau::DeepTauBase.produce(), HepMCValidationHelper.removeIsolatedLeptons(), HLTL1TSeed.seedsL1TriggerObjectMaps(), and TauJetCorrector::ParametrizationTauJet.value().

nano_cff.tauSel

Definition at line 51 of file nano_cff.py.

nano_cff.variables

Definition at line 142 of file nano_cff.py.

nano_cff.weightFiles

Definition at line 72 of file nano_cff.py.