CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
custom_jme_cff.TableRecoJetAdder Class Reference
Inheritance diagram for custom_jme_cff.TableRecoJetAdder:

Public Member Functions

def __init__ (self)
 
def addTable (self, proc, recoJetInfo)
 
def getSequence (self, proc)
 

Public Attributes

 main
 

Detailed Description

Tool to store reco jet variables in NanoAOD for customized
reco jet collections.

Definition at line 263 of file custom_jme_cff.py.

Constructor & Destructor Documentation

◆ __init__()

def custom_jme_cff.TableRecoJetAdder.__init__ (   self)

Definition at line 268 of file custom_jme_cff.py.

268  def __init__(self):
269  self.main = []
270 

Member Function Documentation

◆ addTable()

def custom_jme_cff.TableRecoJetAdder.addTable (   self,
  proc,
  recoJetInfo 
)

Definition at line 282 of file custom_jme_cff.py.

282  def addTable(self, proc, recoJetInfo):
283 
284  currentTasks = []
285 
286  print("custom_jme_cff::TableRecoJetAdder::addTable: Adding Table for Reco Jet Collection: {}".format(recoJetInfo.jet))
287 
288  name = nanoInfo_recojets[recoJetInfo.jet]["name"]
289  doc = nanoInfo_recojets[recoJetInfo.jet]["doc"]
290 
291  if name in recojetNameInNano:
292  raise RuntimeError('RecoJet collection name (%s) taken in NanoAOD for %s' %(name, recoJetInfo.jet))
293 
294  table = "{}Table".format(recoJetInfo.jetTagName)
295  if recoJetInfo.skipUserData:
296  if recoJetInfo.doCalo:
297  tableContents = cms.PSet(
298  P4Vars,
299  area = jetTable.variables.area,
300  rawFactor = jetTable.variables.rawFactor,
301  emf = Var("emEnergyFraction()", float, doc = "electromagnetic energy fraction", precision = 10),
302  )
303  else:
304  tableContents = cms.PSet(
305  P4Vars,
306  area = jetTable.variables.area,
307  rawFactor = jetTable.variables.rawFactor,
308  )
309  else:
310  tableContents = JETVARS.clone()
311 
312  updatedJets = "updatedJets{}".format(recoJetInfo.jetTagName)
313  setattr(proc, table, cms.EDProducer("SimpleCandidateFlatTableProducer",
314  src = cms.InputTag(updatedJets),
315  cut = cms.string(""),
316  name = cms.string(name),
317  doc = cms.string(doc),
318  singleton = cms.bool(False),
319  extension = cms.bool(False),
320  variables = tableContents,
321  )
322  )
323  currentTasks.append(table)
324 
325  self.main.extend(currentTasks)
326 

References custom_jme_cff.TableGenJetAdder.main, custom_jme_cff.TableRecoJetAdder.main, edm.print(), and common_cff.Var().

◆ getSequence()

def custom_jme_cff.TableRecoJetAdder.getSequence (   self,
  proc 
)

Definition at line 271 of file custom_jme_cff.py.

271  def getSequence(self, proc):
272  tasks = self.main
273 
274  resultSequence = cms.Sequence()
275  for idx, task in enumerate(tasks):
276  if idx == 0:
277  resultSequence = cms.Sequence(getattr(proc, task))
278  else:
279  resultSequence.insert(idx, getattr(proc, task))
280  return resultSequence
281 

References custom_jme_cff.TableGenJetAdder.main, and custom_jme_cff.TableRecoJetAdder.main.

Member Data Documentation

◆ main

custom_jme_cff.TableRecoJetAdder.main
common_cff.Var
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
Definition: common_cff.py:20
trackselectionRefitting.getSequence
def getSequence(process, collection, saveCPU=False, TTRHBuilder="WithAngleAndTemplate", usePixelQualityFlag=None, openMassWindow=False, cosmicsDecoMode=False, cosmicsZeroTesla=True, momentumConstraint=None, cosmicTrackSplitting=False, isPVValidation=False, use_d0cut=True)
Definition: trackselectionRefitting.py:7
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
format