TIMBER  beta
Tree Interface for Making Binned Events with RDataFrame
Public Member Functions | Public Attributes | List of all members
HistGroup Class Reference

Stores histograms with dedicated function to use TH1/2/3 methods in a batch. More...

Inheritance diagram for HistGroup:
Inheritance graph
[legend]
Collaboration diagram for HistGroup:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, name)
 Constructor. More...
 
def Do (self, THmethod, argsTuple=())
 Batch act on histograms using ROOT TH1/2/3 methods. More...
 
def Merge (self)
 Merge together the histograms in the group. More...
 
- Public Member Functions inherited from Group
def __init__ (self, name)
 Constructor. More...
 
def Add (self, name, item, makeCopy=False)
 Add item to Group with a name. More...
 
def Drop (self, name, makeCopy=False)
 Drop item from Group with provided name/key. More...
 
def Clone (self, name)
 Clone the current group with a new name. More...
 
def __add__ (self, other)
 Adds two Groups together. More...
 
def keys (self)
 Gets list of keys from Group. More...
 
def values (self)
 Gets list of values from Group. More...
 
def __setitem__ (self, key, value)
 Set key-value pair as you would with dictionary. More...
 
def __getitem__ (self, key)
 Get value from key as you would with dictionary. More...
 

Public Attributes

 type
 Set to 'hist' so group is treated as histograms. More...
 
- Public Attributes inherited from Group
 name
 str More...
 
 items
 OrderedDict() More...
 
 type
 string More...
 

Detailed Description

Stores histograms with dedicated function to use TH1/2/3 methods in a batch.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name 
)

Constructor.

Parameters
name(str): Name for instance.

Member Function Documentation

◆ Do()

def Do (   self,
  THmethod,
  argsTuple = () 
)

Batch act on histograms using ROOT TH1/2/3 methods.

Parameters
THmethod(str): String of the ROOT TH1/2/3 method to use.
argsTuple(tuple): Tuple of arguments to pass to THmethod.
Returns
HistGroup or None: New HistGroup with THmethod applied if THmethod does not return None; else None.

Examples

To scale all histograms by 0.5

myHistGroup.Do("Scale",(0.5))

◆ Merge()

def Merge (   self)

Merge together the histograms in the group.

Returns
TH1 Merged histogram.

Member Data Documentation

◆ type

type

Set to 'hist' so group is treated as histograms.


The documentation for this class was generated from the following file: