Belle II Software development
TestingModule Class Reference
Inheritance diagram for TestingModule:

Public Member Functions

def __init__ (self, expected)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 emd
 event metadata
 

Protected Attributes

 _expected_event_numbers
 list of expected event numbers
 
 _processed_event_numbers
 list of seen event numbers
 

Detailed Description

Test module which writes out the processed event numbers
into the global processed_event_numbers list

Definition at line 74 of file root_input.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  expected 
)
Initialize this nice class with the list of expected event
numbers to see in the correct order

Definition at line 80 of file root_input.py.

80 def __init__(self, expected):
81 """
82 Initialize this nice class with the list of expected event
83 numbers to see in the correct order
84 """
85 super().__init__()
86
87 self.emd = Belle2.PyStoreObj('EventMetaData')
88
89 self._expected_event_numbers = expected
90
91 self._processed_event_numbers = []
92
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Function Documentation

◆ event()

def event (   self)
Called for each event

Definition at line 93 of file root_input.py.

93 def event(self):
94 """
95 Called for each event
96 """
97 self._processed_event_numbers.append(self.emd.getEvent())
98

◆ terminate()

def terminate (   self)
perform check

Definition at line 99 of file root_input.py.

99 def terminate(self):
100 """
101 perform check
102 """
103 # We only want to do the check if we actually execute the process() but
104 # since this script is called from basf2_args with --dry-run this is not
105 # always the case
106 assert self._expected_event_numbers == self._processed_event_numbers
107
108 main.add_module(TestingModule([2, 9, 10, 15, 16, 6, 3, 9, 18, 14]))

Member Data Documentation

◆ _expected_event_numbers

_expected_event_numbers
protected

list of expected event numbers

Definition at line 89 of file root_input.py.

◆ _processed_event_numbers

_processed_event_numbers
protected

list of seen event numbers

Definition at line 91 of file root_input.py.

◆ emd

emd

event metadata

Definition at line 87 of file root_input.py.


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