PhaseSpace¶
-
class
remu.binning.
PhaseSpace
(variables)[source]¶ A PhaseSpace defines the possible combinations of variables that characterize an event.
Parameters: - variables : iterable of strings
The set of variables that define the phase space.
Notes
A PhaseSpace can be seen as the carthesian product of its variables:
>>> ps = PhaseSpace(variables=['a', 'b', 'c']) >>> print ps ('a' X 'c' X 'b')
You can check whether a variable is part of a phase space:
>>> 'a' in ps True
Phase spaces can be compared to one another.
Check whether two phase spaces are identical:
>>> PhaseSpace(['a','b']) == PhaseSpace(['b', 'a']) True >>> PhaseSpace(['a', 'b']) == PhaseSpace(['a', 'c']) False >>> PhaseSpace(['a', 'b']) != PhaseSpace(['a', 'c']) True
Check whether one phase space is a sub-space of the other:
>>> PhaseSpace(['a', 'b','c')] > PhaseSpace(['a', 'b']) True >>> PhaseSpace(['a', 'c']) < PhaseSpace(['a', 'b','c']) True