CMS 3D CMS Logo

Functions | Variables
custom_jme_cff Namespace Reference

Functions

def AddBTaggingScores (proc, jetTableName="")
 
def AddDeepJetGluonLQuarkScores (proc, jetTableName="")
 
def AddJetID (proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
 
def AddNewGenJets (proc, genJetInfo)
 
def AddNewPatJets (proc, recoJetInfo, runOnMC)
 
def AddParticleNetAK4Scores (proc, jetTableName="")
 
def AddPileUpJetIDVars (proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
 
def AddQGLTaggerVars (proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False)
 
def AddVariablesForAK4GenJets (proc)
 
def AddVariablesForAK8GenJets (proc)
 
def AddVariablesForAK8PuppiJets (proc)
 
def PrepJMECustomNanoAOD (process, runOnMC)
 
def PrepJMECustomNanoAOD_Data (process)
 
def PrepJMECustomNanoAOD_MC (process)
 
def ReclusterAK4CHSJets (proc, recoJA, runOnMC)
 
def ReclusterAK4GenJets (proc, genJA)
 
def RemoveAllJetPtCuts (proc)
 
def SaveGenJets (proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
 
def SavePatJets (proc, jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc, doPF, doCalo, ptcut="", doPUIDVar=False, doQGL=False, doBTag=False, runOnMC=False)
 

Variables

 area
 
 bTagCSVV2
 
 btagCSVV2
 
 btagDeepB
 
 bTagDeepCSV
 
 btagDeepCvL
 
 btagDeepFlavB
 
 btagDeepFlavC
 
 btagDeepFlavG
 
 btagDeepFlavUDS
 
 bTagDeepJet
 
 bTagDiscriminatorsForAK4
 
 BTAGVARS
 
 CALOJETVARS
 
 chEmEF
 
 chHEF
 
 config_genjets
 
 config_recojets
 
 DEEPJETVARS
 
 doc
 
 emf
 
 float
 
 GENJETVARS
 
 hfEmEF
 
 hfHEF
 
 int
 
 muEF
 
 nanoInfo_genjets
 
 nanoInfo_recojets
 
 nConstChHads
 
 nConstElecs
 
 nConstHFEMs
 
 nConstHFHads
 
 nConstituents
 
 nConstMuons
 
 nConstNeuHads
 
 nConstPhotons
 
 neEmEF
 
 neHEF
 
 nElectrons
 
 nMuons
 
 particleNetAK4_B
 
 particleNetAK4_CvsB
 
 particleNetAK4_CvsL
 
 particleNetAK4_puIdDisc
 
 particleNetAK4_QvsG
 
 PARTICLENETAK4VARS
 
 PFJETVARS
 
 precision
 
 puId_beta
 
 puId_dR2Mean
 
 puId_frac01
 
 puId_frac02
 
 puId_frac03
 
 puId_frac04
 
 puId_jetR
 
 puId_jetRchg
 
 puId_majW
 
 puId_minW
 
 puId_nCharged
 
 puId_ptD
 
 puId_pull
 
 PUIDVARS
 
 qgl_axis2
 
 qgl_mult
 
 qgl_ptD
 
 QGLVARS
 
 rawFactor
 

Function Documentation

def custom_jme_cff.AddBTaggingScores (   proc,
  jetTableName = "" 
)
Store b-tagging scores from various algortihm

Definition at line 367 of file custom_jme_cff.py.

Referenced by SavePatJets().

367 def AddBTaggingScores(proc, jetTableName=""):
368  """
369  Store b-tagging scores from various algortihm
370  """
371 
372  getattr(proc, jetTableName).variables.btagDeepB = jetTable.variables.btagDeepB
373  getattr(proc, jetTableName).variables.btagCSVV2 = jetTable.variables.btagCSVV2
374  getattr(proc, jetTableName).variables.btagDeepCvL = jetTable.variables.btagDeepCvL
375  getattr(proc, jetTableName).variables.btagDeepFlavB = jetTable.variables.btagDeepFlavB
376  getattr(proc, jetTableName).variables.btagDeepFlavCvL = jetTable.variables.btagDeepFlavCvL
377 
378  return proc
379 
def AddBTaggingScores(proc, jetTableName="")
def custom_jme_cff.AddDeepJetGluonLQuarkScores (   proc,
  jetTableName = "" 
)
Store DeepJet raw score in jetTable for gluon and light quark

Definition at line 380 of file custom_jme_cff.py.

Referenced by SavePatJets().

380 def AddDeepJetGluonLQuarkScores(proc, jetTableName=""):
381  """
382  Store DeepJet raw score in jetTable for gluon and light quark
383  """
384 
385  getattr(proc, jetTableName).variables.btagDeepFlavG = DEEPJETVARS.btagDeepFlavG
386  getattr(proc, jetTableName).variables.btagDeepFlavUDS = DEEPJETVARS.btagDeepFlavUDS
387 
388  return proc
389 
def AddDeepJetGluonLQuarkScores(proc, jetTableName="")
def custom_jme_cff.AddJetID (   proc,
  jetName = "",
  jetSrc = "",
  jetTableName = "",
  jetSequenceName = "" 
)
Setup modules to calculate PF jet ID 

Definition at line 206 of file custom_jme_cff.py.

References popcon2dropbox.copy(), edm::eventsetup::heterocontainer.insert(), and common_cff.Var().

Referenced by SavePatJets().

206 def AddJetID(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName=""):
207  """
208  Setup modules to calculate PF jet ID
209  """
210 
211  isPUPPIJet = True if "Puppi" in jetName else False
212 
213  looseJetId = "looseJetId{}".format(jetName)
214  setattr(proc, looseJetId, proc.looseJetId.clone(
215  src = jetSrc,
216  filterParams=proc.looseJetId.filterParams.clone(
217  version ="WINTER16"
218  ),
219  )
220  )
221 
222  tightJetId = "tightJetId{}".format(jetName)
223  setattr(proc, tightJetId, proc.tightJetId.clone(
224  src = jetSrc,
225  filterParams=proc.tightJetId.filterParams.clone(
226  version = "SUMMER18{}".format("PUPPI" if isPUPPIJet else "")
227  ),
228  )
229  )
230 
231  tightJetIdLepVeto = "tightJetIdLepVeto{}".format(jetName)
232  setattr(proc, tightJetIdLepVeto, proc.tightJetIdLepVeto.clone(
233  src = jetSrc,
234  filterParams=proc.tightJetIdLepVeto.filterParams.clone(
235  version = "SUMMER18{}".format("PUPPI" if isPUPPIJet else "")
236  ),
237  )
238  )
239  run2_jme_2016.toModify(getattr(proc, tightJetId) .filterParams, version = "WINTER16" )
240  run2_jme_2016.toModify(getattr(proc, tightJetIdLepVeto) .filterParams, version = "WINTER16" )
241  run2_jme_2017.toModify(getattr(proc, tightJetId) .filterParams, version = "WINTER17{}".format("PUPPI" if isPUPPIJet else ""))
242  run2_jme_2017.toModify(getattr(proc, tightJetIdLepVeto) .filterParams, version = "WINTER17{}".format("PUPPI" if isPUPPIJet else ""))
243 
244  #
245  # Save variables as userInts in each jet
246  #
247  patJetWithUserData = "{}WithUserData".format(jetSrc)
248  getattr(proc, patJetWithUserData).userInts.tightId = cms.InputTag(tightJetId)
249  getattr(proc, patJetWithUserData).userInts.tightIdLepVeto = cms.InputTag(tightJetIdLepVeto)
250  run2_jme_2016.toModify(getattr(proc, patJetWithUserData).userInts, looseId = cms.InputTag(looseJetId))
251 
252  #
253  # Specfiy variables in the jetTable to save in NanoAOD
254  #
255  getattr(proc, jetTableName).variables.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")
256  run2_jme_2016.toModify(getattr(proc, jetTableName).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"))
257 
258  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, tightJetId))
259  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, tightJetId))+1, getattr(proc, tightJetIdLepVeto))
260 
261  setattr(proc,"_"+jetSequenceName+"_2016", getattr(proc,jetSequenceName).copy())
262  getattr(proc,"_"+jetSequenceName+"_2016").insert(getattr(proc, "_"+jetSequenceName+"_2016").index(getattr(proc, tightJetId)), getattr(proc, looseJetId))
263  run2_jme_2016.toReplaceWith(getattr(proc,jetSequenceName), getattr(proc, "_"+jetSequenceName+"_2016"))
264 
265  return proc
266 
def copy(args, dbName)
def AddJetID(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def custom_jme_cff.AddNewGenJets (   proc,
  genJetInfo 
)
Add genJet into custom nanoAOD

Definition at line 725 of file custom_jme_cff.py.

References SaveGenJets().

Referenced by PrepJMECustomNanoAOD().

725 def AddNewGenJets(proc, genJetInfo):
726  """
727  Add genJet into custom nanoAOD
728  """
729 
730  genJetName = genJetInfo.jetUpper
731  genJetAlgo = genJetInfo.jetAlgo
732  genJetSize = genJetInfo.jetSize
733  genJetSizeNr = genJetInfo.jetSizeNr
734  genJetFinalColl = "{}{}{}".format(genJetAlgo.upper(), genJetSize, "GenJetsNoNu")
735  genJetTablePrefix = nanoInfo_genjets[genJetInfo.jet]["name"]
736  genJetTableDoc = nanoInfo_genjets[genJetInfo.jet]["doc"]
737 
738  SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
739 
740  return proc
741 
def AddNewGenJets(proc, genJetInfo)
def SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
def custom_jme_cff.AddNewPatJets (   proc,
  recoJetInfo,
  runOnMC 
)
Add patJet into custom nanoAOD

Definition at line 403 of file custom_jme_cff.py.

References SavePatJets().

Referenced by PrepJMECustomNanoAOD().

403 def AddNewPatJets(proc, recoJetInfo, runOnMC):
404  """
405  Add patJet into custom nanoAOD
406  """
407 
408  jetName = recoJetInfo.jetUpper
409  payload = recoJetInfo.jetCorrPayload
410  doPF = recoJetInfo.doPF
411  doCalo = recoJetInfo.doCalo
412 
413  if recoJetInfo.inputCollection != "":
414  patJetFinalColl = recoJetInfo.inputCollection
415  else:
416  patJetFinalColl = "selectedUpdatedPatJets{}Final".format(jetName)
417 
418  if doCalo:
419  patJetFinalColl = "selectedPatJets{}".format(jetName)
420 
421  nanoInfoForJet = nanoInfo_recojets[recoJetInfo.jet]
422  jetTablePrefix = nanoInfoForJet["name"]
423  jetTableDoc = nanoInfoForJet["doc"]
424  ptcut = nanoInfoForJet["ptcut"] if "ptcut" in nanoInfoForJet else ""
425  doPUIDVar = nanoInfoForJet["doPUIDVar"] if "doPUIDVar" in nanoInfoForJet else False
426  doQGL = nanoInfoForJet["doQGL"] if "doQGL" in nanoInfoForJet else False
427  doBTag = nanoInfoForJet["doBTag"] if "doBTag" in nanoInfoForJet else False
428 
429  SavePatJets(proc,
430  jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc, doPF, doCalo,
431  ptcut=ptcut, doPUIDVar=doPUIDVar, doQGL=doQGL, doBTag=doBTag, runOnMC=runOnMC
432  )
433 
434  return proc
435 
def AddNewPatJets(proc, recoJetInfo, runOnMC)
def SavePatJets(proc, jetName, payload, patJetFinalColl, jetTablePrefix, jetTableDoc, doPF, doCalo, ptcut="", doPUIDVar=False, doQGL=False, doBTag=False, runOnMC=False)
def custom_jme_cff.AddParticleNetAK4Scores (   proc,
  jetTableName = "" 
)
Store ParticleNetAK4 scores in jetTable

Definition at line 390 of file custom_jme_cff.py.

Referenced by SavePatJets().

390 def AddParticleNetAK4Scores(proc, jetTableName=""):
391  """
392  Store ParticleNetAK4 scores in jetTable
393  """
394 
395  getattr(proc, jetTableName).variables.particleNetAK4_B = PARTICLENETAK4VARS.particleNetAK4_B
396  getattr(proc, jetTableName).variables.particleNetAK4_CvsL = PARTICLENETAK4VARS.particleNetAK4_CvsL
397  getattr(proc, jetTableName).variables.particleNetAK4_CvsB = PARTICLENETAK4VARS.particleNetAK4_CvsB
398  getattr(proc, jetTableName).variables.particleNetAK4_QvsG = PARTICLENETAK4VARS.particleNetAK4_QvsG
399  getattr(proc, jetTableName).variables.particleNetAK4_puIdDisc = PARTICLENETAK4VARS.particleNetAK4_puIdDisc
400 
401  return proc
402 
def AddParticleNetAK4Scores(proc, jetTableName="")
def custom_jme_cff.AddPileUpJetIDVars (   proc,
  jetName = "",
  jetSrc = "",
  jetTableName = "",
  jetSequenceName = "" 
)
Setup modules to calculate pileup jet ID input variables for PF jet

Definition at line 267 of file custom_jme_cff.py.

References edm::eventsetup::heterocontainer.insert().

Referenced by ReclusterAK4CHSJets(), and SavePatJets().

267 def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName=""):
268  """
269  Setup modules to calculate pileup jet ID input variables for PF jet
270  """
271 
272  #
273  # Calculate pileup jet ID variables
274  #
275  puJetIdVarsCalculator = "puJetIdCalculator{}".format(jetName)
276  setattr(proc, puJetIdVarsCalculator, pileupJetIdCalculator.clone(
277  jets = jetSrc,
278  vertexes = "offlineSlimmedPrimaryVertices",
279  inputIsCorrected = True,
280  applyJec = False,
281  usePuppi = True if "Puppi" in jetName else False
282  )
283  )
284  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, puJetIdVarsCalculator))
285 
286  #
287  # Get the variables
288  #
289  puJetIDVar = "puJetIDVar{}".format(jetName)
290  setattr(proc, puJetIDVar, cms.EDProducer("PileupJetIDVarProducer",
291  srcJet = cms.InputTag(jetSrc),
292  srcPileupJetId = cms.InputTag(puJetIdVarsCalculator)
293  )
294  )
295  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, puJetIdVarsCalculator))+1, getattr(proc, puJetIDVar))
296 
297  #
298  # Save variables as userFloats and userInts for each jet
299  #
300  patJetWithUserData = "{}WithUserData".format(jetSrc)
301  getattr(proc,patJetWithUserData).userFloats.puId_dR2Mean = cms.InputTag("{}:dR2Mean".format(puJetIDVar))
302  getattr(proc,patJetWithUserData).userFloats.puId_majW = cms.InputTag("{}:majW".format(puJetIDVar))
303  getattr(proc,patJetWithUserData).userFloats.puId_minW = cms.InputTag("{}:minW".format(puJetIDVar))
304  getattr(proc,patJetWithUserData).userFloats.puId_frac01 = cms.InputTag("{}:frac01".format(puJetIDVar))
305  getattr(proc,patJetWithUserData).userFloats.puId_frac02 = cms.InputTag("{}:frac02".format(puJetIDVar))
306  getattr(proc,patJetWithUserData).userFloats.puId_frac03 = cms.InputTag("{}:frac03".format(puJetIDVar))
307  getattr(proc,patJetWithUserData).userFloats.puId_frac04 = cms.InputTag("{}:frac04".format(puJetIDVar))
308  getattr(proc,patJetWithUserData).userFloats.puId_ptD = cms.InputTag("{}:ptD".format(puJetIDVar))
309  getattr(proc,patJetWithUserData).userFloats.puId_beta = cms.InputTag("{}:beta".format(puJetIDVar))
310  getattr(proc,patJetWithUserData).userFloats.puId_pull = cms.InputTag("{}:pull".format(puJetIDVar))
311  getattr(proc,patJetWithUserData).userFloats.puId_jetR = cms.InputTag("{}:jetR".format(puJetIDVar))
312  getattr(proc,patJetWithUserData).userFloats.puId_jetRchg = cms.InputTag("{}:jetRchg".format(puJetIDVar))
313  getattr(proc,patJetWithUserData).userInts.puId_nCharged = cms.InputTag("{}:nCharged".format(puJetIDVar))
314 
315  #
316  # Specfiy variables in the jet table to save in NanoAOD
317  #
318  getattr(proc,jetTableName).variables.puId_dR2Mean = PUIDVARS.puId_dR2Mean
319  getattr(proc,jetTableName).variables.puId_majW = PUIDVARS.puId_majW
320  getattr(proc,jetTableName).variables.puId_minW = PUIDVARS.puId_minW
321  getattr(proc,jetTableName).variables.puId_frac01 = PUIDVARS.puId_frac01
322  getattr(proc,jetTableName).variables.puId_frac02 = PUIDVARS.puId_frac02
323  getattr(proc,jetTableName).variables.puId_frac03 = PUIDVARS.puId_frac03
324  getattr(proc,jetTableName).variables.puId_frac04 = PUIDVARS.puId_frac04
325  getattr(proc,jetTableName).variables.puId_ptD = PUIDVARS.puId_ptD
326  getattr(proc,jetTableName).variables.puId_beta = PUIDVARS.puId_beta
327  getattr(proc,jetTableName).variables.puId_pull = PUIDVARS.puId_pull
328  getattr(proc,jetTableName).variables.puId_jetR = PUIDVARS.puId_jetR
329  getattr(proc,jetTableName).variables.puId_jetRchg = PUIDVARS.puId_jetRchg
330  getattr(proc,jetTableName).variables.puId_nCharged = PUIDVARS.puId_nCharged
331 
332  return proc
333 
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
def custom_jme_cff.AddQGLTaggerVars (   proc,
  jetName = "",
  jetSrc = "",
  jetTableName = "",
  jetSequenceName = "",
  calculateQGLVars = False 
)
Schedule the QGTagger module to calculate input variables to the QG likelihood 

Definition at line 334 of file custom_jme_cff.py.

References edm::eventsetup::heterocontainer.insert().

Referenced by SavePatJets().

334 def AddQGLTaggerVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False):
335  """
336  Schedule the QGTagger module to calculate input variables to the QG likelihood
337  """
338 
339  QGLTagger="qgtagger{}".format(jetName)
340  patJetWithUserData="{}WithUserData".format(jetSrc)
341 
342  if calculateQGLVars:
343  setattr(proc, QGLTagger, qgtagger.clone(
344  srcJets=jetSrc
345  )
346  )
347 
348  #
349  # Save variables as userFloats and userInts for each jet
350  #
351  getattr(proc,patJetWithUserData).userFloats.qgl_axis2 = cms.InputTag(QGLTagger+":axis2")
352  getattr(proc,patJetWithUserData).userFloats.qgl_ptD = cms.InputTag(QGLTagger+":ptD")
353  getattr(proc,patJetWithUserData).userInts.qgl_mult = cms.InputTag(QGLTagger+":mult")
354 
355  #
356  # Specfiy variables in the jet table to save in NanoAOD
357  #
358  getattr(proc,jetTableName).variables.qgl_axis2 = QGLVARS.qgl_axis2
359  getattr(proc,jetTableName).variables.qgl_ptD = QGLVARS.qgl_ptD
360  getattr(proc,jetTableName).variables.qgl_mult = QGLVARS.qgl_mult
361 
362  if calculateQGLVars:
363  getattr(proc,jetSequenceName).insert(getattr(proc,jetSequenceName).index(getattr(proc, jetSrc))+1, getattr(proc, QGLTagger))
364 
365  return proc
366 
def AddQGLTaggerVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False)
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def custom_jme_cff.AddVariablesForAK4GenJets (   proc)

Definition at line 825 of file custom_jme_cff.py.

Referenced by PrepJMECustomNanoAOD().

826  proc.genJetTable.variables.nConstituents = GENJETVARS.nConstituents
827  return proc
828 
def AddVariablesForAK4GenJets(proc)
def custom_jme_cff.AddVariablesForAK8GenJets (   proc)

Definition at line 829 of file custom_jme_cff.py.

Referenced by PrepJMECustomNanoAOD().

830  proc.genJetAK8Table.variables.nConstituents = GENJETVARS.nConstituents
831  return proc
832 
833 #===========================================================================
834 #
835 # Misc. functions
836 #
837 #===========================================================================
def AddVariablesForAK8GenJets(proc)
def custom_jme_cff.AddVariablesForAK8PuppiJets (   proc)
Add more variables for AK8 PFPUPPI jets

Definition at line 693 of file custom_jme_cff.py.

References common_cff.Var().

Referenced by PrepJMECustomNanoAOD().

694  """
695  Add more variables for AK8 PFPUPPI jets
696  """
697 
698  #
699  # These variables are not stored for AK8PFCHS (slimmedJetsAK8)
700  # in MiniAOD if their pt < 170 GeV. Hence the conditional fill.
701  #
702  proc.fatJetTable.variables.chHEF = Var("?isPFJet()?chargedHadronEnergyFraction():-1", float, doc="charged Hadron Energy Fraction", precision = 6)
703  proc.fatJetTable.variables.neHEF = Var("?isPFJet()?neutralHadronEnergyFraction():-1", float, doc="neutral Hadron Energy Fraction", precision = 6)
704  proc.fatJetTable.variables.chEmEF = Var("?isPFJet()?chargedEmEnergyFraction():-1", float, doc="charged Electromagnetic Energy Fraction", precision = 6)
705  proc.fatJetTable.variables.neEmEF = Var("?isPFJet()?neutralEmEnergyFraction():-1", float, doc="neutral Electromagnetic Energy Fraction", precision = 6)
706  proc.fatJetTable.variables.muEF = Var("?isPFJet()?muonEnergyFraction():-1", float, doc="muon Energy Fraction", precision = 6)
707  proc.fatJetTable.variables.hfHEF = Var("?isPFJet()?HFHadronEnergyFraction():-1", float, doc="energy fraction in forward hadronic calorimeter", precision = 6)
708  proc.fatJetTable.variables.hfEmEF = Var("?isPFJet()?HFEMEnergyFraction():-1", float, doc="energy fraction in forward EM calorimeter", precision = 6)
709  proc.fatJetTable.variables.nConstChHads = Var("?isPFJet()?chargedHadronMultiplicity():-1",int, doc="number of charged hadrons in the jet")
710  proc.fatJetTable.variables.nConstNeuHads = Var("?isPFJet()?neutralHadronMultiplicity():-1",int, doc="number of neutral hadrons in the jet")
711  proc.fatJetTable.variables.nConstHFHads = Var("?isPFJet()?HFHadronMultiplicity():-1", int, doc="number of HF Hadrons in the jet")
712  proc.fatJetTable.variables.nConstHFEMs = Var("?isPFJet()?HFEMMultiplicity():-1", int, doc="number of HF EMs in the jet")
713  proc.fatJetTable.variables.nConstMuons = Var("?isPFJet()?muonMultiplicity():-1", int, doc="number of muons in the jet")
714  proc.fatJetTable.variables.nConstElecs = Var("?isPFJet()?electronMultiplicity():-1", int, doc="number of electrons in the jet")
715  proc.fatJetTable.variables.nConstPhotons = Var("?isPFJet()?photonMultiplicity():-1", int, doc="number of photons in the jet")
716 
717  return proc
718 #******************************************
719 #
720 #
721 # Gen Jets related functions
722 #
723 #
724 #******************************************
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def AddVariablesForAK8PuppiJets(proc)
def custom_jme_cff.PrepJMECustomNanoAOD (   process,
  runOnMC 
)

Definition at line 857 of file custom_jme_cff.py.

References AddNewGenJets(), AddNewPatJets(), AddVariablesForAK4GenJets(), AddVariablesForAK8GenJets(), AddVariablesForAK8PuppiJets(), ReclusterAK4CHSJets(), ReclusterAK4GenJets(), and RemoveAllJetPtCuts().

Referenced by PrepJMECustomNanoAOD_Data(), and PrepJMECustomNanoAOD_MC().

857 def PrepJMECustomNanoAOD(process,runOnMC):
858 
859  ############################################################################
860  # Remove all default jet pt cuts from jets_cff.py
861  ############################################################################
862  process = RemoveAllJetPtCuts(process)
863 
864  ###########################################################################
865  #
866  # Gen-level jets related functions. Only for MC.
867  #
868  ###########################################################################
869  genJA = GenJetAdder()
870  if runOnMC:
871  ############################################################################
872  # Save additional variables for AK8 GEN jets
873  ############################################################################
874  process = AddVariablesForAK8GenJets(process)
875  ###########################################################################
876  # Recluster AK4 GEN jets
877  ###########################################################################
878  process = ReclusterAK4GenJets(process, genJA)
879  process = AddVariablesForAK4GenJets(process)
880  ###########################################################################
881  # Add additional GEN jets to NanoAOD
882  ###########################################################################
883  for jetConfig in config_genjets:
884  cfg = { k : v for k, v in jetConfig.items() if k != "enabled"}
885  genJetInfo = genJA.addGenJetCollection(process, **cfg)
886  AddNewGenJets(process, genJetInfo)
887 
888  ###########################################################################
889  #
890  # Reco-level jets related functions. For both MC and data.
891  #
892  ###########################################################################
893  recoJA = RecoJetAdder(runOnMC=runOnMC)
894  ###########################################################################
895  # Save additional variables for AK8Puppi jets
896  ###########################################################################
897  process = AddVariablesForAK8PuppiJets(process)
898  ###########################################################################
899  # Recluster AK4 CHS jets and replace "slimmedJets"
900  ###########################################################################
901  process = ReclusterAK4CHSJets(process, recoJA, runOnMC)
902  ###########################################################################
903  # Add additional Reco jets to NanoAOD
904  ###########################################################################
905  for jetConfig in config_recojets:
906  cfg = { k : v for k, v in jetConfig.items() if k != "enabled"}
907  recoJetInfo = recoJA.addRecoJetCollection(process, **cfg)
908  AddNewPatJets(process, recoJetInfo, runOnMC)
909 
910  ###########################################################################
911  # Save Maximum of Pt Hat Max
912  ###########################################################################
913  if runOnMC:
914  process.puTable.savePtHatMax = True
915 
916  return process
917 
def ReclusterAK4CHSJets(proc, recoJA, runOnMC)
def RemoveAllJetPtCuts(proc)
def PrepJMECustomNanoAOD(process, runOnMC)
def AddNewPatJets(proc, recoJetInfo, runOnMC)
def ReclusterAK4GenJets(proc, genJA)
def AddNewGenJets(proc, genJetInfo)
def AddVariablesForAK4GenJets(proc)
def AddVariablesForAK8PuppiJets(proc)
def AddVariablesForAK8GenJets(proc)
def custom_jme_cff.PrepJMECustomNanoAOD_Data (   process)

Definition at line 922 of file custom_jme_cff.py.

References PrepJMECustomNanoAOD().

923  PrepJMECustomNanoAOD(process,runOnMC=False)
924  return process
925 
def PrepJMECustomNanoAOD(process, runOnMC)
def PrepJMECustomNanoAOD_Data(process)
def custom_jme_cff.PrepJMECustomNanoAOD_MC (   process)

Definition at line 918 of file custom_jme_cff.py.

References PrepJMECustomNanoAOD().

919  PrepJMECustomNanoAOD(process,runOnMC=True)
920  return process
921 
def PrepJMECustomNanoAOD(process, runOnMC)
def PrepJMECustomNanoAOD_MC(process)
def custom_jme_cff.ReclusterAK4CHSJets (   proc,
  recoJA,
  runOnMC 
)
Recluster AK4 CHS jets and replace slimmedJets
that is used as default to save AK4 CHS jets 
in NanoAODs.  

Definition at line 571 of file custom_jme_cff.py.

References AddPileUpJetIDVars(), edm.print(), and common_cff.Var().

Referenced by PrepJMECustomNanoAOD().

571 def ReclusterAK4CHSJets(proc, recoJA, runOnMC):
572  """
573  Recluster AK4 CHS jets and replace slimmedJets
574  that is used as default to save AK4 CHS jets
575  in NanoAODs.
576  """
577  print("custom_jme_cff::ReclusterAK4CHSJets: Recluster AK4 PF CHS jets")
578 
579  #
580  # Recluster AK4 CHS jets
581  #
582  cfg = {
583  "jet" : "ak4pfchs",
584  "inputCollection" : "",
585  "genJetsCollection": "AK4GenJetsNoNu",
586  "bTagDiscriminators": bTagDiscriminatorsForAK4
587  }
588  recoJetInfo = recoJA.addRecoJetCollection(proc, **cfg)
589 
590  jetName = recoJetInfo.jetUpper
591  patJetFinalColl = "selectedUpdatedPatJets{}Final".format(jetName)
592 
593  #
594  # Change the input jet source for jetCorrFactorsNano
595  # and updatedJets
596  #
597  proc.jetCorrFactorsNano.src=patJetFinalColl
598  proc.updatedJets.jetSource=patJetFinalColl
599 
600  #
601  # Change pt cut
602  #
603  proc.finalJets.cut = "pt > 2"
604  proc.simpleCleanerTable.jetSel = "pt > 10" # Change this from 15 -> 10
605 
606  #
607  # Add variables
608  #
609  proc.jetTable.variables.hfHEF = PFJETVARS.hfHEF
610  proc.jetTable.variables.hfEmEF = PFJETVARS.hfEmEF
611  proc.jetTable.variables.nConstChHads = PFJETVARS.nConstChHads
612  proc.jetTable.variables.nConstNeuHads = PFJETVARS.nConstNeuHads
613  proc.jetTable.variables.nConstHFHads = PFJETVARS.nConstHFHads
614  proc.jetTable.variables.nConstHFEMs = PFJETVARS.nConstHFEMs
615  proc.jetTable.variables.nConstMuons = PFJETVARS.nConstMuons
616  proc.jetTable.variables.nConstElecs = PFJETVARS.nConstElecs
617  proc.jetTable.variables.nConstPhotons = PFJETVARS.nConstPhotons
618 
619  proc.jetTable.doc = cms.string("AK4 PF CHS Jets with JECs applied, after basic selection (pt > 2)")
620 
621  #
622  # Setup pileup jet ID with 80X training.
623  #
624  pileupJetId80X = "pileupJetId80X"
625  setattr(proc, pileupJetId80X, pileupJetId.clone(
626  jets="updatedJets",
627  algos=cms.VPSet(_chsalgos_81x),
628  inputIsCorrected=True,
629  applyJec=False,
630  vertexes="offlineSlimmedPrimaryVertices"
631  )
632  )
633  proc.jetSequence.insert(proc.jetSequence.index(proc.pileupJetId94X), getattr(proc, pileupJetId80X))
634 
635  proc.updatedJetsWithUserData.userInts.puId80XfullId = cms.InputTag('pileupJetId80X:fullId')
636  run2_jme_2016.toModify(proc.updatedJetsWithUserData.userFloats, puId80XDisc = cms.InputTag("pileupJetId80X:fullDiscriminant"))
637 
638  proc.jetTable.variables.puId = Var("userInt('puId80XfullId')", int, doc="Pilup ID flags with 80X (2016) training")
639  run2_jme_2016.toModify(proc.jetTable.variables, puIdDisc = Var("userFloat('puId80XDisc')",float,doc="Pilup ID discriminant with 80X (2016) training",precision=10))
640 
641  #
642  # Add variables for pileup jet ID studies.
643  #
644  proc = AddPileUpJetIDVars(proc,
645  jetName="",
646  jetSrc="updatedJets",
647  jetTableName="jetTable",
648  jetSequenceName="jetSequence"
649  )
650  #
651  # Add variables for quark guon likelihood tagger studies.
652  # Save variables as userFloats and userInts in each jet
653  #
654  proc.updatedJetsWithUserData.userFloats.qgl_axis2 = cms.InputTag("qgtagger:axis2")
655  proc.updatedJetsWithUserData.userFloats.qgl_ptD = cms.InputTag("qgtagger:ptD")
656  proc.updatedJetsWithUserData.userInts.qgl_mult = cms.InputTag("qgtagger:mult")
657  #
658  # Specfiy variables in the jetTable to save in NanoAOD
659  #
660  proc.jetTable.variables.qgl_axis2 = QGLVARS.qgl_axis2
661  proc.jetTable.variables.qgl_ptD = QGLVARS.qgl_ptD
662  proc.jetTable.variables.qgl_mult = QGLVARS.qgl_mult
663  #
664  # Save DeepJet raw score for gluon and light quarks
665  #
666  proc.jetTable.variables.btagDeepFlavG = DEEPJETVARS.btagDeepFlavG
667  proc.jetTable.variables.btagDeepFlavUDS = DEEPJETVARS.btagDeepFlavUDS
668  #
669  # Add ParticleNetAK4 scores
670  #
671  proc.jetTable.variables.particleNetAK4_B = PARTICLENETAK4VARS.particleNetAK4_B
672  proc.jetTable.variables.particleNetAK4_CvsL = PARTICLENETAK4VARS.particleNetAK4_CvsL
673  proc.jetTable.variables.particleNetAK4_CvsB = PARTICLENETAK4VARS.particleNetAK4_CvsB
674  proc.jetTable.variables.particleNetAK4_QvsG = PARTICLENETAK4VARS.particleNetAK4_QvsG
675  proc.jetTable.variables.particleNetAK4_puIdDisc = PARTICLENETAK4VARS.particleNetAK4_puIdDisc
676 
677  #Adding hf shower shape producer to the jet sequence. By default this producer is not automatically rerun at the NANOAOD step
678  #The following lines make sure it is.
679  hfJetShowerShapeforCustomNanoAOD = "hfJetShowerShapeforCustomNanoAOD"
680  setattr(proc, hfJetShowerShapeforCustomNanoAOD, hfJetShowerShapeforNanoAOD.clone(jets="updatedJets",vertices="offlineSlimmedPrimaryVertices") )
681  proc.jetSequence.insert(proc.jetSequence.index(proc.updatedJetsWithUserData), getattr(proc, hfJetShowerShapeforCustomNanoAOD))
682  proc.updatedJetsWithUserData.userFloats.hfsigmaEtaEta = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:sigmaEtaEta')
683  proc.updatedJetsWithUserData.userFloats.hfsigmaPhiPhi = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:sigmaPhiPhi')
684  proc.updatedJetsWithUserData.userInts.hfcentralEtaStripSize = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:centralEtaStripSize')
685  proc.updatedJetsWithUserData.userInts.hfadjacentEtaStripsSize = cms.InputTag('hfJetShowerShapeforCustomNanoAOD:adjacentEtaStripsSize')
686  proc.jetTable.variables.hfsigmaEtaEta = Var("userFloat('hfsigmaEtaEta')",float,doc="sigmaEtaEta for HF jets (noise discriminating variable)",precision=10)
687  proc.jetTable.variables.hfsigmaPhiPhi = Var("userFloat('hfsigmaPhiPhi')",float,doc="sigmaPhiPhi for HF jets (noise discriminating variable)",precision=10)
688  proc.jetTable.variables.hfcentralEtaStripSize = Var("userInt('hfcentralEtaStripSize')", int, doc="eta size of the central tower strip in HF (noise discriminating variable) ")
689  proc.jetTable.variables.hfadjacentEtaStripsSize = Var("userInt('hfadjacentEtaStripsSize')", int, doc="eta size of the strips next to the central tower strip in HF (noise discriminating variable) ")
690 
691  return proc
692 
def ReclusterAK4CHSJets(proc, recoJA, runOnMC)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
def custom_jme_cff.ReclusterAK4GenJets (   proc,
  genJA 
)
Recluster AK4 Gen jets and replace 
slimmedGenJets that is used as default 
to save AK4 Gen jets in NanoAODs. 

Definition at line 785 of file custom_jme_cff.py.

References edm.print().

Referenced by PrepJMECustomNanoAOD().

785 def ReclusterAK4GenJets(proc, genJA):
786  """
787  Recluster AK4 Gen jets and replace
788  slimmedGenJets that is used as default
789  to save AK4 Gen jets in NanoAODs.
790  """
791  print("custom_jme_cff::ReclusterAK4GenJets: Recluster AK4 Gen jets")
792 
793  #
794  # Recluster AK4 Gen jet
795  #
796  cfg = {
797  "jet" : "ak4gen",
798  }
799  genJetInfo = genJA.addGenJetCollection(proc, **cfg)
800 
801  genJetName = genJetInfo.jetUpper
802  genJetAlgo = genJetInfo.jetAlgo
803  genJetSize = genJetInfo.jetSize
804  genJetSizeNr = genJetInfo.jetSizeNr
805  selectedPatGenJets = "{}{}{}".format(genJetAlgo.upper(), genJetSize, "GenJetsNoNu")
806 
807  #
808  # Change jet source to the newly clustered jet collection. Set very low pt cut for jets
809  # to be stored in the GenJet Table
810  #
811  proc.genJetTable.src = selectedPatGenJets
812  proc.genJetTable.cut = "pt > 1"
813  proc.genJetTable.doc ="AK4 Gen jets (made with visible genparticles)"
814 
815  genJetFlavourAssociationThisJet = "genJet{}FlavourAssociation".format(genJetName)
816  setattr(proc, genJetFlavourAssociationThisJet, genJetFlavourAssociation.clone(
817  jets = proc.genJetTable.src,
818  jetAlgorithm = supportedJetAlgos[genJetAlgo],
819  rParam = genJetSizeNr,
820  )
821  )
822  proc.jetMC.insert(proc.jetMC.index(proc.genJetFlavourTable), getattr(proc, genJetFlavourAssociationThisJet))
823  return proc
824 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def ReclusterAK4GenJets(proc, genJA)
def custom_jme_cff.RemoveAllJetPtCuts (   proc)
Remove default pt cuts for all jets set in jets_cff.py 

Definition at line 838 of file custom_jme_cff.py.

Referenced by PrepJMECustomNanoAOD().

839  """
840  Remove default pt cuts for all jets set in jets_cff.py
841  """
842 
843  proc.finalJets.cut = "" # 15 -> 10
844  proc.finalJetsAK8.cut = "" # 170 -> 170
845  proc.genJetTable.cut = "" # 10 -> 8
846  proc.genJetFlavourTable.cut = "" # 10 -> 8
847  proc.genJetAK8Table.cut = "" # 100 -> 80
848  proc.genJetAK8FlavourTable.cut = "" # 100 -> 80
849 
850  return proc
851 
852 #===========================================================================
853 #
854 # CUSTOMIZATION function
855 #
856 #===========================================================================
def RemoveAllJetPtCuts(proc)
def custom_jme_cff.SaveGenJets (   proc,
  genJetName,
  genJetAlgo,
  genJetSizeNr,
  genJetFinalColl,
  genJetTablePrefix,
  genJetTableDoc,
  runOnMC = False 
)
Schedule modules for a given genJet collection and save its variables into custom NanoAOD

Definition at line 742 of file custom_jme_cff.py.

Referenced by AddNewGenJets().

742 def SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False):
743  """
744  Schedule modules for a given genJet collection and save its variables into custom NanoAOD
745  """
746 
747  genJetTableThisJet = "jet{}Table".format(genJetName)
748  setattr(proc, genJetTableThisJet, genJetTable.clone(
749  src = genJetFinalColl,
750  cut = "pt > 1",
751  name = genJetTablePrefix,
752  doc = genJetTableDoc,
753  variables = GENJETVARS
754  )
755  )
756 
757  genJetFlavourAssociationThisJet = "genJet{}FlavourAssociation".format(genJetName)
758  setattr(proc, genJetFlavourAssociationThisJet, genJetFlavourAssociation.clone(
759  jets = getattr(proc,genJetTableThisJet).src,
760  jetAlgorithm = supportedJetAlgos[genJetAlgo],
761  rParam = genJetSizeNr,
762  )
763  )
764 
765  genJetFlavourTableThisJet = "genJet{}FlavourTable".format(genJetName)
766  setattr(proc, genJetFlavourTableThisJet, genJetFlavourTable.clone(
767  name = getattr(proc,genJetTableThisJet).name,
768  src = getattr(proc,genJetTableThisJet).src,
769  cut = getattr(proc,genJetTableThisJet).cut,
770  jetFlavourInfos = genJetFlavourAssociationThisJet,
771  )
772  )
773 
774  genJetSequenceName = "genJet{}Sequence".format(genJetName)
775  setattr(proc, genJetSequenceName, cms.Sequence(
776  getattr(proc,genJetTableThisJet)+
777  getattr(proc,genJetFlavourAssociationThisJet)+
778  getattr(proc,genJetFlavourTableThisJet)
779  )
780  )
781  proc.nanoSequenceMC.insert(proc.nanoSequenceMC.index(proc.jetMC)+1, getattr(proc,genJetSequenceName))
782 
783  return proc
784 
def SaveGenJets(proc, genJetName, genJetAlgo, genJetSizeNr, genJetFinalColl, genJetTablePrefix, genJetTableDoc, runOnMC=False)
def custom_jme_cff.SavePatJets (   proc,
  jetName,
  payload,
  patJetFinalColl,
  jetTablePrefix,
  jetTableDoc,
  doPF,
  doCalo,
  ptcut = "",
  doPUIDVar = False,
  doQGL = False,
  doBTag = False,
  runOnMC = False 
)
Schedule modules for a given patJet collection and save its variables into custom NanoAOD

Definition at line 437 of file custom_jme_cff.py.

References AddBTaggingScores(), AddDeepJetGluonLQuarkScores(), AddJetID(), AddParticleNetAK4Scores(), AddPileUpJetIDVars(), AddQGLTaggerVars(), and common_cff.Var().

Referenced by AddNewPatJets().

437  doPF, doCalo, ptcut="", doPUIDVar=False, doQGL=False, doBTag=False, runOnMC=False):
438  """
439  Schedule modules for a given patJet collection and save its variables into custom NanoAOD
440  """
441 
442  #
443  # Setup jet correction factors
444  #
445  jetCorrFactors = "jetCorrFactorsNano{}".format(jetName)
446  setattr(proc, jetCorrFactors, jetCorrFactorsNano.clone(
447  src = patJetFinalColl,
448  payload = payload,
449  )
450  )
451 
452  #
453  # Update jets
454  #
455  srcJets = "updatedJets{}".format(jetName)
456  setattr(proc, srcJets, updatedJets.clone(
457  jetSource = patJetFinalColl,
458  jetCorrFactorsSource=[jetCorrFactors],
459  )
460  )
461 
462  #
463  # Setup UserDataEmbedder
464  #
465  srcJetsWithUserData = "updatedJets{}WithUserData".format(jetName)
466  setattr(proc, srcJetsWithUserData, cms.EDProducer("PATJetUserDataEmbedder",
467  src = cms.InputTag(srcJets),
468  userFloats = cms.PSet(),
469  userInts = cms.PSet(),
470  )
471  )
472 
473  #
474  # Filter jets with pt cut
475  #
476  finalJetsForTable = "finalJets{}".format(jetName)
477  setattr(proc, finalJetsForTable, finalJets.clone(
478  src = srcJetsWithUserData,
479  cut = ptcut
480  )
481  )
482 
483  #
484  # Save jets in table
485  #
486  tableContent = PFJETVARS
487  if doCalo:
488  tableContent = CALOJETVARS
489 
490  jetTable = "jet{}Table".format(jetName)
491  setattr(proc,jetTable, cms.EDProducer("SimpleCandidateFlatTableProducer",
492  src = cms.InputTag(finalJetsForTable),
493  cut = cms.string(""), # Don't specify cuts here
494  name = cms.string(jetTablePrefix),
495  doc = cms.string(jetTableDoc),
496  singleton = cms.bool(False), # the number of entries is variable
497  extension = cms.bool(False), # this is the main table for the jets
498  variables = cms.PSet(tableContent)
499  )
500  )
501  getattr(proc,jetTable).variables.pt.precision=10
502 
503  #
504  # Save MC-only jet variables in table
505  #
506  jetMCTable = "jet{}MCTable".format(jetName)
507  setattr(proc, jetMCTable, cms.EDProducer("SimpleCandidateFlatTableProducer",
508  src = cms.InputTag(finalJetsForTable),
509  cut = getattr(proc,jetTable).cut,
510  name = cms.string(jetTablePrefix),
511  singleton = cms.bool(False),
512  extension = cms.bool(True), # this is an extension table
513  variables = cms.PSet(
514  partonFlavour = Var("partonFlavour()", int, doc="flavour from parton matching"),
515  hadronFlavour = Var("hadronFlavour()", int, doc="flavour from hadron ghost clustering"),
516  genJetIdx = Var("?genJetFwdRef().backRef().isNonnull()?genJetFwdRef().backRef().key():-1", int, doc="index of matched gen jet"),
517  )
518  )
519  )
520 
521  #
522  # Define the jet modules sequence first
523  #
524  jetSequenceName = "jet{}Sequence".format(jetName)
525  setattr(proc, jetSequenceName, cms.Sequence(
526  getattr(proc,jetCorrFactors)+
527  getattr(proc,srcJets)+
528  getattr(proc,srcJetsWithUserData)+
529  getattr(proc,finalJetsForTable)
530  )
531  )
532 
533  #
534  # Define the jet table sequences
535  #
536  jetTableSequenceName = "jet{}TablesSequence".format(jetName)
537  setattr(proc, jetTableSequenceName, cms.Sequence(getattr(proc,jetTable)))
538 
539  jetTableSequenceMCName = "jet{}MCTablesSequence".format(jetName)
540  setattr(proc, jetTableSequenceMCName, cms.Sequence(getattr(proc,jetMCTable)))
541 
542  if runOnMC:
543  proc.nanoSequenceMC += getattr(proc,jetSequenceName)
544  proc.nanoSequenceMC += getattr(proc,jetTableSequenceName)
545  proc.nanoSequenceMC += getattr(proc,jetTableSequenceMCName)
546  else:
547  proc.nanoSequence += getattr(proc,jetSequenceName)
548  proc.nanoSequence += getattr(proc,jetTableSequenceName)
549 
550  #
551  # Schedule plugins to calculate Jet ID, PileUp Jet ID input variables, and Quark-Gluon Likehood input variables.
552  #
553  if doPF:
554  proc = AddJetID(proc, jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName)
555  if doPUIDVar:
556  proc = AddPileUpJetIDVars(proc, jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName)
557  if doQGL:
558  proc = AddQGLTaggerVars(proc,jetName=jetName, jetSrc=srcJets, jetTableName=jetTable, jetSequenceName=jetSequenceName, calculateQGLVars=True)
559 
560  #
561  # Save b-tagging algorithm scores. Should only be done for jet collection with b-tagging
562  # calculated when reclustered or collection saved with b-tagging info in MiniAOD
563  #
564  if doBTag:
565  AddBTaggingScores(proc,jetTableName=jetTable)
566  AddDeepJetGluonLQuarkScores(proc,jetTableName=jetTable)
567  AddParticleNetAK4Scores(proc,jetTableName=jetTable)
568 
569  return proc
570 
def AddBTaggingScores(proc, jetTableName="")
def AddJetID(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
def AddQGLTaggerVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="", calculateQGLVars=False)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def AddDeepJetGluonLQuarkScores(proc, jetTableName="")
def AddPileUpJetIDVars(proc, jetName="", jetSrc="", jetTableName="", jetSequenceName="")
def AddParticleNetAK4Scores(proc, jetTableName="")

Variable Documentation

custom_jme_cff.bTagCSVV2

Definition at line 21 of file custom_jme_cff.py.

custom_jme_cff.btagCSVV2

Definition at line 175 of file custom_jme_cff.py.

custom_jme_cff.btagDeepB

Definition at line 174 of file custom_jme_cff.py.

custom_jme_cff.bTagDeepCSV

Definition at line 22 of file custom_jme_cff.py.

custom_jme_cff.btagDeepCvL

Definition at line 176 of file custom_jme_cff.py.

custom_jme_cff.btagDeepFlavB

Definition at line 179 of file custom_jme_cff.py.

custom_jme_cff.btagDeepFlavC

Definition at line 180 of file custom_jme_cff.py.

custom_jme_cff.btagDeepFlavG

Definition at line 181 of file custom_jme_cff.py.

custom_jme_cff.btagDeepFlavUDS

Definition at line 182 of file custom_jme_cff.py.

custom_jme_cff.bTagDeepJet

Definition at line 23 of file custom_jme_cff.py.

custom_jme_cff.bTagDiscriminatorsForAK4

Definition at line 29 of file custom_jme_cff.py.

custom_jme_cff.BTAGVARS

Definition at line 173 of file custom_jme_cff.py.

custom_jme_cff.CALOJETVARS

Definition at line 192 of file custom_jme_cff.py.

custom_jme_cff.chEmEF

Definition at line 137 of file custom_jme_cff.py.

custom_jme_cff.chHEF

Definition at line 135 of file custom_jme_cff.py.

custom_jme_cff.config_genjets

Definition at line 37 of file custom_jme_cff.py.

custom_jme_cff.config_recojets

Definition at line 60 of file custom_jme_cff.py.

custom_jme_cff.DEEPJETVARS

Definition at line 178 of file custom_jme_cff.py.

custom_jme_cff.doc

Definition at line 140 of file custom_jme_cff.py.

custom_jme_cff.float

Definition at line 140 of file custom_jme_cff.py.

custom_jme_cff.GENJETVARS

Definition at line 129 of file custom_jme_cff.py.

custom_jme_cff.hfEmEF

Definition at line 141 of file custom_jme_cff.py.

custom_jme_cff.hfHEF

Definition at line 140 of file custom_jme_cff.py.

custom_jme_cff.int

Definition at line 145 of file custom_jme_cff.py.

custom_jme_cff.muEF

Definition at line 139 of file custom_jme_cff.py.

custom_jme_cff.nanoInfo_genjets

Definition at line 47 of file custom_jme_cff.py.

custom_jme_cff.nanoInfo_recojets

Definition at line 97 of file custom_jme_cff.py.

custom_jme_cff.nConstChHads

Definition at line 145 of file custom_jme_cff.py.

custom_jme_cff.nConstElecs

Definition at line 150 of file custom_jme_cff.py.

custom_jme_cff.nConstHFEMs

Definition at line 148 of file custom_jme_cff.py.

custom_jme_cff.nConstHFHads

Definition at line 147 of file custom_jme_cff.py.

custom_jme_cff.nConstMuons

Definition at line 149 of file custom_jme_cff.py.

custom_jme_cff.nConstNeuHads

Definition at line 146 of file custom_jme_cff.py.

custom_jme_cff.nConstPhotons

Definition at line 151 of file custom_jme_cff.py.

custom_jme_cff.neEmEF

Definition at line 138 of file custom_jme_cff.py.

custom_jme_cff.neHEF

Definition at line 136 of file custom_jme_cff.py.

custom_jme_cff.particleNetAK4_B

Definition at line 185 of file custom_jme_cff.py.

custom_jme_cff.particleNetAK4_CvsB

Definition at line 187 of file custom_jme_cff.py.

custom_jme_cff.particleNetAK4_CvsL

Definition at line 186 of file custom_jme_cff.py.

custom_jme_cff.particleNetAK4_puIdDisc

Definition at line 189 of file custom_jme_cff.py.

custom_jme_cff.particleNetAK4_QvsG

Definition at line 188 of file custom_jme_cff.py.

custom_jme_cff.PARTICLENETAK4VARS

Definition at line 184 of file custom_jme_cff.py.

custom_jme_cff.PFJETVARS

Definition at line 132 of file custom_jme_cff.py.

custom_jme_cff.precision

Definition at line 140 of file custom_jme_cff.py.

custom_jme_cff.puId_beta

Definition at line 162 of file custom_jme_cff.py.

custom_jme_cff.puId_dR2Mean

Definition at line 154 of file custom_jme_cff.py.

custom_jme_cff.puId_frac01

Definition at line 157 of file custom_jme_cff.py.

custom_jme_cff.puId_frac02

Definition at line 158 of file custom_jme_cff.py.

custom_jme_cff.puId_frac03

Definition at line 159 of file custom_jme_cff.py.

custom_jme_cff.puId_frac04

Definition at line 160 of file custom_jme_cff.py.

custom_jme_cff.puId_jetR

Definition at line 164 of file custom_jme_cff.py.

custom_jme_cff.puId_jetRchg

Definition at line 165 of file custom_jme_cff.py.

custom_jme_cff.puId_majW

Definition at line 155 of file custom_jme_cff.py.

custom_jme_cff.puId_minW

Definition at line 156 of file custom_jme_cff.py.

custom_jme_cff.puId_nCharged

Definition at line 166 of file custom_jme_cff.py.

custom_jme_cff.puId_ptD

Definition at line 161 of file custom_jme_cff.py.

custom_jme_cff.puId_pull

Definition at line 163 of file custom_jme_cff.py.

custom_jme_cff.PUIDVARS

Definition at line 153 of file custom_jme_cff.py.

custom_jme_cff.qgl_axis2

Definition at line 169 of file custom_jme_cff.py.

custom_jme_cff.qgl_mult

Definition at line 171 of file custom_jme_cff.py.

custom_jme_cff.qgl_ptD

Definition at line 170 of file custom_jme_cff.py.

custom_jme_cff.QGLVARS

Definition at line 168 of file custom_jme_cff.py.

custom_jme_cff.rawFactor

Definition at line 133 of file custom_jme_cff.py.