Belle II Software  release-06-01-15
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 process(main)
47 
48 # Print call statistics
49 print(statistics)
50 
51 statistics_plots(
52  "EvtGenSim_statistics.root",
53  contact="Software team b2soft@mail.desy.de",
54  job_desc="a standard simulation job with generic EvtGen events",
55  prefix="EvtGenSim",
56 )
57 event_timing_plot(
58  "../EvtGenSim.root",
59  "EvtGenSim_statistics.root",
60  contact="Software team b2soft@mail.desy.de",
61  job_desc="a standard simulation job with generic EvtGen events",
62  prefix="EvtGenSim",
63 )