Belle II Software development
IfStoreArrayPresentModule Class Reference
Inheritance diagram for IfStoreArrayPresentModule:
IfModule WrapperModule IfMCParticlesPresentModule IfStoreArrayNotPresentModule

Public Member Functions

def __init__ (self, module, storearray_name, storearray_durability=0)
 
def initialize (self)
 
def condition (self)
 

Public Attributes

 storearray_name
 Name of the StoreArray to be checked (str).
 
 storearray_durability
 Durability of the StoreArray to be checked (int).
 
 storearray_is_present
 Flag that the StoreArray is present (bool).
 

Detailed Description

Conditional execution of the wrapped module if a StoreArray is present.

Attributes:
  storearray_name (str): The name of the StoreArray which presence has to be checked.
  storearray_durability (int): The durability of the StoreArray
  storearray_is_present (bool): The flag whether the StoreArray is present.
    Set during initialisation.

Definition at line 234 of file metamodules.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  module,
  storearray_name,
  storearray_durability = 0 
)
Args:
  module (basf2.Module): The module executed, if the condition is met.
  storearray_name (str): The name of the StoreArray which presence has to be checked.
  storearray_durability (int, optional): The durability of the StoreArray. Default 0.

Reimplemented from IfModule.

Reimplemented in IfMCParticlesPresentModule.

Definition at line 245 of file metamodules.py.

248 storearray_durability=0):
249 """
250 Args:
251 module (basf2.Module): The module executed, if the condition is met.
252 storearray_name (str): The name of the StoreArray which presence has to be checked.
253 storearray_durability (int, optional): The durability of the StoreArray. Default 0.
254 """
255
256 super().__init__(module)
257
258
259 self.storearray_name = storearray_name
260
261
262 self.storearray_durability = storearray_durability
263
264
265 self.storearray_is_present = None
266

Member Function Documentation

◆ condition()

def condition (   self)
Returns true if the StoreArray is present.

Checks presence of the StoreArray once and remembers the result for all following events.

Reimplemented from IfModule.

Reimplemented in IfStoreArrayNotPresentModule.

Definition at line 272 of file metamodules.py.

272 def condition(self):
273 """Returns true if the StoreArray is present.
274
275 Checks presence of the StoreArray once and remembers the result for all following events.
276 """
277 if self.storearray_is_present is None:
278 self.storearray_is_present = is_storearray_present(self.storearray_name,
279 self.storearray_durability)
280 return self.storearray_is_present
281
282

◆ initialize()

def initialize (   self)
Initialize the contianed module (only of the condition is true).

Reimplemented from WrapperModule.

Definition at line 267 of file metamodules.py.

267 def initialize(self):
268 """Initialize the contianed module (only of the condition is true)."""
269 if self.condition():
270 super().initialize()
271

Member Data Documentation

◆ storearray_durability

storearray_durability

Durability of the StoreArray to be checked (int).

Definition at line 262 of file metamodules.py.

◆ storearray_is_present

storearray_is_present

Flag that the StoreArray is present (bool).

Definition at line 265 of file metamodules.py.

◆ storearray_name

storearray_name

Name of the StoreArray to be checked (str).

Definition at line 259 of file metamodules.py.


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