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

Public Member Functions

def get_records_file_name (self, n_events=None, random_seed=None)
 Filename of the recorded/collected data for the final QE MVA training.
 
def get_input_files (self, n_events=None, random_seed=None)
 
def requires (self)
 
def output (self)
 
def create_path (self)
 

Static Public Attributes

b2luigi n_events = b2luigi.IntParameter()
 Number of events to generate.
 
b2luigi experiment_number = b2luigi.IntParameter()
 Experiment number of the conditions database, e.g.
 
b2luigi random_seed = b2luigi.Parameter()
 Random basf2 seed used by the GenerateSimTask.
 
str queue = 'l'
 specify queue.
 

Detailed Description

Collect variables/features from VXDTF2 tracking and write them to a ROOT
file.

These variables are to be used as labelled training data for the MVA
classifier which is the VXD track quality estimator

Definition at line 654 of file combined_quality_estimator_teacher.py.

Member Function Documentation

◆ create_path()

def create_path (   self)
Create basf2 path with VXDTF2 tracking and VXD QE data collection.

Definition at line 740 of file combined_quality_estimator_teacher.py.

740 def create_path(self):
741 """
742 Create basf2 path with VXDTF2 tracking and VXD QE data collection.
743 """
744 path = basf2.create_path()
745 inputFileNames = self.get_input_files()
746 path.add_module(
747 "RootInput",
748 inputFileNames=inputFileNames,
749 )
750 path.add_module("Gearbox")
751 tracking.add_geometry_modules(path)
752 if 'DATA' in self.random_seed:
753 from rawdata import add_unpackers
754 add_unpackers(path, components=['SVD', 'PXD'])
755 tracking.add_hit_preparation_modules(path)
756 tracking.add_vxd_track_finding_vxdtf2(
757 path, components=["SVD"], add_mva_quality_indicator=False
758 )
759 if 'DATA' in self.random_seed:
760 path.add_module(
761 "VXDQETrainingDataCollector",
762 TrainingDataOutputName=self.get_output_file_name(self.get_records_file_name()),
763 SpacePointTrackCandsStoreArrayName="SPTrackCands",
764 EstimationMethod="tripletFit",
765 UseTimingInfo=False,
766 ClusterInformation="Average",
767 MCStrictQualityEstimator=False,
768 mva_target=False,
769 MCInfo=False,
770 )
771 else:
772 path.add_module(
773 "TrackFinderMCTruthRecoTracks",
774 RecoTracksStoreArrayName="MCRecoTracks",
775 WhichParticles=[],
776 UsePXDHits=False,
777 UseSVDHits=True,
778 UseCDCHits=False,
779 )
780 path.add_module(
781 "VXDQETrainingDataCollector",
782 TrainingDataOutputName=self.get_output_file_name(self.get_records_file_name()),
783 SpacePointTrackCandsStoreArrayName="SPTrackCands",
784 EstimationMethod="tripletFit",
785 UseTimingInfo=False,
786 ClusterInformation="Average",
787 MCStrictQualityEstimator=True,
788 mva_target=False,
789 )
790 return path
791
792

◆ get_input_files()

def get_input_files (   self,
  n_events = None,
  random_seed = None 
)
Get input file names depending on the use case: If they already exist, search in
the corresponding folders, for data check the specified list and if they are created
in the same run, check for the task that produced them.

Definition at line 693 of file combined_quality_estimator_teacher.py.

693 def get_input_files(self, n_events=None, random_seed=None):
694 """
695 Get input file names depending on the use case: If they already exist, search in
696 the corresponding folders, for data check the specified list and if they are created
697 in the same run, check for the task that produced them.
698 """
699 if n_events is None:
700 n_events = self.n_events
701 if random_seed is None:
702 random_seed = self.random_seed
703 if "USESIM" in random_seed:
704 if 'USESIMBB' in random_seed:
705 random_seed = 'BBBAR_' + random_seed.split("_", 1)[1]
706 elif 'USESIMEE' in random_seed:
707 random_seed = 'BHABHA_' + random_seed.split("_", 1)[1]
708 return ['datafiles/' + GenerateSimTask.output_file_name(GenerateSimTask,
709 n_events=n_events, random_seed=random_seed)]
710 elif "DATA" in random_seed:
711 return MasterTask.datafiles
712 else:
713 return self.get_input_file_names(GenerateSimTask.output_file_name(
714 GenerateSimTask, n_events=n_events, random_seed=random_seed))
715

◆ get_records_file_name()

def get_records_file_name (   self,
  n_events = None,
  random_seed = None 
)

Filename of the recorded/collected data for the final QE MVA training.

Create output file name depending on number of events and production
mode that is specified in the random_seed string.

Definition at line 673 of file combined_quality_estimator_teacher.py.

673 def get_records_file_name(self, n_events=None, random_seed=None):
674 """
675 Create output file name depending on number of events and production
676 mode that is specified in the random_seed string.
677 """
678 if n_events is None:
679 n_events = self.n_events
680 if random_seed is None:
681 random_seed = self.random_seed
682 if 'vxd' not in random_seed:
683 random_seed += '_vxd'
684 if 'DATA' in random_seed:
685 return 'qe_records_DATA_vxd.root'
686 else:
687 if 'USESIMBB' in random_seed:
688 random_seed = 'BBBAR_' + random_seed.split("_", 1)[1]
689 elif 'USESIMEE' in random_seed:
690 random_seed = 'BHABHA_' + random_seed.split("_", 1)[1]
691 return 'qe_records_N' + str(n_events) + '_' + random_seed + '.root'
692

◆ 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 733 of file combined_quality_estimator_teacher.py.

733 def output(self):
734 """
735 Generate list of output files that the task should produce.
736 The task is considered finished if and only if the outputs all exist.
737 """
738 yield self.add_to_output(self.get_records_file_name())
739

◆ requires()

def requires (   self)
Generate list of luigi Tasks that this Task depends on.

Definition at line 716 of file combined_quality_estimator_teacher.py.

716 def requires(self):
717 """
718 Generate list of luigi Tasks that this Task depends on.
719 """
720 if "USESIM" in self.random_seed or "DATA" in self.random_seed:
721 for filename in self.get_input_files():
722 yield CheckExistingFile(
723 filename=filename,
724 )
725 else:
726 yield SplitNMergeSimTask(
727 bkgfiles_dir=MasterTask.bkgfiles_by_exp[self.experiment_number],
728 random_seed=self.random_seed,
729 n_events=self.n_events,
730 experiment_number=self.experiment_number,
731 )
732

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

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 663 of file combined_quality_estimator_teacher.py.

◆ queue

str queue = 'l'
static

specify queue.

E.g. choose between 'l' (long), 's' (short) or 'sx' (short, extra ram)

Definition at line 670 of file combined_quality_estimator_teacher.py.

◆ random_seed

b2luigi random_seed = b2luigi.Parameter()
static

Random basf2 seed used by the GenerateSimTask.

It is further used to read of the production process to preserve clearness in the b2luigi output.

Definition at line 668 of file combined_quality_estimator_teacher.py.


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