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...
 
 random_seed = b2luigi.Parameter()
 Random basf2 seed. More...
 
 n_events = b2luigi.IntParameter()
 Number of events to generate.
 
 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 178 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 224 of file combined_to_pxd_ckf_mva_training.py.

224 
225  def create_path(self):
226  """
227  Create basf2 path to process with event generation and simulation.
228  """
229  basf2.set_random_seed(self.random_seed)
230  path = basf2.create_path()
231  path.add_module(
232  "EventInfoSetter", evtNumList=[self.n_events], runList=[0], expList=[self.experiment_number]
233  )
234  path.add_module("EvtGenInput")
235  bkg_files = ""
236  if self.experiment_number == 0:
237  bkg_files = background.get_background_files()
238  else:
239  bkg_files = background.get_background_files(self.bkgfiles_dir)
240 
241  simulation.add_simulation(path, bkgfiles=bkg_files, bkgOverlay=True, usePXDDataReduction=False)
242 
243  path.add_module(
244  "RootOutput",
245  outputFileName=self.get_output_file_name(self.output_file_name()),
246  )
247  return path
248 
249 
250 # 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 217 of file combined_to_pxd_ckf_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 203 of file combined_to_pxd_ckf_mva_training.py.

Member Data Documentation

◆ bkgfiles_dir

bkgfiles_dir
static
Initial value:
= b2luigi.Parameter(
)

Directory with overlay background root files.

Definition at line 195 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 188 of file combined_to_pxd_ckf_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 200 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 191 of file combined_to_pxd_ckf_mva_training.py.


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