CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, jetSelection)
 
def analyze (self, event)
 
def beginFile (self, inputFile, outputFile, inputTree, wrappedOutputTree)
 
def beginJob (self)
 
def endFile (self, inputFile, outputFile, inputTree, wrappedOutputTree)
 
def endJob (self)
 

Public Attributes

 jetSel
 
 out
 

Detailed Description

Definition at line 18 of file exampleModule.py.

Constructor & Destructor Documentation

◆ __init__()

def exampleModule.exampleProducer.__init__ (   self,
  jetSelection 
)

Definition at line 19 of file exampleModule.py.

19  def __init__(self, jetSelection):
20  self.jetSel = jetSelection
21  pass
22 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ analyze()

def exampleModule.exampleProducer.analyze (   self,
  event 
)
process event, return True (go to next module) or False (fail, go to next event)

Definition at line 36 of file exampleModule.py.

36  def analyze(self, event):
37  """process event, return True (go to next module) or False (fail, go to next event)"""
38  electrons = Collection(event, "Electron")
39  muons = Collection(event, "Muon")
40  jets = Collection(event, "Jet")
41  eventSum = ROOT.TLorentzVector()
42  for lep in muons:
43  eventSum += lep.p4()
44  for lep in electrons:
45  eventSum += lep.p4()
46  for j in filter(self.jetSel, jets):
47  eventSum += j.p4()
48  self.out.fillBranch("EventMass", eventSum.M())
49  return True
50 
51 
52 # define modules using the syntax 'name = lambda : constructor' to avoid having them loaded when not needed
53 
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override

◆ beginFile()

def exampleModule.exampleProducer.beginFile (   self,
  inputFile,
  outputFile,
  inputTree,
  wrappedOutputTree 
)

Definition at line 29 of file exampleModule.py.

29  def beginFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
30  self.out = wrappedOutputTree
31  self.out.branch("EventMass", "F")
32 

◆ beginJob()

def exampleModule.exampleProducer.beginJob (   self)

Definition at line 23 of file exampleModule.py.

23  def beginJob(self):
24  pass
25 
void beginJob()
Definition: Breakpoints.cc:14

◆ endFile()

def exampleModule.exampleProducer.endFile (   self,
  inputFile,
  outputFile,
  inputTree,
  wrappedOutputTree 
)

Definition at line 33 of file exampleModule.py.

33  def endFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
34  pass
35 

◆ endJob()

def exampleModule.exampleProducer.endJob (   self)

Definition at line 26 of file exampleModule.py.

26  def endJob(self):
27  pass
28 

Member Data Documentation

◆ jetSel

exampleModule.exampleProducer.jetSel

Definition at line 20 of file exampleModule.py.

◆ out

exampleModule.exampleProducer.out