Belle II Software development
|
Class for the PXD background generator module. More...
Public Member Functions | |
def | __init__ (self, str model="convnet", Union[None, str, pathlib.Path] checkpoint=None, Union[None, int] seed=None, int nintra=1, int ninter=1, str globaltag="PXDBackgroundGenerator") |
Constructor for the PXD background generator module. | |
def | initialize (self) |
Method called before event processing to initialize the module. | |
def | event (self) |
Method called each time an event is processed. | |
Public Attributes | |
model | |
Name of the generator model. | |
checkpoint | |
Path to the checkpoint file with the pre-trained model weights. | |
seed | |
Integer number in the interval set as the initial seed. | |
nintra | |
Number of intra-op threads utilized. | |
ninter | |
Number of inter-op threads utilized. | |
globaltag | |
Global tag of the conditions database providing the default checkpoints stored as payloads. | |
Protected Attributes | |
_generate_func | |
Generation function applied on the model instance to return an output that is transcoded into digits. | |
_generator | |
Generator model instance. | |
_vxdids | |
Sequence of identifier objects for each PXD module. | |
_pystorearray | |
Accessor for PXD background digits in the data store. | |
Class for the PXD background generator module.
Generates PXD background samples for background overlay on the fly. :param model: Name of the generator model to use - either "convnet" or "resnet", defaults to "convnet" (optional) :type model: str :param checkpoint: Path to the checkpoint file with weights for the selected model, defaults to None - use the default checkpoint from the conditions database (optional) :type checkpoint: str :param seed: Integer number in the interval :math:`[-2^{63}, 2^{63} - 1]` used internally as the initial seed, defaults to None - derive a deterministic seed from the value returned by :py:func:`basf2.get_random_seed` (optional) :type seed: int :param nintra: Number of intra-op threads to be utilized for the generation, defaults to 1 (optional) :type nintra: int :param ninter: Number of inter-op threads to be utilized for the generation, defaults to 1 (optional) :type ninter: int :param globaltag: Global tag of the conditions database providing the default checkpoints stored as payloads, defaults to "PXDBackgroundGenerator" (optional) :type globaltag: str
Definition at line 138 of file __init__.py.
def __init__ | ( | self, | |
str | model = "convnet" , |
||
Union[None, str, pathlib.Path] | checkpoint = None , |
||
Union[None, int] | seed = None , |
||
int | nintra = 1 , |
||
int | ninter = 1 , |
||
str | globaltag = "PXDBackgroundGenerator" |
||
) |
Constructor for the PXD background generator module.
model | Name of the generator model to use - either "convnet" or "resnet", defaults to "convnet" |
checkpoint | Path to the checkpoint file with weights for the selected model, defaults to None - use the default checkpoint from the conditions database |
seed | Integer number in the interval used internally as the initial seed, defaults to None - derive a deterministic seed from the value returned by basf2.get_random_seed() |
nintra | Number of intra-op threads to be utilized for the generation, defaults to 1 |
ninter | Number of inter-op threads to be utilized for the generation, defaults to 1 |
globaltag | Global tag of the conditions database providing the default checkpoints stored as payloads, defaults to "PXDBackgroundGenerator" |
Definition at line 192 of file __init__.py.
def event | ( | self | ) |
Method called each time an event is processed.
Definition at line 288 of file __init__.py.
def initialize | ( | self | ) |
Method called before event processing to initialize the module.
Definition at line 225 of file __init__.py.
|
protected |
Generation function applied on the model instance to return an output that is transcoded into digits.
Definition at line 239 of file __init__.py.
|
protected |
Generator model instance.
Definition at line 242 of file __init__.py.
|
protected |
Accessor for PXD background digits in the data store.
Definition at line 283 of file __init__.py.
|
protected |
Sequence of identifier objects for each PXD module.
Definition at line 273 of file __init__.py.
checkpoint |
Path to the checkpoint file with the pre-trained model weights.
Definition at line 206 of file __init__.py.
globaltag |
Global tag of the conditions database providing the default checkpoints stored as payloads.
Definition at line 218 of file __init__.py.
model |
Name of the generator model.
Definition at line 203 of file __init__.py.
ninter |
Number of inter-op threads utilized.
Definition at line 215 of file __init__.py.
nintra |
Number of intra-op threads utilized.
Definition at line 212 of file __init__.py.
seed |
Integer number in the interval set as the initial seed.
Definition at line 209 of file __init__.py.