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

Public Member Functions

def requires (self)
 

Static Public Attributes

b2luigi process_type
 Define which kind of process shall be used.
 
b2luigi n_events_training
 Number of events to generate for the training data set.
 
b2luigi n_events_testing
 Number of events to generate for the test data set.
 
b2luigi n_events_per_task
 Number of events per task.
 
b2luigi num_processes
 Number of basf2 processes to use in Basf2PathTasks.
 
b2luigi datafiles = b2luigi.get_setting("datafiles")
 list of raw-datafiles to be used in the case of processing data.
 
b2luigi 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 2494 of file combined_quality_estimator_teacher.py.

Member Function Documentation

◆ requires()

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

Definition at line 2668 of file combined_quality_estimator_teacher.py.

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

Member Data Documentation

◆ bkgfiles_by_exp [1/2]

b2luigi 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 2537 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 2539 of file combined_quality_estimator_teacher.py.

◆ datafiles

b2luigi datafiles = b2luigi.get_setting("datafiles")
static

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

Definition at line 2535 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 2541 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 2591 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 2585 of file combined_quality_estimator_teacher.py.

◆ n_events_per_task

b2luigi 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 2523 of file combined_quality_estimator_teacher.py.

◆ n_events_testing

b2luigi n_events_testing
static
Initial value:
= b2luigi.get_setting(
)

Number of events to generate for the test data set.

Definition at line 2517 of file combined_quality_estimator_teacher.py.

◆ n_events_training

b2luigi n_events_training
static
Initial value:
= b2luigi.get_setting(
)

Number of events to generate for the training data set.

Definition at line 2511 of file combined_quality_estimator_teacher.py.

◆ num_processes

b2luigi num_processes
static
Initial value:
= b2luigi.get_setting(
)

Number of basf2 processes to use in Basf2PathTasks.

Definition at line 2529 of file combined_quality_estimator_teacher.py.

◆ process_type

b2luigi 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 2505 of file combined_quality_estimator_teacher.py.


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