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