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 n_events = b2luigi.IntParameter()
 Number of events to generate.
 
b2luigi random_seed = b2luigi.Parameter()
 Random basf2 seed.
 
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 167 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 214 of file cdc_and_svd_ckf_merger_mva_training.py.

214 def create_path(self):
215 """
216 Create basf2 path to process with event generation and simulation.
217 """
218 basf2.set_random_seed(self.random_seed)
219 path = basf2.create_path()
220 path.add_module(
221 "EventInfoSetter", evtNumList=[self.n_events], runList=[0], expList=[self.experiment_number]
222 )
223 path.add_module("EvtGenInput")
224 bkg_files = ""
225 # \cond suppress doxygen warning
226 if self.experiment_number == 0:
228 else:
229 bkg_files = background.get_background_files(self.bkgfiles_dir)
230 # \endcond
231
232 simulation.add_simulation(path, bkgfiles=bkg_files, bkgOverlay=True, usePXDDataReduction=False)
233
234 path.add_module(
235 "RootOutput",
236 outputFileName=self.get_output_file_name(self.output_file_name()),
237 )
238 return path
239
240
241# I don't use the default MergeTask or similar because they only work if every input file is called the same.
242# 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 207 of file cdc_and_svd_ckf_merger_mva_training.py.

207 def output(self):
208 """
209 Generate list of output files that the task should produce.
210 The task is considered finished if and only if the outputs all exist.
211 """
212 yield self.add_to_output(self.output_file_name())
213

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

193 def output_file_name(self, n_events=None, random_seed=None):
194 """
195 Create output file name depending on number of events and production
196 mode that is specified in the random_seed string.
197
198 :param n_events: Number of events to simulate.
199 :param random_seed: Random seed to use for the simulation to create independent samples.
200 """
201 if n_events is None:
202 n_events = self.n_events
203 if random_seed is None:
204 random_seed = self.random_seed
205 return "generated_mc_N" + str(n_events) + "_" + random_seed + ".root"
206

Member Data Documentation

◆ bkgfiles_dir

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

Directory with overlay background root files.

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

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 179 of file cdc_and_svd_ckf_merger_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 190 of file cdc_and_svd_ckf_merger_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 182 of file cdc_and_svd_ckf_merger_mva_training.py.


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