Belle II Software  release-08-01-10
GenerateSimTask Class Reference
Inheritance diagram for GenerateSimTask:
Collaboration diagram for GenerateSimTask:

Public Member Functions

def output_file_name (self, n_events=None, random_seed=None)
 Name of the ROOT output file with generated and simulated events. More...
 
def output (self)
 
def create_path (self)
 

Static Public Attributes

 experiment_number = b2luigi.IntParameter()
 Experiment number of the conditions database, e.g. More...
 
 n_events = b2luigi.IntParameter()
 Number of events to generate.
 
 random_seed = b2luigi.Parameter()
 Random basf2 seed. More...
 
 bkgfiles_dir
 Directory with overlay background root files. More...
 
string queue = 'l'
 specify queue. More...
 

Detailed Description

Generate simulated Monte Carlo with background overlay.

Make sure to use different ``random_seed`` parameters for the training data
format the classifier trainings and for the test data for the respective
evaluation/validation tasks.

Definition at line 166 of file cdc_and_svd_ckf_merger_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 212 of file cdc_and_svd_ckf_merger_mva_training.py.

212 
213  def create_path(self):
214  """
215  Create basf2 path to process with event generation and simulation.
216  """
217  basf2.set_random_seed(self.random_seed)
218  path = basf2.create_path()
219  path.add_module(
220  "EventInfoSetter", evtNumList=[self.n_events], runList=[0], expList=[self.experiment_number]
221  )
222  path.add_module("EvtGenInput")
223  bkg_files = ""
224  if self.experiment_number == 0:
225  bkg_files = background.get_background_files()
226  else:
227  bkg_files = background.get_background_files(self.bkgfiles_dir)
228 
229  simulation.add_simulation(path, bkgfiles=bkg_files, bkgOverlay=True, usePXDDataReduction=False)
230 
231  path.add_module(
232  "RootOutput",
233  outputFileName=self.get_output_file_name(self.output_file_name()),
234  )
235  return path
236 
237 
238 # I don't use the default MergeTask or similar because they only work if every input file is called the same.
def get_background_files(folder=None, output_file_info=True)
Definition: background.py:17
def add_simulation(path, components=None, bkgfiles=None, bkgOverlay=True, forceSetPXDDataReduction=False, usePXDDataReduction=True, cleanupPXDDataReduction=True, generate_2nd_cdc_hits=False, simulateT0jitter=True, isCosmics=False, FilterEvents=False, usePXDGatedMode=False, skipExperimentCheckForBG=False, save_slow_pions_in_mc=False)
Definition: simulation.py:121

◆ 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 205 of file cdc_and_svd_ckf_merger_mva_training.py.

◆ output_file_name()

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

Name of the ROOT output file with generated and simulated events.

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

:param n_events: Number of events to simulate.
:param random_seed: Random seed to use for the simulation to create independent samples.

Definition at line 191 of file cdc_and_svd_ckf_merger_mva_training.py.

Member Data Documentation

◆ bkgfiles_dir

bkgfiles_dir
static
Initial value:
= b2luigi.Parameter(
)

Directory with overlay background root files.

Definition at line 183 of file cdc_and_svd_ckf_merger_mva_training.py.

◆ experiment_number

experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 176 of file cdc_and_svd_ckf_merger_mva_training.py.

◆ queue

string queue = 'l'
static

specify queue.

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

Definition at line 188 of file cdc_and_svd_ckf_merger_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 181 of file cdc_and_svd_ckf_merger_mva_training.py.


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