Belle II Software  release-08-01-10
PXDBackgroundGenerator Class Reference

Class for the PXD background generator module. More...

Inheritance diagram for PXDBackgroundGenerator:
Collaboration diagram for PXDBackgroundGenerator:

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. More...
 
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 $ [-2^{63}, 2^{63} - 1] $ 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.
 

Private 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.
 

Detailed Description

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 137 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
modelName of the generator model to use - either "convnet" or "resnet", defaults to "convnet"
checkpointPath to the checkpoint file with weights for the selected model, defaults to None - use the default checkpoint from the conditions database
seedInteger number in the interval $ [-2^{63}, 2^{63} - 1] $ used internally as the initial seed, defaults to None - derive a deterministic seed from the value returned by basf2.get_random_seed()
nintraNumber of intra-op threads to be utilized for the generation, defaults to 1
ninterNumber of inter-op threads to be utilized for the generation, defaults to 1
globaltagGlobal tag of the conditions database providing the default checkpoints stored as payloads, defaults to "PXDBackgroundGenerator"

Definition at line 191 of file __init__.py.


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