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="", minPtFastjet=None)
 
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 63 of file jetCollectionTools.py.

Constructor & Destructor Documentation

def jetCollectionTools.GenJetAdder.__init__ (   self)

Member Function Documentation

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

Definition at line 81 of file jetCollectionTools.py.

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

Referenced by jetCollectionTools.GenJetAdder.addProcessAndTask().

81  ):
82  print("jetCollectionTools::GenJetAdder::addGenJetCollection: Adding Gen Jet Collection: {}".format(jet))
83 
84  #
85  # Decide which genJet collection we are dealing with
86  #
87  genJetInfo = GenJetInfo(jet,inputCollection)
88  jetLower = genJetInfo.jetLower
89  jetUpper = genJetInfo.jetUpper
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  #
121  # Set minimum pt threshold of gen jets to be saved after fastjet clustering
122  #
123  if minPtFastjet != None:
124  getattr(proc, genJetsCollection).jetPtMin = minPtFastjet
125  self.prerequisites.append(genJetsCollection)
126 
127  return genJetInfo
128 #============================================
129 #
130 # RecoJetInfo
131 #
132 #============================================
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 72 of file jetCollectionTools.py.

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

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

72  def addProcessAndTask(self, proc, label, module):
73  task = getPatAlgosToolsTask(proc)
74  addToProcessAndTask(label, module, proc, task)
75 
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