Belle II Software  release-08-01-10
EvtGenSim.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <output>EvtGenSim.root</output>
15  <cacheable/>
16  <contact>Software team b2soft@mail.desy.de</contact>
17  <description>This steering file produces 1000 generic BBbar events with EvtGen
18  and runs the detector simulation with mixed in background.</description>
19 </header>
20 """
21 
22 from basf2 import set_random_seed, create_path, process, statistics
23 from simulation import add_simulation
24 from validation import statistics_plots, event_timing_plot
25 from background import get_background_files
26 
27 set_random_seed(12345)
28 
29 main = create_path()
30 
31 # specify number of events to be generated
32 main.add_module("EventInfoSetter", evtNumList=[1000], runList=[1], expList=[0])
33 
34 # generate BBbar events
35 main.add_module("EvtGenInput")
36 
37 # detector and L1 trigger simulation
38 add_simulation(main, bkgfiles=get_background_files())
39 
40 # memory profile
41 main.add_module("Profile")
42 
43 # output
44 main.add_module("RootOutput", outputFileName="../EvtGenSim.root")
45 
46 main.add_module('Progress')
47 process(main)
48 
49 # Print call statistics
50 print(statistics)
51 
52 statistics_plots(
53  "EvtGenSim_statistics.root",
54  contact="Software team b2soft@mail.desy.de",
55  job_desc="a standard simulation job with generic EvtGen events",
56  prefix="EvtGenSim",
57 )
58 event_timing_plot(
59  "../EvtGenSim.root",
60  "EvtGenSim_statistics.root",
61  contact="Software team b2soft@mail.desy.de",
62  job_desc="a standard simulation job with generic EvtGen events",
63  prefix="EvtGenSim",
64 )