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