CMS 3D CMS Logo

Classes | Functions | Variables
custom_jme_cff Namespace Reference

Classes

class  TableGenJetAdder
 
class  TableRecoJetAdder
 

Functions

def PrepJMECustomNanoAOD (process)
 

Variables

 area
 
 chEmEF
 
 chHEF
 
 config_genjets
 
 config_recojets
 
 doc
 
 float
 
 genjetNameInNano
 
 HFEMEF
 
 HFHEF
 
 int
 
 jercCHF
 
 jercCHPUF
 
 jetId
 
 JETVARS
 
 muEF
 
 nanoInfo_genjets
 
 nanoInfo_recojets
 
 neEmEF
 
 neHEF
 
 precision
 
 rawFactor
 
 recojetNameInNano
 

Function Documentation

def custom_jme_cff.PrepJMECustomNanoAOD (   process)

Definition at line 339 of file custom_jme_cff.py.

References common_cff.Var().

339 def PrepJMECustomNanoAOD(process):
340  #
341  # Additional variables to AK4GenJets
342  #
343  process.genJetTable.variables.area = JETVARS.area
344  #
345  # Additional variables to AK8GenJets
346  #
347  process.genJetAK8Table.variables.area = JETVARS.area
348  #
349  # Additional variables for AK4PFCHS
350  #
351  process.jetTable.variables.HFHEF = JETVARS.HFHEF
352  process.jetTable.variables.HFEMEF = JETVARS.HFEMEF
353  #
354  # Additional variables to AK8PFPUPPI
355  #
356  # These variables are not stored for AK8PFCHS (slimmedJetsAK8)
357  # in MiniAOD if their pt < 170 GeV. Hence the conditional fill.
358  #
359  process.fatJetTable.variables.chHEF = Var("?isPFJet()?chargedHadronEnergyFraction():-1", float, doc="charged Hadron Energy Fraction", precision = 6)
360  process.fatJetTable.variables.neHEF = Var("?isPFJet()?neutralHadronEnergyFraction():-1", float, doc="neutral Hadron Energy Fraction", precision = 6)
361  process.fatJetTable.variables.chEmEF = Var("?isPFJet()?chargedEmEnergyFraction():-1", float, doc="charged Electromagnetic Energy Fraction", precision = 6)
362  process.fatJetTable.variables.neEmEF = Var("?isPFJet()?neutralEmEnergyFraction():-1", float, doc="neutral Electromagnetic Energy Fraction", precision = 6)
363  process.fatJetTable.variables.muEF = Var("?isPFJet()?muonEnergyFraction():-1", float, doc="muon Energy Fraction", precision = 6)
364  process.fatJetTable.variables.HFHEF = Var("?isPFJet()?HFHadronEnergyFraction():-1", float, doc="energy fraction in forward hadronic calorimeter", precision = 6)
365  process.fatJetTable.variables.HFEMEF = Var("?isPFJet()?HFEMEnergyFraction():-1", float, doc="energy fraction in forward EM calorimeter", precision = 6)
366  #
367  #
368  #
369  process.jercVarsFatJet = process.jercVars.clone(
370  srcJet = "updatedJetsAK8",
371  maxDR = 0.8,
372  )
373  process.jetSequence.insert(process.jetSequence.index(process.updatedJetsAK8WithUserData), process.jercVarsFatJet)
374 
375  process.updatedJetsAK8WithUserData.userFloats.jercCHPUF = cms.InputTag(
376  "%s:chargedHadronPUEnergyFraction" % process.jercVarsFatJet.label()
377  )
378  process.updatedJetsAK8WithUserData.userFloats.jercCHF = cms.InputTag(
379  "%s:chargedHadronCHSEnergyFraction" % process.jercVarsFatJet.label()
380  )
381  process.fatJetTable.variables.jercCHPUF = JETVARS.jercCHPUF
382  process.fatJetTable.variables.jercCHF = JETVARS.jercCHF
383  #
384  # Remove any pT cuts.
385  #
386  process.finalJets.cut = "" # 15 -> 10
387  process.finalJetsAK8.cut = "" # 170 -> 170
388  process.genJetTable.cut = "" # 10 -> 8
389  process.genJetFlavourTable.cut = "" # 10 -> 8
390  process.genJetAK8Table.cut = "" # 100 -> 80
391  process.genJetAK8FlavourTable.cut = "" # 100 -> 80
392 
393  ######################################################################################################################
394 
395  #
396  # Add GenJets to NanoAOD
397  #
398  genJA = GenJetAdder()
399  tableGenJA = TableGenJetAdder()
400 
401  for jetConfig in config_genjets:
402  cfg = { k : v for k, v in jetConfig.items() if k != "enabled" }
403  genJetInfo = genJA.addGenJetCollection(process, **cfg)
404  tableGenJA.addTable(process, genJetInfo)
405 
406  process.nanoSequenceMC += genJA.getSequence(process)
407  process.nanoSequenceMC += tableGenJA.getSequence(process)
408 
409  #
410  # Add RecoJets to NanoAOD
411  #
412  recoJA = RecoJetAdder()
413  tableRecoJA = TableRecoJetAdder()
414 
415  for jetConfig in config_recojets:
416  cfg = { k : v for k, v in jetConfig.items() if k != "enabled" }
417  recoJetInfo = recoJA.addRecoJetCollection(process, **cfg)
418  tableRecoJA.addTable(process, recoJetInfo)
419 
420  process.nanoSequenceMC += recoJA.getSequence(process)
421  process.nanoSequenceMC += tableRecoJA.getSequence(process)
422 
423 
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
def PrepJMECustomNanoAOD(process)

Variable Documentation

custom_jme_cff.chEmEF

Definition at line 172 of file custom_jme_cff.py.

custom_jme_cff.chHEF

Definition at line 170 of file custom_jme_cff.py.

custom_jme_cff.config_genjets

Definition at line 19 of file custom_jme_cff.py.

custom_jme_cff.config_recojets

Definition at line 76 of file custom_jme_cff.py.

custom_jme_cff.doc

Definition at line 167 of file custom_jme_cff.py.

custom_jme_cff.float

Definition at line 167 of file custom_jme_cff.py.

custom_jme_cff.genjetNameInNano

Definition at line 164 of file custom_jme_cff.py.

custom_jme_cff.HFEMEF

Definition at line 168 of file custom_jme_cff.py.

custom_jme_cff.HFHEF

Definition at line 167 of file custom_jme_cff.py.

custom_jme_cff.int

Definition at line 183 of file custom_jme_cff.py.

custom_jme_cff.jercCHF

Definition at line 178 of file custom_jme_cff.py.

custom_jme_cff.jercCHPUF

Definition at line 177 of file custom_jme_cff.py.

custom_jme_cff.jetId

Definition at line 176 of file custom_jme_cff.py.

custom_jme_cff.JETVARS

Definition at line 166 of file custom_jme_cff.py.

custom_jme_cff.muEF

Definition at line 174 of file custom_jme_cff.py.

custom_jme_cff.nanoInfo_genjets

Definition at line 45 of file custom_jme_cff.py.

custom_jme_cff.nanoInfo_recojets

Definition at line 124 of file custom_jme_cff.py.

custom_jme_cff.neEmEF

Definition at line 173 of file custom_jme_cff.py.

custom_jme_cff.neHEF

Definition at line 171 of file custom_jme_cff.py.

custom_jme_cff.precision

Definition at line 167 of file custom_jme_cff.py.

custom_jme_cff.rawFactor

Definition at line 175 of file custom_jme_cff.py.

custom_jme_cff.recojetNameInNano

Definition at line 159 of file custom_jme_cff.py.