Belle II Software development
PathModule Class Reference
Inheritance diagram for PathModule:
CombinedTrackingValidationModule

Public Member Functions

def __init__ (self, path=None, modules=None)
 
def event (self)
 

Protected Attributes

 _path
 The contained path.
 

Detailed Description

Wrapper for a basf2 path into a module such that
it can be passed around and added to a basf2 path as a basf2 module.

The wrapper is implement in such a way that it unconditionally executes
the contained path by means of a positive return value.
The calling path is continued after the execution of the wrapped path.

Attributes:
  _path (basf2.Path): The wrapped execution path.

Definition at line 308 of file metamodules.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  path = None,
  modules = None 
)
Initialises the module with a path to be wrapped.

May also give a list of modules that should be appended to the path.
If the path is omitted a new basf2.Path is constructed.

Args:
  path (basf2.Path): The execution path to be wrapped.
    If no path is given create a new one.

  modules (iterable of basf2.Module): Module to be added to the path.

Reimplemented in CombinedTrackingValidationModule.

Definition at line 321 of file metamodules.py.

321 def __init__(self, path=None, modules=None):
322 """Initialises the module with a path to be wrapped.
323
324 May also give a list of modules that should be appended to the path.
325 If the path is omitted a new basf2.Path is constructed.
326
327 Args:
328 path (basf2.Path): The execution path to be wrapped.
329 If no path is given create a new one.
330
331 modules (iterable of basf2.Module): Module to be added to the path.
332 """
333
334 super().__init__()
335
336 if path is None:
337 path = basf2.create_path()
338
339
340 self._path = path
341
342 if modules:
343 for module in modules:
344 path.add_module(module)
345
346 self.if_true(path, basf2.AfterConditionPath.CONTINUE)
347
348 # Pass a telling name to the C++ world
349 if modules is None:
350 itemCount = 0
351 else:
352 itemCount = len(modules)
353 self.set_name(f"{self.__class__.__name__} ({itemCount} modules):")
354

Member Function Documentation

◆ event()

def event (   self)
Event method of the module

Sets the return value of this module to true and triggers the execution of the wrapped path.

Definition at line 355 of file metamodules.py.

355 def event(self):
356 """Event method of the module
357
358 Sets the return value of this module to true and triggers the execution of the wrapped path.
359 """
360
361 self.return_value(True)

Member Data Documentation

◆ _path

_path
protected

The contained path.

Definition at line 340 of file metamodules.py.


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