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

Public Member Functions

def __init__ (self, out_file=None)
 
def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 out_file
 Output file path for saving the event numbers.
 
 eventInfo
 Initialise event metadata from data store.
 
 pass_list
 List to save event numbers of pass events.
 

Detailed Description

Save event numbers to a Parquet file.

Arguments:
    out_file (str): Output file path for saving the event numbers.

Returns:
    None

Note:
    This module should be added after the skimming process.

Definition at line 22 of file NN_trainer_module.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  out_file = None 
)
Initialize the SaveFlag module.

:param out_file: Output file path for saving the event numbers.

Definition at line 36 of file NN_trainer_module.py.

36 def __init__(self, out_file=None):
37 """
38 Initialize the SaveFlag module.
39
40 :param out_file: Output file path for saving the event numbers.
41 """
42 super().__init__()
43
44 self.out_file = out_file
45

Member Function Documentation

◆ event()

def event (   self)
Process each event and append event numbers to the pass list.

Definition at line 55 of file NN_trainer_module.py.

55 def event(self):
56 """
57 Process each event and append event numbers to the pass list.
58 """
59 self.pass_list.append(self.eventInfo.getEvent())
60

◆ initialize()

def initialize (   self)
Initialize the data store and the list to save event numbers before processing events.

Definition at line 46 of file NN_trainer_module.py.

46 def initialize(self):
47 """
48 Initialize the data store and the list to save event numbers before processing events.
49 """
50
51 self.eventInfo = Belle2.PyStoreObj('EventMetaData')
52
53 self.pass_list = []
54
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ terminate()

def terminate (   self)
Finalize the module and save the pass list to a Parquet file.

Definition at line 61 of file NN_trainer_module.py.

61 def terminate(self):
62 """
63 Finalize the module and save the pass list to a Parquet file.
64 """
65 ak.to_parquet(self.pass_list, self.out_file)
66
67

Member Data Documentation

◆ eventInfo

eventInfo

Initialise event metadata from data store.

Definition at line 51 of file NN_trainer_module.py.

◆ out_file

out_file

Output file path for saving the event numbers.

Definition at line 44 of file NN_trainer_module.py.

◆ pass_list

pass_list

List to save event numbers of pass events.

Definition at line 53 of file NN_trainer_module.py.


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