Belle II Software release-09-00-00
ResultRecordingTask Class Reference
Inheritance diagram for ResultRecordingTask:
Collaboration 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 607 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 735 of file combined_cdc_to_svd_ckf_mva_training.py.

735 def create_path(self):
736 """
737 Create basf2 path to process with event generation and simulation.
738 """
739 return self.create_result_recording_path(
740 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
741 )
742
743

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

659 def create_result_recording_path(self, result_filter_records_name):
660 """
661 Create a path for the recording of the result filter. This file is then used to train the result filter.
662
663 :param result_filter_records_name: Name of the recording file.
664 """
665
666 path = basf2.create_path()
667
668 # get all the file names from the list of input files that are meant for training
669 file_list = [fname for sublist in self.get_input_file_names().values()
670 for fname in sublist if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
671 path.add_module("RootInput", inputFileNames=file_list)
672
673 path.add_module("Gearbox")
674 path.add_module("Geometry")
675 path.add_module("SetupGenfitExtrapolation")
676
677 add_hit_preparation_modules(path, components=["SVD"])
678
679 add_track_finding(path, reco_tracks="CDCRecoTracks", components=["CDC"], prune_temporary_tracks=False)
680
681 path.add_module('TrackFinderMCTruthRecoTracks',
682 RecoTracksStoreArrayName="MCRecoTracks",
683 WhichParticles=[],
684 UsePXDHits=True,
685 UseSVDHits=True,
686 UseCDCHits=True)
687
688 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=False, UseCDCHits=True,
689 mcRecoTracksStoreArrayName="MCRecoTracks",
690 prRecoTracksStoreArrayName="CDCRecoTracks")
691 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCRecoTracks")
692
693 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
694 path.add_module("CDCToSVDSpacePointCKF",
695 inputRecoTrackStoreArrayName="CDCRecoTracks",
696 outputRecoTrackStoreArrayName="VXDRecoTracks",
697 outputRelationRecoTrackStoreArrayName="CDCRecoTracks",
698
699 relationCheckForDirection="backward",
700 reverseSeed=False,
701 writeOutDirection="backward",
702
703 firstHighFilter="mva_with_direction_check",
704 firstHighFilterParameters={
705 "identifier": self.get_input_file_names(f"trk_CDCToSVDSpacePointStateFilter_1{fast_bdt_string}.xml")[0],
706 "cut": 0.001,
707 "direction": "backward"},
708 firstHighUseNStates=10,
709
710 advanceHighFilter="advance",
711 advanceHighFilterParameters={"direction": "backward"},
712
713 secondHighFilter="mva",
714 secondHighFilterParameters={
715 "identifier": self.get_input_file_names(f"trk_CDCToSVDSpacePointStateFilter_2{fast_bdt_string}.xml")[0],
716 "cut": 0.001},
717 secondHighUseNStates=10,
718
719 updateHighFilter="fit",
720
721 thirdHighFilter="mva",
722 thirdHighFilterParameters={
723 "identifier": self.get_input_file_names(f"trk_CDCToSVDSpacePointStateFilter_3{fast_bdt_string}.xml")[0],
724 "cut": 0.001},
725 thirdHighUseNStates=10,
726
727 filter="recording",
728 filterParameters={"rootFileName": result_filter_records_name},
729 exportTracks=False,
730
731 enableOverlapResolving=True)
732
733 return path
734

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

630 def output(self):
631 """
632 Generate list of output files that the task should produce.
633 The task is considered finished if and only if the outputs all exist.
634 """
635 yield self.add_to_output(self.result_filter_records_name)
636

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

637 def requires(self):
638 """
639 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained
640 using the CKFStateFilterTeacherTask..
641 """
642 yield SplitNMergeSimTask(
643 bkgfiles_dir=MainTask.bkgfiles_by_exp[self.experiment_number],
644 experiment_number=self.experiment_number,
645 random_seed=self.random_seed,
646 n_events=self.n_events,
647 )
648 filter_numbers = [1, 2, 3]
649 for filter_number in filter_numbers:
650 yield self.clone(
651 CKFStateFilterTeacherTask,
652 experiment_number=self.experiment_number,
653 n_events=self.n_events,
654 random_seed=self.random_seed,
655 filter_number=filter_number,
656 fast_bdt_option=self.fast_bdt_option_state_filter
657 )
658

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 615 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 622 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 620 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 618 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 628 of file combined_cdc_to_svd_ckf_mva_training.py.


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