Belle II Software  release-08-01-10
ToFlat Class Reference
Inheritance diagram for ToFlat:
Collaboration diagram for ToFlat:

Public Member Functions

def __init__ (self, *args)
 
def get_flat_bins (self)
 
def get_x (self, x_flat)
 
def fit (self, x, y=None)
 
def __call__ (self, x)
 
def transform (self, x, set_limits=False)
 
def set_n_bins (self, n)
 
def set_limits (self, x)
 
def io (self)
 

Public Attributes

 cdf
 Transformation with the CDF.
 
 n_bins
 Binning in x, will be set automatically.
 
 max
 Maximum of the fitted distribution.
 
 min
 Minimum of the fitted distribution.
 
 is_processed
 Status flag.
 
 name
 Name of the transformation.
 

Private Member Functions

def _fit (self, x, y=None)
 
def _transform (self, x)
 
def _initialise (self, x)
 

Detailed Description

This transformation uses the CDF to transform input data to a
flat transformation.

Attributes
----------
cdf : Transform.CDF
    Transformation with the CDF

Definition at line 235 of file transform.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
args 
)
 Init function

:param args: None

Definition at line 248 of file transform.py.

Member Function Documentation

◆ __call__()

def __call__ (   self,
  x 
)
inherited
 Call function calls transform
:param x:   Input data
:return:    Transformed data

Definition at line 95 of file transform.py.

◆ _fit()

def _fit (   self,
  x,
  y = None 
)
private
Fit function calculates the cumulative distribution with numpy percentile.

:param x:   Inout distribution
:param y:   Will not be used in this transformation

Reimplemented from Transform.

Definition at line 258 of file transform.py.

◆ _initialise()

def _initialise (   self,
  x 
)
privateinherited
Sets limits for the data.
Not called by the user.

:param x: array type

Definition at line 71 of file transform.py.

◆ _transform()

def _transform (   self,
  x 
)
private
Transforms the input data according to the cdf.
:param x:   Input data
:return:    Transformed data

Reimplemented from Transform.

Definition at line 268 of file transform.py.

◆ fit()

def fit (   self,
  x,
  y = None 
)
inherited
The fit function is calls the individual _fit() functions.

:param x:   Distribution to fit, array type
:param y:   optional for some transformations, sets signal class

Definition at line 84 of file transform.py.

◆ get_flat_bins()

def get_flat_bins (   self)
Returns the binning of the CDF
:return: Binning for a flat distribution

Definition at line 278 of file transform.py.

◆ get_x()

def get_x (   self,
  x_flat 
)
Dirty version for getting the original x value out of a flat x value.
:param x_flat:  x value in the flat distribution
:return:        x value on the original axis (approx)

Definition at line 285 of file transform.py.

◆ io()

def io (   self)
inherited
Logging function
:return: logger

Definition at line 49 of file settings.py.

◆ set_limits()

def set_limits (   self,
  x 
)
inherited
Limits the data to the fitted range.
:param x:   Input data
:return:    Limited data

Definition at line 139 of file transform.py.

◆ set_n_bins()

def set_n_bins (   self,
  n 
)
inherited
Calculates the optimal size for the binning.
:param n:   Length of the input data

Definition at line 131 of file transform.py.

◆ transform()

def transform (   self,
  x,
  set_limits = False 
)
inherited
This is defined in the children and overwritten.
:param x:           Distribution to transform, array type
:param set_limits:  Limits the range of the data to the fitted range
:return:            Transformed data

Definition at line 110 of file transform.py.


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