Belle II Software development
GenerateSimTask Class Reference
Inheritance 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.
 
def output (self)
 
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 = b2luigi.IntParameter()
 Number of events to generate.
 
b2luigi bkgfiles_dir
 Directory with overlay background root files.
 
str queue = 'l'
 specify queue.
 

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 181 of file combined_cdc_to_svd_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 228 of file combined_cdc_to_svd_ckf_mva_training.py.

228 def create_path(self):
229 """
230 Create basf2 path to process with event generation and simulation.
231 """
232 basf2.set_random_seed(self.random_seed)
233 path = basf2.create_path()
234 path.add_module(
235 "EventInfoSetter", evtNumList=[self.n_events], runList=[0], expList=[self.experiment_number]
236 )
237 path.add_module("EvtGenInput")
238 bkg_files = ""
239 # \cond suppress doxygen warning
240 if self.experiment_number == 0:
242 else:
243 bkg_files = background.get_background_files(self.bkgfiles_dir)
244 # \endcond
245
246 simulation.add_simulation(path, bkgfiles=bkg_files, bkgOverlay=True, usePXDDataReduction=False)
247
248 path.add_module(
249 "RootOutput",
250 outputFileName=self.get_output_file_name(self.output_file_name()),
251 )
252 return path
253
254
255# I don't use the default MergeTask or similar because they only work if every input file is called the same.
256# Additionally, I want to add more features like deleting the original input to save storage space.
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:126

◆ 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 221 of file combined_cdc_to_svd_ckf_mva_training.py.

221 def output(self):
222 """
223 Generate list of output files that the task should produce.
224 The task is considered finished if and only if the outputs all exist.
225 """
226 yield self.add_to_output(self.output_file_name())
227

◆ 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 207 of file combined_cdc_to_svd_ckf_mva_training.py.

207 def output_file_name(self, n_events=None, random_seed=None):
208 """
209 Create output file name depending on number of events and production
210 mode that is specified in the random_seed string.
211
212 :param n_events: Number of events to simulate.
213 :param random_seed: Random seed to use for the simulation to create independent samples.
214 """
215 if n_events is None:
216 n_events = self.n_events
217 if random_seed is None:
218 random_seed = self.random_seed
219 return "generated_mc_N" + str(n_events) + "_" + random_seed + ".root"
220

Member Data Documentation

◆ bkgfiles_dir

b2luigi bkgfiles_dir
static
Initial value:
= b2luigi.Parameter(
)

Directory with overlay background root files.

Definition at line 198 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ experiment_number

b2luigi experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 191 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 196 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ queue

str queue = 'l'
static

specify queue.

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

Definition at line 204 of file combined_cdc_to_svd_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 194 of file combined_cdc_to_svd_ckf_mva_training.py.


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