/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Member Functions
DybPython::Util::hists::Keeper Class Reference

List of all members.

Public Member Functions

def __init__
def __setattr__
def __getattr__

Private Member Functions

def _key2path

Detailed Description

A histogram keeper to help organize your histograms and make use
of the StatisticsSvc.  You create histograms as normal and assign
them to data members.  This will cause them to be registered with
the StatisticsSvc.  After that the histogram can be accessed
through the data member for filling.  Eg:

from DybPython.hists import *
from ROOT import TH1I

def initialize(self):
    self.h = hists.Keeper(statsSvc,"/file1/MyAlgName/mysubdir")
    self.h.nHits = TH1I("nHits","Number of Hit PMTs per event",192,0,192)

def execute(self):
    nHits = ...
    self.h.nHits.Fill(nHits)

Definition at line 7 of file hists.py.


Constructor & Destructor Documentation

def DybPython::Util::hists::Keeper::__init__ (   self,
  statSvc,
  prefix 
)

Definition at line 28 of file hists.py.

00029                                      :
00030         self.__dict__['_statSvc'] = statSvc
00031         self.__dict__['_prefix'] = prefix
00032         return


Member Function Documentation

def DybPython::Util::hists::Keeper::_key2path (   self,
  key 
) [private]

Definition at line 33 of file hists.py.

00034                            :
00035         'Convert the given key to a FQ path if it is not already absolute'
00036         if key[0] != '/':
00037             key = self._prefix + '/' + key
00038         return key

def DybPython::Util::hists::Keeper::__setattr__ (   self,
  key,
  value 
)

Definition at line 39 of file hists.py.

00040                                    :
00041         key = self._key2path(key)
00042         if self.__dict__.has_key(key):
00043             raise KeyError, 'key "%s" already set' % key
00044         self._statSvc.put(key,value)
00045         self.__dict__[key] = value
00046         return

def DybPython::Util::hists::Keeper::__getattr__ (   self,
  key 
)

Definition at line 47 of file hists.py.

00048                              :
00049         return self.__dict__[self._key2path(key)]


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4