CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
python.rootplot.utilities Namespace Reference

Classes

class  Hist
 
class  Hist2D
 Define classes. More...
 
class  HistStack
 
class  RootFile
 

Functions

def _rootglob0
 
def _rootglob1
 
def find_num_processors
 
def get
 
def has_glob_magic
 
def irootglob
 
def loadROOT
 Define additional helping functions. More...
 
def ls
 
def process_bin_labels
 
def pwd
 
def replace
 
def rootglob
 
def testfile
 
def wilson_interval
 

Variables

string __license__
 
tuple glob_magic_check = re.compile('[*?[]')
 Functions for globbing within root files. More...
 

Detailed Description

Utilities for rootplot including histogram classes.

Function Documentation

def python.rootplot.utilities._rootglob0 (   tdirectory,
  dirname,
  basename 
)
private

Definition at line 552 of file utilities.py.

def python.rootplot.utilities._rootglob1 (   tdirectory,
  dirname,
  pattern 
)
private

Definition at line 545 of file utilities.py.

def python.rootplot.utilities.find_num_processors ( )

Definition at line 510 of file utilities.py.

def python.rootplot.utilities.get (   object_name)
Return a Hist object with the given name.

Definition at line 426 of file utilities.py.

def python.rootplot.utilities.has_glob_magic (   s)

Definition at line 537 of file utilities.py.

def python.rootplot.utilities.irootglob (   tdirectory,
  pathname 
)
Return an iterator which yields the paths matching a pathname pattern.

The pattern may contain simple shell-style wildcards a la fnmatch.

Definition at line 575 of file utilities.py.

def python.rootplot.utilities.loadROOT (   batch = True)

Define additional helping functions.

Definition at line 433 of file utilities.py.

def python.rootplot.utilities.ls (   directory = None)
Return a python list of ROOT object names from the given directory.

Definition at line 408 of file utilities.py.

def python.rootplot.utilities.process_bin_labels (   binlabels)

Definition at line 484 of file utilities.py.

def python.rootplot.utilities.pwd ( )
Return ROOT's present working directory.

Definition at line 422 of file utilities.py.

def python.rootplot.utilities.replace (   string,
  replacements 
)
Modify a string based on a list of patterns and substitutions.

replacements should be a list of two-entry tuples, the first entry giving
a string to search for and the second entry giving the string with which
to replace it.  If replacements includes a pattern entry containing
'use_regexp', then all patterns will be treated as regular expressions
using re.sub.

Definition at line 461 of file utilities.py.

def python.rootplot.utilities.rootglob (   tdirectory,
  pathname 
)
Return a list of paths matching a pathname pattern.

The pattern may contain simple shell-style wildcards a la fnmatch.

>>> import rootplot.utilities
>>> f = rootplot.utilities.testfile()
>>> rootglob(f, '*')
['dir1', 'dir2', 'dir3', 'dir4']
>>> rootglob(f, 'dir1/*')
['dir1/hist1', 'dir1/hist2', 'dir1/hist3', 'dir1/hist4']
>>> rootglob(f, '*/hist1')
['dir1/hist1', 'dir2/hist1', 'dir3/hist1', 'dir4/hist1']
>>> rootglob(f, 'dir1/hist[1-2]')
['dir1/hist1', 'dir1/hist2']

Definition at line 557 of file utilities.py.

def python.rootplot.utilities.testfile ( )

Definition at line 521 of file utilities.py.

def python.rootplot.utilities.wilson_interval (   numerator_array,
  denominator_array 
)

Definition at line 494 of file utilities.py.

Variable Documentation

string python.rootplot.utilities.__license__
Initial value:
1 = '''\
2 Copyright (c) 2009-2010 Jeff Klukas <klukas@wisc.edu>
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 '''

Definition at line 5 of file utilities.py.

tuple python.rootplot.utilities.glob_magic_check = re.compile('[*?[]')

Functions for globbing within root files.

Definition at line 535 of file utilities.py.