![]() |
TIMBER
beta
Tree Interface for Making Binned Events with RDataFrame
|
Stores histograms with dedicated function to use TH1/2/3 methods in a batch. More...


Public Member Functions | |
| def | __getitem__ (self, key, lazy=False) |
| Get value from key as you would with dictionary. More... | |
| def | __init__ (self, name) |
| Constructor. More... | |
| def | Add (self, name, item, meta={}) |
| Add histogram to the group. 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 | __add__ (self, other) |
| Adds two Groups together. More... | |
| def | __getitem__ (self, key) |
| Get value from key as you would with dictionary. More... | |
| def | __init__ (self, name) |
| Constructor. More... | |
| def | __setitem__ (self, key, value) |
| Set key-value pair as you would with dictionary. More... | |
| def | Add (self, name, item, meta={}, makeCopy=False) |
| Add item to Group with a name. More... | |
| def | Clone (self, name) |
| Clone the current group with a new name. More... | |
| def | Drop (self, name, makeCopy=False) |
| Drop item from Group with provided name/key. More... | |
| def | keys (self) |
| Gets list of keys from Group. More... | |
| def | values (self) |
| Gets list of values from Group. More... | |
Public Attributes | |
| type | |
| str Set to 'hist' so group is treated as histograms. More... | |
Public Attributes inherited from Group | |
| item_meta | |
| OrderedDict() More... | |
| items | |
| OrderedDict() More... | |
| name | |
| str More... | |
| type | |
| string More... | |
Stores histograms with dedicated function to use TH1/2/3 methods in a batch.
| def __init__ | ( | self, | |
| name | |||
| ) |
Constructor.
| name | (str): Name for instance. |
| def __getitem__ | ( | self, | |
| key, | |||
lazy = False |
|||
| ) |
Get value from key as you would with dictionary.
If lazy == False and the stored value is a histogram pointer, return the actual histogram. Ex. val = mygroup["item_name"]
| key | (obj): Key for name/key in Group. |
| lazy | (bool): Access only the pointer, not the histogram (avoids execution of loop). |
| def Add | ( | self, | |
| name, | |||
| item, | |||
meta = {} |
|||
| ) |
Add histogram to the group.
Internal group name will match the histogram name if not otherwise specified but note that this will cause an RDataFrame loop to happen!
| name | (str): Name of histogram to use as key. Cannot access name of histogram from the pointer or it will execute the loop. |
| item | (TH1): Histogram to add. |
| meta | (dict): Meta information to associate with the histogram like "xtitle", "ytitle", "ztitle" that can be shipped for later use so that the loop does not execute. |
| def Do | ( | self, | |
| THmethod, | |||
argsTuple = () |
|||
| ) |
Batch act on histograms using ROOT TH1/2/3 methods.
| THmethod | (str): String of the ROOT TH1/2/3 method to use. |
| argsTuple | (tuple): Tuple of arguments to pass to THmethod. |
Examples
To scale all histograms by 0.5
| def Merge | ( | self | ) |
Merge together the histograms in the group.
| type |
str Set to 'hist' so group is treated as histograms.
1.8.13