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

Public Member Functions

 __init__ (self, module, storearray_name, storearray_durability=0)
 
 initialize (self)
 
 condition (self)
 
 event (self)
 
 wrapper_name (self)
 
 param (self)
 
 available_params (self)
 
 compose_wrapped_module_name (self, module)
 
 get_name (self)
 
 beginRun (self)
 
 endRun (self)
 
 terminate (self)
 

Public Attributes

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

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__()

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

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

◆ available_params()

available_params ( self)
inherited
Forwards the available parameters

Definition at line 78 of file metamodules.py.

78 def available_params(self):
79 """Forwards the available parameters"""
80 return self.module.available_params
81

◆ beginRun()

beginRun ( self)
inherited
Begin run method of the module

Definition at line 94 of file metamodules.py.

94 def beginRun(self):
95 """Begin run method of the module"""
96 self.module.beginRun()
97

◆ compose_wrapped_module_name()

compose_wrapped_module_name ( self,
module )
inherited
Compose a name that indicates the wrapped module.

Definition at line 82 of file metamodules.py.

82 def compose_wrapped_module_name(self, module):
83 """Compose a name that indicates the wrapped module."""
84 return f"{self.wrapper_name}({module.name()})"
85

◆ condition()

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

◆ endRun()

endRun ( self)
inherited
End run method of the module

Definition at line 102 of file metamodules.py.

102 def endRun(self):
103 """End run method of the module"""
104 self.module.endRun()
105

◆ event()

event ( self)
inherited
Event method of the module

Evaluates the condition and sets the return value of this module
to trigger the execution of the wrapped module.

Reimplemented from WrapperModule.

Definition at line 212 of file metamodules.py.

212 def event(self):
213 """Event method of the module
214
215 Evaluates the condition and sets the return value of this module
216 to trigger the execution of the wrapped module.
217 """
218
219 if self.condition():
220 super().event()
221
222

◆ get_name()

get_name ( self)
inherited
Forwards the name().

Definition at line 86 of file metamodules.py.

86 def get_name(self):
87 """Forwards the name()."""
88 return self.name()
89

◆ initialize()

initialize ( self)
Initialize the contained module (only if the condition is true).

Reimplemented from WrapperModule.

Definition at line 267 of file metamodules.py.

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

◆ param()

param ( self)
inherited
Forwards the parameters

Definition at line 73 of file metamodules.py.

73 def param(self):
74 """Forwards the parameters"""
75 return self.module.param
76

◆ terminate()

terminate ( self)
inherited
Terminate method of the module

Reimplemented in PyProfilingModule.

Definition at line 106 of file metamodules.py.

106 def terminate(self):
107 """Terminate method of the module"""
108 self.module.terminate()
109
110

◆ wrapper_name()

wrapper_name ( self)
inherited
Name of the wrapper class.

Definition at line 68 of file metamodules.py.

68 def wrapper_name(self):
69 """Name of the wrapper class."""
70 return self.__class__.__name__
71

Member Data Documentation

◆ module

module = module
inherited

The wrapped module.

Definition at line 53 of file metamodules.py.

◆ storearray_durability

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 = None

Flag that the StoreArray is present (bool).

Definition at line 265 of file metamodules.py.

◆ storearray_name

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: