Belle II Software development
|
Public Member Functions | |
def | __init__ (self, in_dir, out_dir, job_id, save_vars=None) |
def | process (self) |
def | process_b2script (self, num_events=2500) |
def | merge_files (self) |
def | clean_up (self) |
Public Attributes | |
data | |
Input root file generated before skimming. | |
flag | |
Filename of the flag file indicating passing events. | |
out_temp | |
Temperary directory to keep intermediate files for advanced mode. | |
temp_file | |
Intermediate files. | |
out_file | |
Final output Parquet file. | |
save_vars | |
Variables to save for different event levels. | |
Process data for training and save to Parquet file. Two modes are provided: Fast mode: save_vars set to None, produce the dataset with only the necessary information for the training. Advanced mode: save_vars set to a dictionary of event-level variables, run through hard-coded b2 steering code in self.process_b2script to produce the required particle lists and save the required variables, can be used for event-level cuts or evaluations of the NN performance. Arguments: in_dir (str): Input directory. out_dir (str): Output directory. job_id (int): Job ID for batch processing. save_vars (dict): Event-level variables to save for different particles. By default None for fast mode. In the example script having Y4S and B keys for the corresponding particle list. Returns: None
Definition at line 143 of file NN_trainer_module.py.
def __init__ | ( | self, | |
in_dir, | |||
out_dir, | |||
job_id, | |||
save_vars = None |
|||
) |
Initialize the data_production object. :param in_dir: Input directory. :param out_dir: Output directory. :param job_id: Job ID for batch processing. :param save_vars: Event-level variables to save for different particles. By default None for fast mode. In the example script having Y4S and B keys for the corresponding particle list.
Definition at line 163 of file NN_trainer_module.py.
def clean_up | ( | self | ) |
Clean up temporary files.
Definition at line 269 of file NN_trainer_module.py.
def merge_files | ( | self | ) |
Merge file of particle-level information (MC) with those of event-level information (Y4S, B). Preprocess and save to disk as Parquet file in form of Awkward Array.
Definition at line 257 of file NN_trainer_module.py.
def process | ( | self | ) |
Process the b2 steering file and the data generation.
Definition at line 196 of file NN_trainer_module.py.
def process_b2script | ( | self, | |
num_events = 2500 |
|||
) |
Skimming process with TrainDataSaver module. :param num_events: Maximum number of events to process.
Definition at line 204 of file NN_trainer_module.py.
data |
Input root file generated before skimming.
Definition at line 177 of file NN_trainer_module.py.
flag |
Filename of the flag file indicating passing events.
Definition at line 179 of file NN_trainer_module.py.
out_file |
Final output Parquet file.
Definition at line 192 of file NN_trainer_module.py.
out_temp |
Temperary directory to keep intermediate files for advanced mode.
Definition at line 182 of file NN_trainer_module.py.
save_vars |
Variables to save for different event levels.
Definition at line 194 of file NN_trainer_module.py.
temp_file |
Intermediate files.
Definition at line 186 of file NN_trainer_module.py.