CMS 3D CMS Logo

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

Public Member Functions

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

Public Attributes

 main
 

Detailed Description

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

Definition at line 188 of file custom_jme_cff.py.

Constructor & Destructor Documentation

◆ __init__()

def custom_jme_cff.TableGenJetAdder.__init__ (   self)

Definition at line 193 of file custom_jme_cff.py.

193  def __init__(self):
194  self.main = []
195 

Member Function Documentation

◆ addTable()

def custom_jme_cff.TableGenJetAdder.addTable (   self,
  proc,
  genJetInfo 
)

Definition at line 210 of file custom_jme_cff.py.

210  def addTable(self, proc, genJetInfo):
211  currentTasks = []
212 
213  print("custom_jme_cff::TableGenJetAdder::addTable: Adding Table for GenJet Collection: {}".format(genJetInfo.jet))
214 
215  name = nanoInfo_genjets[genJetInfo.jet]["name"]
216  doc = nanoInfo_genjets[genJetInfo.jet]["doc"]
217 
218  if name in genjetNameInNano:
219  raise RuntimeError('GenJet collection name (%s) taken in NanoAOD for %s' %(name, genJetInfo.jet))
220 
221  #
222  # GenJet Table
223  #
224  table = "{}Table".format(genJetInfo.jetTagName)
225  genJetsCollection = "{}{}{}".format(genJetInfo.jetAlgo.upper(), genJetInfo.jetSize, 'GenJetsNoNu')
226  setattr(proc, table, cms.EDProducer("SimpleCandidateFlatTableProducer",
227  src = cms.InputTag(genJetsCollection),
228  cut = cms.string(""),
229  name = cms.string(name),
230  doc = cms.string('{} (generator level)'.format(doc)),
231  singleton = cms.bool(False),
232  extension = cms.bool(False),
233  variables = cms.PSet(P4Vars,
234  area = jetTable.variables.area,
235  ),
236  )
237  )
238  currentTasks.append(table)
239 
240  #
241  # GenJet Flavour Table
242  #
243  genFlavour = "{}Flavour".format(genJetInfo.jetTagName)
244  genFlavourTable = "{}Table".format(genFlavour)
245  if genFlavourTable in self.main:
246  raise ValueError("Step '%s' already implemented" % genFlavourTable)
247  setattr(proc, genFlavourTable, cms.EDProducer("GenJetFlavourTableProducer",
248  name = cms.string(name),
249  src = cms.InputTag(genJetsCollection),
250  cut = cms.string(""),
251  deltaR = cms.double(0.1),
252  jetFlavourInfos = cms.InputTag(genFlavour),
253  )
254  )
255  currentTasks.append(genFlavourTable)
256  self.main.extend(currentTasks)
257 
258 #============================================
259 #
260 # TableRecoJetAdder
261 #
262 #============================================

References custom_jme_cff.TableGenJetAdder.main, and edm.print().

◆ getSequence()

def custom_jme_cff.TableGenJetAdder.getSequence (   self,
  proc 
)
Tool to add 

Definition at line 196 of file custom_jme_cff.py.

196  def getSequence(self, proc):
197  """
198  Tool to add
199  """
200  tasks = self.main
201 
202  resultSequence = cms.Sequence()
203  for idx, task in enumerate(tasks):
204  if idx == 0:
205  resultSequence = cms.Sequence(getattr(proc, task))
206  else:
207  resultSequence.insert(idx, getattr(proc, task))
208  return resultSequence
209 

References custom_jme_cff.TableGenJetAdder.main.

Member Data Documentation

◆ main

custom_jme_cff.TableGenJetAdder.main
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