Package madgraph :: Package various :: Module histograms :: Class Histogram
[hide private]
[frames] | no frames]

Class Histogram

source code

object --+
         |
        Histogram
Known Subclasses:

A mother class for all specific implementations of Histogram conventions

Instance Methods [hide private]
 
__init__(self, title='NoName', n_dimensions=2, type=None, x_axis_mode='LIN', y_axis_mode='LOG', bins=None)
Initializes an empty histogram, possibly specifying > a title > a number of dimensions > a bin content
source code
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
nice_string(self, short=True)
Nice representation of this histogram.
source code
 
alter_weights(self, func)
Apply a given function to all bin weights.
source code
 
__add__(self, other)
Overload the plus function.
source code
 
__sub__(self, other)
Overload the subtraction function.
source code
 
__mul__(self, other)
Overload the multiplication function.
source code
 
__div__(self, other)
Overload the multiplication function.
source code
 
__truediv__(self, other)
Overload the multiplication function.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
combine(cls, histoA, histoB, func)
Function to combine two Histograms.
source code
Static Methods [hide private]
 
MULTIPLY(wgtsA, wgtsB)
Apply the multiplication to the weights of two bins.
source code
 
DIVIDE(wgtsA, wgtsB)
Apply the division to the weights of two bins.
source code
 
OPERATION(wgtsA, wgtsB, wgt_operation, stat_error_operation)
Apply the operation to the weights of two bins.
source code
 
SINGLEHISTO_OPERATION(wgts, wgt_operation, stat_error_operation)
Apply the operation to the weights of a *single* bins.
source code
 
ADD(wgtsA, wgtsB)
Implements the addition using OPERATION above.
source code
 
SUBTRACT(wgtsA, wgtsB)
Implements the subtraction using OPERATION above.
source code
 
RESCALE(factor)
Implements the rescaling using SINGLEHISTO_OPERATION above.
source code
 
OFFSET(offset)
Implements the offset using SINGLEBIN_OPERATION above.
source code
Class Variables [hide private]
  allowed_dimensions = None
hash(x)
  allowed_types = []
  allowed_axis_modes = ['LOG', 'LIN']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, title='NoName', n_dimensions=2, type=None, x_axis_mode='LIN', y_axis_mode='LOG', bins=None)
(Constructor)

source code 

Initializes an empty histogram, possibly specifying > a title > a number of dimensions > a bin content

Overrides: object.__init__

__setattr__(self, name, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

combine(cls, histoA, histoB, func)
Class Method

source code 

Function to combine two Histograms. The 'func' is such that it takes two weight dictionaries and merge them into one.

OPERATION(wgtsA, wgtsB, wgt_operation, stat_error_operation)
Static Method

source code 

Apply the operation to the weights of two bins. Notice that we assume here the two dict operands to have the same weight labels. The operation is a function that takes two floats as input.

SINGLEHISTO_OPERATION(wgts, wgt_operation, stat_error_operation)
Static Method

source code 

Apply the operation to the weights of a *single* bins. The operation is a function that takes a single float as input.