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

Public Member Functions

 requires (self)
 

Static Public Attributes

 process_type
 Define which kind of process shall be used.
 
 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.
 
 datafiles = b2luigi.get_setting("datafiles")
 list of raw-datafiles to be used in the case of processing data.
 
 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.
 
list exclude_variables_cdc
 list of variables to exclude for the cdc mva.
 
list exclude_variables_vxd
 list of variables to exclude for the vxd mva:
 
list exclude_variables_rec
 list of variables to exclude for the recotrack mva:
 

Detailed Description

Wrapper task that needs to finish for b2luigi to finish running this steering file.

It is done if the outputs of all required subtasks exist.  It is thus at the
top of the luigi task graph.  Edit the ``requires`` method to steer which
tasks and with which parameters you want to run.

Definition at line 2524 of file combined_quality_estimator_teacher.py.

Member Function Documentation

◆ requires()

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

Definition at line 2702 of file combined_quality_estimator_teacher.py.

2702 def requires(self):
2703 """
2704 Generate list of tasks that needs to be done for luigi to finish running
2705 this steering file.
2706 """
2707 cdc_training_targets = [
2708 "truth", # treats clones as background, only best matched CDC tracks are true
2709 # "truth_track_is_matched" # treats clones as signal
2710 ]
2711
2712 fast_bdt_options = []
2713 # possible to run over a chosen hyperparameter space if wanted
2714 # in principle this can be extended to specific options for the three different MVAs
2715 # for i in range(250, 400, 50):
2716 # for j in range(6, 10, 2):
2717 # for k in range(2, 6):
2718 # for l in range(0, 5):
2719 # fast_bdt_options.append([100 + i, j, 3+k, 0.025+l*0.025])
2720 # fast_bdt_options.append([200, 8, 3, 0.1]) # default FastBDT option
2721 fast_bdt_options.append([350, 6, 5, 0.1])
2722
2723 experiment_numbers = b2luigi.get_setting("experiment_numbers")
2724
2725 # iterate over all possible combinations of parameters from the above defined parameter lists
2726 for experiment_number, cdc_training_target, fast_bdt_option in itertools.product(
2727 experiment_numbers, cdc_training_targets, fast_bdt_options
2728 ):
2729 # if test_selected_task is activated, only run the following tasks:
2730 if b2luigi.get_setting("test_selected_task", default=False):
2731 # for process_type in ['BHABHA', 'MUMU', 'TAUPAIR', 'YY', 'EEEE', 'EEMUMU', 'UUBAR', \
2732 # 'DDBAR', 'CCBAR', 'SSBAR', 'BBBAR', 'V0BBBAR', 'V0STUDY']:
2733 for cut in ['000', '070', '090', '095']:
2734 yield RecoTrackQEDataCollectionTask(
2735 num_processes=self.num_processes,
2736 n_events=self.n_events_testing,
2737 experiment_number=experiment_number,
2738 random_seed=self.process_type + '_test',
2739 recotrack_option='useCDC_useVXD_deleteCDCQI'+cut,
2740 cdc_training_target=cdc_training_target,
2741 fast_bdt_option=fast_bdt_option,
2742 )
2743 yield CDCQEDataCollectionTask(
2744 num_processes=self.num_processes,
2745 n_events=self.n_events_testing,
2746 experiment_number=experiment_number,
2747 random_seed=self.process_type + '_test',
2748 )
2749 yield CDCQETeacherTask(
2750 n_events_training=self.n_events_training,
2751 process_type=self.process_type,
2752 experiment_number=experiment_number,
2753 exclude_variables=self.exclude_variables_cdc,
2754 training_target=cdc_training_target,
2755 fast_bdt_option=fast_bdt_option,
2756 )
2757 else:
2758 # if data shall be processed, it can neither be trained nor evaluated
2759 if 'DATA' in self.process_type:
2760 yield VXDQEDataCollectionTask(
2761 num_processes=self.num_processes,
2762 n_events=self.n_events_testing,
2763 experiment_number=experiment_number,
2764 random_seed=self.process_type + '_test',
2765 )
2766 yield CDCQEDataCollectionTask(
2767 num_processes=self.num_processes,
2768 n_events=self.n_events_testing,
2769 experiment_number=experiment_number,
2770 random_seed=self.process_type + '_test',
2771 )
2772 yield RecoTrackQEDataCollectionTask(
2773 num_processes=self.num_processes,
2774 n_events=self.n_events_testing,
2775 experiment_number=experiment_number,
2776 random_seed=self.process_type + '_test',
2777 recotrack_option='deleteCDCQI080',
2778 cdc_training_target=cdc_training_target,
2779 fast_bdt_option=fast_bdt_option,
2780 )
2781 else:
2782
2783 if b2luigi.get_setting("run_validation_tasks", default=True):
2784 yield RecoTrackQEValidationPlotsTask(
2785 n_events_training=self.n_events_training,
2786 n_events_testing=self.n_events_testing,
2787 process_type=self.process_type,
2788 experiment_number=experiment_number,
2789 cdc_training_target=cdc_training_target,
2790 exclude_variables=self.exclude_variables_rec,
2791 fast_bdt_option=fast_bdt_option,
2792 )
2793 yield CDCQEValidationPlotsTask(
2794 n_events_training=self.n_events_training,
2795 n_events_testing=self.n_events_testing,
2796 process_type=self.process_type,
2797 experiment_number=experiment_number,
2798 exclude_variables=self.exclude_variables_cdc,
2799 training_target=cdc_training_target,
2800 fast_bdt_option=fast_bdt_option,
2801 )
2802 yield VXDQEValidationPlotsTask(
2803 n_events_training=self.n_events_training,
2804 n_events_testing=self.n_events_testing,
2805 process_type=self.process_type,
2806 exclude_variables=self.exclude_variables_vxd,
2807 experiment_number=experiment_number,
2808 fast_bdt_option=fast_bdt_option,
2809 )
2810
2811 if b2luigi.get_setting("run_mva_evaluate", default=True):
2812 # Evaluate trained weightfiles via basf2_mva_evaluate.py on separate testdatasets
2813 # requires a latex installation to work
2814 yield RecoTrackQEEvaluationTask(
2815 n_events_training=self.n_events_training,
2816 n_events_testing=self.n_events_testing,
2817 process_type=self.process_type,
2818 experiment_number=experiment_number,
2819 cdc_training_target=cdc_training_target,
2820 exclude_variables=self.exclude_variables_rec,
2821 fast_bdt_option=fast_bdt_option,
2822 )
2823 yield CDCTrackQEEvaluationTask(
2824 n_events_training=self.n_events_training,
2825 n_events_testing=self.n_events_testing,
2826 process_type=self.process_type,
2827 experiment_number=experiment_number,
2828 exclude_variables=self.exclude_variables_cdc,
2829 fast_bdt_option=fast_bdt_option,
2830 training_target=cdc_training_target,
2831 )
2832 yield VXDTrackQEEvaluationTask(
2833 n_events_training=self.n_events_training,
2834 n_events_testing=self.n_events_testing,
2835 process_type=self.process_type,
2836 experiment_number=experiment_number,
2837 exclude_variables=self.exclude_variables_vxd,
2838 fast_bdt_option=fast_bdt_option,
2839 )
2840
2841

Member Data Documentation

◆ 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 2567 of file combined_quality_estimator_teacher.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 2569 of file combined_quality_estimator_teacher.py.

◆ datafiles

datafiles = b2luigi.get_setting("datafiles")
static

list of raw-datafiles to be used in the case of processing data.

Definition at line 2565 of file combined_quality_estimator_teacher.py.

◆ exclude_variables_cdc

list exclude_variables_cdc
static

list of variables to exclude for the cdc mva.

Definition at line 2571 of file combined_quality_estimator_teacher.py.

◆ exclude_variables_rec

list exclude_variables_rec
static

list of variables to exclude for the recotrack mva:

Definition at line 2622 of file combined_quality_estimator_teacher.py.

◆ exclude_variables_vxd

list exclude_variables_vxd
static
Initial value:
= [
'energyLoss_max', 'energyLoss_min', 'energyLoss_mean', 'energyLoss_std', 'energyLoss_sum',
'size_max', 'size_min', 'size_mean', 'size_std', 'size_sum',
'seedCharge_max', 'seedCharge_min', 'seedCharge_mean', 'seedCharge_std', 'seedCharge_sum',
'tripletFit_P_Mag', 'tripletFit_P_Eta', 'tripletFit_P_Phi', 'tripletFit_P_X', 'tripletFit_P_Y', 'tripletFit_P_Z']

list of variables to exclude for the vxd mva:

Definition at line 2616 of file combined_quality_estimator_teacher.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 2553 of file combined_quality_estimator_teacher.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 2547 of file combined_quality_estimator_teacher.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 2541 of file combined_quality_estimator_teacher.py.

◆ num_processes

num_processes
static
Initial value:
= b2luigi.get_setting(
)

Number of basf2 processes to use in Basf2PathTasks.

Definition at line 2559 of file combined_quality_estimator_teacher.py.

◆ process_type

process_type
static
Initial value:
= b2luigi.get_setting(
)

Define which kind of process shall be used.

Decide between simulating BBBAR or BHABHA, MUMU, YY, DDBAR, UUBAR, SSBAR, CCBAR, reconstructing DATA or already simulated files (USESIMBB/EE) or running on existing reconstructed files (USERECBB/EE)

Definition at line 2535 of file combined_quality_estimator_teacher.py.


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