CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self)
 
def addGenJetCollection (self, proc, jet, inputCollection="", genName="")
 
def addProcessAndTask (self, proc, label, module)
 

Public Attributes

 gpLabel
 
 main
 
 prerequisites
 

Detailed Description

Tool to schedule modules for building a genjet collection with input MiniAODs

Definition at line 62 of file jetCollectionTools.py.

Constructor & Destructor Documentation

def jetCollectionTools.GenJetAdder.__init__ (   self)

Member Function Documentation

def jetCollectionTools.GenJetAdder.addGenJetCollection (   self,
  proc,
  jet,
  inputCollection = "",
  genName = "" 
)

Definition at line 80 of file jetCollectionTools.py.

References jetCollectionTools.GenJetAdder.addProcessAndTask(), jetCollectionTools.GenJetAdder.prerequisites, and edm.print().

Referenced by jetCollectionTools.GenJetAdder.addProcessAndTask().

80  ):
81  print("jetCollectionTools::GenJetAdder::addGenJetCollection: Adding Gen Jet Collection: {}".format(jet))
82 
83  #
84  # Decide which genJet collection we are dealing with
85  #
86  jetLower = jet.lower()
87  jetUpper = jet.upper()
88  tagName = jetUpper
89  genJetInfo = GenJetInfo(jet,inputCollection)
90 
91  #=======================================================
92  #
93  # If genJet collection in MiniAOD is not
94  # specified, build the genjet collection.
95  #
96  #========================================================
97  if not inputCollection:
98  print("jetCollectionTools::GenJetAdder::addGenJetCollection: inputCollection not specified. Building genjet collection now")
99  #
100  # Setup GenParticles
101  #
102  packedGenPartNoNu = "packedGenParticlesForJetsNoNu"
103  if packedGenPartNoNu not in self.prerequisites:
104  self.addProcessAndTask(proc, packedGenPartNoNu, cms.EDFilter("CandPtrSelector",
105  src = cms.InputTag("packedGenParticles"),
106  cut = cms.string("abs(pdgId) != 12 && abs(pdgId) != 14 && abs(pdgId) != 16"),
107  )
108  )
109  self.prerequisites.append(packedGenPartNoNu)
110  #
111  # Create the GenJet collection
112  #
113  genJetsCollection = "{}{}{}".format(genJetInfo.jetAlgo.upper(), genJetInfo.jetSize, 'GenJetsNoNu')
114  self.addProcessAndTask(proc, genJetsCollection, ak4GenJets.clone(
115  src = packedGenPartNoNu,
116  jetAlgorithm = cms.string(supportedJetAlgos[genJetInfo.jetAlgo]),
117  rParam = cms.double(genJetInfo.jetSizeNr),
118  )
119  )
120  self.prerequisites.append(genJetsCollection)
121 
122  return genJetInfo
123 
124 #============================================
125 #
126 # RecoJetInfo
127 #
128 #============================================
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def addProcessAndTask(self, proc, label, module)
def jetCollectionTools.GenJetAdder.addProcessAndTask (   self,
  proc,
  label,
  module 
)

Definition at line 71 of file jetCollectionTools.py.

References jetCollectionTools.GenJetAdder.addGenJetCollection(), helpers.addToProcessAndTask(), and helpers.getPatAlgosToolsTask().

Referenced by jetCollectionTools.GenJetAdder.addGenJetCollection(), and jetCollectionTools.RecoJetAdder.addRecoJetCollection().

71  def addProcessAndTask(self, proc, label, module):
72  task = getPatAlgosToolsTask(proc)
73  addToProcessAndTask(label, module, proc, task)
74 
def addToProcessAndTask(label, module, process, task)
Definition: helpers.py:29
def addProcessAndTask(self, proc, label, module)
def getPatAlgosToolsTask(process)
Definition: helpers.py:14

Member Data Documentation

jetCollectionTools.GenJetAdder.gpLabel
jetCollectionTools.GenJetAdder.main
jetCollectionTools.GenJetAdder.prerequisites