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

Public Member Functions

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

Static Public Attributes

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

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 613 of file combined_cdc_to_svd_ckf_mva_training.py.

Member Function Documentation

◆ create_path()

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

Definition at line 763 of file combined_cdc_to_svd_ckf_mva_training.py.

763 def create_path(self):
764 """
765 Create basf2 path to process with event generation and simulation.
766 """
767 return self.create_result_recording_path(
768 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
769 )
770
771

◆ create_result_recording_path()

def 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 668 of file combined_cdc_to_svd_ckf_mva_training.py.

668 def create_result_recording_path(self, result_filter_records_name):
669 """
670 Create a path for the recording of the result filter. This file is then used to train the result filter.
671
672 :param result_filter_records_name: Name of the recording file.
673 """
674
675 path = basf2.create_path()
676
677 # get all the file names from the list of input files that are meant for training
678 file_list = [fname for sublist in self.get_input_file_names().values()
679 for fname in sublist if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
680 path.add_module("RootInput", inputFileNames=file_list)
681
682 path.add_module("Gearbox")
683 path.add_module("Geometry")
684 path.add_module("SetupGenfitExtrapolation")
685
686 add_hit_preparation_modules(path, components=["SVD"])
687
688 add_track_finding(path, reco_tracks="CDCRecoTracks", components=["CDC"], prune_temporary_tracks=False)
689
690 path.add_module('TrackFinderMCTruthRecoTracks',
691 RecoTracksStoreArrayName="MCRecoTracks",
692 WhichParticles=[],
693 UsePXDHits=True,
694 UseSVDHits=True,
695 UseCDCHits=True)
696
697 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=False, UseCDCHits=True,
698 mcRecoTracksStoreArrayName="MCRecoTracks",
699 prRecoTracksStoreArrayName="CDCRecoTracks")
700 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCRecoTracks")
701
702 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
703 # write the tracking MVA filter parameters and the cut on MVA classifier to be applied on a local db
704 iov = [0, 0, 0, -1]
706 f"trk_CDCToSVDSpacePointStateFilter_1_Parameter{fast_bdt_string}",
707 iov,
708 f"trk_CDCToSVDSpacePointStateFilter_1{fast_bdt_string}",
709 0.001)
710
712 f"trk_CDCToSVDSpacePointStateFilter_2_Parameter{fast_bdt_string}",
713 iov,
714 f"trk_CDCToSVDSpacePointStateFilter_2{fast_bdt_string}",
715 0.001)
716
718 f"trk_CDCToSVDSpacePointStateFilter_3_Parameter{fast_bdt_string}",
719 iov,
720 f"trk_CDCToSVDSpacePointStateFilter_3{fast_bdt_string}",
721 0.001)
722
723 basf2.conditions.prepend_testing_payloads("localdb/database.txt")
724 first_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_1_Parameter{fast_bdt_string}",
725 "direction": "backward"}
726 second_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_2_Parameter{fast_bdt_string}"}
727 third_high_filter_parameters = {"DBPayloadName": f"trk_CDCToSVDSpacePointStateFilter_3_Parameter{fast_bdt_string}"}
728
729 path.add_module("CDCToSVDSpacePointCKF",
730 inputRecoTrackStoreArrayName="CDCRecoTracks",
731 outputRecoTrackStoreArrayName="VXDRecoTracks",
732 outputRelationRecoTrackStoreArrayName="CDCRecoTracks",
733
734 relationCheckForDirection="backward",
735 reverseSeed=False,
736 writeOutDirection="backward",
737
738 firstHighFilter="mva_with_direction_check",
739 firstHighFilterParameters=first_high_filter_parameters,
740 firstHighUseNStates=10,
741
742 advanceHighFilter="advance",
743 advanceHighFilterParameters={"direction": "backward"},
744
745 secondHighFilter="mva",
746 secondHighFilterParameters=second_high_filter_parameters,
747 secondHighUseNStates=10,
748
749 updateHighFilter="fit",
750
751 thirdHighFilter="mva",
752 thirdHighFilterParameters=third_high_filter_parameters,
753 thirdHighUseNStates=10,
754
755 filter="recording",
756 filterParameters={"rootFileName": result_filter_records_name},
757 exportTracks=False,
758
759 enableOverlapResolving=True)
760
761 return path
762

◆ output()

def 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 639 of file combined_cdc_to_svd_ckf_mva_training.py.

639 def output(self):
640 """
641 Generate list of output files that the task should produce.
642 The task is considered finished if and only if the outputs all exist.
643 """
644 yield self.add_to_output(self.result_filter_records_name)
645

◆ requires()

def 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 646 of file combined_cdc_to_svd_ckf_mva_training.py.

646 def requires(self):
647 """
648 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained
649 using the CKFStateFilterTeacherTask..
650 """
651 yield SplitNMergeSimTask(
652 bkgfiles_dir=MainTask.bkgfiles_by_exp[self.experiment_number],
653 experiment_number=self.experiment_number,
654 random_seed=self.random_seed,
655 n_events=self.n_events,
656 )
657 filter_numbers = [1, 2, 3]
658 for filter_number in filter_numbers:
659 yield self.clone(
660 CKFStateFilterTeacherTask,
661 experiment_number=self.experiment_number,
662 n_events=self.n_events,
663 random_seed=self.random_seed,
664 filter_number=filter_number,
665 fast_bdt_option=self.fast_bdt_option_state_filter
666 )
667

Member Data Documentation

◆ experiment_number

b2luigi experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 621 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ fast_bdt_option_state_filter

b2luigi 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 628 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate for the training data set.

Definition at line 626 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ random_seed

b2luigi 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 624 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ result_filter_records_name

b2luigi result_filter_records_name = b2luigi.Parameter()
static

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

Definition at line 634 of file combined_cdc_to_svd_ckf_mva_training.py.


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