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

726 def create_path(self):
727 """
728 Create basf2 path to process with event generation and simulation.
729 """
730 return self.create_result_recording_path(
731 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
732 )
733
734

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

631 def create_result_recording_path(self, result_filter_records_name):
632 """
633 Create a path for the recording of the result filter. This file is then used to train the result filter.
634
635 :param result_filter_records_name: Name of the recording file.
636 """
637
638 path = basf2.create_path()
639
640 # get all the file names from the list of input files that are meant for training
641 file_list = [fname for sublist in self.get_input_file_names().values()
642 for fname in sublist if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
643 path.add_module("RootInput", inputFileNames=file_list)
644
645 path.add_module("Gearbox")
646 path.add_module("Geometry")
647 path.add_module("SetupGenfitExtrapolation")
648
649 add_hit_preparation_modules(path, components=["SVD", "PXD"])
650
651 add_track_finding(path, reco_tracks="CDCSVDRecoTracks", components=["CDC", "SVD"], prune_temporary_tracks=False)
652
653 path.add_module('TrackFinderMCTruthRecoTracks',
654 RecoTracksStoreArrayName="MCRecoTracks",
655 WhichParticles=[],
656 UsePXDHits=True,
657 UseSVDHits=True,
658 UseCDCHits=True)
659
660 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=True, UseCDCHits=True,
661 mcRecoTracksStoreArrayName="MCRecoTracks",
662 prRecoTracksStoreArrayName="CDCSVDRecoTracks")
663 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCSVDRecoTracks")
664
665 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
666
667 # write the tracking MVA filter parameters and the cut on MVA classifier to be applied on a local db
668 iov = [0, 0, 0, -1]
670 f"trk_ToPXDStateFilter_1_Parameter{fast_bdt_string}",
671 iov,
672 f"trk_ToPXDStateFilter_1{fast_bdt_string}",
673 0.01)
674
676 f"trk_ToPXDStateFilter_2_Parameter{fast_bdt_string}",
677 iov,
678 f"trk_ToPXDStateFilter_2{fast_bdt_string}",
679 0.01)
680
682 f"trk_ToPXDStateFilter_3_Parameter{fast_bdt_string}",
683 iov,
684 f"trk_ToPXDStateFilter_3{fast_bdt_string}",
685 0.01)
686
687 basf2.conditions.prepend_testing_payloads("localdb/database.txt")
688 first_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_1_Parameter{fast_bdt_string}",
689 "direction": "backward"}
690 second_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_2_Parameter{fast_bdt_string}"}
691 third_high_filter_parameters = {"DBPayloadName": f"trk_ToPXDStateFilter_3_Parameter{fast_bdt_string}"}
692
693 path.add_module("ToPXDCKF",
694 inputRecoTrackStoreArrayName="CDCSVDRecoTracks",
695 outputRecoTrackStoreArrayName="RecoTracks",
696 outputRelationRecoTrackStoreArrayName="CDCSVDRecoTracks",
697
698 relationCheckForDirection="backward",
699 reverseSeed=False,
700 writeOutDirection="backward",
701
702 firstHighFilter="mva",
703 firstHighFilterParameters=first_high_filter_parameters,
704 firstHighUseNStates=10,
705
706 advanceHighFilter="advance",
707
708 secondHighFilter="mva",
709 secondHighFilterParameters=second_high_filter_parameters,
710 secondHighUseNStates=10,
711
712 updateHighFilter="fit",
713
714 thirdHighFilter="mva",
715 thirdHighFilterParameters=third_high_filter_parameters,
716 thirdHighUseNStates=10,
717
718 filter="recording",
719 filterParameters={"rootFileName": result_filter_records_name},
720 exportTracks=False,
721
722 enableOverlapResolving=True)
723
724 return path
725

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

602 def output(self):
603 """
604 Generate list of output files that the task should produce.
605 The task is considered finished if and only if the outputs all exist.
606 """
607 yield self.add_to_output(self.result_filter_records_name)
608

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

609 def requires(self):
610 """
611 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained using
612 the CKFStateFilterTeacherTask..
613 """
614 yield SplitNMergeSimTask(
615 bkgfiles_dir=MainTask.bkgfiles_by_exp[self.experiment_number],
616 experiment_number=self.experiment_number,
617 n_events=self.n_events_training,
618 random_seed=self.random_seed,
619 )
620 filter_numbers = [1, 2, 3]
621 for filter_number in filter_numbers:
622 yield self.clone(
623 CKFStateFilterTeacherTask,
624 experiment_number=self.experiment_number,
625 n_events=self.n_events_training,
626 random_seed=self.random_seed,
627 filter_number=filter_number,
628 fast_bdt_option_state_filter=self.fast_bdt_option_state_filter
629 )
630

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 584 of file combined_to_pxd_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 591 of file combined_to_pxd_ckf_mva_training.py.

◆ n_events_training

b2luigi n_events_training = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 589 of file combined_to_pxd_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 587 of file combined_to_pxd_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 597 of file combined_to_pxd_ckf_mva_training.py.


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