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

Public Member Functions

 output (self)
 
 requires (self)
 
 run (self)
 
 remove_output (self)
 

Static Public Attributes

 n_events_training
 Number of events to generate for the training data set.
 
 n_events_testing
 Number of events to generate for the test data set.
 
 n_events_per_task
 Number of events per task.
 
 num_processes
 Number of basf2 processes to use in Basf2PathTasks.
 
 bkgfiles_by_exp = b2luigi.get_setting("bkgfiles_by_exp")
 Dictionary with experiment numbers as keys and background directory paths as values.
 
dict bkgfiles_by_exp = {int(key): val for (key, val) in bkgfiles_by_exp.items()}
 Transform dictionary keys (exp.
 
str batch_system = 'local'
 Use local batch system.
 
str output_file_name = 'summary.json'
 Output file name.
 

Detailed Description

Task that collects and summarizes the main figure-of-merits from all the
(validation and optimisation) child taks.

Definition at line 1146 of file combined_cdc_to_svd_ckf_mva_training.py.

Member Function Documentation

◆ output()

output ( self)
Output method.

Definition at line 1187 of file combined_cdc_to_svd_ckf_mva_training.py.

1187 def output(self):
1188 """
1189 Output method.
1190 """
1191 yield self.add_to_output(self.output_file_name)
1192

◆ remove_output()

remove_output ( self)
Default function from base b2luigi.Task class.

Definition at line 1265 of file combined_cdc_to_svd_ckf_mva_training.py.

1265 def remove_output(self):
1266 """
1267 Default function from base b2luigi.Task class.
1268 """
1269 self._remove_output()
1270
1271

◆ requires()

requires ( self)
Generate list of tasks that needs to be done for luigi to finish running
this steering file.

Definition at line 1193 of file combined_cdc_to_svd_ckf_mva_training.py.

1193 def requires(self):
1194 """
1195 Generate list of tasks that needs to be done for luigi to finish running
1196 this steering file.
1197 """
1198
1199 fast_bdt_options = [
1200 [50, 8, 3, 0.1],
1201 [100, 8, 3, 0.1],
1202 [200, 8, 3, 0.1],
1203 ]
1204
1205 experiment_numbers = b2luigi.get_setting("experiment_numbers")
1206
1207 # iterate over all possible combinations of parameters from the above defined parameter lists
1208 for experiment_number, fast_bdt_option_state_filter, fast_bdt_option_result_filter in itertools.product(
1209 experiment_numbers, fast_bdt_options, fast_bdt_options
1210 ):
1211
1212 state_filter_cuts = [0.01, 0.02, 0.03, 0.05, 0.1, 0.2]
1213 n_best_states_list = [3, 5, 10]
1214 result_filter_cuts = [0.05, 0.1, 0.2]
1215 n_best_results_list = [3, 5, 10]
1216 for state_filter_cut, n_best_states, result_filter_cut, n_best_results in \
1217 itertools.product(state_filter_cuts, n_best_states_list, result_filter_cuts, n_best_results_list):
1218 yield self.clone(
1219 ValidationAndOptimisationTask,
1220 experiment_number=experiment_number,
1221 n_events_training=self.n_events_training,
1222 n_events_testing=self.n_events_testing,
1223 state_filter_cut=state_filter_cut,
1224 use_n_best_states=n_best_states,
1225 result_filter_cut=result_filter_cut,
1226 use_n_best_results=n_best_results,
1227 fast_bdt_option_state_filter=fast_bdt_option_state_filter,
1228 fast_bdt_option_result_filter=fast_bdt_option_result_filter,
1229 )
1230

◆ run()

run ( self)
Run method.

Definition at line 1231 of file combined_cdc_to_svd_ckf_mva_training.py.

1231 def run(self):
1232 """
1233 Run method.
1234 """
1235 import ROOT # noqa
1236
1237 # These are the "TNtuple" names to check for
1238 ntuple_names = (
1239 'MCSideTrackingValidationModule_overview_figures_of_merit',
1240 'PRSideTrackingValidationModule_overview_figures_of_merit',
1241 'PRSideTrackingValidationModule_subdetector_figures_of_merit'
1242 )
1243
1244 # Collect the information in a dictionary...
1245 output_dict = {}
1246 all_files = self.get_all_input_file_names()
1247 for idx, single_file in enumerate(all_files):
1248 with ROOT.TFile.Open(single_file, 'READ') as f:
1249 branch_data = {}
1250 for ntuple_name in ntuple_names:
1251 ntuple = f.Get(ntuple_name)
1252 for i in range(min(1, ntuple.GetEntries())): # Here we expect only 1 entry
1253 ntuple.GetEntry(i)
1254 for branch in ntuple.GetListOfBranches():
1255 name = branch.GetName()
1256 value = getattr(ntuple, name)
1257 branch_data[name] = value
1258 branch_data['file_path'] = single_file
1259 output_dict[f'{idx}'] = branch_data
1260
1261 # ... and store the information in a JSON file
1262 with open(self.get_output_file_name(self.output_file_name), 'w') as f:
1263 json.dump(output_dict, f, indent=4)
1264

Member Data Documentation

◆ batch_system

str batch_system = 'local'
static

Use local batch system.

Definition at line 1183 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ bkgfiles_by_exp [1/2]

bkgfiles_by_exp = b2luigi.get_setting("bkgfiles_by_exp")
static

Dictionary with experiment numbers as keys and background directory paths as values.

Definition at line 1178 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ bkgfiles_by_exp [2/2]

dict bkgfiles_by_exp = {int(key): val for (key, val) in bkgfiles_by_exp.items()}
static

Transform dictionary keys (exp.

numbers) from strings to int

Definition at line 1180 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events_per_task

n_events_per_task
static
Initial value:
= b2luigi.get_setting(
)

Number of events per task.

Used to split up the simulation tasks.

Definition at line 1165 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events_testing

n_events_testing
static
Initial value:
= b2luigi.get_setting(
)

Number of events to generate for the test data set.

Definition at line 1159 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events_training

n_events_training
static
Initial value:
= b2luigi.get_setting(
)

Number of events to generate for the training data set.

Definition at line 1153 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ num_processes

num_processes
static
Initial value:
= b2luigi.get_setting(
)

Number of basf2 processes to use in Basf2PathTasks.

Definition at line 1171 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ output_file_name

output_file_name = 'summary.json'
static

Output file name.

Definition at line 1185 of file combined_cdc_to_svd_ckf_mva_training.py.


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