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 42 of file eventloop.py.

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

◆ addObjectList()

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

Definition at line 46 of file eventloop.py.

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

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

◆ 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 38 of file eventloop.py.

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

◆ beginFile()

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

Definition at line 32 of file eventloop.py.

32  def beginFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
33  pass
34 

◆ 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)
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 35 of file eventloop.py.

35  def endFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
36  pass
37 

◆ 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.histFile, 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  if hasattr(self, 'histFile') and self.histFile != None:
30  self.histFile.Close()
31 

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 eventloop.Module.endJob(), and 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().