![]() |
Belle II Software development
|
Class for the PXD background generator module. More...
Public Member Functions | |
| __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. | |
| initialize (self) | |
| Method called before event processing to initialize the module. | |
| event (self) | |
| Method called each time an event is processed. | |
Public Attributes | |
| model = _verify_model(model) | |
| Name of the generator model. | |
| checkpoint = _verify_checkpoint(checkpoint) | |
| Path to the checkpoint file with the pre-trained model weights. | |
| seed = _verify_seed(seed) | |
Integer number in the interval ![]() | |
| nintra = _verify_nintra(nintra) | |
| Number of intra-op threads utilized. | |
| ninter = _verify_ninter(ninter) | |
| Number of inter-op threads utilized. | |
| globaltag = _verify_globaltag(globaltag) | |
| Global tag of the conditions database providing the default checkpoints stored as payloads. | |
Protected Attributes | |
| _generate_func = _get_generate_func(self.model) | |
| Generation function applied on the model instance to return an output that is transcoded into digits. | |
| _generator = _get_model_cls(self.model)() | |
| Generator model instance. | |
| _vxdids = tuple(VxdID(*arg) for arg in VXDID_ARGS) | |
| Sequence of identifier objects for each PXD module. | |
| _pystorearray = PyStoreArray("PXDDigits", DataStore.c_DontWriteOut) | |
| 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.
| __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 ![]() 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.
| event | ( | self | ) |
Method called each time an event is processed.
Definition at line 288 of file __init__.py.
| 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 = _verify_checkpoint(checkpoint) |
Path to the checkpoint file with the pre-trained model weights.
Definition at line 206 of file __init__.py.
| globaltag = _verify_globaltag(globaltag) |
Global tag of the conditions database providing the default checkpoints stored as payloads.
Definition at line 218 of file __init__.py.
| model = _verify_model(model) |
Name of the generator model.
Definition at line 203 of file __init__.py.
| ninter = _verify_ninter(ninter) |
Number of inter-op threads utilized.
Definition at line 215 of file __init__.py.
| nintra = _verify_nintra(nintra) |
Number of intra-op threads utilized.
Definition at line 212 of file __init__.py.
| seed = _verify_seed(seed) |
Integer number in the interval ![$ [-2^{63}, 2^{63} - 1] $](form_53.png)
Definition at line 209 of file __init__.py.