2DAlphabet
2.0
Background modeling framework
|
Wraps binned distributions in a common type so that distributions can easily be manipulated and compared. More...
Public Member Functions | |
def | __init__ (self, name, binning, forcePositive=True) |
Constructor. More... | |
def | Add (self, name, other, factor='1') |
Add self with other . More... | |
def | Divide (self, name, other) |
Divide self by other . More... | |
def | getBinVal (self, xbin, ybin) |
Get bin value (for the current parameter values) in bin (xbin, ybin). More... | |
def | getBinVar (self, xbin, ybin, c='') |
Get the bin variable associated with (xbin,ybin). More... | |
def | Multiply (self, name, other) |
Multiply self with other . More... | |
def | RooParametricHist (self) |
Produce a RooParametricHist2D filled with this object's binVars. More... | |
Public Attributes | |
binArgLists | |
Dict mapping of the subspaces (LOW, SIG, HIGH) to the RooArgList of the RooAbsArgs in the subspace. More... | |
binning | |
Binning object. More... | |
binVars | |
Ordered dictionary of all RooAbsArgs representing the bins of the space. More... | |
forcePositive | |
Option to ensure bin values cannot be negative. More... | |
name | |
Unique name of object which will be prepended to all associated RooFit objects. More... | |
nuisances | |
All tracked nuisance dictionaries. More... | |
rph | |
Dict mapping of the subspaces (LOW, SIG, HIGH) to the RooParametricHist2D objects of the subspaces. More... | |
Private Member Functions | |
def | _manipulate (self, name, other, operator='') |
Base method to create a new Generic2D object. More... | |
Private Attributes | |
_varStorage | |
Wraps binned distributions in a common type so that distributions can easily be manipulated and compared.
While a full distribution is always input, this class will actually store three sets of bins, one each for the 'LOW', 'SIG', and 'HIGH' categories of the X axis. The three sets are considered one "object" to the user. Combining an object of class Generic2D with another (see _manipulate
method) creates a new Generic2D object with new RooFormulaVars corresponding to the manipulation. To avoid python's garbage collection of RooFit objects, assign each instance of this class to a persistent variable.
def __init__ | ( | self, | |
name, | |||
binning, | |||
forcePositive = True |
|||
) |
Constructor.
name | Unique name of object which will be prepended to all associated RooFit objects. |
binning | Binning scheme object. forcePositive (bool, optional). Defaults to True in which case the bin values will be lower bound by 1e-9. |
|
private |
Base method to create a new Generic2D object.
When combining self
and other
, a new set of RooFormulaVars will be created for the new Generic2D object that connect self
and other
with the operator
string. The associated nuisances of self
and other
will also be passed to the new object as one set (with potential duplicates removed).
If attempting to add, subtract, multiply, or divide, use the dedicated methods. More complex use cases could be built here.
name | Unique name for the new output Generic2D object. |
other | Object to combine with self. operator (str, optional): Connecting mathematical operator string for the combination. Defaults to '*' which causes the method to return self*other. |
self
and other
. def Add | ( | self, | |
name, | |||
other, | |||
factor = '1' |
|||
) |
Add self
with other
.
Optionally change the factor in front of other
(defaults to 1). This option is primarly for the case of subtracting other
from self
.
name | Unique name for the new output Generic2D object. |
other | Object to add to self . factor (str, optional): Factor to include in front of other in the combination. Defaults to '1'. Primary use case is "-1" which will subtract other from self . |
self
and other
. def Divide | ( | self, | |
name, | |||
other | |||
) |
def getBinVal | ( | self, | |
xbin, | |||
ybin | |||
) |
Get bin value (for the current parameter values) in bin (xbin, ybin).
xbin | Indexed at 1 for ROOT compatibility. |
ybin | Indexed at 1 for ROOT compatibility. |
def getBinVar | ( | self, | |
xbin, | |||
ybin, | |||
c = '' |
|||
) |
Get the bin variable associated with (xbin,ybin).
The xbin
and ybin
args are assumed to be for global bin numbers but can be for a given category ("LOW", "SIG", or "HIGH") if specified with the c
option.
xbin | [description] |
ybin | [description] c (str, optional): One of "LOW", "SIG", or "HIGH" which will cause xbin and ybin to be interpreted as indexes for the given subspace. Defaults to '' in which case xbin and ybin are treated as global. |
def Multiply | ( | self, | |
name, | |||
other | |||
) |
def RooParametricHist | ( | self | ) |
Produce a RooParametricHist2D filled with this object's binVars.
binArgLists |
Dict mapping of the subspaces (LOW, SIG, HIGH) to the RooArgList of the RooAbsArgs in the subspace.
binning |
Binning object.
binVars |
Ordered dictionary of all RooAbsArgs representing the bins of the space.
forcePositive |
Option to ensure bin values cannot be negative.
name |
Unique name of object which will be prepended to all associated RooFit objects.
nuisances |
All tracked nuisance dictionaries.
rph |
Dict mapping of the subspaces (LOW, SIG, HIGH) to the RooParametricHist2D objects of the subspaces.