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_training = b2luigi.IntParameter()
 Number of events to generate.
 
 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 632 of file combined_to_pxd_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 782 of file combined_to_pxd_ckf_mva_training.py.

782 def create_path(self):
783 """
784 Create basf2 path to process with event generation and simulation.
785 """
786 return self.create_result_recording_path(
787 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
788 )
789

◆ 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 687 of file combined_to_pxd_ckf_mva_training.py.

687 def create_result_recording_path(self, result_filter_records_name):
688 """
689 Create a path for the recording of the result filter. This file is then used to train the result filter.
690
691 :param result_filter_records_name: Name of the recording file.
692 """
693
694 path = basf2.create_path()
695
696 # get all the file names from the list of input files that are meant for training
697 file_list = [fname for fname in self.get_all_input_file_names()
698 if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
699 path.add_module("RootInput", inputFileNames=file_list)
700
701 path.add_module("Gearbox")
702 path.add_module("Geometry")
703 path.add_module("SetupGenfitExtrapolation")
704
705 add_hit_preparation_modules(path, components=["SVD", "PXD"])
706
707 add_track_finding(path, reco_tracks="CDCSVDRecoTracks", components=["CDC", "SVD"], prune_temporary_tracks=False)
708
709 path.add_module('TrackFinderMCTruthRecoTracks',
710 RecoTracksStoreArrayName="MCRecoTracks",
711 WhichParticles=[],
712 UsePXDHits=True,
713 UseSVDHits=True,
714 UseCDCHits=True)
715
716 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=True, UseCDCHits=True,
717 mcRecoTracksStoreArrayName="MCRecoTracks",
718 prRecoTracksStoreArrayName="CDCSVDRecoTracks")
719 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCSVDRecoTracks")
720
721 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
722
723 # write the tracking MVA filter parameters and the cut on MVA classifier to be applied on a local db
724 iov = [0, 0, 0, -1]
726 f"trk_ToPXDStateFilter_1_Parameter{fast_bdt_string}",
727 iov,
728 f"trk_ToPXDStateFilter_1{fast_bdt_string}",
729 0.01)
730
732 f"trk_ToPXDStateFilter_2_Parameter{fast_bdt_string}",
733 iov,
734 f"trk_ToPXDStateFilter_2{fast_bdt_string}",
735 0.01)
736
738 f"trk_ToPXDStateFilter_3_Parameter{fast_bdt_string}",
739 iov,
740 f"trk_ToPXDStateFilter_3{fast_bdt_string}",
741 0.01)
742
743 basf2.conditions.prepend_testing_payloads("localdb/database.txt")
744 first_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_1_Parameter{fast_bdt_string}",
745 "direction": "backward"}
746 second_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_2_Parameter{fast_bdt_string}"}
747 third_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_3_Parameter{fast_bdt_string}"}
748
749 path.add_module("ToPXDCKF",
750 inputRecoTrackStoreArrayName="CDCSVDRecoTracks",
751 outputRecoTrackStoreArrayName="RecoTracks",
752 outputRelationRecoTrackStoreArrayName="CDCSVDRecoTracks",
753
754 relationCheckForDirection="backward",
755 reverseSeed=False,
756 writeOutDirection="backward",
757
758 firstHighFilter="mva",
759 firstHighFilterParameters=first_high_filter_parameters,
760 firstHighUseNStates=10,
761
762 advanceHighFilter="advance",
763
764 secondHighFilter="mva",
765 secondHighFilterParameters=second_high_filter_parameters,
766 secondHighUseNStates=10,
767
768 updateHighFilter="fit",
769
770 thirdHighFilter="mva",
771 thirdHighFilterParameters=third_high_filter_parameters,
772 thirdHighUseNStates=10,
773
774 filter="recording",
775 filterParameters={"rootFileName": result_filter_records_name},
776 exportTracks=False,
777
778 enableOverlapResolving=True)
779
780 return path
781

◆ 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 658 of file combined_to_pxd_ckf_mva_training.py.

658 def output(self):
659 """
660 Generate list of output files that the task should produce.
661 The task is considered finished if and only if the outputs all exist.
662 """
663 yield self.add_to_output(self.result_filter_records_name)
664

◆ remove_output()

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

Definition at line 790 of file combined_to_pxd_ckf_mva_training.py.

790 def remove_output(self):
791 """
792 Default function from base b2luigi.Task class.
793 """
794 self._remove_output()
795
796

◆ 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 665 of file combined_to_pxd_ckf_mva_training.py.

665 def requires(self):
666 """
667 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained using
668 the CKFStateFilterTeacherTask..
669 """
670 yield SplitNMergeSimTask(
671 bkgfiles_dir=SummaryTask.bkgfiles_by_exp[self.experiment_number],
672 experiment_number=self.experiment_number,
673 n_events=self.n_events_training,
674 random_seed=self.random_seed,
675 )
676 filter_numbers = [1, 2, 3]
677 for filter_number in filter_numbers:
678 yield self.clone(
679 CKFStateFilterTeacherTask,
680 experiment_number=self.experiment_number,
681 n_events=self.n_events_training,
682 random_seed=self.random_seed,
683 filter_number=filter_number,
684 fast_bdt_option_state_filter=self.fast_bdt_option_state_filter
685 )
686

Member Data Documentation

◆ batch_system

str batch_system = 'lsf'
staticinherited

batch system

Definition at line 189 of file combined_to_pxd_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 640 of file combined_to_pxd_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 647 of file combined_to_pxd_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_to_pxd_ckf_mva_training.py.

◆ n_events_training

n_events_training = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 645 of file combined_to_pxd_ckf_mva_training.py.

◆ queue

str queue = 's'
staticinherited

queue

Definition at line 191 of file combined_to_pxd_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 643 of file combined_to_pxd_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 653 of file combined_to_pxd_ckf_mva_training.py.


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