CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def add (self, trigger, run, lumi)
 
def write (self, dirName, fileName='RLTInfo.root')
 

Public Attributes

 dict
 

Detailed Description

Definition at line 18 of file rltinfo.py.

Constructor & Destructor Documentation

def rltinfo.RLTInfo.__init__ (   self)

Definition at line 19 of file rltinfo.py.

19  def __init__(self):
20  self.dict = {}
21 
def __init__(self)
Definition: rltinfo.py:19

Member Function Documentation

def rltinfo.RLTInfo.__str__ (   self)

Definition at line 26 of file rltinfo.py.

References rltinfo.RLTInfo.dict, join(), and str.

26  def __str__(self):
27  lines = []
28  for rlt, count in six.iteritems(self.dict):
29  lines.append( ': '.join( [str(rlt), str(count)] ))
30  return '\n'.join(lines)
31 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __str__(self)
Definition: rltinfo.py:26
#define str(s)
def rltinfo.RLTInfo.add (   self,
  trigger,
  run,
  lumi 
)

Definition at line 22 of file rltinfo.py.

Referenced by counter.Counter.register().

22  def add(self, trigger, run, lumi):
23  nEv = self.dict.setdefault( (trigger, run, lumi), MyInteger(0) )
24  nEv += 1
25 
def add(self, trigger, run, lumi)
Definition: rltinfo.py:22
def rltinfo.RLTInfo.write (   self,
  dirName,
  fileName = 'RLTInfo.root' 
)

Definition at line 32 of file rltinfo.py.

References rltinfo.RLTInfo.dict, and join().

32  def write(self, dirName, fileName='RLTInfo.root'):
33  f = TFile('/'.join( [dirName, fileName]), 'RECREATE')
34  t = Tree('RLTInfo','HLT/Run/Lumi information')
35  t.var('run', int )
36  t.var('lumi', int )
37  t.var('counts', int )
38  t.var('trigger', int )
39  for rlt, count in six.iteritems(self.dict):
40  t.fill('run', rlt[1])
41  t.fill('lumi', rlt[2])
42  t.fill( 'counts', count.integer)
43  t.tree.Fill()
44  f.Write()
45  f.Close()
46 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def write(self, dirName, fileName='RLTInfo.root')
Definition: rltinfo.py:32

Member Data Documentation

rltinfo.RLTInfo.dict