Belle II Software development
background_generator.py
1#!/usr/bin/env python3
2
3
10
11
24
25import basf2 as b2
26from background import get_background_files
27from pxd.background_generator import inject_simulation, PXDBackgroundGenerator
28from reconstruction import add_reconstruction
29from mdst import add_mdst_output
30
31# create path
32main = b2.create_path()
33
34# specify number of events to be generated
35main.add_module('EventInfoSetter', evtNumList=[10])
36
37# print event numbers
38main.add_module('EventInfoPrinter')
39
40# generate BBbar events
41main.add_module('EvtGenInput')
42
43# list of background overlay files that are available on the system
44files = get_background_files()
45
46# instantiate the PXD background generator module
47generator_module = PXDBackgroundGenerator(model='resnet')
48
49# create a drop-in simulation function that incorporates the module
50add_simulation = inject_simulation(generator_module)
51
52# detector and L1 trigger simulation with background overlay
53add_simulation(main, bkgfiles=files)
54
55# reconstruction
56add_reconstruction(main)
57# or add_reconstruction(main, components) to run the reconstruction of a selection of detectors
58
59# full output
60main.add_module('RootOutput', outputFileName='output.root')
61
62# mdst output
63add_mdst_output(main)
64
65# cdst output (for calibration)
66# add_cdst_output(main)
67
68# process events and print call statistics
69b2.process(main)
70print(b2.statistics)
basf2 (Belle II Analysis Software Framework) # Author: The Belle II Collaboration # # See git log for...
Definition: __init__.py:1