Belle II Software development
EvtGenSimNoBkg.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <output>EvtGenSimNoBkg.root</output>
14 <contact>arul.prakash@physik.uni-muenchen.de</contact>
15 <cacheable/>
16 <description>This steering file produces 1000 generic BBbar events with EvtGen
17 and runs the detector simulation without mixing in background.</description>
18</header>
19"""
20
21from basf2 import (
22 set_random_seed,
23 create_path,
24 process,
25 statistics,
26 register_module,
27)
28from simulation import add_simulation
29from beamparameters import add_beamparameters
30from validation import statistics_plots, event_timing_plot
31
32set_random_seed(12345)
33
34main = create_path()
35
36# specify number of events to be generated
37eventinfosetter = register_module("EventInfoSetter")
38eventinfosetter.param("evtNumList", [1000])
39eventinfosetter.param("runList", [1])
40eventinfosetter.param("expList", [0])
41main.add_module(eventinfosetter)
42
43# beam parameters
44beamparameters = add_beamparameters(main, "Y4S")
45# beamparameters.param("smearVertex", False)
46
47# generate BBbar events
48evtgeninput = register_module("EvtGenInput")
49main.add_module(evtgeninput)
50
51# detector and L1 trigger simulation, no background files
52add_simulation(main)
53
54# memory profile
55main.add_module(register_module("Profile"))
56
57# output
58output = register_module("RootOutput")
59output.param("outputFileName", "../EvtGenSimNoBkg.root")
60main.add_module(output)
61
62main.add_module('Progress')
63process(main)
64
65# Print call statistics
66print(statistics)
67
68statistics_plots(
69 "EvtGenSimNoBkg_statistics.root",
70 contact="arul.prakash@physik.uni-muenchen.de",
71 job_desc="a standard simulation job with generic EvtGen events",
72 prefix="EvtGenSimNoBkg",
73)
74event_timing_plot(
75 "../EvtGenSimNoBkg.root",
76 "EvtGenSimNoBkg_statistics.root",
77 contact="arul.prakash@physik.uni-muenchen.de",
78 job_desc="a standard simulation job with generic EvtGen events",
79 prefix="EvtGenSimNoBkg",
80)