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_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 570 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 696 of file combined_to_pxd_ckf_mva_training.py.

696 def create_path(self):
697 """
698 Create basf2 path to process with event generation and simulation.
699 """
700 return self.create_result_recording_path(
701 result_filter_records_name=self.get_output_file_name(self.result_filter_records_name),
702 )
703
704

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

622 def create_result_recording_path(self, result_filter_records_name):
623 """
624 Create a path for the recording of the result filter. This file is then used to train the result filter.
625
626 :param result_filter_records_name: Name of the recording file.
627 """
628
629 path = basf2.create_path()
630
631 # get all the file names from the list of input files that are meant for training
632 file_list = [fname for sublist in self.get_input_file_names().values()
633 for fname in sublist if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
634 path.add_module("RootInput", inputFileNames=file_list)
635
636 path.add_module("Gearbox")
637 path.add_module("Geometry")
638 path.add_module("SetupGenfitExtrapolation")
639
640 add_hit_preparation_modules(path, components=["SVD", "PXD"])
641
642 add_track_finding(path, reco_tracks="CDCSVDRecoTracks", components=["CDC", "SVD"], prune_temporary_tracks=False)
643
644 path.add_module('TrackFinderMCTruthRecoTracks',
645 RecoTracksStoreArrayName="MCRecoTracks",
646 WhichParticles=[],
647 UsePXDHits=True,
648 UseSVDHits=True,
649 UseCDCHits=True)
650
651 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=True, UseCDCHits=True,
652 mcRecoTracksStoreArrayName="MCRecoTracks",
653 prRecoTracksStoreArrayName="CDCSVDRecoTracks")
654 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCSVDRecoTracks")
655
656 fast_bdt_string = create_fbdt_option_string(self.fast_bdt_option_state_filter)
657 path.add_module("ToPXDCKF",
658 inputRecoTrackStoreArrayName="CDCSVDRecoTracks",
659 outputRecoTrackStoreArrayName="RecoTracks",
660 outputRelationRecoTrackStoreArrayName="CDCSVDRecoTracks",
661
662 relationCheckForDirection="backward",
663 reverseSeed=False,
664 writeOutDirection="backward",
665
666 firstHighFilter="mva",
667 firstHighFilterParameters={
668 "identifier": self.get_input_file_names(f"trk_ToPXDStateFilter_1{fast_bdt_string}.xml")[0],
669 "cut": 0.01},
670 firstHighUseNStates=10,
671
672 advanceHighFilter="advance",
673
674 secondHighFilter="mva",
675 secondHighFilterParameters={
676 "identifier": self.get_input_file_names(f"trk_ToPXDStateFilter_2{fast_bdt_string}.xml")[0],
677 "cut": 0.01},
678 secondHighUseNStates=10,
679
680 updateHighFilter="fit",
681
682 thirdHighFilter="mva",
683 thirdHighFilterParameters={
684 "identifier": self.get_input_file_names(f"trk_ToPXDStateFilter_3{fast_bdt_string}.xml")[0],
685 "cut": 0.01},
686 thirdHighUseNStates=10,
687
688 filter="recording",
689 filterParameters={"rootFileName": result_filter_records_name},
690 exportTracks=False,
691
692 enableOverlapResolving=True)
693
694 return path
695

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

593 def output(self):
594 """
595 Generate list of output files that the task should produce.
596 The task is considered finished if and only if the outputs all exist.
597 """
598 yield self.add_to_output(self.result_filter_records_name)
599

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

600 def requires(self):
601 """
602 This task requires that the training SplitMergeSimTask is finished, as well as that the state filters are trained using
603 the CKFStateFilterTeacherTask..
604 """
605 yield SplitNMergeSimTask(
606 bkgfiles_dir=MainTask.bkgfiles_by_exp[self.experiment_number],
607 experiment_number=self.experiment_number,
608 n_events=self.n_events_training,
609 random_seed=self.random_seed,
610 )
611 filter_numbers = [1, 2, 3]
612 for filter_number in filter_numbers:
613 yield self.clone(
614 CKFStateFilterTeacherTask,
615 experiment_number=self.experiment_number,
616 n_events=self.n_events_training,
617 random_seed=self.random_seed,
618 filter_number=filter_number,
619 fast_bdt_option_state_filter=self.fast_bdt_option_state_filter
620 )
621

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 578 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 585 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 583 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 581 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 591 of file combined_to_pxd_ckf_mva_training.py.


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