Belle II Software  release-05-01-25
EvtGenSimRecLarge.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 <header>
6  <contact>Software team b2soft@mail.desy.de</contact>
7  <output>EvtGenSimRecLarge.root</output>
8  <description>
9  This steering file produces 10000 generic BBbar events with
10  EvtGen, runs the detector simulation with mixed in background, and performs
11  the standard reconstruction. It will only be run for release validation in
12  order to test the software on a larger set of events to be more closer to
13  the typical runtime on a grid site.
14  </description>
15  <interval>release</interval>
16 </header>
17 """
18 
19 from basf2 import set_random_seed, create_path, process, statistics, \
20  register_module
21 from simulation import add_simulation
22 from L1trigger import add_tsim
23 from reconstruction import add_reconstruction
24 from beamparameters import add_beamparameters
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 eventinfosetter = register_module('EventInfoSetter')
33 # will roughly run for 10 hours
34 eventinfosetter.param('evtNumList', [40000])
35 eventinfosetter.param('runList', [1])
36 eventinfosetter.param('expList', [0])
37 main.add_module(eventinfosetter)
38 
39 # beam parameters
40 beamparameters = add_beamparameters(main, "Y4S")
41 # beamparameters.param("smearVertex", False)
42 
43 # generate BBbar events
44 evtgeninput = register_module('EvtGenInput')
45 main.add_module(evtgeninput)
46 
47 # detector simulation
48 add_simulation(main, bkgfiles=get_background_files())
49 
50 # trigger simulation
51 add_tsim(main)
52 
53 # reconstruction
54 add_reconstruction(main)
55 
56 # memory profile
57 main.add_module(register_module('Profile'))
58 
59 # do not output to save storage space
60 process(main)
61 
62 # Print call statistics
63 print(statistics)
64 
65 from validation import *
66 statistics_plots(
67  'EvtGenSimRecLarge_statistics.root',
68  contact='Software team b2soft@mail.desy.de',
69  job_desc='a standard simulation and reconstruction job with generic '
70  'EvtGen events',
71  prefix='EvtGenSimRecLarge'
72 )
73 event_timing_plot(
74  '../EvtGenSimRecLarge.root',
75  'EvtGenSimRecLarge_statistics.root',
76  contact='Software team b2soft@mail.desy.de',
77  job_desc='a standard simulation and reconstruction job with generic '
78  'EvtGen events',
79  prefix='EvtGenSimRecLarge'
80 )