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 register_module,
26)
27from simulation import add_simulation
28from beamparameters import add_beamparameters
29from validation import statistics_plots, event_timing_plot
30
31set_random_seed(12345)
32
33main = create_path()
34
35# specify number of events to be generated
36eventinfosetter = register_module("EventInfoSetter")
37eventinfosetter.param("evtNumList", [1000])
38eventinfosetter.param("runList", [1])
39eventinfosetter.param("expList", [0])
40main.add_module(eventinfosetter)
41
42# beam parameters
43beamparameters = add_beamparameters(main, "Y4S")
44# beamparameters.param("smearVertex", False)
45
46# generate BBbar events
47evtgeninput = register_module("EvtGenInput")
48main.add_module(evtgeninput)
49
50# detector and L1 trigger simulation, no background files
51add_simulation(main)
52
53# memory profile
54main.add_module(register_module("Profile"))
55
56# output
57output = register_module("RootOutput")
58output.param("outputFileName", "../EvtGenSimNoBkg.root")
59main.add_module(output)
60
61main.add_module('Progress')
62process(main, calculateStatistics=True)
63
64statistics_plots(
65 "EvtGenSimNoBkg_statistics.root",
66 contact="arul.prakash@physik.uni-muenchen.de",
67 job_desc="a standard simulation job with generic EvtGen events",
68 prefix="EvtGenSimNoBkg",
69)
70event_timing_plot(
71 "../EvtGenSimNoBkg.root",
72 "EvtGenSimNoBkg_statistics.root",
73 contact="arul.prakash@physik.uni-muenchen.de",
74 job_desc="a standard simulation job with generic EvtGen events",
75 prefix="EvtGenSimNoBkg",
76)