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 19 of file rltinfo.py.

Constructor & Destructor Documentation

def rltinfo.RLTInfo.__init__ (   self)

Definition at line 20 of file rltinfo.py.

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

Member Function Documentation

def rltinfo.RLTInfo.__str__ (   self)

Definition at line 27 of file rltinfo.py.

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

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

Definition at line 23 of file rltinfo.py.

Referenced by counter.Counter.register().

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

Definition at line 33 of file rltinfo.py.

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

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

Member Data Documentation

rltinfo.RLTInfo.dict