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

Organizes objects in OrderedDict with basic functionality to add and drop items, add Groups together, get keys, and access items. More...

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

Public Member Functions

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

 name
 str More...
 
 items
 OrderedDict() More...
 
 type
 string More...
 

Detailed Description

Organizes objects in OrderedDict with basic functionality to add and drop items, add Groups together, get keys, and access items.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name 
)

Constructor.

name Name for instance.

Member Function Documentation

◆ __add__()

def __add__ (   self,
  other 
)

Adds two Groups together.

Items in other override duplicates. If groups do not have matching type, a generic Group will be returned. Ex. newgroup = group1 + group2

Parameters
other(Group): Group to add to current Group.
Returns
Group Addition of the two groups (will be VarGroup, CutGroup, or HistGroup if applicable).

◆ __getitem__()

def __getitem__ (   self,
  key 
)

Get value from key as you would with dictionary.

Ex. val = mygroup["item_name"]

Parameters
key(obj): Key for name/key in Group.
Returns
obj Item for given key.

◆ __setitem__()

def __setitem__ (   self,
  key,
  value 
)

Set key-value pair as you would with dictionary.

Ex. mygroup["item_name"] = new_value

Parameters
key(obj): Key for value.
value(obj): Value to store.

◆ Add()

def Add (   self,
  name,
  item,
  makeCopy = False 
)

Add item to Group with a name.

Modifies in-place if copy == False.

   @param name (str): Name/key for added item.
   @param item (obj): Item to add.
   @param makeCopy (bool, optional): Creates a copy of the group with the item added.
Returns
None

◆ Clone()

def Clone (   self,
  name 
)

Clone the current group with a new name.

Parameters
name(str): Name for clone.
Returns
Group Group clone (will be VarGroup, CutGroup, or HistGroup if applicable).

◆ Drop()

def Drop (   self,
  name,
  makeCopy = False 
)

Drop item from Group with provided name/key.

Modifies in-place if copy == False.

   @param name (str): Name/key for dropped item.
   @param makeCopy (bool, optional): Creates a copy of the group with the item dropped.
Returns
None

◆ keys()

def keys (   self)

Gets list of keys from Group.

Returns
list Names/keys from Group.

◆ values()

def values (   self)

Gets list of values from Group.

Returns
list Values from Group.

Member Data Documentation

◆ items

items

OrderedDict()

Items stored as an OrderedDict()

◆ name

name

str

Name of Group

◆ type

type

string

Group type - "cut", "var", "hist"


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