CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self)
 
def addObject (self, obj)
 
def addObjectList (self, names, obj)
 
def analyze (self, event)
 
def beginFile (self, inputFile, outputFile, inputTree, wrappedOutputTree)
 
def beginJob (self, histFile=None, histDirName=None)
 
def endFile (self, inputFile, outputFile, inputTree, wrappedOutputTree)
 
def endJob (self)
 

Public Attributes

 dir
 
 histFile
 
 objs
 
 writeHistFile
 

Detailed Description

Definition at line 8 of file eventloop.py.

Constructor & Destructor Documentation

◆ __init__()

def eventloop.Module.__init__ (   self)

Definition at line 9 of file eventloop.py.

9  def __init__(self):
10  self.writeHistFile = False
11 
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

◆ addObject()

def eventloop.Module.addObject (   self,
  obj 
)

Definition at line 40 of file eventloop.py.

40  def addObject(self, obj):
41  setattr(self, obj.GetName(), obj)
42  self.objs.append(getattr(self, obj.GetName()))
43 

◆ addObjectList()

def eventloop.Module.addObjectList (   self,
  names,
  obj 
)

Definition at line 44 of file eventloop.py.

References mps_setup.append, eventloop.eventLoop(), eventloop.Module.objs, and DQMImplNet< ObjType >::ImplPeer.objs.

44  def addObjectList(self, names, obj):
45  objlist = []
46  for iname, name in enumerate(names):
47  setattr(self, obj.GetName() + '_' + name,
48  obj.Clone(obj.GetName() + '_' + name))
49  objlist.append(getattr(self, obj.GetName() + '_' + name))
50  self.objs.append(getattr(self, obj.GetName() + '_' + name))
51  setattr(self, obj.GetName(), objlist)
52 
53 

◆ analyze()

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

Definition at line 36 of file eventloop.py.

36  def analyze(self, event):
37  """process event, return True (go to next module) or False (fail, go to next event)"""
38  pass
39 
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override

◆ beginFile()

def eventloop.Module.beginFile (   self,
  inputFile,
  outputFile,
  inputTree,
  wrappedOutputTree 
)

Definition at line 30 of file eventloop.py.

30  def beginFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
31  pass
32 

◆ beginJob()

def eventloop.Module.beginJob (   self,
  histFile = None,
  histDirName = None 
)

Definition at line 12 of file eventloop.py.

References eventloop.Module.writeHistFile.

12  def beginJob(self, histFile=None, histDirName=None):
13  if histFile != None and histDirName != None:
14  self.writeHistFile = True
15  prevdir = ROOT.gDirectory
16  self.histFile = histFile
17  self.histFile.cd()
18  self.dir = self.histFile.mkdir(histDirName, "", True)
19  prevdir.cd()
20  self.objs = []
21 
void beginJob()
Definition: Breakpoints.cc:14
def mkdir(path)
Definition: eostools.py:251

◆ endFile()

def eventloop.Module.endFile (   self,
  inputFile,
  outputFile,
  inputTree,
  wrappedOutputTree 
)

Definition at line 33 of file eventloop.py.

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

◆ endJob()

def eventloop.Module.endJob (   self)

Definition at line 22 of file eventloop.py.

References hippyaddtobaddatafiles.cd(), eventloop.Module.dir, histograms.Histograms.dir, nano_mu::DTTrigGeomUtils::chambCoord.dir, dataset.LocalDataset.dir, eventloop.Module.objs, and DQMImplNet< ObjType >::ImplPeer.objs.

22  def endJob(self):
23  if hasattr(self, 'objs') and self.objs != None:
24  prevdir = ROOT.gDirectory
25  self.dir.cd()
26  for obj in self.objs:
27  obj.Write()
28  prevdir.cd()
29 

Member Data Documentation

◆ dir

eventloop.Module.dir

Definition at line 18 of file eventloop.py.

Referenced by eventloop.Module.endJob(), and Inspector.Inspector.Loop().

◆ histFile

eventloop.Module.histFile

Definition at line 16 of file eventloop.py.

Referenced by postprocessor.PostProcessor.run().

◆ objs

eventloop.Module.objs

Definition at line 20 of file eventloop.py.

Referenced by eventloop.Module.addObjectList(), and eventloop.Module.endJob().

◆ writeHistFile

eventloop.Module.writeHistFile

Definition at line 10 of file eventloop.py.

Referenced by eventloop.Module.beginJob().