Belle II Software development
ResultRecordingTask Class Reference
Inheritance diagram for ResultRecordingTask:
LSFTask

Public Member Functions

 output (self)
 
 requires (self)
 
 create_result_recording_path (self, result_filter_records_name)
 
 create_path (self)
 
 remove_output (self)
 

Public Attributes

 job_name = self.task_id
 set the job name (inherited variable)
 

Static Public Attributes

 experiment_number = b2luigi.IntParameter()
 Experiment number of the conditions database, e.g.
 
 random_seed = b2luigi.Parameter()
 Random basf2 seed.
 
 n_events = b2luigi.IntParameter()
 Number of events to generate for the training data set.
 
 fast_bdt_option_state_filter
 Hyperparameter option of the FastBDT algorithm.
 
 result_filter_records_name = b2luigi.Parameter()
 Name of the records file for training the final result filter.
 
str batch_system = 'lsf'
 batch system
 
str queue = 's'
 queue
 

Detailed Description

Task to record data for the final result filter. This requires trained state filters.
The cuts on the state filter classifiers are set to rather low values to ensure that all signal is contained in the
recorded file. Also, the values for XXXXXHighUseNStates are chosen conservatively, i.e. rather on the high side.

Definition at line 667 of file combined_cdc_to_svd_ckf_mva_training.py.

Member Function Documentation

◆ create_path()

create_path ( self)
Create basf2 path to process with event generation and simulation.

Definition at line 817 of file combined_cdc_to_svd_ckf_mva_training.py.

817 def create_path(self):
818 """
819 Create basf2 path to process with event generation and simulation.
820 """
821 return self.create_result_recording_path(
822 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
823 )
824

◆ create_result_recording_path()

create_result_recording_path ( self,
result_filter_records_name )
Create a path for the recording of the result filter. This file is then used to train the result filter.

:param result_filter_records_name: Name of the recording file.

Definition at line 722 of file combined_cdc_to_svd_ckf_mva_training.py.

722 def create_result_recording_path(self, result_filter_records_name):
723 """
724 Create a path for the recording of the result filter. This file is then used to train the result filter.
725
726 :param result_filter_records_name: Name of the recording file.
727 """
728
729 path = basf2.create_path()
730
731 # get all the file names from the list of input files that are meant for training
732 file_list = [fname for fname in self.get_all_input_file_names()
733 if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
734 path.add_module("RootInput", inputFileNames=file_list)
735
736 path.add_module("Gearbox")
737 path.add_module("Geometry")
738 path.add_module("SetupGenfitExtrapolation")
739
740 add_hit_preparation_modules(path, components=["SVD"])
741
742 add_track_finding(path, reco_tracks="CDCRecoTracks", components=["CDC"], prune_temporary_tracks=False)
743
744 path.add_module('TrackFinderMCTruthRecoTracks',
745 RecoTracksStoreArrayName="MCRecoTracks",
746 WhichParticles=[],
747 UsePXDHits=True,
748 UseSVDHits=True,
749 UseCDCHits=True)
750
751 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=False, UseCDCHits=True,
752 mcRecoTracksStoreArrayName="MCRecoTracks",
753 prRecoTracksStoreArrayName="CDCRecoTracks")
754 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCRecoTracks")
755
756 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
757 # write the tracking MVA filter parameters and the cut on MVA classifier to be applied on a local db
758 iov = [0, 0, 0, -1]
760 f"trk_CDCToSVDSpacePointStateFilter_1_Parameter{fast_bdt_string}",
761 iov,
762 f"trk_CDCToSVDSpacePointStateFilter_1{fast_bdt_string}",
763 0.001)
764
766 f"trk_CDCToSVDSpacePointStateFilter_2_Parameter{fast_bdt_string}",
767 iov,
768 f"trk_CDCToSVDSpacePointStateFilter_2{fast_bdt_string}",
769 0.001)
770
772 f"trk_CDCToSVDSpacePointStateFilter_3_Parameter{fast_bdt_string}",
773 iov,
774 f"trk_CDCToSVDSpacePointStateFilter_3{fast_bdt_string}",
775 0.001)
776
777 basf2.conditions.prepend_testing_payloads("localdb/database.txt")
778 first_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_1_Parameter{fast_bdt_string}",
779 "direction": "backward"}
780 second_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_2_Parameter{fast_bdt_string}"}
781 third_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_3_Parameter{fast_bdt_string}"}
782
783 path.add_module("CDCToSVDSpacePointCKF",
784 inputRecoTrackStoreArrayName="CDCRecoTracks",
785 outputRecoTrackStoreArrayName="VXDRecoTracks",
786 outputRelationRecoTrackStoreArrayName="CDCRecoTracks",
787
788 relationCheckForDirection="backward",
789 reverseSeed=False,
790 writeOutDirection="backward",
791
792 firstHighFilter="mva_with_direction_check",
793 firstHighFilterParameters=first_high_filter_parameters,
794 firstHighUseNStates=10,
795
796 advanceHighFilter="advance",
797 advanceHighFilterParameters={"direction": "backward"},
798
799 secondHighFilter="mva",
800 secondHighFilterParameters=second_high_filter_parameters,
801 secondHighUseNStates=10,
802
803 updateHighFilter="fit",
804
805 thirdHighFilter="mva",
806 thirdHighFilterParameters=third_high_filter_parameters,
807 thirdHighUseNStates=10,
808
809 filter="recording",
810 filterParameters={"rootFileName": result_filter_records_name},
811 exportTracks=False,
812
813 enableOverlapResolving=True)
814
815 return path
816

◆ output()

output ( self)
Generate list of output files that the task should produce.
The task is considered finished if and only if the outputs all exist.

Definition at line 693 of file combined_cdc_to_svd_ckf_mva_training.py.

693 def output(self):
694 """
695 Generate list of output files that the task should produce.
696 The task is considered finished if and only if the outputs all exist.
697 """
698 yield self.add_to_output(self.result_filter_records_name)
699

◆ remove_output()

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

Definition at line 825 of file combined_cdc_to_svd_ckf_mva_training.py.

825 def remove_output(self):
826 """
827 Default function from base b2luigi.Task class.
828 """
829 self._remove_output()
830
831

◆ requires()

requires ( self)
This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained
using the CKFStateFilterTeacherTask..

Definition at line 700 of file combined_cdc_to_svd_ckf_mva_training.py.

700 def requires(self):
701 """
702 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained
703 using the CKFStateFilterTeacherTask..
704 """
705 yield SplitNMergeSimTask(
706 bkgfiles_dir=SummaryTask.bkgfiles_by_exp[self.experiment_number],
707 experiment_number=self.experiment_number,
708 random_seed=self.random_seed,
709 n_events=self.n_events,
710 )
711 filter_numbers = [1, 2, 3]
712 for filter_number in filter_numbers:
713 yield self.clone(
714 CKFStateFilterTeacherTask,
715 experiment_number=self.experiment_number,
716 n_events=self.n_events,
717 random_seed=self.random_seed,
718 filter_number=filter_number,
719 fast_bdt_option=self.fast_bdt_option_state_filter
720 )
721

Member Data Documentation

◆ batch_system

str batch_system = 'lsf'
staticinherited

batch system

Definition at line 189 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ experiment_number

experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 675 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ fast_bdt_option_state_filter

fast_bdt_option_state_filter
static
Initial value:
= b2luigi.ListParameter(
)

Hyperparameter option of the FastBDT algorithm.

default are the FastBDT default values.

Definition at line 682 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ job_name

job_name = self.task_id
inherited

set the job name (inherited variable)

Definition at line 197 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events

n_events = b2luigi.IntParameter()
static

Number of events to generate for the training data set.

Definition at line 680 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ queue

str queue = 's'
staticinherited

queue

Definition at line 191 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ random_seed

random_seed = b2luigi.Parameter()
static

Random basf2 seed.

It is further used to read of the production process to preserve clearness in the b2luigi output.

Definition at line 678 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ result_filter_records_name

result_filter_records_name = b2luigi.Parameter()
static

Name of the records file for training the final result filter.

Definition at line 688 of file combined_cdc_to_svd_ckf_mva_training.py.


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